Skip to content

Latest commit

 

History

History
139 lines (114 loc) · 8.42 KB

combined-check.md

File metadata and controls

139 lines (114 loc) · 8.42 KB

A daily combined check

With an existing reviewed configuration and Node.js 22+, run:

npx handoff-check@0.16.0 check --profile production
npx handoff-check@0.16.0 check --profile production --registry rules.review.json --sources sources.json --format json

Choose an explicitly configured profile, or use --scope with optional --constraints/--handoff overrides. Profile selection rejects those overrides. --config chooses the configuration; configured inputs and source bindings resolve from its directory. Explicit input, registry, sources and relations paths resolve from cwd.

Every check verifies the saved handoff with mandatory content tracking and at least one active rule. Legacy ID-only handoffs are invalid. There are no force, skip, policy override, output, Git, child-command or recording flags. Use --as-of only for reproducible evaluation; the default captures one current clock after metadata reads. Sources are always current file bytes.

Review is included only with --registry; source inspection only with --sources. Relationships are included only with --relations ; no capture or adoption occurs. See relationship semantics. No maintenance registry is discovered implicitly. Omitted sections are explicitly NOT-REQUESTED, not passed. Use the existing review-record/source-record workflows after actual review; check never captures, adopts, refreshes or writes inputs.

Reports and failures

Text, JSON and Markdown show verification, review and sources independently. JSON uses combined schema v1, kind combined-check, with status passed, attention or invalid. Each selected section contains its unchanged engine result and passed/attention state, or invalid with a bounded diagnostic. Invalid sections never contain fabricated successful results. Unselected sections contain only status not-requested. Without --relations, the report and all three summary sections remain byte-compatible with 0.13. requestedChecks excludes not-requested sections.

With --relations, JSON uses combined schema v2. It adds a fourth relations section: passed with the unchanged satisfied relationship result, attention with its unchanged attention result, or invalid with an error only. Relations is always requested in v2, even if its metadata could not be read or parsed. Review and sources may still be not-requested. Counts sum to four, with two to four requested checks. Text and Markdown include the same fourth section.

For schema consumers, register check.v1 first, then each referenced standalone result schema only if its canonical $id is not already registered, then check.v2. The unchanged v1 schema embeds review/source resources with their canonical IDs; registering those IDs twice is an error in validators such as Ajv. v2 references the canonical v1 verification, review, source and relationship result resources. Register these local packaged resources before compiling v2; no network load is needed.

The schema validates section shapes and engine-status coupling. Runtime engines enforce semantic relationships, shared context, aggregate precedence and summary counts; JSON Schema alone does not prove those invariants or input authenticity.

Exit 2 (any invalid section) takes precedence over exit 1 (attention); exit 0 means every requested section passed. Zero active rules need attention. A passing verification cannot hide overdue reviews or changed sources; an invalid optional registry cannot hide valid verification or source findings.

Invalid invocation, config, profile, manifest, common project identity, scope or clock fails normally on stderr with exit 2 and no combined stdout. Once common inputs are valid, missing/malformed handoff or selected registry, legacy handoff, and selected role binding failures appear on stdout in the combined report, with exit 2. Check all sections before interpreting its status.

Selecting --sources explicitly authorizes its independent reads even when the handoff is invalid. Source metadata and project identity must validate first. Only selected active rules with current references produce read targets; stale, missing, inactive and orphan entries do not. The existing portable-path, symlink, regular-file, 10 MiB and 256-entry safeguards remain in force.

Each resolved metadata pathname is read once per invocation, including config and failed reads; each role is still parsed independently if paths coincide. Filesystem aliases through symlinks/hard links are not deduplicated identities. Shared exact source paths use the source adapter's observation cache. Input reads and source observations are not atomic. There is no guaranteed timeout for stuck OS I/O.

Exact metadata identities with --report

npx handoff-check@0.16.0 check --profile production --report --format json
npx handoff-check@0.16.0 check --profile production --relations relationships.json --report --format markdown

--report requires explicit JSON or Markdown format; text/default format is rejected before input I/O. JSON wraps the unchanged combined v1/v2 result in a separate combined-check-report v1 envelope. The envelope contains schemaVersion, kind, packageVersion, inputs, result and notice. Markdown retains the normal combined report and appends reproducibility metadata. Without --report, JSON/text/Markdown remain byte-compatible with 0.14. Verification reports are unchanged; --git-context remains verify-only and run rejects --report.

inputs always identifies config, manifest and handoff. review, sources and relations appear exactly when those roles were selected. Each identity records an absolute resolved pathname and one status:

  • read includes SHA256 of the exact raw Buffer consumed, even if JSON is empty, malformed or fails role validation. Whitespace changes the digest.
  • unreadable has no digest and is allowed for handoff or selected optional roles. Their nested section remains invalid; no empty-file hash is invented.
  • absent has no digest and is allowed only for a missing implicit default config. A present implicit config is read. An explicit missing config is a common error.

Manifest/config/context failures still produce stderr-only exit 2 with no envelope. Selected invalid roles produce a stdout envelope with exit 2, preserving independent results; attention remains exit 1 and passed remains exit 0. Passed/attention roles require read identities. A v2 nested result requires the relations identity, and v1 prohibits it. The schema enforces these shapes and selection relationships; runtime enforces digest truth, context equality, arithmetic and result semantics.

Add combined-report.v1 to the canonical schema registration sequence described above after check.v1, its standalone resources and check.v2. No old schema is changed. Metadata hashes come from the same resolved-path cache used for parsing, including failed reads. Identical paths share an identity while each role parses independently. Config reuses its existing same-read hash. No additional file read, realpath, stat, Git command or source observation is added; no-report identity collection is off. The sources identity identifies the registry, while file observations stay in the existing nested source result. Report rendering uses the prepared snapshot only.

These identities identify consumed bytes; they do not retain files, reconstruct missing contents, guarantee replay or authenticate declarations. Reads remain non-atomic, and a later pass must use current inputs/time. Paths, hashes and retained nested content may be sensitive. Review before sharing. Output is stdout only; never redirect a report onto input files because the shell can truncate them before the CLI starts. No automatic report files, redaction or signed attestations are added.

Limits and privacy

A local pass checks declarations and explicitly selected records, not agent behavior, authenticated review or permission to act. Check never executes a child, reads transcripts, fetches references or calls models. Hashes, paths, owner data and retained rule content in nested findings may be sensitive; review reports before sharing. Shell redirection can truncate files independently of this CLI: never redirect reports onto inputs.

Default verify/run/review/source-check outputs and policies remain unchanged. Run can explicitly select maintenance with --registry/--sources/--relations, but this command does not install hooks or enable maintenance in another workflow.