Skip to content

docs(habitat): add D0 public contract inventory for deep refactor - #1809

Draft
mateicanavra wants to merge 1 commit into
codex/deep-habitat-implementation-framefrom
codex/deep-habitat-d0-public-contract-inventory
Draft

docs(habitat): add D0 public contract inventory for deep refactor#1809
mateicanavra wants to merge 1 commit into
codex/deep-habitat-implementation-framefrom
codex/deep-habitat-d0-public-contract-inventory

Conversation

@mateicanavra

Copy link
Copy Markdown
Owner

This PR establishes the D0 public contract inventory for the Deep Habitat refactor, creating a durable compatibility ledger that all later refactor packets (D1–D14) must consult before moving, narrowing, removing, or versioning any Habitat surface.

The core artifact is docs/projects/habitat-harness/deep-refactor/D0-public-contract-inventory.md, which classifies every current Habitat surface into one of eight contract states: public stable, public versioned, package-internal, command-only DTO, test-only, generated/derived, deprecated, or refused. Coverage includes:

  • CLI verbs (check, classify, verify, fix, graph, hook) with their flags, human output contracts, and machine JSON/receipt DTO contracts
  • Command DTOs (CheckReport, Classification, DiffClassification, VerifyProof, GritApplyTransactionProof, HookTrace) distinguished from internal helpers that happen to be exported
  • src/index.ts export matrix classifying every exported symbol across baseline, command-engine, Grit, hooks, process, receipt artifact, rule registry, and Pattern Authority modules
  • Package export paths, root scripts, inferred Nx targets, generator schemas, and Husky hook delegators

Key compatibility decisions recorded:

  • bun run habitat check --json is canonical; bun run habitat check -- --json is a product compatibility issue, not a typo
  • Root alias forwarding (bun run habitat:check -- --json) is a separate public surface from nested forwarding
  • Proof/artifact-shaped surfaces (VerifyProof, GritApplyTransactionProof, ProofArtifactWriter) are current compatibility facts only — downstream packets must simplify them into minimal command receipts where product scenarios justify them, not treat artifact generation as target-domain authority
  • Classification currently lacks top-level schema versioning; D4 must preserve or explicitly version it before changing fields
  • Command-entrypoint tests require dependency/build grounding (bun install --frozen-lockfile + bun run --cwd tools/habitat-harness build) before claiming command behavior, as stale dist/** artifacts produce false results

The accompanying OpenSpec change (deep-habitat-d0-public-contract-inventory) adds requirements that gate all later refactor packet closure on consulting this ledger. The downstream realignment ledger tracks watched obligations for D1 through D14. No command behavior, package exports, generators, hooks, or generated artifacts are changed.

Copy link
Copy Markdown
Owner Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@mateicanavra
mateicanavra force-pushed the codex/deep-habitat-d0-public-contract-inventory branch 3 times, most recently from 3286a6e to fd6a5e8 Compare June 18, 2026 01:31
Add the D0 public contract inventory and OpenSpec workstream records for the Deep Habitat refactor. The inventory classifies Habitat command, script, package, generator, hook, and JSON/receipt surfaces without changing runtime behavior.

Record dependency/build grounding for command-entrypoint validation and downstream realignment obligations for proof-shaped compatibility surfaces, command help drift, and implemented-surface docs.

Validation:
- bun run openspec -- validate deep-habitat-d0-public-contract-inventory --strict
- bun run openspec:validate
- bun install --frozen-lockfile
- bun run --cwd tools/habitat-harness build
- bun run --cwd tools/habitat-harness test -- test/commands/habitat-entrypoints.test.ts
- bun run habitat classify tools/habitat-harness/src/plugin.js
- bun run nx g @internal/habitat-harness:project unsupported-d0-probe --kind=mod --dry-run
- bun run lint
- git diff --check
@mateicanavra
mateicanavra force-pushed the codex/deep-habitat-d0-public-contract-inventory branch from fd6a5e8 to 25d6f43 Compare June 18, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant