Skip to content

feat!: ship Anatomy composition CLI and SDK in one npm package - #6

Merged
Zmnortal merged 8 commits into
mainfrom
codex/cod-420-composition-sdk
Sep 15, 2026
Merged

Zmnortal merged 8 commits into
mainfrom
codex/cod-420-composition-sdk

Conversation

@Zmnortal

@Zmnortal Zmnortal commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Anatomy definitions can reuse directory units across real mount locations and run through either the CLI or a data-only SDK. Both interfaces ship in one public npm package, anatomy-cli: run anatomy in a terminal or import scanAnatomy, queryAnatomyBundle, and schemas/types from anatomy-cli.

  • Add --bundle, composition scanning/querying, dependency and ownership validation, isolated mount state, and findings traced to original rules and actual directories. The five-definition DB Schema example mounts shared Table/Relation Domain roots without duplicate accounts/accounts/ paths.
  • Keep engine/schema workspaces private. Ship their ESM code and declarations inside anatomy-cli, resolve internal imports to package-local paths, and retain lazy source analysis. Consumers install one tarball with no dependency on published @anatomy-cli/* packages.
  • Require Node 24+, pin development/CI to 24.21.0, and use one current Anatomy contract with explicit entry/contents root modes. Remove format-version selectors and old-format compatibility; migrate bundled definitions.
  • Enforce repository-wide structural and named-function export contracts across 325 Git-visible files.
  • Automatically publish patch-only 0.0.x versions of anatomy-cli on relevant main pushes. Manual channel=canary and canary-* Git tags publish to the npm canary tag without changing latest. Stable retries reuse the source revision's version. Only NPM_TOKEN with publish permission for anatomy-cli is required.
  • Verify packed CLI/SDK consumers before publication, then read back registry integrity/tags and install the published package. Stage release versions without bot version commits.

This branch includes the unmerged foundation from #5: architecture queries, named-function export constraints, and repository self-coverage. Review the complete branch against main accordingly.

Validation on Node 24.21.0:

  • bun run quality: self-scan, typechecks, lint, 300 tests, and builds passed.
  • Single-package canary preparation installed and exercised the CLI/SDK successfully.
  • Single-package consumer and patch planner: 21 tests passed, covering isolated installation, strict TypeScript declarations, lazy SDK and source-export scans, CLI/SDK equivalence, exit codes, file preservation, private-package isolation, patch increments, canary tags, retries, and rejection of internal package publication.
  • Workflow passed actionlint 1.7.7. Remote CI quality and docs build passed at 1449a1b.
  • The earlier composition implementation also passed 15 real-directory CLI scenarios, including rejected type-test filenames, missing required entries, shared dependencies, cycles, ownership ambiguity, and mount/root queries.

Local requirement documents, detailed logs, tarballs, and temporary consumer fixtures remain under ignored root docs/ and are excluded from this PR. Daedalus integration and online MCP-to-Worker scanning remain downstream work. The canary publication is verified; this PR has not been merged.

Related: COD-420.

Publication verification:

  • Published anatomy-cli@0.0.4-canary.34956971727.1 from source 47a17b2; registry canary resolves to it and latest remains 0.0.3.
  • Registry source SHA and tarball SHA-512 match the Actions release artifact. Fresh registry installation passed CLI help, SDK scan/query, and consumer TypeScript validation on Node 24.21.0.
  • Five additional tests against the registry-installed package passed: CLI scan (exit 0), mount query, blocked file (exit 1, file preserved), SDK matching named export, and mismatched named export rejection.
  • npm accepted the uploads but processed them asynchronously. Runs 34955766797 attempt 2 and 34956971727 remain marked failed because the original registry check timed out before visibility. Publication was subsequently confirmed from the registry; it is not inferred from the npm exit code.
  • Commit 8b18b78 extends processing verification to 15 minutes and preserves npm output. Typechecks, CLI lint and 16 release-planning tests passed for the fix; the same verifier completed the real registry-install check locally. Final CI quality and docs build passed at 8b18b78. No third canary was published for this timeout-only fix.

@Zmnortal Zmnortal changed the title feat!: add portable Anatomy compositions and Node 24 SDK feat!: add Anatomy composition SDK and automated patch releases Sep 15, 2026
@Zmnortal Zmnortal changed the title feat!: add Anatomy composition SDK and automated patch releases feat!: ship Anatomy composition CLI and SDK in one npm package Sep 15, 2026
@Zmnortal
Zmnortal merged commit 15ea87c into main Sep 15, 2026
3 checks passed
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