@warpgogol/forge 8.0.4 → 9.1.0
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 +56 -0
- package/bin/cli.ts +26 -13
- package/dist/bin/cli.js +18 -13
- package/dist/bin/cli.js.map +1 -1
- package/dist/os/adr/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/adr/handlers/implement-stamp.js +1 -0
- package/dist/os/adr/handlers/implement-stamp.js.map +1 -1
- package/dist/os/adr/types.d.ts +2 -0
- package/dist/os/adr/types.d.ts.map +1 -1
- package/dist/os/agent/agent.module.d.ts +3 -0
- package/dist/os/agent/agent.module.d.ts.map +1 -0
- package/dist/os/agent/agent.module.js +60 -0
- package/dist/os/agent/agent.module.js.map +1 -0
- package/dist/os/agent/handlers/agent-delegate.d.ts +29 -0
- package/dist/os/agent/handlers/agent-delegate.d.ts.map +1 -0
- package/dist/os/agent/handlers/agent-delegate.js +187 -0
- package/dist/os/agent/handlers/agent-delegate.js.map +1 -0
- package/dist/os/agent/handlers/agent-tiers-validate.d.ts +15 -0
- package/dist/os/agent/handlers/agent-tiers-validate.d.ts.map +1 -0
- package/dist/os/agent/handlers/agent-tiers-validate.js +209 -0
- package/dist/os/agent/handlers/agent-tiers-validate.js.map +1 -0
- package/dist/os/agent/index.d.ts +5 -0
- package/dist/os/agent/index.d.ts.map +1 -0
- package/dist/os/agent/index.js +18 -0
- package/dist/os/agent/index.js.map +1 -0
- package/dist/os/agent/invoke-adapter.d.ts +43 -0
- package/dist/os/agent/invoke-adapter.d.ts.map +1 -0
- package/dist/os/agent/invoke-adapter.js +83 -0
- package/dist/os/agent/invoke-adapter.js.map +1 -0
- package/dist/os/authority/authority.module.d.ts.map +1 -1
- package/dist/os/authority/authority.module.js +2 -10
- package/dist/os/authority/authority.module.js.map +1 -1
- package/dist/os/authority/handlers/delegate.d.ts.map +1 -1
- package/dist/os/authority/handlers/delegate.js +2 -1
- package/dist/os/authority/handlers/delegate.js.map +1 -1
- package/dist/os/authority/index.d.ts.map +1 -1
- package/dist/os/authority/index.js +2 -1
- package/dist/os/authority/index.js.map +1 -1
- package/dist/os/checks/checks.module.d.ts +3 -0
- package/dist/os/checks/checks.module.d.ts.map +1 -0
- package/dist/os/checks/checks.module.js +94 -0
- package/dist/os/checks/checks.module.js.map +1 -0
- package/dist/os/checks/handlers/contribution-report.d.ts +35 -0
- package/dist/os/checks/handlers/contribution-report.d.ts.map +1 -0
- package/dist/os/checks/handlers/contribution-report.js +265 -0
- package/dist/os/checks/handlers/contribution-report.js.map +1 -0
- package/dist/os/checks/handlers/counters-export.d.ts +19 -0
- package/dist/os/checks/handlers/counters-export.d.ts.map +1 -0
- package/dist/os/checks/handlers/counters-export.js +126 -0
- package/dist/os/checks/handlers/counters-export.js.map +1 -0
- package/dist/os/checks/handlers/counters-journal.d.ts +67 -0
- package/dist/os/checks/handlers/counters-journal.d.ts.map +1 -0
- package/dist/os/checks/handlers/counters-journal.js +155 -0
- package/dist/os/checks/handlers/counters-journal.js.map +1 -0
- package/dist/os/checks/handlers/counters-validate.d.ts +11 -0
- package/dist/os/checks/handlers/counters-validate.d.ts.map +1 -0
- package/dist/os/checks/handlers/counters-validate.js +135 -0
- package/dist/os/checks/handlers/counters-validate.js.map +1 -0
- package/dist/os/checks/index.d.ts +6 -0
- package/dist/os/checks/index.d.ts.map +1 -0
- package/dist/os/checks/index.js +17 -0
- package/dist/os/checks/index.js.map +1 -0
- package/dist/os/compass/compass.module.d.ts.map +1 -1
- package/dist/os/compass/compass.module.js +55 -20
- package/dist/os/compass/compass.module.js.map +1 -1
- package/dist/os/compass/handlers/compass-docs-scaffold.js +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold.js +10 -3
- package/dist/os/compass/handlers/compass-header-scaffold.js.map +1 -1
- package/dist/os/compass/handlers/compass-invariants-generate.d.ts +15 -0
- package/dist/os/compass/handlers/compass-invariants-generate.d.ts.map +1 -0
- package/dist/os/compass/handlers/compass-invariants-generate.js +209 -0
- package/dist/os/compass/handlers/compass-invariants-generate.js.map +1 -0
- package/dist/os/compass/handlers/compass-inventory-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-inventory-handler.js +46 -4
- package/dist/os/compass/handlers/compass-inventory-handler.js.map +1 -1
- package/dist/os/compass/handlers/invariant-bindings.d.ts +85 -0
- package/dist/os/compass/handlers/invariant-bindings.d.ts.map +1 -0
- package/dist/os/compass/handlers/invariant-bindings.js +390 -0
- package/dist/os/compass/handlers/invariant-bindings.js.map +1 -0
- package/dist/os/conformance/conformance.module.d.ts +3 -0
- package/dist/os/conformance/conformance.module.d.ts.map +1 -0
- package/dist/os/conformance/conformance.module.js +96 -0
- package/dist/os/conformance/conformance.module.js.map +1 -0
- package/dist/os/conformance/handlers/conformance-run.d.ts +14 -0
- package/dist/os/conformance/handlers/conformance-run.d.ts.map +1 -0
- package/dist/os/conformance/handlers/conformance-run.js +149 -0
- package/dist/os/conformance/handlers/conformance-run.js.map +1 -0
- package/dist/os/conformance/handlers/conformance-validate.d.ts +14 -0
- package/dist/os/conformance/handlers/conformance-validate.d.ts.map +1 -0
- package/dist/os/conformance/handlers/conformance-validate.js +216 -0
- package/dist/os/conformance/handlers/conformance-validate.js.map +1 -0
- package/dist/os/conformance/index.d.ts +6 -0
- package/dist/os/conformance/index.d.ts.map +1 -0
- package/dist/os/conformance/index.js +17 -0
- package/dist/os/conformance/index.js.map +1 -0
- package/dist/os/context/context.module.d.ts +3 -0
- package/dist/os/context/context.module.d.ts.map +1 -0
- package/dist/os/context/context.module.js +73 -0
- package/dist/os/context/context.module.js.map +1 -0
- package/dist/os/context/handlers/context-assemble.d.ts +28 -0
- package/dist/os/context/handlers/context-assemble.d.ts.map +1 -0
- package/dist/os/context/handlers/context-assemble.js +146 -0
- package/dist/os/context/handlers/context-assemble.js.map +1 -0
- package/dist/os/context/handlers/context-slate-eval.d.ts +15 -0
- package/dist/os/context/handlers/context-slate-eval.d.ts.map +1 -0
- package/dist/os/context/handlers/context-slate-eval.js +74 -0
- package/dist/os/context/handlers/context-slate-eval.js.map +1 -0
- package/dist/os/context/handlers/index-build.d.ts +19 -0
- package/dist/os/context/handlers/index-build.d.ts.map +1 -0
- package/dist/os/context/handlers/index-build.js +191 -0
- package/dist/os/context/handlers/index-build.js.map +1 -0
- package/dist/os/context/index.d.ts +5 -0
- package/dist/os/context/index.d.ts.map +1 -0
- package/dist/os/context/index.js +16 -0
- package/dist/os/context/index.js.map +1 -0
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +34 -11
- package/dist/os/core/core.module.js.map +1 -1
- package/dist/os/formal/formal.module.d.ts +3 -0
- package/dist/os/formal/formal.module.d.ts.map +1 -0
- package/dist/os/formal/formal.module.js +63 -0
- package/dist/os/formal/formal.module.js.map +1 -0
- package/dist/os/formal/handlers/proof-check.d.ts +10 -0
- package/dist/os/formal/handlers/proof-check.d.ts.map +1 -0
- package/dist/os/formal/handlers/proof-check.js +82 -0
- package/dist/os/formal/handlers/proof-check.js.map +1 -0
- package/dist/os/formal/index.d.ts +4 -0
- package/dist/os/formal/index.d.ts.map +1 -0
- package/dist/os/formal/index.js +16 -0
- package/dist/os/formal/index.js.map +1 -0
- package/dist/os/friction/friction.module.d.ts +3 -0
- package/dist/os/friction/friction.module.d.ts.map +1 -0
- package/dist/os/friction/friction.module.js +71 -0
- package/dist/os/friction/friction.module.js.map +1 -0
- package/dist/os/friction/handlers/friction-validate.d.ts +4 -0
- package/dist/os/friction/handlers/friction-validate.d.ts.map +1 -0
- package/dist/os/friction/handlers/friction-validate.js +228 -0
- package/dist/os/friction/handlers/friction-validate.js.map +1 -0
- package/dist/os/friction/index.d.ts +4 -0
- package/dist/os/friction/index.d.ts.map +1 -0
- package/dist/os/friction/index.js +23 -0
- package/dist/os/friction/index.js.map +1 -0
- package/dist/os/friction/types.d.ts +97 -0
- package/dist/os/friction/types.d.ts.map +1 -0
- package/dist/os/friction/types.js +78 -0
- package/dist/os/friction/types.js.map +1 -0
- package/dist/os/gate/gate.module.d.ts +3 -0
- package/dist/os/gate/gate.module.d.ts.map +1 -0
- package/dist/os/gate/gate.module.js +65 -0
- package/dist/os/gate/gate.module.js.map +1 -0
- package/dist/os/gate/handlers/gate-probe-catalog.d.ts +18 -0
- package/dist/os/gate/handlers/gate-probe-catalog.d.ts.map +1 -0
- package/dist/os/gate/handlers/gate-probe-catalog.js +70 -0
- package/dist/os/gate/handlers/gate-probe-catalog.js.map +1 -0
- package/dist/os/gate/handlers/gate-probe.d.ts +32 -0
- package/dist/os/gate/handlers/gate-probe.d.ts.map +1 -0
- package/dist/os/gate/handlers/gate-probe.js +232 -0
- package/dist/os/gate/handlers/gate-probe.js.map +1 -0
- package/dist/os/gate/index.d.ts +4 -0
- package/dist/os/gate/index.d.ts.map +1 -0
- package/dist/os/gate/index.js +15 -0
- package/dist/os/gate/index.js.map +1 -0
- package/dist/os/instructions/handlers/budget-validate.d.ts +29 -0
- package/dist/os/instructions/handlers/budget-validate.d.ts.map +1 -0
- package/dist/os/instructions/handlers/budget-validate.js +164 -0
- package/dist/os/instructions/handlers/budget-validate.js.map +1 -0
- package/dist/os/instructions/handlers/scar-migrate.d.ts +13 -0
- package/dist/os/instructions/handlers/scar-migrate.d.ts.map +1 -0
- package/dist/os/instructions/handlers/scar-migrate.js +270 -0
- package/dist/os/instructions/handlers/scar-migrate.js.map +1 -0
- package/dist/os/instructions/instructions.module.d.ts +3 -0
- package/dist/os/instructions/instructions.module.d.ts.map +1 -0
- package/dist/os/instructions/instructions.module.js +75 -0
- package/dist/os/instructions/instructions.module.js.map +1 -0
- package/dist/os/knowledge/handlers/knowledge-authz-probe.d.ts +16 -0
- package/dist/os/knowledge/handlers/knowledge-authz-probe.d.ts.map +1 -0
- package/dist/os/knowledge/handlers/knowledge-authz-probe.js +202 -0
- package/dist/os/knowledge/handlers/knowledge-authz-probe.js.map +1 -0
- package/dist/os/knowledge/handlers/knowledge-conflicts-resolve.d.ts +11 -0
- package/dist/os/knowledge/handlers/knowledge-conflicts-resolve.d.ts.map +1 -0
- package/dist/os/knowledge/handlers/knowledge-conflicts-resolve.js +428 -0
- package/dist/os/knowledge/handlers/knowledge-conflicts-resolve.js.map +1 -0
- package/dist/os/knowledge/handlers/knowledge-rebuild.d.ts +15 -0
- package/dist/os/knowledge/handlers/knowledge-rebuild.d.ts.map +1 -0
- package/dist/os/knowledge/handlers/knowledge-rebuild.js +141 -0
- package/dist/os/knowledge/handlers/knowledge-rebuild.js.map +1 -0
- package/dist/os/knowledge/index.d.ts +5 -0
- package/dist/os/knowledge/index.d.ts.map +1 -0
- package/dist/os/knowledge/index.js +17 -0
- package/dist/os/knowledge/index.js.map +1 -0
- package/dist/os/knowledge/knowledge.module.d.ts +3 -0
- package/dist/os/knowledge/knowledge.module.d.ts.map +1 -0
- package/dist/os/knowledge/knowledge.module.js +95 -0
- package/dist/os/knowledge/knowledge.module.js.map +1 -0
- package/dist/os/mission/handlers/archive.d.ts.map +1 -1
- package/dist/os/mission/handlers/archive.js +102 -6
- package/dist/os/mission/handlers/archive.js.map +1 -1
- package/dist/os/mission/mission.module.d.ts.map +1 -1
- package/dist/os/mission/mission.module.js +7 -0
- package/dist/os/mission/mission.module.js.map +1 -1
- package/dist/os/naming/naming-convention.d.ts.map +1 -1
- package/dist/os/naming/naming-convention.js +2 -1
- package/dist/os/naming/naming-convention.js.map +1 -1
- package/dist/os/program/schemas.d.ts +5 -5
- package/dist/os/queue/handlers/queue-validate.d.ts.map +1 -1
- package/dist/os/queue/handlers/queue-validate.js +129 -5
- package/dist/os/queue/handlers/queue-validate.js.map +1 -1
- package/dist/os/queue/manifest.d.ts.map +1 -1
- package/dist/os/queue/manifest.js +8 -7
- package/dist/os/queue/manifest.js.map +1 -1
- package/dist/os/queue/queue.module.d.ts.map +1 -1
- package/dist/os/queue/queue.module.js +12 -31
- package/dist/os/queue/queue.module.js.map +1 -1
- package/dist/os/queue/types.d.ts +23 -0
- package/dist/os/queue/types.d.ts.map +1 -1
- package/dist/os/queue/types.js +24 -3
- package/dist/os/queue/types.js.map +1 -1
- package/dist/os/resolver/handlers/resolver-doors-audit.d.ts +22 -0
- package/dist/os/resolver/handlers/resolver-doors-audit.d.ts.map +1 -0
- package/dist/os/resolver/handlers/resolver-doors-audit.js +238 -0
- package/dist/os/resolver/handlers/resolver-doors-audit.js.map +1 -0
- package/dist/os/resolver/resolver.module.d.ts +3 -0
- package/dist/os/resolver/resolver.module.d.ts.map +1 -0
- package/dist/os/resolver/resolver.module.js +41 -0
- package/dist/os/resolver/resolver.module.js.map +1 -0
- package/dist/os/rfc/acceptance.d.ts +2 -1
- package/dist/os/rfc/acceptance.d.ts.map +1 -1
- package/dist/os/rfc/acceptance.js +158 -82
- package/dist/os/rfc/acceptance.js.map +1 -1
- package/dist/os/rfc/decision-log.d.ts +10 -0
- package/dist/os/rfc/decision-log.d.ts.map +1 -1
- package/dist/os/rfc/decision-log.js +14 -0
- package/dist/os/rfc/decision-log.js.map +1 -1
- package/dist/os/rfc/handlers/fixed-inputs.d.ts +29 -0
- package/dist/os/rfc/handlers/fixed-inputs.d.ts.map +1 -0
- package/dist/os/rfc/handlers/fixed-inputs.js +214 -0
- package/dist/os/rfc/handlers/fixed-inputs.js.map +1 -0
- package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts +48 -0
- package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts.map +1 -0
- package/dist/os/rfc/handlers/implement-stamp-deviations.js +148 -0
- package/dist/os/rfc/handlers/implement-stamp-deviations.js.map +1 -0
- package/dist/os/rfc/handlers/implement-stamp-origin.d.ts +15 -1
- package/dist/os/rfc/handlers/implement-stamp-origin.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-origin.js +67 -7
- package/dist/os/rfc/handlers/implement-stamp-origin.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-outcome.d.ts +44 -0
- package/dist/os/rfc/handlers/implement-stamp-outcome.d.ts.map +1 -0
- package/dist/os/rfc/handlers/implement-stamp-outcome.js +104 -0
- package/dist/os/rfc/handlers/implement-stamp-outcome.js.map +1 -0
- package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.js +262 -56
- package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
- package/dist/os/rfc/handlers/index-graph.d.ts +4 -2
- package/dist/os/rfc/handlers/index-graph.d.ts.map +1 -1
- package/dist/os/rfc/handlers/index-graph.js +57 -3
- package/dist/os/rfc/handlers/index-graph.js.map +1 -1
- package/dist/os/rfc/handlers/lifecycle.d.ts.map +1 -1
- package/dist/os/rfc/handlers/lifecycle.js +13 -6
- package/dist/os/rfc/handlers/lifecycle.js.map +1 -1
- package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
- package/dist/os/rfc/handlers/list-create.js +144 -13
- package/dist/os/rfc/handlers/list-create.js.map +1 -1
- package/dist/os/rfc/handlers/supersede-propose.d.ts.map +1 -1
- package/dist/os/rfc/handlers/supersede-propose.js +34 -7
- package/dist/os/rfc/handlers/supersede-propose.js.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts +4 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.js +159 -11
- package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
- package/dist/os/rfc/handlers/validate.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate.js +10 -1
- package/dist/os/rfc/handlers/validate.js.map +1 -1
- package/dist/os/rfc/outcome-probe.d.ts +20 -0
- package/dist/os/rfc/outcome-probe.d.ts.map +1 -0
- package/dist/os/rfc/outcome-probe.js +315 -0
- package/dist/os/rfc/outcome-probe.js.map +1 -0
- package/dist/os/rfc/reachable-symbol.d.ts.map +1 -1
- package/dist/os/rfc/reachable-symbol.js +54 -13
- package/dist/os/rfc/reachable-symbol.js.map +1 -1
- package/dist/os/rfc/rfc.module.d.ts.map +1 -1
- package/dist/os/rfc/rfc.module.js +68 -15
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/os/rfc/types.d.ts +110 -12
- package/dist/os/rfc/types.d.ts.map +1 -1
- package/dist/os/rfc/types.js +24 -7
- package/dist/os/rfc/types.js.map +1 -1
- package/dist/os/rfc/verification-evidence.d.ts +4 -1
- package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
- package/dist/os/rfc/verification-evidence.js +69 -17
- package/dist/os/rfc/verification-evidence.js.map +1 -1
- package/dist/os/rfc/verification-origin.d.ts +8 -0
- package/dist/os/rfc/verification-origin.d.ts.map +1 -1
- package/dist/os/rfc/verification-origin.js +48 -1
- package/dist/os/rfc/verification-origin.js.map +1 -1
- package/dist/os/rfc/verification-refresh.d.ts.map +1 -1
- package/dist/os/rfc/verification-refresh.js +19 -2
- package/dist/os/rfc/verification-refresh.js.map +1 -1
- package/dist/os/rfc/verification-verdicts.d.ts +14 -0
- package/dist/os/rfc/verification-verdicts.d.ts.map +1 -0
- package/dist/os/rfc/verification-verdicts.js +104 -0
- package/dist/os/rfc/verification-verdicts.js.map +1 -0
- package/dist/os/rfc/verifier/rfc-1391/support.d.ts +34 -0
- package/dist/os/rfc/verifier/rfc-1391/support.d.ts.map +1 -0
- package/dist/os/rfc/verifier/rfc-1391/support.js +188 -0
- package/dist/os/rfc/verifier/rfc-1391/support.js.map +1 -0
- package/dist/os/session/frontmatter-io.d.ts +3 -1
- package/dist/os/session/frontmatter-io.d.ts.map +1 -1
- package/dist/os/session/frontmatter-io.js +3 -1
- package/dist/os/session/frontmatter-io.js.map +1 -1
- package/dist/os/session/handlers/save.d.ts.map +1 -1
- package/dist/os/session/handlers/save.js +5 -2
- package/dist/os/session/handlers/save.js.map +1 -1
- package/dist/os/session/handlers/session-audit-report.d.ts +20 -0
- package/dist/os/session/handlers/session-audit-report.d.ts.map +1 -0
- package/dist/os/session/handlers/session-audit-report.js +82 -0
- package/dist/os/session/handlers/session-audit-report.js.map +1 -0
- package/dist/os/session/handlers/session-audit.d.ts +25 -0
- package/dist/os/session/handlers/session-audit.d.ts.map +1 -0
- package/dist/os/session/handlers/session-audit.js +269 -0
- package/dist/os/session/handlers/session-audit.js.map +1 -0
- package/dist/os/session/session.module.d.ts.map +1 -1
- package/dist/os/session/session.module.js +49 -2
- package/dist/os/session/session.module.js.map +1 -1
- package/dist/os/spec/spec-amendments.d.ts +7 -0
- package/dist/os/spec/spec-amendments.d.ts.map +1 -0
- package/dist/os/spec/spec-amendments.js +86 -0
- package/dist/os/spec/spec-amendments.js.map +1 -0
- package/dist/os/spec/spec-materialize.d.ts.map +1 -1
- package/dist/os/spec/spec-materialize.js +22 -24
- package/dist/os/spec/spec-materialize.js.map +1 -1
- package/dist/os/spec/spec-status.d.ts.map +1 -1
- package/dist/os/spec/spec-status.js +25 -29
- package/dist/os/spec/spec-status.js.map +1 -1
- package/dist/os/spec/spec-validate.d.ts.map +1 -1
- package/dist/os/spec/spec-validate.js +9 -29
- package/dist/os/spec/spec-validate.js.map +1 -1
- package/dist/os/spec/spec.module.d.ts.map +1 -1
- package/dist/os/spec/spec.module.js +7 -36
- package/dist/os/spec/spec.module.js.map +1 -1
- package/dist/os/trajectory/handlers/journal-io.d.ts +60 -0
- package/dist/os/trajectory/handlers/journal-io.d.ts.map +1 -0
- package/dist/os/trajectory/handlers/journal-io.js +179 -0
- package/dist/os/trajectory/handlers/journal-io.js.map +1 -0
- package/dist/os/trajectory/handlers/outcome-record.d.ts +16 -0
- package/dist/os/trajectory/handlers/outcome-record.d.ts.map +1 -0
- package/dist/os/trajectory/handlers/outcome-record.js +145 -0
- package/dist/os/trajectory/handlers/outcome-record.js.map +1 -0
- package/dist/os/trajectory/handlers/trajectory-index.d.ts +59 -0
- package/dist/os/trajectory/handlers/trajectory-index.d.ts.map +1 -0
- package/dist/os/trajectory/handlers/trajectory-index.js +449 -0
- package/dist/os/trajectory/handlers/trajectory-index.js.map +1 -0
- package/dist/os/trajectory/handlers/trajectory-recall.d.ts +21 -0
- package/dist/os/trajectory/handlers/trajectory-recall.d.ts.map +1 -0
- package/dist/os/trajectory/handlers/trajectory-recall.js +179 -0
- package/dist/os/trajectory/handlers/trajectory-recall.js.map +1 -0
- package/dist/os/trajectory/index.d.ts +5 -0
- package/dist/os/trajectory/index.d.ts.map +1 -0
- package/dist/os/trajectory/index.js +16 -0
- package/dist/os/trajectory/index.js.map +1 -0
- package/dist/os/trajectory/trajectory.module.d.ts +3 -0
- package/dist/os/trajectory/trajectory.module.d.ts.map +1 -0
- package/dist/os/trajectory/trajectory.module.js +98 -0
- package/dist/os/trajectory/trajectory.module.js.map +1 -0
- package/dist/os/werkstatt/handlers/session-close.d.ts +13 -0
- package/dist/os/werkstatt/handlers/session-close.d.ts.map +1 -0
- package/dist/os/werkstatt/handlers/session-close.js +56 -0
- package/dist/os/werkstatt/handlers/session-close.js.map +1 -0
- package/dist/os/werkstatt/handlers/session-engine.d.ts +3 -0
- package/dist/os/werkstatt/handlers/session-engine.d.ts.map +1 -0
- package/dist/os/werkstatt/handlers/session-engine.js +28 -0
- package/dist/os/werkstatt/handlers/session-engine.js.map +1 -0
- package/dist/os/werkstatt/handlers/session-open.d.ts +10 -0
- package/dist/os/werkstatt/handlers/session-open.d.ts.map +1 -0
- package/dist/os/werkstatt/handlers/session-open.js +46 -0
- package/dist/os/werkstatt/handlers/session-open.js.map +1 -0
- package/dist/os/werkstatt/handlers/session-status.d.ts +9 -0
- package/dist/os/werkstatt/handlers/session-status.d.ts.map +1 -0
- package/dist/os/werkstatt/handlers/session-status.js +34 -0
- package/dist/os/werkstatt/handlers/session-status.js.map +1 -0
- package/dist/os/werkstatt/werkstatt.module.d.ts.map +1 -1
- package/dist/os/werkstatt/werkstatt.module.js +98 -3
- package/dist/os/werkstatt/werkstatt.module.js.map +1 -1
- package/dist/os/yaml/handlers/scalars-validate.d.ts +28 -0
- package/dist/os/yaml/handlers/scalars-validate.d.ts.map +1 -0
- package/dist/os/yaml/handlers/scalars-validate.js +311 -0
- package/dist/os/yaml/handlers/scalars-validate.js.map +1 -0
- package/dist/os/yaml/index.d.ts +4 -0
- package/dist/os/yaml/index.d.ts.map +1 -0
- package/dist/os/yaml/index.js +15 -0
- package/dist/os/yaml/index.js.map +1 -0
- package/dist/os/yaml/yaml.module.d.ts +3 -0
- package/dist/os/yaml/yaml.module.d.ts.map +1 -0
- package/dist/os/yaml/yaml.module.js +58 -0
- package/dist/os/yaml/yaml.module.js.map +1 -0
- package/dist/src/authority/delegations.d.ts +1 -1
- package/dist/src/authority/delegations.d.ts.map +1 -1
- package/dist/src/authority/delegations.js +6 -3
- package/dist/src/authority/delegations.js.map +1 -1
- package/dist/src/cli-flags.d.ts.map +1 -1
- package/dist/src/cli-flags.js +91 -16
- package/dist/src/cli-flags.js.map +1 -1
- package/dist/src/compass/index.d.ts +2 -0
- package/dist/src/compass/index.d.ts.map +1 -0
- package/dist/src/compass/index.js +26 -0
- package/dist/src/compass/index.js.map +1 -0
- package/dist/src/compass/invariant-parser.d.ts +37 -0
- package/dist/src/compass/invariant-parser.d.ts.map +1 -0
- package/dist/src/compass/invariant-parser.js +219 -0
- package/dist/src/compass/invariant-parser.js.map +1 -0
- package/dist/src/config/forge-config.d.ts +125 -0
- package/dist/src/config/forge-config.d.ts.map +1 -1
- package/dist/src/config/forge-config.js +110 -17
- package/dist/src/config/forge-config.js.map +1 -1
- package/dist/src/conformance/index.d.ts +42 -0
- package/dist/src/conformance/index.d.ts.map +1 -0
- package/dist/src/conformance/index.js +193 -0
- package/dist/src/conformance/index.js.map +1 -0
- package/dist/src/formal/exhaustive.d.ts +40 -0
- package/dist/src/formal/exhaustive.d.ts.map +1 -0
- package/dist/src/formal/exhaustive.js +141 -0
- package/dist/src/formal/exhaustive.js.map +1 -0
- package/dist/src/formal/index.d.ts +7 -0
- package/dist/src/formal/index.d.ts.map +1 -0
- package/dist/src/formal/index.js +17 -0
- package/dist/src/formal/index.js.map +1 -0
- package/dist/src/formal/proof-runner.d.ts +51 -0
- package/dist/src/formal/proof-runner.d.ts.map +1 -0
- package/dist/src/formal/proof-runner.js +451 -0
- package/dist/src/formal/proof-runner.js.map +1 -0
- package/dist/src/formal/proof-spec.d.ts +69 -0
- package/dist/src/formal/proof-spec.d.ts.map +1 -0
- package/dist/src/formal/proof-spec.js +97 -0
- package/dist/src/formal/proof-spec.js.map +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/knowledge/index.d.ts +2 -2
- package/dist/src/knowledge/index.d.ts.map +1 -1
- package/dist/src/knowledge/index.js +4 -3
- package/dist/src/knowledge/index.js.map +1 -1
- package/dist/src/knowledge/parse.d.ts +1 -0
- package/dist/src/knowledge/parse.d.ts.map +1 -1
- package/dist/src/knowledge/parse.js +20 -18
- package/dist/src/knowledge/parse.js.map +1 -1
- package/dist/src/knowledge/schema.d.ts +8 -0
- package/dist/src/knowledge/schema.d.ts.map +1 -1
- package/dist/src/knowledge/schema.js +10 -4
- package/dist/src/knowledge/schema.js.map +1 -1
- package/dist/src/knowledge/serialize.d.ts.map +1 -1
- package/dist/src/knowledge/serialize.js +3 -0
- package/dist/src/knowledge/serialize.js.map +1 -1
- package/dist/src/knowledge/sync.d.ts +61 -0
- package/dist/src/knowledge/sync.d.ts.map +1 -1
- package/dist/src/knowledge/sync.js +202 -7
- package/dist/src/knowledge/sync.js.map +1 -1
- package/dist/src/onboarding/agents-generate.d.ts.map +1 -1
- package/dist/src/onboarding/agents-generate.js +18 -3
- package/dist/src/onboarding/agents-generate.js.map +1 -1
- package/dist/src/onboarding/compass-docs/semantic-layer-block.js +1 -1
- package/dist/src/onboarding/doctor.d.ts +2 -0
- package/dist/src/onboarding/doctor.d.ts.map +1 -1
- package/dist/src/onboarding/doctor.js +253 -27
- package/dist/src/onboarding/doctor.js.map +1 -1
- package/dist/src/onboarding/init.js +3 -3
- package/dist/src/onboarding/init.js.map +1 -1
- package/dist/src/onboarding/nested-agents-generate.js +1 -1
- package/dist/src/onboarding/nested-agents-templates.js +1 -1
- package/dist/src/onboarding/upgrade.d.ts.map +1 -1
- package/dist/src/onboarding/upgrade.js +18 -10
- package/dist/src/onboarding/upgrade.js.map +1 -1
- package/dist/src/profiles/profile-schema.d.ts +8 -0
- package/dist/src/profiles/profile-schema.d.ts.map +1 -1
- package/dist/src/profiles/profile-schema.js +10 -2
- package/dist/src/profiles/profile-schema.js.map +1 -1
- package/dist/src/profiles/stack-profile.d.ts +4 -0
- package/dist/src/profiles/stack-profile.d.ts.map +1 -1
- package/dist/src/reachability/command-mentions.d.ts +17 -0
- package/dist/src/reachability/command-mentions.d.ts.map +1 -0
- package/dist/src/reachability/command-mentions.js +83 -0
- package/dist/src/reachability/command-mentions.js.map +1 -0
- package/dist/src/registry.d.ts +30 -0
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +168 -68
- package/dist/src/registry.js.map +1 -1
- package/dist/src/types.d.ts +51 -3
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +11 -14
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/sync-fs.d.ts +1 -1
- package/dist/src/utils/sync-fs.d.ts.map +1 -1
- package/dist/src/utils/sync-fs.js +2 -1
- package/dist/src/utils/sync-fs.js.map +1 -1
- package/dist/src/validators/skill-validate.d.ts +5 -0
- package/dist/src/validators/skill-validate.d.ts.map +1 -1
- package/dist/src/validators/skill-validate.js +34 -8
- package/dist/src/validators/skill-validate.js.map +1 -1
- package/docs/reference/forge-yaml.md +20 -0
- package/os/adr/handlers/implement-stamp.ts +2 -0
- package/os/adr/types.ts +2 -0
- package/os/agent/agent.module.ts +64 -0
- package/os/agent/handlers/agent-delegate.ts +227 -0
- package/os/agent/handlers/agent-tiers-validate.ts +232 -0
- package/os/agent/index.ts +18 -0
- package/os/agent/invoke-adapter.ts +119 -0
- package/os/authority/authority.module.ts +2 -10
- package/os/authority/handlers/delegate.ts +2 -1
- package/os/authority/index.ts +2 -1
- package/os/checks/checks.module.ts +99 -0
- package/os/checks/handlers/contribution-report.test.ts +250 -0
- package/os/checks/handlers/contribution-report.ts +317 -0
- package/os/checks/handlers/counters-export.test.ts +181 -0
- package/os/checks/handlers/counters-export.ts +174 -0
- package/os/checks/handlers/counters-journal.test.ts +193 -0
- package/os/checks/handlers/counters-journal.ts +180 -0
- package/os/checks/handlers/counters-validate.test.ts +182 -0
- package/os/checks/handlers/counters-validate.ts +163 -0
- package/os/checks/handlers/variant-candidates.test.ts +71 -0
- package/os/checks/index.ts +27 -0
- package/os/compass/compass.module.ts +58 -20
- package/os/compass/handlers/compass-docs-scaffold.ts +1 -1
- package/os/compass/handlers/compass-header-scaffold.ts +10 -3
- package/os/compass/handlers/compass-invariants-generate.ts +294 -0
- package/os/compass/handlers/compass-inventory-handler.ts +59 -4
- package/os/compass/handlers/invariant-bindings.ts +526 -0
- package/os/compass/handlers/tests/compass-invariant-binding.test.ts +500 -0
- package/os/compass/handlers/tests/compass-invariants-generate.test.ts +235 -0
- package/os/compass/handlers/tests/compass-migrate.test.ts +5 -3
- package/os/conformance/conformance.module.ts +105 -0
- package/os/conformance/handlers/conformance-run.ts +175 -0
- package/os/conformance/handlers/conformance-validate.ts +334 -0
- package/os/conformance/handlers/tests/conformance.test.ts +657 -0
- package/os/conformance/index.ts +19 -0
- package/os/context/context.module.ts +78 -0
- package/os/context/handlers/context-assemble.test.ts +95 -0
- package/os/context/handlers/context-assemble.ts +175 -0
- package/os/context/handlers/context-slate-eval.test.ts +70 -0
- package/os/context/handlers/context-slate-eval.ts +90 -0
- package/os/context/handlers/index-build.test.ts +101 -0
- package/os/context/handlers/index-build.ts +214 -0
- package/os/context/handlers/no-model-deps.test.ts +38 -0
- package/os/context/handlers/slate-fill.test.ts +37 -0
- package/os/context/index.ts +16 -0
- package/os/core/core.module.ts +34 -11
- package/os/formal/formal.module.ts +67 -0
- package/os/formal/handlers/proof-check.test.ts +337 -0
- package/os/formal/handlers/proof-check.ts +100 -0
- package/os/formal/index.ts +17 -0
- package/os/friction/friction-validate.test.ts +442 -0
- package/os/friction/friction.module.ts +74 -0
- package/os/friction/handlers/friction-validate.ts +349 -0
- package/os/friction/index.ts +30 -0
- package/os/friction/types.ts +113 -0
- package/os/gate/gate.module.ts +69 -0
- package/os/gate/handlers/gate-probe-catalog.test.ts +82 -0
- package/os/gate/handlers/gate-probe-catalog.ts +89 -0
- package/os/gate/handlers/gate-probe.test.ts +114 -0
- package/os/gate/handlers/gate-probe.ts +256 -0
- package/os/gate/index.ts +15 -0
- package/os/instructions/budget.test.ts +131 -0
- package/os/instructions/handlers/budget-validate.ts +197 -0
- package/os/instructions/handlers/scar-migrate.ts +292 -0
- package/os/instructions/instructions.module.ts +79 -0
- package/os/knowledge/handlers/knowledge-authz-probe.test.ts +107 -0
- package/os/knowledge/handlers/knowledge-authz-probe.ts +240 -0
- package/os/knowledge/handlers/knowledge-conflicts-resolve.ts +571 -0
- package/os/knowledge/handlers/knowledge-rebuild.test.ts +82 -0
- package/os/knowledge/handlers/knowledge-rebuild.ts +167 -0
- package/os/knowledge/index.ts +17 -0
- package/os/knowledge/knowledge.module.ts +100 -0
- package/os/mission/handlers/archive.ts +113 -6
- package/os/mission/handlers/ship-inflight-degraded.test.ts +105 -0
- package/os/mission/mission.module.ts +8 -0
- package/os/naming/naming-convention.ts +2 -1
- package/os/queue/decision-ledger.test.ts +71 -1
- package/os/queue/handlers/queue-validate.ts +132 -5
- package/os/queue/manifest.ts +8 -7
- package/os/queue/queue-validate.test.ts +194 -0
- package/os/queue/queue.module.ts +12 -31
- package/os/queue/types.ts +26 -3
- package/os/resolver/handlers/resolver-doors-audit.test.ts +150 -0
- package/os/resolver/handlers/resolver-doors-audit.ts +281 -0
- package/os/resolver/resolver.module.ts +44 -0
- package/os/rfc/acceptance-reachable.test.ts +78 -0
- package/os/rfc/acceptance.test.ts +229 -1
- package/os/rfc/acceptance.ts +141 -45
- package/os/rfc/decision-log.ts +15 -0
- package/os/rfc/handlers/fixed-inputs.ts +252 -0
- package/os/rfc/handlers/implement-stamp-deviations.test.ts +140 -0
- package/os/rfc/handlers/implement-stamp-deviations.ts +186 -0
- package/os/rfc/handlers/implement-stamp-formal.test.ts +168 -0
- package/os/rfc/handlers/implement-stamp-origin.ts +97 -13
- package/os/rfc/handlers/implement-stamp-outcome.test.ts +193 -0
- package/os/rfc/handlers/implement-stamp-outcome.ts +148 -0
- package/os/rfc/handlers/implement-stamp-stale.test.ts +2 -1
- package/os/rfc/handlers/implement-stamp.ts +280 -53
- package/os/rfc/handlers/index-graph.ts +66 -4
- package/os/rfc/handlers/lifecycle.test.ts +59 -1
- package/os/rfc/handlers/lifecycle.ts +25 -15
- package/os/rfc/handlers/list-create.test.ts +223 -0
- package/os/rfc/handlers/list-create.ts +173 -13
- package/os/rfc/handlers/supersede-propose.ts +50 -7
- package/os/rfc/handlers/tests/index-graph.test.ts +165 -0
- package/os/rfc/handlers/validate-rules-rfc1334.test.ts +2 -1
- package/os/rfc/handlers/validate-rules-rfc1453.test.ts +164 -0
- package/os/rfc/handlers/validate-rules-rfc1454.test.ts +137 -0
- package/os/rfc/handlers/validate-rules-rfc1455.test.ts +283 -0
- package/os/rfc/handlers/validate-rules.test.ts +129 -2
- package/os/rfc/handlers/validate-rules.ts +233 -9
- package/os/rfc/handlers/validate.ts +11 -0
- package/os/rfc/outcome-probe.ts +326 -0
- package/os/rfc/reachable-symbol.ts +67 -17
- package/os/rfc/rfc-0000-template.md +20 -0
- package/os/rfc/rfc.module.ts +74 -15
- package/os/rfc/types.ts +139 -14
- package/os/rfc/verification-evidence.ts +74 -14
- package/os/rfc/verification-origin.ts +61 -1
- package/os/rfc/verification-refresh.test.ts +63 -0
- package/os/rfc/verification-refresh.ts +24 -2
- package/os/rfc/verification-verdicts.ts +123 -0
- package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +12 -0
- package/os/rfc/verifier/rfc-1333/imp12-gate.acceptance.test.ts +12 -0
- package/os/rfc/verifier/rfc-1333/skills-and-types.acceptance.test.ts +12 -0
- package/os/rfc/verifier/rfc-1333/verify-workspace.acceptance.test.ts +12 -0
- package/os/rfc/verifier/rfc-1391/ac1-proved-exit-0.acceptance.test.ts +151 -0
- package/os/rfc/verifier/rfc-1391/ac2-unavailable-nonzero.acceptance.test.ts +111 -0
- package/os/rfc/verifier/rfc-1391/ac3-version-mismatch-error.acceptance.test.ts +97 -0
- package/os/rfc/verifier/rfc-1391/ac4-cardinality-mismatch-error.acceptance.test.ts +179 -0
- package/os/rfc/verifier/rfc-1391/ac5-imp13-formal-stamp-block.acceptance.test.ts +295 -0
- package/os/rfc/verifier/rfc-1391/ac6-formal-high-tier-gates.acceptance.test.ts +203 -0
- package/os/rfc/verifier/rfc-1391/ac7-v46-empty-assumptions.acceptance.test.ts +126 -0
- package/os/rfc/verifier/rfc-1391/cx1-emit-proof-envelope.acceptance.test.ts +130 -0
- package/os/rfc/verifier/rfc-1391/fixtures/no-report.proof.test.ts +39 -0
- package/os/rfc/verifier/rfc-1391/fixtures/small-domain.proof.test.ts +45 -0
- package/os/rfc/verifier/rfc-1391/origin-proof-spec-entry.acceptance.test.ts +175 -0
- package/os/rfc/verifier/rfc-1391/support.ts +209 -0
- package/os/session/fixtures/audit/clean.md +7 -0
- package/os/session/fixtures/audit/denied-retry.md +10 -0
- package/os/session/frontmatter-io.ts +3 -1
- package/os/session/handlers/save.ts +5 -2
- package/os/session/handlers/session-audit-detectors.test.ts +97 -0
- package/os/session/handlers/session-audit-report.test.ts +70 -0
- package/os/session/handlers/session-audit-report.ts +97 -0
- package/os/session/handlers/session-audit.test.ts +86 -0
- package/os/session/handlers/session-audit.ts +321 -0
- package/os/session/session.module.ts +51 -2
- package/os/spec/spec-amendments.ts +91 -0
- package/os/spec/spec-materialize.ts +20 -22
- package/os/spec/spec-status.test.ts +17 -1
- package/os/spec/spec-status.ts +23 -29
- package/os/spec/spec-validate.test.ts +45 -0
- package/os/spec/spec-validate.ts +9 -29
- package/os/spec/spec.module.ts +7 -36
- package/os/trajectory/handlers/extract-units.test.ts +75 -0
- package/os/trajectory/handlers/journal-io.ts +229 -0
- package/os/trajectory/handlers/outcome-record.test.ts +198 -0
- package/os/trajectory/handlers/outcome-record.ts +165 -0
- package/os/trajectory/handlers/producer-trust.test.ts +169 -0
- package/os/trajectory/handlers/trajectory-index.test.ts +275 -0
- package/os/trajectory/handlers/trajectory-index.ts +493 -0
- package/os/trajectory/handlers/trajectory-recall.test.ts +254 -0
- package/os/trajectory/handlers/trajectory-recall.ts +201 -0
- package/os/trajectory/handlers/trajectory.test.ts +100 -0
- package/os/trajectory/handlers/verdict-binding.test.ts +249 -0
- package/os/trajectory/index.ts +16 -0
- package/os/trajectory/trajectory.module.ts +103 -0
- package/os/werkstatt/handlers/session-close.ts +82 -0
- package/os/werkstatt/handlers/session-engine.ts +34 -0
- package/os/werkstatt/handlers/session-open.ts +68 -0
- package/os/werkstatt/handlers/session-status.ts +55 -0
- package/os/werkstatt/werkstatt.module.ts +101 -3
- package/os/yaml/handlers/scalars-validate.ts +343 -0
- package/os/yaml/index.ts +23 -0
- package/os/yaml/scalars.test.ts +152 -0
- package/os/yaml/yaml.module.ts +61 -0
- package/package.json +210 -1
- package/profiles/forge-shell.yaml +3 -1
- package/profiles/godot-game.yaml +3 -1
- package/profiles/knowledge.yaml +3 -1
- package/profiles/phaser-game.yaml +3 -1
- package/profiles/site-workshop.yaml +3 -1
- package/profiles/typescript.yaml +3 -1
- package/skills/_shared/agent-operating-model.md +1 -1
- package/skills/_shared/fo-pipeline-conventions.md +5 -1
- package/skills/fo/fo-add-tests/SKILL.md +9 -1
- package/skills/fo/fo-add-tests/pbt-guide.md +1 -0
- package/skills/fo/fo-compass-annotate/SKILL.md +18 -0
- package/skills/fo/fo-compass-annotate/templates/header-format.md +3 -2
- package/skills/fo/fo-fix/SKILL.md +14 -8
- package/skills/fo/fo-idea-create-adr/SKILL.md +5 -3
- package/skills/fo/fo-idea-create-rfc/SKILL.md +20 -8
- package/skills/fo/fo-idea-create-rfc/acceptance-criteria-standard.md +20 -0
- package/skills/fo/fo-idea-i-just-want-to-see-the-result/SKILL.md +31 -13
- package/skills/fo/fo-idea-implement/SKILL.md +20 -14
- package/skills/fo/fo-idea-plan/SKILL.md +1 -1
- package/skills/fo/fo-knowledge-distill/SKILL.md +13 -5
- package/skills/fo/fo-memory-sync/SKILL.md +9 -0
- package/skills/fo/fo-memory-sync/fix-patterns.md +65 -0
- package/skills/fo/fo-memory-sync/learned-principles.md +10 -0
- package/skills/fo/fo-memory-sync/qa-log.md +30 -0
- package/skills/fo/fo-reproduce/SKILL.md +116 -0
- package/skills/fo/fo-review/SKILL.md +11 -5
- package/skills/fo/fo-session-retro/SKILL.md +134 -49
- package/skills/fo/fo-session-save/SKILL.md +2 -0
- package/skills/fo/fo-step-commit/SKILL.md +4 -3
- package/skills/fo/fo-triage/SKILL.md +9 -0
- package/skills/shared/grilling/SKILL.md +7 -0
- package/skills/shared/grilling/learned-principles.md +7 -0
- package/skills/shared/grilling/qa-log.md +39 -0
- package/skills/shared/writing-great-skills/SKILL.md +12 -9
- package/src/authority/delegations.ts +6 -3
- package/src/cli-flags.ts +111 -16
- package/src/compass/index.ts +37 -0
- package/src/compass/invariant-parser.ts +254 -0
- package/src/config/forge-config.ts +150 -22
- package/src/conformance/index.ts +281 -0
- package/src/formal/exhaustive.test.ts +117 -0
- package/src/formal/exhaustive.ts +183 -0
- package/src/formal/index.ts +27 -0
- package/src/formal/proof-runner.test.ts +310 -0
- package/src/formal/proof-runner.ts +563 -0
- package/src/formal/proof-spec.test.ts +70 -0
- package/src/formal/proof-spec.ts +132 -0
- package/src/index.ts +1 -0
- package/src/knowledge/index.ts +11 -2
- package/src/knowledge/parse.ts +20 -17
- package/src/knowledge/schema.ts +14 -4
- package/src/knowledge/serialize.ts +3 -0
- package/src/knowledge/sync.ts +281 -7
- package/src/onboarding/agents-generate.ts +19 -3
- package/src/onboarding/compass-docs/semantic-layer-block.ts +1 -1
- package/src/onboarding/doctor.ts +277 -27
- package/src/onboarding/init.ts +3 -3
- package/src/onboarding/nested-agents-generate.ts +1 -1
- package/src/onboarding/nested-agents-templates.ts +1 -1
- package/src/onboarding/templates/behavioral-layer-core.md +1 -1
- package/src/onboarding/upgrade.ts +18 -10
- package/src/profiles/profile-schema.ts +10 -2
- package/src/reachability/command-mentions.ts +89 -0
- package/src/registry.ts +197 -76
- package/src/tests/bindings-schema.test.ts +4 -0
- package/src/tests/cli-flags.test.ts +226 -1
- package/src/tests/discover-pack-skills.test.ts +26 -0
- package/src/tests/doctor-autonomy.test.ts +144 -0
- package/src/tests/doctor-dist-freshness.test.ts +24 -0
- package/src/tests/doctor-knowledge-conflicts.test.ts +135 -0
- package/src/tests/doctor-nested-agents.test.ts +30 -1
- package/src/tests/fixtures/agents-generate-business-before.txt +4 -2
- package/src/tests/forge-config.test.ts +5 -2
- package/src/tests/implement-stamp.test.ts +238 -4
- package/src/tests/knowledge-conflicts-resolve.pbt.test.ts +38 -0
- package/src/tests/knowledge-conflicts-resolve.test.ts +648 -0
- package/src/tests/knowledge-parse.test.ts +26 -1
- package/src/tests/rfc-verification-verdict-ingest.test.ts +244 -0
- package/src/tests/session-handlers.test.ts +47 -0
- package/src/tests/session-retro.test.ts +47 -0
- package/src/tests/skill-validate-knowledge.test.ts +93 -2
- package/src/tests/upgrade.test.ts +38 -0
- package/src/types.ts +59 -18
- package/src/utils/sync-fs.ts +2 -0
- package/src/validators/skill-validate.ts +37 -9
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Register forgeContextModule — context.index.build, context.assemble, context.slate.eval (RFC-1470): task-time context slate retrieval.</purpose>
|
|
4
|
+
<non-goals>
|
|
5
|
+
<item>TODO(compass): record the boundary this file must not take on.</item>
|
|
6
|
+
</non-goals>
|
|
7
|
+
</MODULE_CONTRACT>
|
|
8
|
+
<CHANGE_SUMMARY>
|
|
9
|
+
<item>RFC-1470: forgeContextModule registering the slate-retrieval commands</item>
|
|
10
|
+
<item>RFC-1470: context.index.build + context.assemble + context.slate.eval — slate-retrieval projection over the artifact corpus</item>
|
|
11
|
+
<item>RFC-1470: declare generated index files in context.index.build and trajectory.index writes</item>
|
|
12
|
+
<item>RFC-1485: sweep compass headers — forge-os-context</item>
|
|
13
|
+
</CHANGE_SUMMARY>
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import type { ForgeModule } from "../../src/forge-module.ts";
|
|
17
|
+
import { runIndexBuild } from "./handlers/index-build.ts";
|
|
18
|
+
import { runContextAssemble } from "./handlers/context-assemble.ts";
|
|
19
|
+
import { runSlateEval } from "./handlers/context-slate-eval.ts";
|
|
20
|
+
|
|
21
|
+
export const forgeContextModule: ForgeModule = {
|
|
22
|
+
name: "forge-context",
|
|
23
|
+
version: "0.1.0",
|
|
24
|
+
runtime: "autonomous",
|
|
25
|
+
declarations: [],
|
|
26
|
+
commands: [
|
|
27
|
+
{
|
|
28
|
+
name: "context.index.build",
|
|
29
|
+
coverage: "operator" as const,
|
|
30
|
+
contract: "context",
|
|
31
|
+
mutatesState: true,
|
|
32
|
+
description:
|
|
33
|
+
"RFC-1470: rebuild docs/.index/context/index.yaml — a pure-projection unit catalog (session-block, knowledge-entry, friction, remediation, rfc-header, adr-header, skill-manifest, handoff, decision). Drop the dir, rebuild from sources.",
|
|
34
|
+
scope: "workspace",
|
|
35
|
+
acceptsAllFlag: false,
|
|
36
|
+
flags: {},
|
|
37
|
+
reads: ["docs/sessions/**/*.md", ".agents/**", "docs/frictions.yaml", "docs/remediation-catalog.*.yaml", "docs/rfcs/**", "docs/adrs/**", "packages/forge/skills/**", "docs/handoffs/**", "docs/queues/*decisions.yaml"],
|
|
38
|
+
writes: ["docs/.index/context/**", "docs/.index/context/index.yaml"],
|
|
39
|
+
generates: [{ path: "docs/.index/context/index.yaml", phase: "on-demand" as const }],
|
|
40
|
+
execute: runIndexBuild,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "context.assemble",
|
|
44
|
+
coverage: "operator" as const,
|
|
45
|
+
contract: "context",
|
|
46
|
+
mutatesState: false,
|
|
47
|
+
description:
|
|
48
|
+
"RFC-1470: emit a budgeted context slate for --task — units ranked by lexical overlap + recency + kind weight + path overlap, each citing source + reasons. Flags: --task, --budget, --paths, --auto-index, --format markdown.",
|
|
49
|
+
scope: "workspace",
|
|
50
|
+
acceptsAllFlag: false,
|
|
51
|
+
flags: {
|
|
52
|
+
task: { kind: "string", description: "Task description to retrieve context for." },
|
|
53
|
+
budget: { kind: "string", description: "Token budget for the slate (default 4000)." },
|
|
54
|
+
paths: { kind: "string", description: "Path glob terms to boost (e.g. the files being edited)." },
|
|
55
|
+
"auto-index": { kind: "boolean", description: "Build the index lazily when missing." },
|
|
56
|
+
format: { kind: "string", description: "markdown for a paste-ready block." },
|
|
57
|
+
},
|
|
58
|
+
reads: ["docs/.index/context/index.yaml"],
|
|
59
|
+
execute: runContextAssemble,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "context.slate.eval",
|
|
63
|
+
coverage: "operator" as const,
|
|
64
|
+
contract: "context",
|
|
65
|
+
mutatesState: false,
|
|
66
|
+
description:
|
|
67
|
+
"RFC-1470: report recall@budget over docs/context-devset/ task → requiredUnits pairs — the completeness metric and ranker-change regression gate.",
|
|
68
|
+
scope: "workspace",
|
|
69
|
+
acceptsAllFlag: false,
|
|
70
|
+
flags: {
|
|
71
|
+
budget: { kind: "string", description: "Token budget for the recall measurement (default 4000)." },
|
|
72
|
+
},
|
|
73
|
+
reads: ["docs/.index/context/index.yaml", "docs/context-devset/*.yaml"],
|
|
74
|
+
execute: runSlateEval,
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
pipelines: [],
|
|
78
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>RFC-1470 context.assemble tests — budgeted slate ranks task-relevant units first, every unit carries source + reasons, missing index blocks.</purpose>
|
|
4
|
+
<non-goals>
|
|
5
|
+
<item>TODO(compass): record the boundary this file must not take on.</item>
|
|
6
|
+
</non-goals>
|
|
7
|
+
</MODULE_CONTRACT>
|
|
8
|
+
<CHANGE_SUMMARY>
|
|
9
|
+
<item>RFC-1485: sweep compass headers — forge-os-context</item>
|
|
10
|
+
</CHANGE_SUMMARY>
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { test, expect, describe, beforeEach, afterEach } from "vitest";
|
|
14
|
+
import { mkdtemp, rm, mkdir, writeFile } from "node:fs/promises";
|
|
15
|
+
import { join } from "node:path";
|
|
16
|
+
import { tmpdir } from "node:os";
|
|
17
|
+
import { runContextAssemble } from "./context-assemble.ts";
|
|
18
|
+
import type { ForgeRuntimeContext } from "../../../src/types.ts";
|
|
19
|
+
|
|
20
|
+
let root: string;
|
|
21
|
+
|
|
22
|
+
function ctx(): ForgeRuntimeContext {
|
|
23
|
+
return {
|
|
24
|
+
workspaceRoot: root,
|
|
25
|
+
outputFormat: "json",
|
|
26
|
+
logger: { info() {}, warn() {}, error() {}, success() {}, section() {} },
|
|
27
|
+
} as unknown as ForgeRuntimeContext;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function flags(f: Record<string, unknown> = {}) {
|
|
31
|
+
return { argv: [], flags: f } as never;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const INDEX = `schema: forge/context-index@1
|
|
35
|
+
sourceWatermark: docs/sessions/2026-10-30-12-00-00-aaaaaa.md
|
|
36
|
+
units:
|
|
37
|
+
- id: "friction:F-0009"
|
|
38
|
+
kind: friction
|
|
39
|
+
source: "docs/frictions.yaml#F-0009"
|
|
40
|
+
tokens: 50
|
|
41
|
+
text: "F-0009 [process]: scar bullets accumulate in AGENTS.md without a migration path"
|
|
42
|
+
meta: { category: process }
|
|
43
|
+
- id: "session-block:s1:summary"
|
|
44
|
+
kind: session-block
|
|
45
|
+
source: "docs/sessions/s1.md#summary"
|
|
46
|
+
tokens: 40
|
|
47
|
+
text: "summary: worked on deployment pipeline for the frontend"
|
|
48
|
+
meta: { date: "2026-10-30" }
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
beforeEach(async () => {
|
|
52
|
+
root = await mkdtemp(join(tmpdir(), "ctx-assemble-"));
|
|
53
|
+
await mkdir(join(root, "docs", ".index", "context"), { recursive: true });
|
|
54
|
+
await writeFile(join(root, "docs", ".index", "context", "index.yaml"), INDEX);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
afterEach(async () => {
|
|
58
|
+
await rm(root, { recursive: true, force: true });
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
describe("context.assemble (RFC-1470)", () => {
|
|
62
|
+
test("slate ranks task-relevant units first, every unit carries source + reasons", async () => {
|
|
63
|
+
const res = await runContextAssemble(flags({ task: "migrate friction scars" }), ctx());
|
|
64
|
+
expect(res.data?.units[0]?.id).toContain("F-0009");
|
|
65
|
+
for (const u of res.data?.units ?? []) {
|
|
66
|
+
expect(u.source.length).toBeGreaterThan(0);
|
|
67
|
+
expect(u.reasons.length).toBeGreaterThan(0);
|
|
68
|
+
}
|
|
69
|
+
expect(res.exitCode).toBe(0);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
test("budget fills in rank order — smallest high-score units first", async () => {
|
|
73
|
+
const res = await runContextAssemble(flags({ task: "friction scars", budget: 60 }), ctx());
|
|
74
|
+
// 50-token friction + 40-token session — only one fits in 60.
|
|
75
|
+
expect(res.data?.usedTokens).toBeLessThanOrEqual(60);
|
|
76
|
+
expect(res.data?.skipped).toBeGreaterThanOrEqual(0);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
test("CTX-02: stale index vs a newer session source → warn", async () => {
|
|
80
|
+
await mkdir(join(root, "docs", "sessions"), { recursive: true });
|
|
81
|
+
await writeFile(join(root, "docs", "sessions", "2026-10-31-18-00-00-bbbbbb.md"), `---\nid: s-new\n---\nbody`);
|
|
82
|
+
const warns: string[] = [];
|
|
83
|
+
const c = ctx() as unknown as { logger: { warn: (m: string) => void } };
|
|
84
|
+
c.logger.warn = (m: string) => warns.push(m);
|
|
85
|
+
await runContextAssemble(flags({ task: "scars" }), c as never);
|
|
86
|
+
expect(warns.some((w) => w.startsWith("CTX-02"))).toBe(true);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test("missing index → CONTEXT-01 blocking hint", async () => {
|
|
90
|
+
await rm(join(root, "docs", ".index", "context", "index.yaml"));
|
|
91
|
+
const res = await runContextAssemble(flags({ task: "x" }), ctx());
|
|
92
|
+
expect(res.exitCode).toBe(1);
|
|
93
|
+
expect(res.summary).toContain("CONTEXT-01");
|
|
94
|
+
});
|
|
95
|
+
});
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
RFC-1470: context.assemble --task "<desc>" [--budget <tokens>] [--paths <globs>]
|
|
5
|
+
— scores every indexed unit (lexical BM25-lite term overlap + recency + kind
|
|
6
|
+
weight + path overlap) and fills the token budget in rank order; each unit
|
|
7
|
+
carries source + machine-readable reasons. Missing index → blocking hint (or
|
|
8
|
+
lazy build via --auto-index). Dense channel is the declared EmbeddingGemma-2
|
|
9
|
+
slot — absent binding → lexical-only floor (shipped default).
|
|
10
|
+
</purpose>
|
|
11
|
+
<non-goals>
|
|
12
|
+
<item>TODO(compass): record the boundary this file must not take on.</item>
|
|
13
|
+
</non-goals>
|
|
14
|
+
</MODULE_CONTRACT>
|
|
15
|
+
<CHANGE_SUMMARY>
|
|
16
|
+
<item>RFC-1470: context.index.build + context.assemble + context.slate.eval — slate-retrieval projection over the artifact corpus</item>
|
|
17
|
+
<item>RFC-1470: apply r1 repairs — post-fence knowledge prose, devset re-anchored to real unit ids, source-group discount, CTX-01/02, exact-match eval, file-scoped ids, meta fields</item>
|
|
18
|
+
<item>RFC-1470: apply r2 repairs — devset real anchors, CTX-02 watermark staleness, path-scoped K-ids, eval scoring parity</item>
|
|
19
|
+
<item>RFC-1470: apply r3 repair — CTX-02 session-scoped watermark vs path-compare, regression test asserts the warn fires</item>
|
|
20
|
+
<item>RFC-1485: sweep compass headers — forge-os-context</item>
|
|
21
|
+
<history>RFC-1470</history>
|
|
22
|
+
</CHANGE_SUMMARY>
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import path from "node:path";
|
|
26
|
+
import { parse as yamlParse } from "yaml";
|
|
27
|
+
import { ambientIo, resolveIo } from "../../../src/utils/io.ts";
|
|
28
|
+
import { runIndexBuild } from "./index-build.ts";
|
|
29
|
+
import type { ContextUnit } from "./index-build.ts";
|
|
30
|
+
import type {
|
|
31
|
+
ForgeCommandInput,
|
|
32
|
+
ForgeCommandResult,
|
|
33
|
+
ForgeRuntimeContext,
|
|
34
|
+
} from "../../../src/types.ts";
|
|
35
|
+
|
|
36
|
+
export interface SlateUnit {
|
|
37
|
+
id: string;
|
|
38
|
+
kind: string;
|
|
39
|
+
source: string;
|
|
40
|
+
tokens: number;
|
|
41
|
+
score: number;
|
|
42
|
+
reasons: string[];
|
|
43
|
+
text: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface AssembleData {
|
|
47
|
+
command: "context.assemble";
|
|
48
|
+
status: "ok";
|
|
49
|
+
task: string;
|
|
50
|
+
budget: number;
|
|
51
|
+
usedTokens: number;
|
|
52
|
+
units: SlateUnit[];
|
|
53
|
+
skipped: number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const HEADER_TOKENS = 12;
|
|
57
|
+
|
|
58
|
+
const STOPWORDS = new Set(["the", "for", "and", "run", "all", "can", "use", "with", "this", "that", "from"]);
|
|
59
|
+
|
|
60
|
+
const KIND_WEIGHT: Record<string, number> = {
|
|
61
|
+
"knowledge-entry": 1.2, friction: 1.1, remediation: 1.0,
|
|
62
|
+
"session-block": 0.9, "rfc-header": 0.8, "adr-header": 0.8,
|
|
63
|
+
"skill-manifest": 0.7, decision: 0.7, handoff: 0.5,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export function tokenize(text: string): Set<string> {
|
|
67
|
+
return new Set(
|
|
68
|
+
text.toLowerCase().replace(/[^a-zа-яё0-9_.-]+/g, " ").split(/\s+/).filter((t) => t.length > 2 && !STOPWORDS.has(t)),
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function termHit(t: string, unitTokens: Set<string>): boolean {
|
|
73
|
+
if (unitTokens.has(t)) return true;
|
|
74
|
+
// Word-prefix tolerance — "scars"↔"scar", "migrate"↔"migration".
|
|
75
|
+
for (const u of unitTokens) if (u.startsWith(t) || t.startsWith(u)) return true;
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function scoreUnit(unit: ContextUnit, taskTokens: Set<string>, pathTerms: Set<string>): { score: number; reasons: string[] } {
|
|
80
|
+
const reasons: string[] = [];
|
|
81
|
+
const unitTokens = tokenize(unit.text + " " + unit.source);
|
|
82
|
+
const hits = [...taskTokens].filter((t) => termHit(t, unitTokens)).length;
|
|
83
|
+
if (hits > 0) reasons.push(`lexical:${hits}`);
|
|
84
|
+
const kindW = KIND_WEIGHT[unit.kind] ?? 0.5;
|
|
85
|
+
const recDays = typeof unit.meta.date === "string"
|
|
86
|
+
? Math.max(0, (Date.now() - new Date(unit.meta.date).getTime()) / 86_400_000)
|
|
87
|
+
: 365;
|
|
88
|
+
const recency = Math.max(0, 1 - recDays / 365);
|
|
89
|
+
if (recency > 0.5) reasons.push(`recent:${recDays.toFixed(0)}d`);
|
|
90
|
+
const pathHits = [...pathTerms].filter((t) => unit.source.includes(t)).length;
|
|
91
|
+
if (pathHits > 0) reasons.push(`path:${pathHits}`);
|
|
92
|
+
const confirmations = typeof unit.meta.confirmations === "number" ? unit.meta.confirmations : 0;
|
|
93
|
+
if (confirmations > 0) reasons.push(`confirmations:${confirmations}`);
|
|
94
|
+
const recurrences = typeof unit.meta.recurrences === "number" ? unit.meta.recurrences : 0;
|
|
95
|
+
if (recurrences > 0) reasons.push(`recurrences:${recurrences}`);
|
|
96
|
+
const score = hits * 2 * kindW + recency * 1.5 * kindW + pathHits * 3 + Math.min(confirmations, 5) * 0.4 + Math.min(recurrences, 10) * 0.3;
|
|
97
|
+
if (reasons.length === 0) reasons.push("baseline");
|
|
98
|
+
return { score, reasons };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export async function runContextAssemble(
|
|
102
|
+
input: ForgeCommandInput,
|
|
103
|
+
context: ForgeRuntimeContext,
|
|
104
|
+
): Promise<ForgeCommandResult<AssembleData>> {
|
|
105
|
+
const io = resolveIo(context.io ?? ambientIo);
|
|
106
|
+
const root = context.workspaceRoot;
|
|
107
|
+
const task = String(input.flags["task"] ?? input.argv?.[0] ?? "");
|
|
108
|
+
const budget = Math.max(1, Number(input.flags["budget"] ?? 4000) || 4000);
|
|
109
|
+
const pathTerms = tokenize(String(input.flags["paths"] ?? ""));
|
|
110
|
+
if (!task) {
|
|
111
|
+
return { data: { command: "context.assemble", status: "ok", task: "", budget, usedTokens: 0, units: [], skipped: 0 }, summary: "missing --task", exitCode: 1 };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const indexRel = path.join(root, "docs", ".index", "context", "index.yaml");
|
|
115
|
+
let indexSrc = await io.readFile(indexRel).catch(() => null);
|
|
116
|
+
if (indexSrc === null) {
|
|
117
|
+
if (input.flags["auto-index"] !== true) {
|
|
118
|
+
return {
|
|
119
|
+
data: { command: "context.assemble", status: "ok", task, budget, usedTokens: 0, units: [], skipped: 0 },
|
|
120
|
+
summary: "CONTEXT-01 index missing — run `werkstatt run context.index.build` or --auto-index",
|
|
121
|
+
exitCode: 1,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
await runIndexBuild(input, context);
|
|
125
|
+
indexSrc = await io.readFile(indexRel).catch(() => null);
|
|
126
|
+
if (indexSrc === null) {
|
|
127
|
+
return { data: { command: "context.assemble", status: "ok", task, budget, usedTokens: 0, units: [], skipped: 0 }, summary: "index build produced nothing", exitCode: 1 };
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const units = ((yamlParse(indexSrc) as { units?: ContextUnit[] } | null)?.units ?? []);
|
|
131
|
+
// CTX-02 staleness — the index's sourceWatermark (newest source date seen at
|
|
132
|
+
// build) vs the newest source file in the corpus.
|
|
133
|
+
const watermark = (yamlParse(indexSrc) as { sourceWatermark?: string } | null)?.sourceWatermark ?? "";
|
|
134
|
+
const sessionDir = path.join(root, "docs", "sessions");
|
|
135
|
+
const newestSrc = (await io.readdir(sessionDir).catch(() => [] as { name: string; isDirectory: boolean }[]))
|
|
136
|
+
.filter((e) => !e.isDirectory && /^\d{4}-\d{2}-\d{2}-\d{2}-\d{2}-\d{2}-[0-9a-f]{6}\.md$/.test(e.name))
|
|
137
|
+
.sort().at(-1)?.name ?? "";
|
|
138
|
+
const newestPath = newestSrc ? `docs/sessions/${newestSrc}` : "";
|
|
139
|
+
if (watermark && newestPath && newestPath > watermark) {
|
|
140
|
+
context.logger.warn(`CTX-02 index is stale (watermark ${watermark} < newest source ${newestPath}) — rerun context.index.build`);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const taskTokens = tokenize(task);
|
|
144
|
+
const scored = units
|
|
145
|
+
.map((u) => ({ u, ...scoreUnit(u, taskTokens, pathTerms) }))
|
|
146
|
+
.sort((a, b) => b.score - a.score || a.u.id.localeCompare(b.u.id));
|
|
147
|
+
|
|
148
|
+
// Source-group discount (AC-4): the second unit from the same source file
|
|
149
|
+
// pays only its body cost — the header (source line + kind tag) is charged once.
|
|
150
|
+
const slate: SlateUnit[] = [];
|
|
151
|
+
const groupSeen = new Set<string>();
|
|
152
|
+
let used = 0;
|
|
153
|
+
let skipped = 0;
|
|
154
|
+
for (const s of scored) {
|
|
155
|
+
const group = s.u.source.split("#")[0] ?? s.u.source;
|
|
156
|
+
const charge = groupSeen.has(group) ? Math.max(1, s.u.tokens - HEADER_TOKENS) : s.u.tokens;
|
|
157
|
+
if (used + charge > budget) { skipped++; continue; }
|
|
158
|
+
used += charge;
|
|
159
|
+
groupSeen.add(group);
|
|
160
|
+
slate.push({ id: s.u.id, kind: s.u.kind, source: s.u.source, tokens: s.u.tokens, score: Number(s.score.toFixed(3)), reasons: s.reasons, text: s.u.text });
|
|
161
|
+
}
|
|
162
|
+
if (slate.length === 0) {
|
|
163
|
+
context.logger.warn("CTX-01 budget below the smallest scored unit — empty slate");
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (context.outputFormat === "pretty") {
|
|
167
|
+
context.logger.info(`slate: ${slate.length} unit(s), ${used}/${budget} tokens, ${skipped} skipped`);
|
|
168
|
+
for (const u of slate.slice(0, 12)) context.logger.info(` ${u.score.toFixed(1)} ${u.kind} ${u.source} [${u.reasons.join(",")}]`);
|
|
169
|
+
}
|
|
170
|
+
if (input.flags["format"] === "markdown") {
|
|
171
|
+
const md = slate.map((u) => `- **${u.kind}** \`${u.source}\` — ${u.reasons.join(", ")}\n ${u.text.slice(0, 200)}`).join("\n");
|
|
172
|
+
return { data: { command: "context.assemble", status: "ok", task, budget, usedTokens: used, units: slate, skipped }, summary: md, exitCode: 0 };
|
|
173
|
+
}
|
|
174
|
+
return { data: { command: "context.assemble", status: "ok", task, budget, usedTokens: used, units: slate, skipped }, summary: `${slate.length} unit(s), ${used}/${budget} tokens`, exitCode: 0 };
|
|
175
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>RFC-1470 context.slate.eval tests — recall@budget over the devset; missing index/devset block honestly.</purpose>
|
|
4
|
+
<non-goals>
|
|
5
|
+
<item>TODO(compass): record the boundary this file must not take on.</item>
|
|
6
|
+
</non-goals>
|
|
7
|
+
</MODULE_CONTRACT>
|
|
8
|
+
<CHANGE_SUMMARY>
|
|
9
|
+
<item>RFC-1485: sweep compass headers — forge-os-context</item>
|
|
10
|
+
</CHANGE_SUMMARY>
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { test, expect, describe, beforeEach, afterEach } from "vitest";
|
|
14
|
+
import { mkdtemp, rm, mkdir, writeFile } from "node:fs/promises";
|
|
15
|
+
import { join } from "node:path";
|
|
16
|
+
import { tmpdir } from "node:os";
|
|
17
|
+
import { runSlateEval } from "./context-slate-eval.ts";
|
|
18
|
+
import type { ForgeRuntimeContext } from "../../../src/types.ts";
|
|
19
|
+
|
|
20
|
+
let root: string;
|
|
21
|
+
|
|
22
|
+
function ctx(): ForgeRuntimeContext {
|
|
23
|
+
return {
|
|
24
|
+
workspaceRoot: root,
|
|
25
|
+
outputFormat: "json",
|
|
26
|
+
logger: { info() {}, warn() {}, error() {}, success() {}, section() {} },
|
|
27
|
+
} as unknown as ForgeRuntimeContext;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function flags(f: Record<string, unknown> = {}) {
|
|
31
|
+
return { argv: [], flags: f } as never;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
beforeEach(async () => {
|
|
35
|
+
root = await mkdtemp(join(tmpdir(), "slate-eval-"));
|
|
36
|
+
await mkdir(join(root, "docs", ".index", "context"), { recursive: true });
|
|
37
|
+
await mkdir(join(root, "docs", "context-devset"), { recursive: true });
|
|
38
|
+
await writeFile(join(root, "docs", ".index", "context", "index.yaml"), `schema: forge/context-index@1
|
|
39
|
+
units:
|
|
40
|
+
- id: "friction:F-0009"
|
|
41
|
+
kind: friction
|
|
42
|
+
source: "docs/frictions.yaml#F-0009"
|
|
43
|
+
tokens: 50
|
|
44
|
+
text: "F-0009 [process]: scar bullets accumulate without a migration path"
|
|
45
|
+
meta: {}
|
|
46
|
+
`);
|
|
47
|
+
await writeFile(join(root, "docs", "context-devset", "t1.yaml"), `task: migrate friction scars
|
|
48
|
+
requiredUnits:
|
|
49
|
+
- "friction:F-0009"
|
|
50
|
+
`);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
afterEach(async () => {
|
|
54
|
+
await rm(root, { recursive: true, force: true });
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe("context.slate.eval (RFC-1470)", () => {
|
|
58
|
+
test("required unit found in slate → recall 1.0", async () => {
|
|
59
|
+
const res = await runSlateEval(flags({ budget: 4000 }), ctx());
|
|
60
|
+
expect(res.data?.tasks).toBe(1);
|
|
61
|
+
expect(res.data?.recall).toBe(1);
|
|
62
|
+
expect(res.exitCode).toBe(0);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test("missing index → CONTEXT-01 block", async () => {
|
|
66
|
+
await rm(join(root, "docs", ".index", "context", "index.yaml"));
|
|
67
|
+
const res = await runSlateEval(flags({}), ctx());
|
|
68
|
+
expect(res.exitCode).toBe(1);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
RFC-1470: context.slate.eval — the completeness harness: a gold dev set
|
|
5
|
+
docs/context-devset/ of task → requiredUnits[] pairs scores recall@budget —
|
|
6
|
+
the fraction of required units the slate contains. This is the RFC's own
|
|
7
|
+
acceptance instrument and the regression gate for every ranker change.
|
|
8
|
+
</purpose>
|
|
9
|
+
<non-goals>
|
|
10
|
+
<item>TODO(compass): record the boundary this file must not take on.</item>
|
|
11
|
+
</non-goals>
|
|
12
|
+
</MODULE_CONTRACT>
|
|
13
|
+
<CHANGE_SUMMARY>
|
|
14
|
+
<item>RFC-1470: context.slate.eval recall@budget over the gold dev set</item>
|
|
15
|
+
<item>RFC-1470: context.index.build + context.assemble + context.slate.eval — slate-retrieval projection over the artifact corpus</item>
|
|
16
|
+
<item>RFC-1470: apply r1 repairs — post-fence knowledge prose, devset re-anchored to real unit ids, source-group discount, CTX-01/02, exact-match eval, file-scoped ids, meta fields</item>
|
|
17
|
+
<item>RFC-1470: apply r2 repairs — devset real anchors, CTX-02 watermark staleness, path-scoped K-ids, eval scoring parity</item>
|
|
18
|
+
<item>RFC-1485: sweep compass headers — forge-os-context</item>
|
|
19
|
+
</CHANGE_SUMMARY>
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import path from "node:path";
|
|
23
|
+
import { parse as yamlParse } from "yaml";
|
|
24
|
+
import { ambientIo, resolveIo } from "../../../src/utils/io.ts";
|
|
25
|
+
import { scoreUnit } from "./context-assemble.ts";
|
|
26
|
+
import { tokenize, HEADER_TOKENS } from "./context-assemble.ts";
|
|
27
|
+
import type { ContextUnit } from "./index-build.ts";
|
|
28
|
+
import type {
|
|
29
|
+
ForgeCommandInput,
|
|
30
|
+
ForgeCommandResult,
|
|
31
|
+
ForgeRuntimeContext,
|
|
32
|
+
} from "../../../src/types.ts";
|
|
33
|
+
|
|
34
|
+
export interface EvalData {
|
|
35
|
+
command: "context.slate.eval";
|
|
36
|
+
status: "ok";
|
|
37
|
+
tasks: number;
|
|
38
|
+
recall: number;
|
|
39
|
+
perTask: { task: string; recall: number; found: number; required: number }[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export async function runSlateEval(
|
|
43
|
+
input: ForgeCommandInput,
|
|
44
|
+
context: ForgeRuntimeContext,
|
|
45
|
+
): Promise<ForgeCommandResult<EvalData>> {
|
|
46
|
+
const io = resolveIo(context.io ?? ambientIo);
|
|
47
|
+
const root = context.workspaceRoot;
|
|
48
|
+
const budget = Math.max(1, Number(input.flags["budget"] ?? 4000) || 4000);
|
|
49
|
+
const indexSrc = await io.readFile(path.join(root, "docs", ".index", "context", "index.yaml")).catch(() => null);
|
|
50
|
+
if (indexSrc === null) {
|
|
51
|
+
return { data: { command: "context.slate.eval", status: "ok", tasks: 0, recall: 0, perTask: [] }, summary: "CONTEXT-01 index missing — run context.index.build", exitCode: 1 };
|
|
52
|
+
}
|
|
53
|
+
const units = ((yamlParse(indexSrc) as { units?: ContextUnit[] } | null)?.units ?? []);
|
|
54
|
+
const devsetDir = path.join(root, "docs", "context-devset");
|
|
55
|
+
const entries = await io.readdir(devsetDir).catch(() => [] as { name: string; isDirectory: boolean }[]);
|
|
56
|
+
const tasks = entries.filter((e) => !e.isDirectory && e.name.endsWith(".yaml"));
|
|
57
|
+
if (tasks.length === 0) {
|
|
58
|
+
return { data: { command: "context.slate.eval", status: "ok", tasks: 0, recall: 0, perTask: [] }, summary: "devset empty — docs/context-devset/*.yaml", exitCode: 1 };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const perTask: EvalData["perTask"] = [];
|
|
62
|
+
for (const tf of tasks) {
|
|
63
|
+
const src = await io.readFile(path.join(devsetDir, tf.name)).catch(() => null);
|
|
64
|
+
if (src === null) continue;
|
|
65
|
+
const d = yamlParse(src) as { task?: string; requiredUnits?: string[] } | null;
|
|
66
|
+
if (!d?.task || !Array.isArray(d.requiredUnits)) continue;
|
|
67
|
+
const taskTokens = tokenize(d.task);
|
|
68
|
+
const scored = units.map((u) => ({ u, ...scoreUnit(u, taskTokens, new Set()) })).sort((a, b) => b.score - a.score || a.u.id.localeCompare(b.u.id));
|
|
69
|
+
const slateIds = new Set<string>();
|
|
70
|
+
const groupSeen = new Set<string>();
|
|
71
|
+
let used = 0;
|
|
72
|
+
for (const s of scored) {
|
|
73
|
+
const group = s.u.source.split("#")[0] ?? s.u.source;
|
|
74
|
+
const charge = groupSeen.has(group) ? Math.max(1, s.u.tokens - HEADER_TOKENS) : s.u.tokens;
|
|
75
|
+
if (used + charge > budget) continue;
|
|
76
|
+
used += charge;
|
|
77
|
+
groupSeen.add(group);
|
|
78
|
+
slateIds.add(s.u.id);
|
|
79
|
+
slateIds.add(s.u.source);
|
|
80
|
+
}
|
|
81
|
+
const found = d.requiredUnits.filter((r) => slateIds.has(r)).length;
|
|
82
|
+
perTask.push({ task: tf.name, recall: d.requiredUnits.length > 0 ? found / d.requiredUnits.length : 1, found, required: d.requiredUnits.length });
|
|
83
|
+
}
|
|
84
|
+
const recall = perTask.length > 0 ? perTask.reduce((s, t) => s + t.recall, 0) / perTask.length : 0;
|
|
85
|
+
return {
|
|
86
|
+
data: { command: "context.slate.eval", status: "ok", tasks: perTask.length, recall: Number(recall.toFixed(3)), perTask },
|
|
87
|
+
summary: `${perTask.length} task(s): recall@${budget} = ${(recall * 100).toFixed(1)}%`,
|
|
88
|
+
exitCode: 0,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>RFC-1470 context.index.build tests — unit catalog covers the required kinds (session-block, friction, rfc-header minimum); rebuild is pure projection.</purpose>
|
|
4
|
+
<non-goals>
|
|
5
|
+
<item>Not a contract source of truth — context.index.build and RFC-1470 own the behavior.</item>
|
|
6
|
+
</non-goals>
|
|
7
|
+
</MODULE_CONTRACT>
|
|
8
|
+
<CHANGE_SUMMARY>
|
|
9
|
+
<item>RFC-1481: context index retains consumer-local L-K-NNNN identity.</item>
|
|
10
|
+
<item>RFC-1481: collapse compass summaries and add missing contract blocks</item>
|
|
11
|
+
</CHANGE_SUMMARY>
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { test, expect, describe, beforeEach, afterEach } from "vitest";
|
|
15
|
+
import { mkdtemp, rm, mkdir, writeFile, readFile } from "node:fs/promises";
|
|
16
|
+
import { join } from "node:path";
|
|
17
|
+
import { tmpdir } from "node:os";
|
|
18
|
+
import { runIndexBuild } from "./index-build.ts";
|
|
19
|
+
import type { ForgeRuntimeContext } from "../../../src/types.ts";
|
|
20
|
+
|
|
21
|
+
let root: string;
|
|
22
|
+
|
|
23
|
+
function ctx(): ForgeRuntimeContext {
|
|
24
|
+
return {
|
|
25
|
+
workspaceRoot: root,
|
|
26
|
+
outputFormat: "json",
|
|
27
|
+
logger: { info() {}, warn() {}, error() {}, success() {}, section() {} },
|
|
28
|
+
} as unknown as ForgeRuntimeContext;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function flags(f: Record<string, unknown> = {}) {
|
|
32
|
+
return { argv: [], flags: f } as never;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
beforeEach(async () => {
|
|
36
|
+
root = await mkdtemp(join(tmpdir(), "index-build-"));
|
|
37
|
+
await mkdir(join(root, "docs", "sessions"), { recursive: true });
|
|
38
|
+
await mkdir(join(root, "docs", "rfcs"), { recursive: true });
|
|
39
|
+
await writeFile(join(root, "docs", "frictions.yaml"), `- id: F-0001
|
|
40
|
+
friction: "test scar"
|
|
41
|
+
category: process
|
|
42
|
+
`);
|
|
43
|
+
await writeFile(join(root, "docs", "sessions", "2026-10-31-12-00-00-aaaaaa.md"), `---
|
|
44
|
+
id: s-test
|
|
45
|
+
summary: "worked on the migration path for scars"
|
|
46
|
+
---
|
|
47
|
+
body
|
|
48
|
+
`);
|
|
49
|
+
await writeFile(join(root, "docs", "rfcs", "rfc-test.md"), `---
|
|
50
|
+
id: RFC-9001
|
|
51
|
+
title: "Test RFC for the index"
|
|
52
|
+
status: accepted
|
|
53
|
+
successSignals:
|
|
54
|
+
- "the index covers the unit"
|
|
55
|
+
---
|
|
56
|
+
# Test
|
|
57
|
+
`);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
afterEach(async () => {
|
|
61
|
+
await rm(root, { recursive: true, force: true });
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
describe("context.index.build (RFC-1470)", () => {
|
|
65
|
+
test("covers session-block + friction + rfc-header kinds", async () => {
|
|
66
|
+
const res = await runIndexBuild(flags({}), ctx());
|
|
67
|
+
expect(res.data?.units).toBeGreaterThan(0);
|
|
68
|
+
const kinds = Object.keys(res.data?.byKind ?? {});
|
|
69
|
+
expect(kinds).toContain("session-block");
|
|
70
|
+
expect(kinds).toContain("friction");
|
|
71
|
+
expect(kinds).toContain("rfc-header");
|
|
72
|
+
const index = await readFile(join(root, "docs", ".index", "context", "index.yaml"), "utf8");
|
|
73
|
+
expect(index).toContain("forge/context-index@1");
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test("indexes consumer-local L-K-NNNN knowledge entries by their full ID", async () => {
|
|
77
|
+
const knowledgeDir = join(root, ".agents", "skills", "consumer-skill");
|
|
78
|
+
await mkdir(knowledgeDir, { recursive: true });
|
|
79
|
+
await writeFile(
|
|
80
|
+
join(knowledgeDir, "qa-log.md"),
|
|
81
|
+
`<!-- knowledge-layer: L0 -->
|
|
82
|
+
|
|
83
|
+
### L-K-0001: Local identity
|
|
84
|
+
\`\`\`knowledge-entry
|
|
85
|
+
id: L-K-0001
|
|
86
|
+
layer: L0
|
|
87
|
+
created: 2026-08-03
|
|
88
|
+
status: active
|
|
89
|
+
\`\`\`
|
|
90
|
+
|
|
91
|
+
Indexed local knowledge body.
|
|
92
|
+
`,
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
await runIndexBuild(flags({}), ctx());
|
|
96
|
+
|
|
97
|
+
const index = await readFile(join(root, "docs", ".index", "context", "index.yaml"), "utf8");
|
|
98
|
+
expect(index).toContain("qa-log:L-K-0001");
|
|
99
|
+
expect(index).toContain("L-K-0001");
|
|
100
|
+
});
|
|
101
|
+
});
|