Metadata-Version: 2.2
Name: hmos-precheck
Version: 0.1.1
Summary: LLM-first low-noise Build@1 guard for HarmonyOS and ArkTS repos.
Author: OpenAI Codex
License: MIT
Keywords: harmonyos,arkts,precheck,cli,llm
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# hmos-precheck

Agent-first diff checks for HarmonyOS / ArkTS repositories.

## Preflight

Install on Linux / macOS:
```bash
python3 -m pip install hmos-precheck
hmos-precheck --help
```

Install on Windows:
```powershell
py -m pip install hmos-precheck
hmos-precheck --help
```

Verify and configure:
```bash
hmos-precheck doctor --project-root /path/to/repo
hmos-precheck init --scope user --commandline-tools /abs/path/to/command-line-tools
```

User config:
- Linux: `~/.config/hmos-precheck/config.json`
- macOS: `~/Library/Application Support/hmos-precheck/config.json`
- Windows: `%APPDATA%\hmos-precheck\config.json`

Project config: `<repo>/.hmos-precheck.json`
Resolution order: `--commandline-tools` -> project config -> user config -> `HARMONYOS_COMMANDLINE_TOOLS` -> auto-detect

## Copy For Agents Use

Primary command:
```text
Use `hmos-precheck run --project-root <repo> --output-dir <out>` as a gate.
Interpret stdout JSON only.
- `pass`: stop; do not read artifacts.
- `fail`: read `<out>/hmos-precheck-result.json` only; fix listed issues only; rerun once.
- `warn`: do not read artifacts unless the task explicitly requires debugging or environment repair.
Only `error` blocks. `warning` and `suggestion` stay in artifacts.
Treat `fail` as bounded repair: do not expand beyond the listed repair payload.
Do not read lint/detail artifacts on `pass`.
Do not share one `--output-dir` across parallel runs.
If rerun still returns `fail`, stop and surface the latest repair payload instead of looping.
```

## Manual Use
```bash
hmos-precheck run --project-root /path/to/repo --output-dir /tmp/hmos-out
hmos-precheck run --project-root /path/to/repo --output-dir /tmp/hmos-out --base-ref origin/main --head-ref HEAD
```

Profiles: default and supported are `arkts-diff`, `codelinter-diff`.
Checks: `arkts-diff` and `codelinter-diff` both run on changed `.ets` files only and keep changed-line diagnostics only.

Diff scope:
- changed tracked `.ets` files
- untracked `.ets` files not ignored by Git
- ignored/generated files are skipped by Git ignore rules
- sequential reruns are safe; parallel runs must not share `--output-dir`

## Artifacts

Read policy: `pass` read nothing else; `fail` read `hmos-precheck-result.json`; `warn` read details only for explicit debugging.

Primary:
- `hmos-precheck-result.json`

Debug only:
- `hmos-precheck-summary.md`
- `hmos-precheck-debug.json` with `--debug-artifact`
- `arkts-precheck-result.json`, `arkts-precheck-fix-summary.md`
- `codelinter-report.json`, `codelinter-fix-summary.md`
- `codelinter-stdout.txt`, `codelinter-stderr.txt`

## Release Check
```bash
python3 -m pylint src tests
python3 -m pytest -q
python3 -m build
python3 -m twine check dist/*
```
