@ybotok/loam 0.1.0-beta.3 → 0.2.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2635 -86
- package/COMPARISON.md +80 -63
- package/CONTRIBUTING.md +84 -0
- package/MIGRATING-from-OpenSpec.md +213 -54
- package/QUICKSTART.md +125 -0
- package/README.md +450 -150
- package/ROADMAP.md +599 -0
- package/SCHEMA.md +2355 -256
- package/SECURITY.md +21 -3
- package/WORKFLOW.md +701 -0
- package/dist/cli.js +113 -19
- package/dist/cli.js.map +1 -1
- package/dist/commands/adopt/adopt.js +209 -0
- package/dist/commands/adopt/adopt.js.map +1 -0
- package/dist/commands/adopt/render.js +268 -0
- package/dist/commands/adopt/render.js.map +1 -0
- package/dist/commands/archive/archive.js +77 -0
- package/dist/commands/archive/archive.js.map +1 -0
- package/dist/commands/archive/plan/contracts/asyncapi.js +178 -0
- package/dist/commands/archive/plan/contracts/asyncapi.js.map +1 -0
- package/dist/commands/archive/plan/contracts/openapi.js +159 -0
- package/dist/commands/archive/plan/contracts/openapi.js.map +1 -0
- package/dist/commands/archive/plan/gate.js +323 -0
- package/dist/commands/archive/plan/gate.js.map +1 -0
- package/dist/commands/archive/plan/landscape.js +180 -0
- package/dist/commands/archive/plan/landscape.js.map +1 -0
- package/dist/commands/archive/plan/refusal.js +111 -0
- package/dist/commands/archive/plan/refusal.js.map +1 -0
- package/dist/commands/archive/plan/specs.js +237 -0
- package/dist/commands/archive/plan/specs.js.map +1 -0
- package/dist/commands/archive/plan/state.js +27 -0
- package/dist/commands/archive/plan/state.js.map +1 -0
- package/dist/commands/archive/run.js +252 -0
- package/dist/commands/archive/run.js.map +1 -0
- package/dist/commands/context/context.js +99 -0
- package/dist/commands/context/context.js.map +1 -0
- package/dist/commands/context/print.js +283 -0
- package/dist/commands/context/print.js.map +1 -0
- package/dist/commands/delta/delta.js +279 -0
- package/dist/commands/delta/delta.js.map +1 -0
- package/dist/commands/delta/print.js +205 -0
- package/dist/commands/delta/print.js.map +1 -0
- package/dist/commands/dependencies.js +9 -7
- package/dist/commands/dependencies.js.map +1 -1
- package/dist/commands/diff/diff.js +93 -0
- package/dist/commands/diff/diff.js.map +1 -0
- package/dist/commands/diff/print.js +38 -0
- package/dist/commands/diff/print.js.map +1 -0
- package/dist/commands/doctor.js +5 -4
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/explain/explain.js +151 -0
- package/dist/commands/explain/explain.js.map +1 -0
- package/dist/commands/explore.js +29 -24
- package/dist/commands/explore.js.map +1 -1
- package/dist/commands/gate/gate.js +115 -0
- package/dist/commands/gate/gate.js.map +1 -0
- package/dist/commands/gate/print.js +54 -0
- package/dist/commands/gate/print.js.map +1 -0
- package/dist/commands/gherkin/commit.js +146 -0
- package/dist/commands/gherkin/commit.js.map +1 -0
- package/dist/commands/gherkin/gherkin.js +246 -0
- package/dist/commands/gherkin/gherkin.js.map +1 -0
- package/dist/commands/gherkin/reconcile.js +149 -0
- package/dist/commands/gherkin/reconcile.js.map +1 -0
- package/dist/commands/gherkin/render.js +77 -0
- package/dist/commands/gherkin/render.js.map +1 -0
- package/dist/commands/init/example.js +204 -0
- package/dist/commands/init/example.js.map +1 -0
- package/dist/commands/init/first-hour.js +28 -0
- package/dist/commands/init/first-hour.js.map +1 -0
- package/dist/commands/{init.js → init/init.js} +146 -71
- package/dist/commands/init/init.js.map +1 -0
- package/dist/commands/init/mcp.js +131 -0
- package/dist/commands/init/mcp.js.map +1 -0
- package/dist/commands/init/options.js +78 -0
- package/dist/commands/init/options.js.map +1 -0
- package/dist/commands/instructions.js +72 -14
- package/dist/commands/instructions.js.map +1 -1
- package/dist/commands/list/campaign/campaign.js +65 -0
- package/dist/commands/list/campaign/campaign.js.map +1 -0
- package/dist/commands/list/campaign/owners.js +65 -0
- package/dist/commands/list/campaign/owners.js.map +1 -0
- package/dist/commands/list/json.js +157 -0
- package/dist/commands/list/json.js.map +1 -0
- package/dist/commands/list/list.js +343 -0
- package/dist/commands/list/list.js.map +1 -0
- package/dist/commands/list/print.js +301 -0
- package/dist/commands/list/print.js.map +1 -0
- package/dist/commands/list/review.js +120 -0
- package/dist/commands/list/review.js.map +1 -0
- package/dist/commands/list/views.js +105 -0
- package/dist/commands/list/views.js.map +1 -0
- package/dist/commands/mcp/dispatch.js +183 -0
- package/dist/commands/mcp/dispatch.js.map +1 -0
- package/dist/commands/mcp/mcp.js +34 -0
- package/dist/commands/mcp/mcp.js.map +1 -0
- package/dist/commands/mcp/serve.js +55 -0
- package/dist/commands/mcp/serve.js.map +1 -0
- package/dist/commands/migrate-openspec/materialize/active.js +170 -0
- package/dist/commands/migrate-openspec/materialize/active.js.map +1 -0
- package/dist/commands/migrate-openspec/materialize/feature.js +41 -0
- package/dist/commands/migrate-openspec/materialize/feature.js.map +1 -0
- package/dist/commands/migrate-openspec/materialize/living.js +62 -0
- package/dist/commands/migrate-openspec/materialize/living.js.map +1 -0
- package/dist/commands/migrate-openspec/materialize/stage.js +142 -0
- package/dist/commands/migrate-openspec/materialize/stage.js.map +1 -0
- package/dist/commands/migrate-openspec/materialize/target.js +219 -0
- package/dist/commands/migrate-openspec/materialize/target.js.map +1 -0
- package/dist/commands/migrate-openspec/migrate-openspec.js +142 -0
- package/dist/commands/migrate-openspec/migrate-openspec.js.map +1 -0
- package/dist/commands/migrate-openspec/openspec/decisions.js +91 -0
- package/dist/commands/migrate-openspec/openspec/decisions.js.map +1 -0
- package/dist/commands/migrate-openspec/openspec/error.js +19 -0
- package/dist/commands/migrate-openspec/openspec/error.js.map +1 -0
- package/dist/commands/migrate-openspec/openspec/mapping.js +170 -0
- package/dist/commands/migrate-openspec/openspec/mapping.js.map +1 -0
- package/dist/commands/migrate-openspec/openspec/paths.js +43 -0
- package/dist/commands/migrate-openspec/openspec/paths.js.map +1 -0
- package/dist/commands/migrate-openspec/openspec/read.js +49 -0
- package/dist/commands/migrate-openspec/openspec/read.js.map +1 -0
- package/dist/commands/migrate-openspec/print.js +89 -0
- package/dist/commands/migrate-openspec/print.js.map +1 -0
- package/dist/commands/new/commit.js +76 -0
- package/dist/commands/new/commit.js.map +1 -0
- package/dist/commands/new/new.js +283 -0
- package/dist/commands/new/new.js.map +1 -0
- package/dist/commands/new/templates.js +355 -0
- package/dist/commands/new/templates.js.map +1 -0
- package/dist/commands/open.js +203 -0
- package/dist/commands/open.js.map +1 -0
- package/dist/commands/policy/format.js +152 -0
- package/dist/commands/policy/format.js.map +1 -0
- package/dist/commands/{docs-repo-gate.js → policy/gate.js} +11 -11
- package/dist/commands/policy/gate.js.map +1 -0
- package/dist/commands/rebase/edit.js +106 -0
- package/dist/commands/rebase/edit.js.map +1 -0
- package/dist/commands/rebase/living.js +185 -0
- package/dist/commands/rebase/living.js.map +1 -0
- package/dist/commands/rebase/plan.js +245 -0
- package/dist/commands/rebase/plan.js.map +1 -0
- package/dist/commands/rebase/rebase.js +275 -0
- package/dist/commands/rebase/rebase.js.map +1 -0
- package/dist/commands/seed/commit.js +192 -0
- package/dist/commands/seed/commit.js.map +1 -0
- package/dist/commands/seed/plan.js +133 -0
- package/dist/commands/seed/plan.js.map +1 -0
- package/dist/commands/seed/seed.js +172 -0
- package/dist/commands/seed/seed.js.map +1 -0
- package/dist/commands/show/feature.js +178 -0
- package/dist/commands/show/feature.js.map +1 -0
- package/dist/commands/show/marks.js +24 -0
- package/dist/commands/show/marks.js.map +1 -0
- package/dist/commands/{show.js → show/service.js} +63 -152
- package/dist/commands/show/service.js.map +1 -0
- package/dist/commands/show/show.js +77 -0
- package/dist/commands/show/show.js.map +1 -0
- package/dist/commands/status/json.js +45 -0
- package/dist/commands/status/json.js.map +1 -0
- package/dist/commands/status/print.js +157 -0
- package/dist/commands/status/print.js.map +1 -0
- package/dist/commands/status/status.js +119 -0
- package/dist/commands/status/status.js.map +1 -0
- package/dist/commands/steps/steps.js +189 -0
- package/dist/commands/steps/steps.js.map +1 -0
- package/dist/commands/subsystem/edit.js +192 -0
- package/dist/commands/subsystem/edit.js.map +1 -0
- package/dist/commands/subsystem/move.js +265 -0
- package/dist/commands/subsystem/move.js.map +1 -0
- package/dist/commands/subsystem/query.js +115 -0
- package/dist/commands/subsystem/query.js.map +1 -0
- package/dist/commands/subsystem/subsystem.js +101 -0
- package/dist/commands/subsystem/subsystem.js.map +1 -0
- package/dist/commands/subsystem/sync.js +103 -0
- package/dist/commands/subsystem/sync.js.map +1 -0
- package/dist/commands/subsystem/txn/txn.js +94 -0
- package/dist/commands/subsystem/txn/txn.js.map +1 -0
- package/dist/commands/subsystem/txn/views.js +70 -0
- package/dist/commands/subsystem/txn/views.js.map +1 -0
- package/dist/commands/unarchive/manifest.js +160 -0
- package/dist/commands/unarchive/manifest.js.map +1 -0
- package/dist/commands/{unarchive.js → unarchive/restore.js} +47 -160
- package/dist/commands/unarchive/restore.js.map +1 -0
- package/dist/commands/unarchive/unarchive.js +67 -0
- package/dist/commands/unarchive/unarchive.js.map +1 -0
- package/dist/commands/validate/arch-coverage.js +204 -0
- package/dist/commands/validate/arch-coverage.js.map +1 -0
- package/dist/commands/validate/checks/fleet-shape.js +296 -0
- package/dist/commands/validate/checks/fleet-shape.js.map +1 -0
- package/dist/commands/validate/checks/health-deps.js +55 -0
- package/dist/commands/validate/checks/health-deps.js.map +1 -0
- package/dist/commands/validate/checks/requirements.js +254 -0
- package/dist/commands/validate/checks/requirements.js.map +1 -0
- package/dist/commands/validate/checks/sources.js +76 -0
- package/dist/commands/validate/checks/sources.js.map +1 -0
- package/dist/commands/validate/checks/vocabulary.js +31 -0
- package/dist/commands/validate/checks/vocabulary.js.map +1 -0
- package/dist/commands/validate/feature.js +216 -0
- package/dist/commands/validate/feature.js.map +1 -0
- package/dist/commands/validate/fleet/census.js +69 -0
- package/dist/commands/validate/fleet/census.js.map +1 -0
- package/dist/commands/validate/fleet/kind-tags.js +39 -0
- package/dist/commands/validate/fleet/kind-tags.js.map +1 -0
- package/dist/commands/validate/fleet/landscape.js +353 -0
- package/dist/commands/validate/fleet/landscape.js.map +1 -0
- package/dist/commands/validate/fleet/load.js +52 -0
- package/dist/commands/validate/fleet/load.js.map +1 -0
- package/dist/commands/validate/fleet/obligations.js +270 -0
- package/dist/commands/validate/fleet/obligations.js.map +1 -0
- package/dist/commands/validate/fleet/scorecard/adoption.js +102 -0
- package/dist/commands/validate/fleet/scorecard/adoption.js.map +1 -0
- package/dist/commands/validate/fleet/scorecard/contracts.js +98 -0
- package/dist/commands/validate/fleet/scorecard/contracts.js.map +1 -0
- package/dist/commands/validate/fleet/scorecard/print.js +63 -0
- package/dist/commands/validate/fleet/scorecard/print.js.map +1 -0
- package/dist/commands/validate/fleet/scorecard/scorecard.js +156 -0
- package/dist/commands/validate/fleet/scorecard/scorecard.js.map +1 -0
- package/dist/commands/validate/fleet/usecases/capability-tag.js +94 -0
- package/dist/commands/validate/fleet/usecases/capability-tag.js.map +1 -0
- package/dist/commands/validate/fleet/usecases/place.js +13 -0
- package/dist/commands/validate/fleet/usecases/place.js.map +1 -0
- package/dist/commands/validate/fleet/usecases/requirement-tag.js +95 -0
- package/dist/commands/validate/fleet/usecases/requirement-tag.js.map +1 -0
- package/dist/commands/validate/fleet/usecases/steps.js +197 -0
- package/dist/commands/validate/fleet/usecases/steps.js.map +1 -0
- package/dist/commands/validate/fleet/usecases/usecases.js +99 -0
- package/dist/commands/validate/fleet/usecases/usecases.js.map +1 -0
- package/dist/commands/validate/fleet/views/ids.js +40 -0
- package/dist/commands/validate/fleet/views/ids.js.map +1 -0
- package/dist/commands/validate/fleet/views/stale.js +59 -0
- package/dist/commands/validate/fleet/views/stale.js.map +1 -0
- package/dist/commands/validate/links/corpus.js +92 -0
- package/dist/commands/validate/links/corpus.js.map +1 -0
- package/dist/commands/validate/links/glossary.js +75 -0
- package/dist/commands/validate/links/glossary.js.map +1 -0
- package/dist/commands/validate/report.js +269 -0
- package/dist/commands/validate/report.js.map +1 -0
- package/dist/commands/validate/service/api.js +338 -0
- package/dist/commands/validate/service/api.js.map +1 -0
- package/dist/commands/validate/service/events/events.js +219 -0
- package/dist/commands/validate/service/events/events.js.map +1 -0
- package/dist/commands/validate/service/events/message-producers.js +77 -0
- package/dist/commands/validate/service/events/message-producers.js.map +1 -0
- package/dist/commands/validate/service/evidence-pins.js +131 -0
- package/dist/commands/validate/service/evidence-pins.js.map +1 -0
- package/dist/commands/validate/service/service.js +251 -0
- package/dist/commands/validate/service/service.js.map +1 -0
- package/dist/commands/validate/service/specs.js +251 -0
- package/dist/commands/validate/service/specs.js.map +1 -0
- package/dist/commands/validate/service/spine.js +113 -0
- package/dist/commands/validate/service/spine.js.map +1 -0
- package/dist/commands/validate/validate.js +338 -0
- package/dist/commands/validate/validate.js.map +1 -0
- package/dist/commands/verify/cross/diff.js +182 -0
- package/dist/commands/verify/cross/diff.js.map +1 -0
- package/dist/commands/verify/evidence/contract.js +32 -0
- package/dist/commands/verify/evidence/contract.js.map +1 -0
- package/dist/commands/verify/evidence/pins.js +52 -0
- package/dist/commands/verify/evidence/pins.js.map +1 -0
- package/dist/commands/verify/evidence/read.js +72 -0
- package/dist/commands/verify/evidence/read.js.map +1 -0
- package/dist/commands/verify/frozen.js +241 -0
- package/dist/commands/verify/frozen.js.map +1 -0
- package/dist/commands/verify/record.js +226 -0
- package/dist/commands/verify/record.js.map +1 -0
- package/dist/commands/verify/report.js +223 -0
- package/dist/commands/verify/report.js.map +1 -0
- package/dist/commands/verify/results.js +246 -0
- package/dist/commands/verify/results.js.map +1 -0
- package/dist/commands/verify/verify.js +217 -0
- package/dist/commands/verify/verify.js.map +1 -0
- package/dist/commands/vouch/contract.js +11 -0
- package/dist/commands/vouch/contract.js.map +1 -0
- package/dist/commands/vouch/pack/contract.js +2 -0
- package/dist/commands/vouch/pack/contract.js.map +1 -0
- package/dist/commands/vouch/pack/pack.js +266 -0
- package/dist/commands/vouch/pack/pack.js.map +1 -0
- package/dist/commands/vouch/pack/print.js +271 -0
- package/dist/commands/vouch/pack/print.js.map +1 -0
- package/dist/commands/vouch/pack/sections.js +142 -0
- package/dist/commands/vouch/pack/sections.js.map +1 -0
- package/dist/commands/vouch/prompt/confirm.js +46 -0
- package/dist/commands/vouch/prompt/confirm.js.map +1 -0
- package/dist/commands/vouch/report.js +101 -0
- package/dist/commands/vouch/report.js.map +1 -0
- package/dist/commands/vouch/run.js +285 -0
- package/dist/commands/vouch/run.js.map +1 -0
- package/dist/commands/vouch/sample/plan.js +125 -0
- package/dist/commands/vouch/sample/plan.js.map +1 -0
- package/dist/commands/vouch/sample/print.js +109 -0
- package/dist/commands/vouch/sample/print.js.map +1 -0
- package/dist/commands/vouch/vet/verify.js +123 -0
- package/dist/commands/vouch/vet/verify.js.map +1 -0
- package/dist/commands/vouch/vouch.js +176 -0
- package/dist/commands/vouch/vouch.js.map +1 -0
- package/dist/core/agent/agents-md/artifacts.js +220 -0
- package/dist/core/agent/agents-md/artifacts.js.map +1 -0
- package/dist/core/agent/agents-md/command-map.js +324 -0
- package/dist/core/agent/agents-md/command-map.js.map +1 -0
- package/dist/core/agent/agents-md/cycle.js +165 -0
- package/dist/core/agent/agents-md/cycle.js.map +1 -0
- package/dist/core/agent/agents-md/map/explain.js +34 -0
- package/dist/core/agent/agents-md/map/explain.js.map +1 -0
- package/dist/core/agent/agents-md/map/lenses/context.js +41 -0
- package/dist/core/agent/agents-md/map/lenses/context.js.map +1 -0
- package/dist/core/agent/agents-md/map/lenses/diff.js +46 -0
- package/dist/core/agent/agents-md/map/lenses/diff.js.map +1 -0
- package/dist/core/agent/agents-md/map/lenses/gate.js +57 -0
- package/dist/core/agent/agents-md/map/lenses/gate.js.map +1 -0
- package/dist/core/agent/agents-md/map/mcp.js +41 -0
- package/dist/core/agent/agents-md/map/mcp.js.map +1 -0
- package/dist/core/agent/agents-md/map/status.js +62 -0
- package/dist/core/agent/agents-md/map/status.js.map +1 -0
- package/dist/core/agent/agents-md/map/subsystem.js +32 -0
- package/dist/core/agent/agents-md/map/subsystem.js.map +1 -0
- package/dist/core/agent/agents-md/map/usecases.js +60 -0
- package/dist/core/agent/agents-md/map/usecases.js.map +1 -0
- package/dist/core/agent/agents-md/refusals.js +246 -0
- package/dist/core/agent/agents-md/refusals.js.map +1 -0
- package/dist/core/agent/agents-md/shipped/archive-gate.js +98 -0
- package/dist/core/agent/agents-md/shipped/archive-gate.js.map +1 -0
- package/dist/core/agent/agents-md/spine.js +40 -0
- package/dist/core/agent/agents-md/spine.js.map +1 -0
- package/dist/core/agent/agents-md.js +170 -0
- package/dist/core/agent/agents-md.js.map +1 -0
- package/dist/core/{agents-stamp.js → agent/agents-stamp.js} +50 -0
- package/dist/core/agent/agents-stamp.js.map +1 -0
- package/dist/core/agent/contract.js +2 -0
- package/dist/core/agent/contract.js.map +1 -0
- package/dist/core/agent/protocol.js +193 -0
- package/dist/core/agent/protocol.js.map +1 -0
- package/dist/core/agent/scaffold.js +259 -0
- package/dist/core/agent/scaffold.js.map +1 -0
- package/dist/core/agent/support/report.js +103 -0
- package/dist/core/agent/support/report.js.map +1 -0
- package/dist/core/agent/tools/dialects.js +150 -0
- package/dist/core/agent/tools/dialects.js.map +1 -0
- package/dist/core/agent/tools/registry.js +228 -0
- package/dist/core/agent/tools/registry.js.map +1 -0
- package/dist/core/agent/workflows/adopt.js +133 -0
- package/dist/core/agent/workflows/adopt.js.map +1 -0
- package/dist/core/agent/workflows/check.js +337 -0
- package/dist/core/agent/workflows/check.js.map +1 -0
- package/dist/core/agent/workflows/closing.js +262 -0
- package/dist/core/agent/workflows/closing.js.map +1 -0
- package/dist/core/agent/workflows/feature.js +105 -0
- package/dist/core/agent/workflows/feature.js.map +1 -0
- package/dist/core/agent/workflows/implement.js +105 -0
- package/dist/core/agent/workflows/implement.js.map +1 -0
- package/dist/core/agent/workflows/reference/authoring.js +209 -0
- package/dist/core/agent/workflows/reference/authoring.js.map +1 -0
- package/dist/core/agent/workflows/reference/codes.js +65 -0
- package/dist/core/agent/workflows/reference/codes.js.map +1 -0
- package/dist/core/agent/workflows/reference/done-check.js +188 -0
- package/dist/core/agent/workflows/reference/done-check.js.map +1 -0
- package/dist/core/agent/workflows/reference/reference.js +16 -0
- package/dist/core/agent/workflows/reference/reference.js.map +1 -0
- package/dist/core/agent/workflows/reference/spine.js +297 -0
- package/dist/core/agent/workflows/reference/spine.js.map +1 -0
- package/dist/core/asyncapi/baseline/plan.js +110 -0
- package/dist/core/asyncapi/baseline/plan.js.map +1 -0
- package/dist/core/asyncapi/baseline/surfaces.js +54 -0
- package/dist/core/asyncapi/baseline/surfaces.js.map +1 -0
- package/dist/core/asyncapi/depth.js +164 -0
- package/dist/core/asyncapi/depth.js.map +1 -0
- package/dist/core/asyncapi/digest.js +141 -0
- package/dist/core/asyncapi/digest.js.map +1 -0
- package/dist/core/asyncapi/merge/components.js +91 -0
- package/dist/core/asyncapi/merge/components.js.map +1 -0
- package/dist/core/asyncapi/merge/error.js +33 -0
- package/dist/core/asyncapi/merge/error.js.map +1 -0
- package/dist/core/asyncapi/merge/markers.js +308 -0
- package/dist/core/asyncapi/merge/markers.js.map +1 -0
- package/dist/core/asyncapi/merge/merge.js +215 -0
- package/dist/core/asyncapi/merge/merge.js.map +1 -0
- package/dist/core/asyncapi/merge/pin.js +107 -0
- package/dist/core/asyncapi/merge/pin.js.map +1 -0
- package/dist/core/asyncapi/model.js +11 -0
- package/dist/core/asyncapi/model.js.map +1 -0
- package/dist/core/asyncapi/producers.js +50 -0
- package/dist/core/asyncapi/producers.js.map +1 -0
- package/dist/core/{asyncapi.js → asyncapi/read.js} +95 -109
- package/dist/core/asyncapi/read.js.map +1 -0
- package/dist/core/brief/brief.js +225 -0
- package/dist/core/brief/brief.js.map +1 -0
- package/dist/core/brief/checks.js +250 -0
- package/dist/core/brief/checks.js.map +1 -0
- package/dist/core/brief/landscape.js +194 -0
- package/dist/core/brief/landscape.js.map +1 -0
- package/dist/core/brief/targets.js +226 -0
- package/dist/core/brief/targets.js.map +1 -0
- package/dist/core/brief/unchecked.js +48 -0
- package/dist/core/brief/unchecked.js.map +1 -0
- package/dist/core/c4/arch.js +174 -0
- package/dist/core/c4/arch.js.map +1 -0
- package/dist/core/c4/likec4.js +90 -0
- package/dist/core/c4/likec4.js.map +1 -0
- package/dist/core/c4/parsed/deployment.js +158 -0
- package/dist/core/c4/parsed/deployment.js.map +1 -0
- package/dist/core/c4/parsed/dynamic-views.js +132 -0
- package/dist/core/c4/parsed/dynamic-views.js.map +1 -0
- package/dist/core/c4/parsed/specification.js +78 -0
- package/dist/core/c4/parsed/specification.js.map +1 -0
- package/dist/core/c4/parsed/values.js +57 -0
- package/dist/core/c4/parsed/values.js.map +1 -0
- package/dist/core/c4/parsed/view-ids.js +75 -0
- package/dist/core/c4/parsed/view-ids.js.map +1 -0
- package/dist/core/c4/project/architecture.js +45 -0
- package/dist/core/c4/project/architecture.js.map +1 -0
- package/dist/core/c4/project/documents.js +58 -0
- package/dist/core/c4/project/documents.js.map +1 -0
- package/dist/core/c4/project/load.js +187 -0
- package/dist/core/c4/project/load.js.map +1 -0
- package/dist/core/c4/project/staged.js +220 -0
- package/dist/core/c4/project/staged.js.map +1 -0
- package/dist/core/c4/resolve/service.js +159 -0
- package/dist/core/c4/resolve/service.js.map +1 -0
- package/dist/core/c4/resolve/steps.js +144 -0
- package/dist/core/c4/resolve/steps.js.map +1 -0
- package/dist/core/c4/seed/fleet-file.js +201 -0
- package/dist/core/c4/seed/fleet-file.js.map +1 -0
- package/dist/core/c4/seed/items.js +91 -0
- package/dist/core/c4/seed/items.js.map +1 -0
- package/dist/core/c4/seed/stamp.js +48 -0
- package/dist/core/c4/seed/stamp.js.map +1 -0
- package/dist/core/c4/seed/template.js +109 -0
- package/dist/core/c4/seed/template.js.map +1 -0
- package/dist/core/c4/source-mask.js +82 -0
- package/dist/core/c4/source-mask.js.map +1 -0
- package/dist/core/c4/source-scan.js +227 -0
- package/dist/core/c4/source-scan.js.map +1 -0
- package/dist/core/c4/splice/authored-source.js +101 -0
- package/dist/core/c4/splice/authored-source.js.map +1 -0
- package/dist/core/c4/splice/contract.js +10 -0
- package/dist/core/c4/splice/contract.js.map +1 -0
- package/dist/core/c4/splice/delta-blocks.js +139 -0
- package/dist/core/c4/splice/delta-blocks.js.map +1 -0
- package/dist/core/c4/splice/identity/edges.js +36 -0
- package/dist/core/c4/splice/identity/edges.js.map +1 -0
- package/dist/core/c4/splice/landscape-merge.js +269 -0
- package/dist/core/c4/splice/landscape-merge.js.map +1 -0
- package/dist/core/c4/splice/placement.js +194 -0
- package/dist/core/c4/splice/placement.js.map +1 -0
- package/dist/core/c4/workspace.js +174 -0
- package/dist/core/c4/workspace.js.map +1 -0
- package/dist/core/capabilities/authoring/notes.js +141 -0
- package/dist/core/capabilities/authoring/notes.js.map +1 -0
- package/dist/core/capabilities/capabilities.js +124 -0
- package/dist/core/capabilities/capabilities.js.map +1 -0
- package/dist/core/capabilities/delta/doc.js +50 -0
- package/dist/core/capabilities/delta/doc.js.map +1 -0
- package/dist/core/capabilities/delta/overlay.js +129 -0
- package/dist/core/capabilities/delta/overlay.js.map +1 -0
- package/dist/core/capabilities/delta/summary.js +57 -0
- package/dist/core/capabilities/delta/summary.js.map +1 -0
- package/dist/core/capabilities/delta/tree.js +43 -0
- package/dist/core/capabilities/delta/tree.js.map +1 -0
- package/dist/core/capabilities/delta/uncovered.js +222 -0
- package/dist/core/capabilities/delta/uncovered.js.map +1 -0
- package/dist/core/capabilities/findings.js +342 -0
- package/dist/core/capabilities/findings.js.map +1 -0
- package/dist/core/capabilities/realizes/findings.js +181 -0
- package/dist/core/capabilities/realizes/findings.js.map +1 -0
- package/dist/core/capabilities/realizes/join.js +143 -0
- package/dist/core/capabilities/realizes/join.js.map +1 -0
- package/dist/core/capabilities/rollup.js +199 -0
- package/dist/core/capabilities/rollup.js.map +1 -0
- package/dist/core/capabilities/tree.js +126 -0
- package/dist/core/capabilities/tree.js.map +1 -0
- package/dist/core/capabilities/usecase-join.js +277 -0
- package/dist/core/capabilities/usecase-join.js.map +1 -0
- package/dist/core/coherence/authoring/scaffold.js +177 -0
- package/dist/core/coherence/authoring/scaffold.js.map +1 -0
- package/dist/core/coherence/authoring/sentinels.js +74 -0
- package/dist/core/coherence/authoring/sentinels.js.map +1 -0
- package/dist/core/coherence/coherence.js +287 -0
- package/dist/core/coherence/coherence.js.map +1 -0
- package/dist/core/coherence/declared.js +269 -0
- package/dist/core/coherence/declared.js.map +1 -0
- package/dist/core/coherence/events/declared.js +206 -0
- package/dist/core/coherence/events/declared.js.map +1 -0
- package/dist/core/coherence/events/events.js +204 -0
- package/dist/core/coherence/events/events.js.map +1 -0
- package/dist/core/coherence/events/grades.js +166 -0
- package/dist/core/coherence/events/grades.js.map +1 -0
- package/dist/core/coherence/events/lookups.js +122 -0
- package/dist/core/coherence/events/lookups.js.map +1 -0
- package/dist/core/coherence/events/merged.js +40 -0
- package/dist/core/coherence/events/merged.js.map +1 -0
- package/dist/core/coherence/living.js +198 -0
- package/dist/core/coherence/living.js.map +1 -0
- package/dist/core/coherence/lookups.js +155 -0
- package/dist/core/coherence/lookups.js.map +1 -0
- package/dist/core/coherence/pending.js +39 -0
- package/dist/core/coherence/pending.js.map +1 -0
- package/dist/core/conflict-markers.js +60 -0
- package/dist/core/conflict-markers.js.map +1 -0
- package/dist/core/delta/claims.js +73 -0
- package/dist/core/delta/claims.js.map +1 -0
- package/dist/core/delta/delta.js +296 -0
- package/dist/core/delta/delta.js.map +1 -0
- package/dist/core/delta/document.js +177 -0
- package/dist/core/delta/document.js.map +1 -0
- package/dist/core/delta/scope.js +48 -0
- package/dist/core/delta/scope.js.map +1 -0
- package/dist/core/delta/select.js +237 -0
- package/dist/core/delta/select.js.map +1 -0
- package/dist/core/dependencies/dependencies.js +141 -0
- package/dist/core/dependencies/dependencies.js.map +1 -0
- package/dist/core/dependencies/facts.js +165 -0
- package/dist/core/dependencies/facts.js.map +1 -0
- package/dist/core/dependencies/fanin.js +88 -0
- package/dist/core/dependencies/fanin.js.map +1 -0
- package/dist/core/dependencies/graph.js +106 -0
- package/dist/core/dependencies/graph.js.map +1 -0
- package/dist/core/deployment/delta.js +188 -0
- package/dist/core/deployment/delta.js.map +1 -0
- package/dist/core/deployment/objects.js +145 -0
- package/dist/core/deployment/objects.js.map +1 -0
- package/dist/core/diff/base-git.js +148 -0
- package/dist/core/diff/base-git.js.map +1 -0
- package/dist/core/diff/base-state.js +209 -0
- package/dist/core/diff/base-state.js.map +1 -0
- package/dist/core/diff/current-state.js +96 -0
- package/dist/core/diff/current-state.js.map +1 -0
- package/dist/core/diff/scope/changed-paths.js +188 -0
- package/dist/core/diff/scope/changed-paths.js.map +1 -0
- package/dist/core/diff/semantic.js +243 -0
- package/dist/core/diff/semantic.js.map +1 -0
- package/dist/core/diff/victims.js +247 -0
- package/dist/core/diff/victims.js.map +1 -0
- package/dist/core/docs.js +7 -64
- package/dist/core/docs.js.map +1 -1
- package/dist/core/doctor/agents.js +222 -0
- package/dist/core/doctor/agents.js.map +1 -0
- package/dist/core/doctor/config.js +135 -0
- package/dist/core/doctor/config.js.map +1 -0
- package/dist/core/doctor/doctor.js +275 -0
- package/dist/core/doctor/doctor.js.map +1 -0
- package/dist/core/doctor/report.js +13 -0
- package/dist/core/doctor/report.js.map +1 -0
- package/dist/core/doctor/residue.js +110 -0
- package/dist/core/doctor/residue.js.map +1 -0
- package/dist/core/document/apply.js +77 -0
- package/dist/core/document/apply.js.map +1 -0
- package/dist/core/{frontmatter.js → document/frontmatter.js} +48 -2
- package/dist/core/document/frontmatter.js.map +1 -0
- package/dist/core/document/grammar/directives.js +143 -0
- package/dist/core/document/grammar/directives.js.map +1 -0
- package/dist/core/document/parse.js +263 -0
- package/dist/core/document/parse.js.map +1 -0
- package/dist/core/document/scenarios.js +221 -0
- package/dist/core/document/scenarios.js.map +1 -0
- package/dist/core/document/spec.js +241 -0
- package/dist/core/document/spec.js.map +1 -0
- package/dist/core/{config.js → envelope/config.js} +79 -18
- package/dist/core/envelope/config.js.map +1 -0
- package/dist/core/envelope/json.js +175 -0
- package/dist/core/envelope/json.js.map +1 -0
- package/dist/core/{version.js → envelope/version.js} +3 -3
- package/dist/core/envelope/version.js.map +1 -0
- package/dist/core/explain/families.js +175 -0
- package/dist/core/explain/families.js.map +1 -0
- package/dist/core/explain/fix-tables.js +178 -0
- package/dist/core/explain/fix-tables.js.map +1 -0
- package/dist/core/explain/lookup.js +181 -0
- package/dist/core/explain/lookup.js.map +1 -0
- package/dist/core/explain/refusals.js +49 -0
- package/dist/core/explain/refusals.js.map +1 -0
- package/dist/core/explain/terms.js +144 -0
- package/dist/core/explain/terms.js.map +1 -0
- package/dist/core/explore/describe.js +105 -0
- package/dist/core/explore/describe.js.map +1 -0
- package/dist/core/{explore.js → explore/explore.js} +50 -101
- package/dist/core/explore/explore.js.map +1 -0
- package/dist/core/fleet-context.js +120 -78
- package/dist/core/fleet-context.js.map +1 -1
- package/dist/core/gate/checks.js +201 -0
- package/dist/core/gate/checks.js.map +1 -0
- package/dist/core/gate/partners.js +205 -0
- package/dist/core/gate/partners.js.map +1 -0
- package/dist/core/gate/report.js +47 -0
- package/dist/core/gate/report.js.map +1 -0
- package/dist/core/gate/verification.js +113 -0
- package/dist/core/gate/verification.js.map +1 -0
- package/dist/core/gherkin/digest.js +60 -0
- package/dist/core/gherkin/digest.js.map +1 -0
- package/dist/core/gherkin/emit.js +177 -0
- package/dist/core/gherkin/emit.js.map +1 -0
- package/dist/core/gherkin/read.js +76 -0
- package/dist/core/gherkin/read.js.map +1 -0
- package/dist/core/gherkin/stale.js +234 -0
- package/dist/core/gherkin/stale.js.map +1 -0
- package/dist/core/gherkin/stamp.js +77 -0
- package/dist/core/gherkin/stamp.js.map +1 -0
- package/dist/core/gherkin/steps/catalogue.js +154 -0
- package/dist/core/gherkin/steps/catalogue.js.map +1 -0
- package/dist/core/gherkin/steps/inventory.js +98 -0
- package/dist/core/gherkin/steps/inventory.js.map +1 -0
- package/dist/core/gherkin/steps/phrase.js +72 -0
- package/dist/core/gherkin/steps/phrase.js.map +1 -0
- package/dist/core/glossary/delta.js +106 -0
- package/dist/core/glossary/delta.js.map +1 -0
- package/dist/core/glossary/tree.js +86 -0
- package/dist/core/glossary/tree.js.map +1 -0
- package/dist/core/kernel/concurrency.js.map +1 -0
- package/dist/core/{document-bytes.js → kernel/document-bytes.js} +1 -1
- package/dist/core/kernel/document-bytes.js.map +1 -0
- package/dist/core/kernel/fences.js +42 -0
- package/dist/core/kernel/fences.js.map +1 -0
- package/dist/core/kernel/ids/capability.js +72 -0
- package/dist/core/kernel/ids/capability.js.map +1 -0
- package/dist/core/kernel/ids/dirs.js +33 -0
- package/dist/core/kernel/ids/dirs.js.map +1 -0
- package/dist/core/kernel/ids/feature.js +75 -0
- package/dist/core/kernel/ids/feature.js.map +1 -0
- package/dist/core/kernel/ids/service.js +156 -0
- package/dist/core/kernel/ids/service.js.map +1 -0
- package/dist/core/kernel/ids/subsystem.js +63 -0
- package/dist/core/kernel/ids/subsystem.js.map +1 -0
- package/dist/core/{path-safety.js → kernel/path-safety.js} +18 -4
- package/dist/core/kernel/path-safety.js.map +1 -0
- package/dist/core/kernel/records.js.map +1 -0
- package/dist/core/links/backlinks.js +68 -0
- package/dist/core/links/backlinks.js.map +1 -0
- package/dist/core/links/case.js +74 -0
- package/dist/core/links/case.js.map +1 -0
- package/dist/core/links/corpus.js +104 -0
- package/dist/core/links/corpus.js.map +1 -0
- package/dist/core/links/findings.js +110 -0
- package/dist/core/links/findings.js.map +1 -0
- package/dist/core/links/parse.js +236 -0
- package/dist/core/links/parse.js.map +1 -0
- package/dist/core/mcp/argv.js +111 -0
- package/dist/core/mcp/argv.js.map +1 -0
- package/dist/core/mcp/author-tools.js +72 -0
- package/dist/core/mcp/author-tools.js.map +1 -0
- package/dist/core/mcp/framing.js +46 -0
- package/dist/core/mcp/framing.js.map +1 -0
- package/dist/core/mcp/protocol.js +280 -0
- package/dist/core/mcp/protocol.js.map +1 -0
- package/dist/core/mcp/tools.js +314 -0
- package/dist/core/mcp/tools.js.map +1 -0
- package/dist/core/obligations/obligations.js +106 -0
- package/dist/core/obligations/obligations.js.map +1 -0
- package/dist/core/openapi/baseline/gate.js +166 -0
- package/dist/core/openapi/baseline/gate.js.map +1 -0
- package/dist/core/openapi/baseline/plan.js +112 -0
- package/dist/core/openapi/baseline/plan.js.map +1 -0
- package/dist/core/openapi/baseline/record.js +175 -0
- package/dist/core/openapi/baseline/record.js.map +1 -0
- package/dist/core/openapi/depth.js +122 -0
- package/dist/core/openapi/depth.js.map +1 -0
- package/dist/core/openapi/digest.js +189 -0
- package/dist/core/openapi/digest.js.map +1 -0
- package/dist/core/{openapi.js → openapi/doc.js} +44 -106
- package/dist/core/openapi/doc.js.map +1 -0
- package/dist/core/openapi/merge/components.js +234 -0
- package/dist/core/openapi/merge/components.js.map +1 -0
- package/dist/core/openapi/merge/error.js +26 -0
- package/dist/core/openapi/merge/error.js.map +1 -0
- package/dist/core/openapi/merge/markers.js +208 -0
- package/dist/core/openapi/merge/markers.js.map +1 -0
- package/dist/core/openapi/merge/merge.js +256 -0
- package/dist/core/openapi/merge/merge.js.map +1 -0
- package/dist/core/openapi/merge/pin.js +128 -0
- package/dist/core/openapi/merge/pin.js.map +1 -0
- package/dist/core/openspec/decide/capabilities.js +244 -0
- package/dist/core/openspec/decide/capabilities.js.map +1 -0
- package/dist/core/openspec/decide/dispositions.js +63 -0
- package/dist/core/openspec/decide/dispositions.js.map +1 -0
- package/dist/core/openspec/decide/renames.js +179 -0
- package/dist/core/openspec/decide/renames.js.map +1 -0
- package/dist/core/openspec/decide/verdict.js +84 -0
- package/dist/core/openspec/decide/verdict.js.map +1 -0
- package/dist/core/openspec/inventory.js +221 -0
- package/dist/core/openspec/inventory.js.map +1 -0
- package/dist/core/openspec/model/mapping.js +76 -0
- package/dist/core/openspec/model/mapping.js.map +1 -0
- package/dist/core/openspec/model/model.js +65 -0
- package/dist/core/openspec/model/model.js.map +1 -0
- package/dist/core/openspec/scan/changes.js +235 -0
- package/dist/core/openspec/scan/changes.js.map +1 -0
- package/dist/core/openspec/scan/config.js +200 -0
- package/dist/core/openspec/scan/config.js.map +1 -0
- package/dist/core/openspec/scan/shape.js +260 -0
- package/dist/core/openspec/scan/shape.js.map +1 -0
- package/dist/core/openspec/scan/walk.js +133 -0
- package/dist/core/openspec/scan/walk.js.map +1 -0
- package/dist/core/openspec/scan/workspace.js +71 -0
- package/dist/core/openspec/scan/workspace.js.map +1 -0
- package/dist/core/owners/codeowners.js +141 -0
- package/dist/core/owners/codeowners.js.map +1 -0
- package/dist/core/pack/features.js +120 -0
- package/dist/core/pack/features.js.map +1 -0
- package/dist/core/pack/joins.js +112 -0
- package/dist/core/pack/joins.js.map +1 -0
- package/dist/core/pack/living.js +137 -0
- package/dist/core/pack/living.js.map +1 -0
- package/dist/core/pack/pack.js +76 -0
- package/dist/core/pack/pack.js.map +1 -0
- package/dist/core/permissions/permissions.js +87 -0
- package/dist/core/permissions/permissions.js.map +1 -0
- package/dist/core/projection/api.js +84 -0
- package/dist/core/projection/api.js.map +1 -0
- package/dist/core/projection/arch-slice.js +63 -0
- package/dist/core/projection/arch-slice.js.map +1 -0
- package/dist/core/projection/events.js +34 -0
- package/dist/core/projection/events.js.map +1 -0
- package/dist/core/provenance/findings.js +208 -0
- package/dist/core/provenance/findings.js.map +1 -0
- package/dist/core/provenance/git.js +225 -0
- package/dist/core/provenance/git.js.map +1 -0
- package/dist/core/provenance/gitq/moves.js +182 -0
- package/dist/core/provenance/gitq/moves.js.map +1 -0
- package/dist/core/provenance/gitq/vouched-ancestor.js +179 -0
- package/dist/core/provenance/gitq/vouched-ancestor.js.map +1 -0
- package/dist/core/provenance/sample/scope.js +238 -0
- package/dist/core/provenance/sample/scope.js.map +1 -0
- package/dist/core/provenance/sample/sections.js +61 -0
- package/dist/core/provenance/sample/sections.js.map +1 -0
- package/dist/core/provenance/sources.js +263 -0
- package/dist/core/provenance/sources.js.map +1 -0
- package/dist/core/provenance/stamp.js +232 -0
- package/dist/core/provenance/stamp.js.map +1 -0
- package/dist/core/provenance/walk.js +157 -0
- package/dist/core/provenance/walk.js.map +1 -0
- package/dist/core/repo/authored/paths.js +210 -0
- package/dist/core/repo/authored/paths.js.map +1 -0
- package/dist/core/repo/entries.js +126 -0
- package/dist/core/repo/entries.js.map +1 -0
- package/dist/core/repo/paths.js +277 -0
- package/dist/core/repo/paths.js.map +1 -0
- package/dist/core/repo/repo.js +248 -0
- package/dist/core/repo/repo.js.map +1 -0
- package/dist/core/repo/service-target.js +153 -0
- package/dist/core/repo/service-target.js.map +1 -0
- package/dist/core/repo/state.js +58 -0
- package/dist/core/repo/state.js.map +1 -0
- package/dist/core/repo/tree/find.js +52 -0
- package/dist/core/repo/tree/find.js.map +1 -0
- package/dist/core/repo/tree/fs.js +64 -0
- package/dist/core/repo/tree/fs.js.map +1 -0
- package/dist/core/repo/tree/marker.js +61 -0
- package/dist/core/repo/tree/marker.js.map +1 -0
- package/dist/core/repo/tree/views.js +172 -0
- package/dist/core/repo/tree/views.js.map +1 -0
- package/dist/core/repo/tree/walk.js +234 -0
- package/dist/core/repo/tree/walk.js.map +1 -0
- package/dist/core/results.js +99 -2
- package/dist/core/results.js.map +1 -1
- package/dist/core/scaffold/landscape.js +131 -0
- package/dist/core/scaffold/landscape.js.map +1 -0
- package/dist/core/scaffold/readme.js +84 -0
- package/dist/core/scaffold/readme.js.map +1 -0
- package/dist/core/staging/commit.js +241 -0
- package/dist/core/staging/commit.js.map +1 -0
- package/dist/core/staging/interrupted.js +96 -0
- package/dist/core/staging/interrupted.js.map +1 -0
- package/dist/core/staging/lock.js +206 -0
- package/dist/core/staging/lock.js.map +1 -0
- package/dist/core/staging/recovery/finding.js +35 -0
- package/dist/core/staging/recovery/finding.js.map +1 -0
- package/dist/core/staging/recovery/intent.js +98 -0
- package/dist/core/staging/recovery/intent.js.map +1 -0
- package/dist/core/staging/recovery/recover.js +126 -0
- package/dist/core/staging/recovery/recover.js.map +1 -0
- package/dist/core/staging/recovery/residue.js +62 -0
- package/dist/core/staging/recovery/residue.js.map +1 -0
- package/dist/core/staging/snapshot.js +202 -0
- package/dist/core/staging/snapshot.js.map +1 -0
- package/dist/core/staging/txn/forward.js +171 -0
- package/dist/core/staging/txn/forward.js.map +1 -0
- package/dist/core/staging/txn/journal.js +139 -0
- package/dist/core/staging/txn/journal.js.map +1 -0
- package/dist/core/staging/txn/transaction.js +75 -0
- package/dist/core/staging/txn/transaction.js.map +1 -0
- package/dist/core/staging/writes.js +113 -0
- package/dist/core/staging/writes.js.map +1 -0
- package/dist/core/status/actions/execution.js +49 -0
- package/dist/core/status/actions/execution.js.map +1 -0
- package/dist/core/status/contracts.js +102 -0
- package/dist/core/status/contracts.js.map +1 -0
- package/dist/core/status/feature/artifacts.js +196 -0
- package/dist/core/status/feature/artifacts.js.map +1 -0
- package/dist/core/status/feature/feature.js +207 -0
- package/dist/core/status/feature/feature.js.map +1 -0
- package/dist/core/status/feature/next.js +150 -0
- package/dist/core/status/feature/next.js.map +1 -0
- package/dist/core/status/feature/state.js +21 -0
- package/dist/core/status/feature/state.js.map +1 -0
- package/dist/core/status/fleet/fleet.js +197 -0
- package/dist/core/status/fleet/fleet.js.map +1 -0
- package/dist/core/status/fleet/next.js +207 -0
- package/dist/core/status/fleet/next.js.map +1 -0
- package/dist/core/status/interrupted.js +97 -0
- package/dist/core/status/interrupted.js.map +1 -0
- package/dist/core/status/report.js +31 -0
- package/dist/core/status/report.js.map +1 -0
- package/dist/core/status/scan.js +41 -0
- package/dist/core/status/scan.js.map +1 -0
- package/dist/core/status/verification.js +201 -0
- package/dist/core/status/verification.js.map +1 -0
- package/dist/core/usecases/capability.js +169 -0
- package/dist/core/usecases/capability.js.map +1 -0
- package/dist/core/usecases/delta/claims.js +116 -0
- package/dist/core/usecases/delta/claims.js.map +1 -0
- package/dist/core/usecases/delta/flows.js +103 -0
- package/dist/core/usecases/delta/flows.js.map +1 -0
- package/dist/core/usecases/delta/overlay.js +72 -0
- package/dist/core/usecases/delta/overlay.js.map +1 -0
- package/dist/core/usecases/fleet.js +137 -0
- package/dist/core/usecases/fleet.js.map +1 -0
- package/dist/core/usecases/operations.js +111 -0
- package/dist/core/usecases/operations.js.map +1 -0
- package/dist/core/usecases/place.js +44 -0
- package/dist/core/usecases/place.js.map +1 -0
- package/dist/core/usecases/touch.js +101 -0
- package/dist/core/usecases/touch.js.map +1 -0
- package/dist/core/verify/answers.js +173 -0
- package/dist/core/verify/answers.js.map +1 -0
- package/dist/core/verify/build.js +150 -0
- package/dist/core/verify/build.js.map +1 -0
- package/dist/core/verify/checklist.js +201 -0
- package/dist/core/verify/checklist.js.map +1 -0
- package/dist/core/verify/claims/identity.js +61 -0
- package/dist/core/verify/claims/identity.js.map +1 -0
- package/dist/core/verify/cross/diff.js +97 -0
- package/dist/core/verify/cross/diff.js.map +1 -0
- package/dist/core/verify/evidence/contract.js +169 -0
- package/dist/core/verify/evidence/contract.js.map +1 -0
- package/dist/core/verify/file.js +257 -0
- package/dist/core/verify/file.js.map +1 -0
- package/dist/core/verify/pins/lint.js +157 -0
- package/dist/core/verify/pins/lint.js.map +1 -0
- package/dist/core/verify/pins/pin.js +95 -0
- package/dist/core/verify/pins/pin.js.map +1 -0
- package/dist/core/verify/record.js +142 -0
- package/dist/core/verify/record.js.map +1 -0
- package/dist/core/verify/store/commit.js +89 -0
- package/dist/core/verify/store/commit.js.map +1 -0
- package/dist/core/verify/store/render.js +57 -0
- package/dist/core/verify/store/render.js.map +1 -0
- package/dist/core/vocabulary/health.js +91 -0
- package/dist/core/vocabulary/health.js.map +1 -0
- package/dist/core/vocabulary/issue.js +58 -0
- package/dist/core/vocabulary/issue.js.map +1 -0
- package/dist/core/vocabulary/maturity.js +145 -0
- package/dist/core/vocabulary/maturity.js.map +1 -0
- package/dist/core/{report.js → vocabulary/report.js} +30 -2
- package/dist/core/vocabulary/report.js.map +1 -0
- package/dist/core/vocabulary/steps.js +266 -0
- package/dist/core/vocabulary/steps.js.map +1 -0
- package/dist/core/workspace/discover.js +239 -0
- package/dist/core/workspace/discover.js.map +1 -0
- package/dist/core/workspace/render.js +52 -0
- package/dist/core/workspace/render.js.map +1 -0
- package/examples/README.md +189 -0
- package/examples/docs/architecture/adrs/0001-transactional-outbox.md +33 -0
- package/examples/docs/architecture/capabilities.yaml +31 -0
- package/examples/docs/architecture/landscape.likec4 +280 -0
- package/examples/docs/architecture/obligations.yaml +23 -0
- package/examples/docs/architecture/permissions.yaml +50 -0
- package/examples/docs/architecture/subsystems.likec4 +11 -0
- package/examples/docs/architecture/usecases/order-notification.likec4 +65 -0
- package/examples/docs/capabilities/checkout/spec.md +55 -0
- package/examples/docs/capabilities/identity/tokens/spec.md +42 -0
- package/examples/docs/capabilities/order-notifications/spec.md +43 -0
- package/examples/docs/features/FEAT-101-payment-splitting/adrs/0001-dedicated-split-service.md +18 -0
- package/examples/docs/features/FEAT-101-payment-splitting/delta.likec4 +94 -0
- package/examples/docs/features/FEAT-101-payment-splitting/intent.md +44 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/checkout-web/spec.md +21 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-service/asyncapi.yaml +129 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-service/spec.md +36 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-split-service/arch.spec.md +40 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-split-service/openapi.yaml +116 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-split-service/spec.md +55 -0
- package/examples/docs/features/FEAT-112-retire-order-v1/intent.md +35 -0
- package/examples/docs/features/FEAT-112-retire-order-v1/specs/order-service/openapi.yaml +28 -0
- package/examples/docs/features/FEAT-112-retire-order-v1/specs/order-service/spec.md +17 -0
- package/examples/docs/features/archive/FEAT-088-refunds/.loam-before/files/architecture/landscape.likec4 +253 -0
- package/examples/docs/features/archive/FEAT-088-refunds/.loam-before/files/services/order-service/spec.md +121 -0
- package/examples/docs/features/archive/FEAT-088-refunds/.loam-before/files/services/payment-service/openapi.yaml +111 -0
- package/examples/docs/features/archive/FEAT-088-refunds/.loam-before/files/services/payment-service/spec.md +58 -0
- package/examples/docs/features/archive/FEAT-088-refunds/.loam-before/manifest.json +32 -0
- package/examples/docs/features/archive/FEAT-088-refunds/adrs/0001-refunds-stay-in-payment-service.md +26 -0
- package/examples/docs/features/archive/FEAT-088-refunds/delta.likec4 +28 -0
- package/examples/docs/features/archive/FEAT-088-refunds/intent.md +26 -0
- package/examples/docs/features/archive/FEAT-088-refunds/specs/order-service/spec.md +37 -0
- package/examples/docs/features/archive/FEAT-088-refunds/specs/payment-service/openapi.yaml +70 -0
- package/examples/docs/features/archive/FEAT-088-refunds/specs/payment-service/spec.md +23 -0
- package/examples/docs/features/archive/FEAT-088-refunds/verification.yaml +76 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/files/architecture/landscape.likec4 +275 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/files/services/payment-service/asyncapi.yaml +96 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/files/services/payment-service/spec.md +82 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/files/services/platform/notification-service/asyncapi.yaml +164 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/files/services/platform/notification-service/spec.md +91 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/manifest.json +46 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/delta.likec4 +36 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/intent.md +22 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/scenario-report.json +10 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/specs/notification-service/asyncapi.yaml +208 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/specs/notification-service/spec.md +24 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/specs/payment-service/asyncapi.yaml +137 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/specs/payment-service/spec.md +31 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/verification.yaml +84 -0
- package/examples/docs/glossary/order.md +15 -0
- package/examples/docs/glossary/payments/authorization.md +14 -0
- package/examples/docs/likec4.config.json +9 -0
- package/examples/docs/loam.json +3 -0
- package/examples/docs/services/checkout-web/model.likec4 +109 -0
- package/examples/docs/services/checkout-web/spec.md +91 -0
- package/examples/docs/services/checkout-web/ui/pages/checkout.page.yaml +40 -0
- package/examples/docs/services/checkout-web/ui/pages/order-status.page.yaml +24 -0
- package/examples/docs/services/checkout-web/ui/pages/split-payment.page.yaml +26 -0
- package/examples/docs/services/order-service/adrs/0001-orchestrated-order-lifecycle.md +52 -0
- package/examples/docs/services/order-service/arch.spec.md +127 -0
- package/examples/docs/services/order-service/asyncapi.yaml +108 -0
- package/examples/docs/services/order-service/health.yaml +57 -0
- package/examples/docs/services/order-service/model.likec4 +138 -0
- package/examples/docs/services/order-service/openapi.yaml +257 -0
- package/examples/docs/services/order-service/runbook.md +62 -0
- package/examples/docs/services/order-service/spec.md +134 -0
- package/examples/docs/services/payment-service/adrs/0001-payments-outbox.md +18 -0
- package/examples/docs/services/payment-service/adrs/0002-idempotency-keys-on-authorization.md +27 -0
- package/examples/docs/services/payment-service/arch.spec.md +73 -0
- package/examples/docs/services/payment-service/asyncapi.yaml +130 -0
- package/examples/docs/services/payment-service/health.yaml +39 -0
- package/examples/docs/services/payment-service/model.likec4 +67 -0
- package/examples/docs/services/payment-service/openapi.yaml +151 -0
- package/examples/docs/services/payment-service/runbook.md +37 -0
- package/examples/docs/services/payment-service/spec.md +88 -0
- package/examples/docs/services/platform/identity-service/adrs/0001-token-introspection-over-local-validation.md +60 -0
- package/examples/docs/services/platform/identity-service/arch.spec.md +117 -0
- package/examples/docs/services/platform/identity-service/health.yaml +70 -0
- package/examples/docs/services/platform/identity-service/model.likec4 +83 -0
- package/examples/docs/services/platform/identity-service/openapi.yaml +197 -0
- package/examples/docs/services/platform/identity-service/runbook.md +95 -0
- package/examples/docs/services/platform/identity-service/spec.md +119 -0
- package/examples/docs/services/platform/notification-service/asyncapi.yaml +199 -0
- package/examples/docs/services/platform/notification-service/health.yaml +35 -0
- package/examples/docs/services/platform/notification-service/model.likec4 +118 -0
- package/examples/docs/services/platform/notification-service/runbook.md +48 -0
- package/examples/docs/services/platform/notification-service/spec.md +112 -0
- package/examples/docs/services/platform/subsystem.yaml +2 -0
- package/examples/fleet.yaml +57 -0
- package/package.json +19 -6
- package/dist/commands/adopt.js +0 -240
- package/dist/commands/adopt.js.map +0 -1
- package/dist/commands/archive.js +0 -1313
- package/dist/commands/archive.js.map +0 -1
- package/dist/commands/delta.js +0 -388
- package/dist/commands/delta.js.map +0 -1
- package/dist/commands/docs-repo-gate.js.map +0 -1
- package/dist/commands/format.js +0 -17
- package/dist/commands/format.js.map +0 -1
- package/dist/commands/gherkin.js +0 -309
- package/dist/commands/gherkin.js.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/list.js +0 -295
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/migrate-openspec.js +0 -950
- package/dist/commands/migrate-openspec.js.map +0 -1
- package/dist/commands/new.js +0 -413
- package/dist/commands/new.js.map +0 -1
- package/dist/commands/rebase.js +0 -356
- package/dist/commands/rebase.js.map +0 -1
- package/dist/commands/show.js.map +0 -1
- package/dist/commands/status.js +0 -262
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/unarchive.js.map +0 -1
- package/dist/commands/validate.js +0 -1773
- package/dist/commands/validate.js.map +0 -1
- package/dist/commands/verify.js +0 -775
- package/dist/commands/verify.js.map +0 -1
- package/dist/commands/vouch.js +0 -421
- package/dist/commands/vouch.js.map +0 -1
- package/dist/core/agent.js +0 -2173
- package/dist/core/agent.js.map +0 -1
- package/dist/core/agents-stamp.js.map +0 -1
- package/dist/core/arch.js +0 -130
- package/dist/core/arch.js.map +0 -1
- package/dist/core/asyncapi.js.map +0 -1
- package/dist/core/brief.js +0 -755
- package/dist/core/brief.js.map +0 -1
- package/dist/core/coherence.js +0 -577
- package/dist/core/coherence.js.map +0 -1
- package/dist/core/concurrency.js.map +0 -1
- package/dist/core/config.js.map +0 -1
- package/dist/core/delta.js +0 -476
- package/dist/core/delta.js.map +0 -1
- package/dist/core/dependencies.js +0 -356
- package/dist/core/dependencies.js.map +0 -1
- package/dist/core/doctor.js +0 -596
- package/dist/core/doctor.js.map +0 -1
- package/dist/core/document-bytes.js.map +0 -1
- package/dist/core/explore.js.map +0 -1
- package/dist/core/frontmatter.js.map +0 -1
- package/dist/core/gherkin.js +0 -463
- package/dist/core/gherkin.js.map +0 -1
- package/dist/core/health.js +0 -67
- package/dist/core/health.js.map +0 -1
- package/dist/core/ids.js +0 -122
- package/dist/core/ids.js.map +0 -1
- package/dist/core/issue.js +0 -9
- package/dist/core/issue.js.map +0 -1
- package/dist/core/json.js +0 -74
- package/dist/core/json.js.map +0 -1
- package/dist/core/likec4.js +0 -489
- package/dist/core/likec4.js.map +0 -1
- package/dist/core/maturity.js +0 -66
- package/dist/core/maturity.js.map +0 -1
- package/dist/core/openapi-merge.js +0 -552
- package/dist/core/openapi-merge.js.map +0 -1
- package/dist/core/openapi.js.map +0 -1
- package/dist/core/openspec-inventory.js +0 -1440
- package/dist/core/openspec-inventory.js.map +0 -1
- package/dist/core/path-safety.js.map +0 -1
- package/dist/core/provenance.js +0 -787
- package/dist/core/provenance.js.map +0 -1
- package/dist/core/records.js.map +0 -1
- package/dist/core/repo.js +0 -438
- package/dist/core/repo.js.map +0 -1
- package/dist/core/report.js.map +0 -1
- package/dist/core/spec.js +0 -505
- package/dist/core/spec.js.map +0 -1
- package/dist/core/staging.js +0 -890
- package/dist/core/staging.js.map +0 -1
- package/dist/core/status.js +0 -1132
- package/dist/core/status.js.map +0 -1
- package/dist/core/steps.js +0 -72
- package/dist/core/steps.js.map +0 -1
- package/dist/core/verify.js +0 -807
- package/dist/core/verify.js.map +0 -1
- package/dist/core/version.js.map +0 -1
- /package/dist/core/{concurrency.js → kernel/concurrency.js} +0 -0
- /package/dist/core/{records.js → kernel/records.js} +0 -0
|
@@ -1,552 +0,0 @@
|
|
|
1
|
-
import { isDeepStrictEqual } from "node:util";
|
|
2
|
-
import { isMap, parseDocument } from "yaml";
|
|
3
|
-
import { HTTP_METHODS, OPENAPI_BASELINE_KEY, classifyBaselineDigests, operationBaselineOf, operationDigest, withoutOperationBaseline, } from "./openapi.js";
|
|
4
|
-
// Every `isRecord` below asks one question of a resolved plain tree: is this a
|
|
5
|
-
// node that can hold OpenAPI keys — an object, not an array?
|
|
6
|
-
import { isRecord } from "./records.js";
|
|
7
|
-
/**
|
|
8
|
-
* Classify one feature operation against its living counterpart, from the raw
|
|
9
|
-
* YAML trees the merge works in. The rule itself lives in core/openapi.ts, so
|
|
10
|
-
* the gate and the merge cannot drift apart about which operations get written.
|
|
11
|
-
*
|
|
12
|
-
* A malformed pin matches no digest and lands in `stale`, which merges rather
|
|
13
|
-
* than skips. Deliberate: `openapi.baseline-invalid` refuses it at the gate, and
|
|
14
|
-
* a value nobody can evaluate must never be the reason a merge quietly drops an
|
|
15
|
-
* operation.
|
|
16
|
-
*/
|
|
17
|
-
export function classifyOperationBaseline(featureOp, livingOp) {
|
|
18
|
-
return classifyBaselineDigests(operationBaselineOf(featureOp), operationDigest(featureOp), livingOp === undefined ? undefined : operationDigest(livingOp));
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Pin every operation in a feature contract against the living one — what
|
|
22
|
-
* `loam rebase` writes on this axis.
|
|
23
|
-
*
|
|
24
|
-
* The pin is always `operationDigest` of the LIVING operation, never of the
|
|
25
|
-
* delta's own, and that single rule produces both merge verdicts by itself: an
|
|
26
|
-
* operation the author only QUOTED is byte-equal to living, so its pin equals
|
|
27
|
-
* its own content and `classifyOperationBaseline` calls it a quote; one the
|
|
28
|
-
* author EDITED differs from its pin, so the merge writes it. Nothing has to
|
|
29
|
-
* guess at intent — the document already records it, and the pin makes it
|
|
30
|
-
* legible to the merge.
|
|
31
|
-
*
|
|
32
|
-
* Slot-keyed (path + method), exactly as the merge upserts. An operationId that
|
|
33
|
-
* moved to another slot is a new slot with nothing living behind it, which is
|
|
34
|
-
* `unresolved` and correct: there is no living version of an operation at a
|
|
35
|
-
* path the contract does not serve yet.
|
|
36
|
-
*/
|
|
37
|
-
export function pinOpenapiOperations(featureText, livingText, service) {
|
|
38
|
-
const doc = parseDocument(featureText);
|
|
39
|
-
if (doc.errors.length > 0)
|
|
40
|
-
throw new OpenapiMergeError("feature", service, doc.errors[0].message);
|
|
41
|
-
let featPlain;
|
|
42
|
-
let livingPlain;
|
|
43
|
-
try {
|
|
44
|
-
featPlain = doc.toJS() ?? {};
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
throw new OpenapiMergeError("feature", service, errorMessage(error));
|
|
48
|
-
}
|
|
49
|
-
try {
|
|
50
|
-
const parsed = parseDocument(livingText);
|
|
51
|
-
if (parsed.errors.length > 0)
|
|
52
|
-
throw new OpenapiMergeError("living", service, parsed.errors[0].message);
|
|
53
|
-
livingPlain = parsed.toJS() ?? {};
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
if (error instanceof OpenapiMergeError)
|
|
57
|
-
throw error;
|
|
58
|
-
throw new OpenapiMergeError("living", service, errorMessage(error));
|
|
59
|
-
}
|
|
60
|
-
const featPaths = plainChild(featPlain, "paths");
|
|
61
|
-
if (!isRecord(featPaths))
|
|
62
|
-
return { text: null, pins: [] };
|
|
63
|
-
const livingPaths = plainChild(livingPlain, "paths");
|
|
64
|
-
const pins = [];
|
|
65
|
-
let edited = false;
|
|
66
|
-
for (const [path, item] of Object.entries(featPaths)) {
|
|
67
|
-
if (!isRecord(item))
|
|
68
|
-
continue;
|
|
69
|
-
for (const [method, op] of Object.entries(item)) {
|
|
70
|
-
if (!HTTP_METHODS.has(method) || !isRecord(op))
|
|
71
|
-
continue;
|
|
72
|
-
// A removal marker asserts a slot rather than restating an operation, so
|
|
73
|
-
// it has nothing to be based on; `openapi.remove-target-mismatch` is what
|
|
74
|
-
// guards it against a living slot that moved under it.
|
|
75
|
-
if (isRemoval(op))
|
|
76
|
-
continue;
|
|
77
|
-
const id = typeof op["operationId"] === "string" ? op["operationId"] : "";
|
|
78
|
-
const at = { path, method, operationId: id };
|
|
79
|
-
const from = operationBaselineOf(op) ?? null;
|
|
80
|
-
const livingItem = plainChild(livingPaths, path);
|
|
81
|
-
const livingOp = isRecord(livingItem) ? livingItem[method] : undefined;
|
|
82
|
-
if (!isRecord(livingOp)) {
|
|
83
|
-
pins.push({ ...at, status: "unresolved", from, to: null });
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
const digest = operationDigest(livingOp);
|
|
87
|
-
if (from === digest) {
|
|
88
|
-
pins.push({ ...at, status: "unchanged", from: digest, to: digest });
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
91
|
-
// One shared value backs every use of an anchor, so `setIn` through an
|
|
92
|
-
// alias would pin every other use of it too — the same reason
|
|
93
|
-
// stripOpenapiRemovalMarkers refuses to edit aliases in place.
|
|
94
|
-
if (!isMap(doc.getIn(["paths", path, method]))) {
|
|
95
|
-
pins.push({ ...at, status: "unwritable", from, to: null });
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
pins.push({ ...at, status: from === null ? "pinned" : "repinned", from, to: digest });
|
|
99
|
-
doc.setIn(["paths", path, method, OPENAPI_BASELINE_KEY], digest);
|
|
100
|
-
edited = true;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (!edited)
|
|
104
|
-
return { text: null, pins };
|
|
105
|
-
try {
|
|
106
|
-
return { text: doc.toString(), pins };
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
throw new OpenapiMergeError("feature", service, errorMessage(error));
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
/** A document the merge planner cannot read. Commands map this domain error to their own envelope. */
|
|
113
|
-
export class OpenapiMergeError extends Error {
|
|
114
|
-
source;
|
|
115
|
-
service;
|
|
116
|
-
name = "OpenapiMergeError";
|
|
117
|
-
constructor(source, service, detail) {
|
|
118
|
-
super(`${source} openapi for ${service} is not valid YAML: ${detail}`);
|
|
119
|
-
this.source = source;
|
|
120
|
-
this.service = service;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Remove feature-only operation-removal markers before a feature contract is
|
|
125
|
-
* used to create a brand-new living document. Normally coherence refuses this
|
|
126
|
-
* shape because there cannot be a removal target; this guard also keeps
|
|
127
|
-
* `--approve` from ever persisting the marker into living docs.
|
|
128
|
-
*/
|
|
129
|
-
export function stripOpenapiRemovalMarkers(featureText, service) {
|
|
130
|
-
const feature = parseDocument(featureText);
|
|
131
|
-
if (feature.errors.length > 0) {
|
|
132
|
-
throw new OpenapiMergeError("feature", service, feature.errors[0].message);
|
|
133
|
-
}
|
|
134
|
-
let plain;
|
|
135
|
-
try {
|
|
136
|
-
plain = feature.toJS() ?? {};
|
|
137
|
-
}
|
|
138
|
-
catch (error) {
|
|
139
|
-
throw new OpenapiMergeError("feature", service, errorMessage(error));
|
|
140
|
-
}
|
|
141
|
-
// Shape from the RESOLVED tree, for the same reason the merge reads it there:
|
|
142
|
-
// an aliased `paths` or path item is not a map node, and treating it as
|
|
143
|
-
// "nothing to strip" is how a feature-only marker reached a living contract.
|
|
144
|
-
const paths = plainChild(plain, "paths");
|
|
145
|
-
if (!isRecord(paths))
|
|
146
|
-
return featureText;
|
|
147
|
-
const cleaned = {};
|
|
148
|
-
let stripped = false;
|
|
149
|
-
for (const [path, item] of Object.entries(paths)) {
|
|
150
|
-
const kept = withoutFeatureMarkers(item);
|
|
151
|
-
if (!isDeepStrictEqual(kept, item))
|
|
152
|
-
stripped = true;
|
|
153
|
-
// A path the strip emptied goes with its last operation: `\/x: {}` is a
|
|
154
|
-
// path the contract advertises and nothing answers.
|
|
155
|
-
if (kept !== undefined)
|
|
156
|
-
cleaned[path] = kept;
|
|
157
|
-
}
|
|
158
|
-
if (!stripped)
|
|
159
|
-
return featureText;
|
|
160
|
-
// Edit the AST in place when every node the strip touches IS a node — the
|
|
161
|
-
// author's comments, key order and formatting are theirs to keep. An alias
|
|
162
|
-
// cannot be edited in place (there is one shared value behind it, and
|
|
163
|
-
// deleting a key through it would change every use), so those documents get
|
|
164
|
-
// their `paths` rewritten from the resolved tree instead: losing formatting
|
|
165
|
-
// is a cost, shipping the marker is a corruption.
|
|
166
|
-
//
|
|
167
|
-
// The test has to reach the OPERATION nodes too, not just the path items. The
|
|
168
|
-
// in-place branch strips a surviving operation's pin through
|
|
169
|
-
// `["paths", p, m, x-loam-based-on]`, and an aliased operation is exactly one
|
|
170
|
-
// level below where the check used to look — so `deleteIn` walked into a node
|
|
171
|
-
// that is not a collection and threw out of archive as `internal`, on a
|
|
172
|
-
// document whose only fault was writing one operation twice.
|
|
173
|
-
//
|
|
174
|
-
// What disqualifies a method is "there is something here to strip and I cannot
|
|
175
|
-
// reach it", not "this is not a map node". Only a resolved MAPPING can be a
|
|
176
|
-
// removal marker or carry a pin, so a method spelled as a scalar — `get: ~`,
|
|
177
|
-
// or a string — is nothing the in-place branch would have touched; demanding a
|
|
178
|
-
// map node of it too demoted whole documents to the rewrite branch and cost
|
|
179
|
-
// their author every comment, anchor and hand-chosen key order inside `paths`,
|
|
180
|
-
// in the bytes archive installs as the living contract. What is left is the
|
|
181
|
-
// real hazard: a mapping the AST does not hand back as a map. An alias is the
|
|
182
|
-
// one node kind that resolves to a mapping without being one, and a method
|
|
183
|
-
// whose KEY is an alias is not findable by name at all, so `deleteIn` reports
|
|
184
|
-
// nothing deleted and the marker ships in silence. Both answer `undefined` or
|
|
185
|
-
// a non-map here, and both belong on the safe branch.
|
|
186
|
-
const editable = isMap(feature.get("paths")) &&
|
|
187
|
-
Object.entries(paths).every(([p, item]) => isMap(feature.getIn(["paths", p])) &&
|
|
188
|
-
(!isRecord(item) ||
|
|
189
|
-
Object.entries(item).every(([m, op]) => !HTTP_METHODS.has(m) || !isRecord(op) || isMap(feature.getIn(["paths", p, m])))));
|
|
190
|
-
if (!editable) {
|
|
191
|
-
feature.setIn(["paths"], cleaned);
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
for (const [path, item] of Object.entries(paths)) {
|
|
195
|
-
if (!isRecord(item))
|
|
196
|
-
continue;
|
|
197
|
-
for (const [m, value] of Object.entries(item)) {
|
|
198
|
-
// A loam marker at PATH level, deleted here for the same reason the
|
|
199
|
-
// resolved-tree branch drops it: the two branches must agree exactly
|
|
200
|
-
// about what a living contract may carry.
|
|
201
|
-
if (FEATURE_ONLY_KEYS.has(m))
|
|
202
|
-
feature.deleteIn(["paths", path, m]);
|
|
203
|
-
if (!HTTP_METHODS.has(m))
|
|
204
|
-
continue;
|
|
205
|
-
if (isRemoval(value))
|
|
206
|
-
feature.deleteIn(["paths", path, m]);
|
|
207
|
-
// The surviving operations keep their formatting but lose their pin:
|
|
208
|
-
// the in-place branch must strip everything the resolved-tree branch
|
|
209
|
-
// does, or the two disagree about what a living contract may carry.
|
|
210
|
-
else if (operationBaselineOf(value) !== undefined) {
|
|
211
|
-
feature.deleteIn(["paths", path, m, OPENAPI_BASELINE_KEY]);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
const remaining = feature.getIn(["paths", path]);
|
|
215
|
-
if (isMap(remaining) && remaining.items.length === 0)
|
|
216
|
-
feature.deleteIn(["paths", path]);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
try {
|
|
220
|
-
return feature.toString();
|
|
221
|
-
}
|
|
222
|
-
catch (error) {
|
|
223
|
-
throw new OpenapiMergeError("feature", service, errorMessage(error));
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Merge the feature's `paths` into the living OpenAPI structurally (YAML AST, not
|
|
228
|
-
* text splicing). A feature document without paths is a successful no-op.
|
|
229
|
-
* The merged operations' local component-ref closure rides along recursively;
|
|
230
|
-
* external refs are left untouched and never gated.
|
|
231
|
-
*
|
|
232
|
-
* Every SHAPE question — is there a `paths` mapping, is this path item a
|
|
233
|
-
* mapping, which methods does it hold — is answered from the RESOLVED plain
|
|
234
|
-
* trees, never from the AST node. Asking the AST (`isMap(node)`) answers a
|
|
235
|
-
* different question: an alias node is not a map even when it resolves to one.
|
|
236
|
-
* `paths: *alias` therefore read as "no paths to merge" and the whole contract
|
|
237
|
-
* delta was dropped with a successful exit, and an aliased path ITEM fell into
|
|
238
|
-
* the wholesale-replace branch and deleted every living operation on that path
|
|
239
|
-
* that the alias did not restate. Aliases are legal OpenAPI and the natural way
|
|
240
|
-
* to write a delta that repeats a shape; nothing here may treat them as absent.
|
|
241
|
-
* An alias that cannot be resolved at all is a document loam cannot read, and
|
|
242
|
-
* says so — it is never "nothing to merge".
|
|
243
|
-
*/
|
|
244
|
-
export function mergeOpenapiPaths(livingText, featureText, service) {
|
|
245
|
-
const feature = parseDocument(featureText);
|
|
246
|
-
if (feature.errors.length > 0) {
|
|
247
|
-
throw new OpenapiMergeError("feature", service, feature.errors[0].message);
|
|
248
|
-
}
|
|
249
|
-
let featPlain;
|
|
250
|
-
try {
|
|
251
|
-
// Resolve aliases once with the document's own anchor context. Calling an
|
|
252
|
-
// individual AST node's toJSON() loses that context and can silently turn
|
|
253
|
-
// an aliased operation or component into the wrong value.
|
|
254
|
-
featPlain = feature.toJS() ?? {};
|
|
255
|
-
}
|
|
256
|
-
catch (error) {
|
|
257
|
-
throw new OpenapiMergeError("feature", service, errorMessage(error));
|
|
258
|
-
}
|
|
259
|
-
const featPathsPlain = plainChild(featPlain, "paths");
|
|
260
|
-
if (featPathsPlain === undefined || featPathsPlain === null) {
|
|
261
|
-
return noop();
|
|
262
|
-
}
|
|
263
|
-
if (!isRecord(featPathsPlain)) {
|
|
264
|
-
throw new OpenapiMergeError("feature", service, "`paths` is not a mapping");
|
|
265
|
-
}
|
|
266
|
-
const featPathEntries = Object.entries(featPathsPlain);
|
|
267
|
-
if (featPathEntries.length === 0)
|
|
268
|
-
return noop();
|
|
269
|
-
const living = parseDocument(livingText);
|
|
270
|
-
if (living.errors.length > 0) {
|
|
271
|
-
throw new OpenapiMergeError("living", service, living.errors[0].message);
|
|
272
|
-
}
|
|
273
|
-
let livingPlain;
|
|
274
|
-
try {
|
|
275
|
-
livingPlain = living.toJS() ?? {};
|
|
276
|
-
}
|
|
277
|
-
catch (error) {
|
|
278
|
-
throw new OpenapiMergeError("living", service, errorMessage(error));
|
|
279
|
-
}
|
|
280
|
-
const livingPathsPlain = plainChild(livingPlain, "paths");
|
|
281
|
-
if (livingPathsPlain !== undefined && livingPathsPlain !== null && !isRecord(livingPathsPlain)) {
|
|
282
|
-
throw new OpenapiMergeError("living", service, "`paths` is not a mapping");
|
|
283
|
-
}
|
|
284
|
-
const modified = [];
|
|
285
|
-
const pathItemModified = [];
|
|
286
|
-
const removed = [];
|
|
287
|
-
const quoted = [];
|
|
288
|
-
const baselineStale = [];
|
|
289
|
-
for (const [path, featItemPlain] of featPathEntries) {
|
|
290
|
-
const existing = living.getIn(["paths", path]);
|
|
291
|
-
const existingPlain = plainChild(livingPathsPlain, path);
|
|
292
|
-
if (existing !== undefined && !isRecord(existingPlain)) {
|
|
293
|
-
// The living contract holds this path as something other than a path
|
|
294
|
-
// item. Replacing it wholesale is the one branch that may delete living
|
|
295
|
-
// operations without naming them, so it is reserved for paths the living
|
|
296
|
-
// contract does not have at all.
|
|
297
|
-
throw new OpenapiMergeError("living", service, `path '${path}' is not a mapping`);
|
|
298
|
-
}
|
|
299
|
-
if (existing !== undefined) {
|
|
300
|
-
if (!isRecord(featItemPlain)) {
|
|
301
|
-
throw new OpenapiMergeError("feature", service, `path '${path}' is not a mapping`);
|
|
302
|
-
}
|
|
303
|
-
// EVERY branch publishes through withoutFeatureMarkers. This one used to
|
|
304
|
-
// copy every key of the feature path item and guard only the HTTP
|
|
305
|
-
// methods, so a path-level `x-loam-remove` landed in the living contract
|
|
306
|
-
// with `modified: []` and no warning. A key the strip drops is never
|
|
307
|
-
// written; the removal handling below still reads the RAW item, because
|
|
308
|
-
// that is where the markers it acts on live.
|
|
309
|
-
const publish = withoutFeatureMarkers(featItemPlain);
|
|
310
|
-
const publishable = isRecord(publish) ? publish : {};
|
|
311
|
-
for (const [m, afterPlain] of Object.entries(featItemPlain)) {
|
|
312
|
-
const before = living.getIn(["paths", path, m]);
|
|
313
|
-
const beforePlain = plainChild(existingPlain, m);
|
|
314
|
-
if (HTTP_METHODS.has(m) && isRemoval(afterPlain)) {
|
|
315
|
-
// Coherence validates the marker and gates absent/mismatched targets.
|
|
316
|
-
// The merge remains defensive under --approve: never delete a
|
|
317
|
-
// different operation merely because it occupies the requested slot.
|
|
318
|
-
if (before !== undefined &&
|
|
319
|
-
operationIdOf(beforePlain) !== undefined &&
|
|
320
|
-
operationIdOf(beforePlain) === operationIdOf(afterPlain)) {
|
|
321
|
-
removed.push(opLabel(beforePlain, afterPlain, m, path));
|
|
322
|
-
living.deleteIn(["paths", path, m]);
|
|
323
|
-
}
|
|
324
|
-
continue;
|
|
325
|
-
}
|
|
326
|
-
if (HTTP_METHODS.has(m)) {
|
|
327
|
-
const verdict = classifyOperationBaseline(afterPlain, before === undefined ? undefined : beforePlain);
|
|
328
|
-
// A QUOTE is not a merge input. The author wrote this operation down
|
|
329
|
-
// because the document is complete, not because they changed it, so
|
|
330
|
-
// the living contract keeps whatever it holds — including a change
|
|
331
|
-
// that landed after this delta was written. This is mechanical, not a
|
|
332
|
-
// judgement, so `--approve` does not turn it back on: overriding a
|
|
333
|
-
// gate is a decision, reverting an operation nobody edited is a bug.
|
|
334
|
-
if (verdict === "quote") {
|
|
335
|
-
quoted.push(opLabel(beforePlain, afterPlain, m, path));
|
|
336
|
-
continue;
|
|
337
|
-
}
|
|
338
|
-
if (verdict === "stale")
|
|
339
|
-
baselineStale.push(opLabel(beforePlain, afterPlain, m, path));
|
|
340
|
-
}
|
|
341
|
-
if (!(m in publishable)) {
|
|
342
|
-
// A feature-only marker at path level. It is never published, and
|
|
343
|
-
// never reported as a path-item overwrite either — it is not a key of
|
|
344
|
-
// the contract at all. The archive gate names it to the author.
|
|
345
|
-
continue;
|
|
346
|
-
}
|
|
347
|
-
// The difference check covers EVERY key of the path item; only the
|
|
348
|
-
// LABEL depends on whether the key is an HTTP method.
|
|
349
|
-
if (before !== undefined && !isDeepStrictEqual(beforePlain, afterPlain)) {
|
|
350
|
-
if (HTTP_METHODS.has(m))
|
|
351
|
-
modified.push(opLabel(beforePlain, afterPlain, m, path));
|
|
352
|
-
else
|
|
353
|
-
pathItemModified.push(`'${m}' (${path})`);
|
|
354
|
-
}
|
|
355
|
-
// Every shape question above was answered from the RESOLVED tree, which
|
|
356
|
-
// is exactly what makes an aliased path item read as an ordinary
|
|
357
|
-
// mapping. The WRITE cannot be that forgiving: `setIn` walks the AST,
|
|
358
|
-
// and one shared value backs every use of an anchor, so an operation
|
|
359
|
-
// merged through the alias would land in every other path that
|
|
360
|
-
// references it. There is no way to write into one use of an anchor and
|
|
361
|
-
// not the rest, so this is a refusal rather than a fallback — and it is
|
|
362
|
-
// asked here, at the write, because reading is safe and writing is not.
|
|
363
|
-
if (!isMap(living.getIn(["paths", path]))) {
|
|
364
|
-
throw new OpenapiMergeError("living", service, `path '${path}' is written as a YAML alias — one shared value backs every use, so merging into it would rewrite every other path that aliases it. Expand it before archiving.`);
|
|
365
|
-
}
|
|
366
|
-
// Without the strip the living contract would grow a pin to a version
|
|
367
|
-
// of itself, and the NEXT feature's baseline would hash it.
|
|
368
|
-
living.setIn(["paths", path, m], publishable[m]);
|
|
369
|
-
}
|
|
370
|
-
// Removing the last method leaves `\/x: {}` — a path the contract still
|
|
371
|
-
// advertises and nothing answers. The same cleanup
|
|
372
|
-
// stripOpenapiRemovalMarkers already does on the feature side.
|
|
373
|
-
const remaining = living.getIn(["paths", path]);
|
|
374
|
-
if (isMap(remaining) && remaining.items.length === 0)
|
|
375
|
-
living.deleteIn(["paths", path]);
|
|
376
|
-
continue;
|
|
377
|
-
}
|
|
378
|
-
if (!isRecord(featItemPlain)) {
|
|
379
|
-
throw new OpenapiMergeError("feature", service, `path '${path}' is not a mapping`);
|
|
380
|
-
}
|
|
381
|
-
const clean = withoutFeatureMarkers(featItemPlain);
|
|
382
|
-
if (clean !== undefined)
|
|
383
|
-
living.setIn(["paths", path], clean);
|
|
384
|
-
}
|
|
385
|
-
const componentsModified = [];
|
|
386
|
-
const unresolved = [];
|
|
387
|
-
const visited = new Set();
|
|
388
|
-
const copies = [];
|
|
389
|
-
const visitRef = (ref, from) => {
|
|
390
|
-
if (!ref.startsWith("#/"))
|
|
391
|
-
return;
|
|
392
|
-
const match = /^#\/components\/([^/]+)\/([^/]+)(?:\/|$)/.exec(ref);
|
|
393
|
-
if (!match) {
|
|
394
|
-
if (!resolvePointer(featPlain, ref).found && !resolvePointer(livingPlain, ref).found) {
|
|
395
|
-
unresolved.push({ ref, from });
|
|
396
|
-
}
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
399
|
-
const kind = match[1];
|
|
400
|
-
const name = match[2];
|
|
401
|
-
const key = `${kind}/${name}`;
|
|
402
|
-
if (visited.has(key))
|
|
403
|
-
return;
|
|
404
|
-
visited.add(key);
|
|
405
|
-
const inFeature = resolvePointer(featPlain, `#/components/${kind}/${name}`);
|
|
406
|
-
if (inFeature.found) {
|
|
407
|
-
copies.push({ kind, name, value: inFeature.value });
|
|
408
|
-
walk(inFeature.value, `components/${key}`);
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
if (!resolvePointer(livingPlain, `#/components/${kind}/${name}`).found) {
|
|
412
|
-
unresolved.push({ ref, from });
|
|
413
|
-
}
|
|
414
|
-
};
|
|
415
|
-
const walk = (node, from) => {
|
|
416
|
-
for (const ref of collectRefs(node))
|
|
417
|
-
visitRef(ref, from);
|
|
418
|
-
};
|
|
419
|
-
for (const [path, featItemPlain] of featPathEntries) {
|
|
420
|
-
walk(withoutFeatureMarkers(featItemPlain), `paths ${path}`);
|
|
421
|
-
}
|
|
422
|
-
for (const { kind, name, value } of copies) {
|
|
423
|
-
const existing = living.getIn(["components", kind, name]);
|
|
424
|
-
if (existing !== undefined) {
|
|
425
|
-
const existingPlain = resolvePointer(livingPlain, `#/components/${kind}/${name}`);
|
|
426
|
-
if (existingPlain.found && isDeepStrictEqual(existingPlain.value, value))
|
|
427
|
-
continue;
|
|
428
|
-
componentsModified.push(`${kind}/${name}`);
|
|
429
|
-
}
|
|
430
|
-
living.setIn(["components", kind, name], value);
|
|
431
|
-
}
|
|
432
|
-
let text;
|
|
433
|
-
try {
|
|
434
|
-
text = living.toString();
|
|
435
|
-
}
|
|
436
|
-
catch (error) {
|
|
437
|
-
throw new OpenapiMergeError("living", service, errorMessage(error));
|
|
438
|
-
}
|
|
439
|
-
return { text, modified, pathItemModified, removed, quoted, baselineStale, componentsModified, unresolved };
|
|
440
|
-
}
|
|
441
|
-
/** The successful "the feature document has nothing to merge" answer. */
|
|
442
|
-
function noop() {
|
|
443
|
-
return {
|
|
444
|
-
text: null,
|
|
445
|
-
modified: [],
|
|
446
|
-
pathItemModified: [],
|
|
447
|
-
removed: [],
|
|
448
|
-
quoted: [],
|
|
449
|
-
baselineStale: [],
|
|
450
|
-
componentsModified: [],
|
|
451
|
-
unresolved: [],
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
/** Every `$ref` string value anywhere in a plain JS tree, in document order. */
|
|
455
|
-
export function collectRefs(node) {
|
|
456
|
-
const out = [];
|
|
457
|
-
const walk = (current) => {
|
|
458
|
-
if (Array.isArray(current)) {
|
|
459
|
-
for (const value of current)
|
|
460
|
-
walk(value);
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
if (current !== null && typeof current === "object") {
|
|
464
|
-
for (const [key, value] of Object.entries(current)) {
|
|
465
|
-
if (key === "$ref" && typeof value === "string")
|
|
466
|
-
out.push(value);
|
|
467
|
-
else
|
|
468
|
-
walk(value);
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
};
|
|
472
|
-
walk(node);
|
|
473
|
-
return out;
|
|
474
|
-
}
|
|
475
|
-
/** Resolve a local JSON pointer (`#/a/b~1c`) against a plain JS tree. */
|
|
476
|
-
export function resolvePointer(root, ref) {
|
|
477
|
-
let current = root;
|
|
478
|
-
for (const raw of ref.slice(2).split("/")) {
|
|
479
|
-
const segment = raw.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
480
|
-
if (Array.isArray(current)) {
|
|
481
|
-
const index = Number(segment);
|
|
482
|
-
if (!Number.isInteger(index) || index < 0 || index >= current.length) {
|
|
483
|
-
return { found: false, value: undefined };
|
|
484
|
-
}
|
|
485
|
-
current = current[index];
|
|
486
|
-
}
|
|
487
|
-
else if (current !== null && typeof current === "object" && segment in current) {
|
|
488
|
-
current = current[segment];
|
|
489
|
-
}
|
|
490
|
-
else {
|
|
491
|
-
return { found: false, value: undefined };
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
return { found: true, value: current };
|
|
495
|
-
}
|
|
496
|
-
/** Name an overwritten operation by its operationId (feature's, else living's), or path+method. */
|
|
497
|
-
function opLabel(before, after, method, path) {
|
|
498
|
-
const operation = operationIdOf(after) ?? operationIdOf(before);
|
|
499
|
-
return operation !== undefined ? `'${operation}' (${method} ${path})` : `${method} ${path}`;
|
|
500
|
-
}
|
|
501
|
-
/** Is this operation node a feature-only explicit removal marker? */
|
|
502
|
-
function isRemoval(node) {
|
|
503
|
-
return node !== null &&
|
|
504
|
-
typeof node === "object" &&
|
|
505
|
-
node["x-loam-remove"] === true;
|
|
506
|
-
}
|
|
507
|
-
/** Read an operationId from a YAML or plain operation node. */
|
|
508
|
-
function operationIdOf(node) {
|
|
509
|
-
const value = isMap(node)
|
|
510
|
-
? node.get("operationId")
|
|
511
|
-
: node !== null && typeof node === "object"
|
|
512
|
-
? node["operationId"]
|
|
513
|
-
: undefined;
|
|
514
|
-
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
515
|
-
}
|
|
516
|
-
/**
|
|
517
|
-
* Every key that is an instruction to loam rather than part of the contract.
|
|
518
|
-
* At PATH level neither has any meaning — `x-loam-remove` addresses one
|
|
519
|
-
* operation and `x-loam-based-on` pins one — so a path item carrying either is
|
|
520
|
-
* an authoring mistake, and one that must not be published whatever else is
|
|
521
|
-
* done about it.
|
|
522
|
-
*/
|
|
523
|
-
const FEATURE_ONLY_KEYS = new Set(["x-loam-remove", OPENAPI_BASELINE_KEY]);
|
|
524
|
-
/**
|
|
525
|
-
* Copy a path item without anything that belongs to the FEATURE rather than to
|
|
526
|
-
* the contract: removal-marker operations, the `x-loam-based-on` pins on the
|
|
527
|
-
* operations that survive, and a loam marker written at PATH level. All three
|
|
528
|
-
* are instructions to loam, and a living contract that carries any of them is
|
|
529
|
-
* lying to the next reader — and, for the pin, to the next feature's baseline.
|
|
530
|
-
*
|
|
531
|
-
* The path-level case used to fall through: the filter guarded only HTTP
|
|
532
|
-
* methods, so `x-loam-remove: true` beside the methods was copied verbatim into
|
|
533
|
-
* the fleet's living contract, where it also kept the empty-path cleanup from
|
|
534
|
-
* ever seeing an empty path.
|
|
535
|
-
*/
|
|
536
|
-
function withoutFeatureMarkers(node) {
|
|
537
|
-
if (node === null || typeof node !== "object" || Array.isArray(node))
|
|
538
|
-
return node;
|
|
539
|
-
const entries = Object.entries(node)
|
|
540
|
-
.filter(([key, value]) => !FEATURE_ONLY_KEYS.has(key) && !(HTTP_METHODS.has(key) && isRemoval(value)))
|
|
541
|
-
.map(([key, value]) => [key, HTTP_METHODS.has(key) ? withoutOperationBaseline(value) : value]);
|
|
542
|
-
return entries.length === 0 ? undefined : Object.fromEntries(entries);
|
|
543
|
-
}
|
|
544
|
-
function plainChild(parent, key) {
|
|
545
|
-
return parent !== null && typeof parent === "object"
|
|
546
|
-
? parent[key]
|
|
547
|
-
: undefined;
|
|
548
|
-
}
|
|
549
|
-
function errorMessage(error) {
|
|
550
|
-
return error instanceof Error ? error.message : String(error);
|
|
551
|
-
}
|
|
552
|
-
//# sourceMappingURL=openapi-merge.js.map
|