@warpgogol/forge 9.0.0 → 9.1.1
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 +36 -0
- package/README.md +15 -8
- package/README.uk.md +15 -8
- package/bin/cli.ts +3 -2
- package/dist/bin/cli.js +3 -2
- package/dist/bin/cli.js.map +1 -1
- package/dist/os/agent/handlers/agent-tiers-validate.d.ts.map +1 -1
- package/dist/os/agent/handlers/agent-tiers-validate.js +5 -1
- package/dist/os/agent/handlers/agent-tiers-validate.js.map +1 -1
- package/dist/os/agent/index.d.ts.map +1 -1
- package/dist/os/agent/index.js +4 -0
- package/dist/os/agent/index.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.map +1 -1
- package/dist/os/checks/checks.module.js +5 -1
- package/dist/os/checks/checks.module.js.map +1 -1
- package/dist/os/checks/handlers/contribution-report.d.ts.map +1 -1
- package/dist/os/checks/handlers/contribution-report.js +5 -4
- package/dist/os/checks/handlers/contribution-report.js.map +1 -1
- package/dist/os/checks/handlers/counters-export.d.ts.map +1 -1
- package/dist/os/checks/handlers/counters-export.js +4 -0
- package/dist/os/checks/handlers/counters-export.js.map +1 -1
- package/dist/os/checks/handlers/counters-journal.d.ts.map +1 -1
- package/dist/os/checks/handlers/counters-journal.js +2 -1
- package/dist/os/checks/handlers/counters-journal.js.map +1 -1
- package/dist/os/checks/handlers/counters-validate.d.ts.map +1 -1
- package/dist/os/checks/handlers/counters-validate.js +5 -1
- package/dist/os/checks/handlers/counters-validate.js.map +1 -1
- package/dist/os/checks/index.d.ts.map +1 -1
- package/dist/os/checks/index.js +11 -0
- package/dist/os/checks/index.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 +6 -1
- package/dist/os/compass/handlers/compass-header-scaffold.js.map +1 -1
- package/dist/os/compass/handlers/compass-invariants-generate.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-invariants-generate.js +3 -2
- package/dist/os/compass/handlers/compass-invariants-generate.js.map +1 -1
- package/dist/os/context/context.module.d.ts.map +1 -1
- package/dist/os/context/context.module.js +6 -1
- package/dist/os/context/context.module.js.map +1 -1
- package/dist/os/context/handlers/context-assemble.d.ts.map +1 -1
- package/dist/os/context/handlers/context-assemble.js +5 -1
- package/dist/os/context/handlers/context-assemble.js.map +1 -1
- package/dist/os/context/handlers/context-slate-eval.d.ts.map +1 -1
- package/dist/os/context/handlers/context-slate-eval.js +4 -0
- package/dist/os/context/handlers/context-slate-eval.js.map +1 -1
- package/dist/os/context/handlers/index-build.d.ts.map +1 -1
- package/dist/os/context/handlers/index-build.js +8 -5
- package/dist/os/context/handlers/index-build.js.map +1 -1
- package/dist/os/context/index.d.ts.map +1 -1
- package/dist/os/context/index.js +11 -0
- package/dist/os/context/index.js.map +1 -1
- package/dist/os/gate/handlers/gate-probe-catalog.d.ts.map +1 -1
- package/dist/os/gate/handlers/gate-probe-catalog.js +4 -0
- package/dist/os/gate/handlers/gate-probe-catalog.js.map +1 -1
- package/dist/os/gate/handlers/gate-probe.d.ts.map +1 -1
- package/dist/os/gate/handlers/gate-probe.js +4 -0
- package/dist/os/gate/handlers/gate-probe.js.map +1 -1
- package/dist/os/gate/index.d.ts.map +1 -1
- package/dist/os/gate/index.js +11 -0
- package/dist/os/gate/index.js.map +1 -1
- package/dist/os/instructions/instructions.module.d.ts.map +1 -1
- package/dist/os/instructions/instructions.module.js +2 -1
- package/dist/os/instructions/instructions.module.js.map +1 -1
- package/dist/os/knowledge/handlers/knowledge-authz-probe.d.ts.map +1 -1
- package/dist/os/knowledge/handlers/knowledge-authz-probe.js +7 -3
- package/dist/os/knowledge/handlers/knowledge-authz-probe.js.map +1 -1
- 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.map +1 -1
- package/dist/os/knowledge/handlers/knowledge-rebuild.js +4 -0
- package/dist/os/knowledge/handlers/knowledge-rebuild.js.map +1 -1
- package/dist/os/knowledge/index.d.ts +1 -0
- package/dist/os/knowledge/index.d.ts.map +1 -1
- package/dist/os/knowledge/index.js +13 -0
- package/dist/os/knowledge/index.js.map +1 -1
- package/dist/os/knowledge/knowledge.module.d.ts.map +1 -1
- package/dist/os/knowledge/knowledge.module.js +35 -1
- package/dist/os/knowledge/knowledge.module.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/resolver/resolver.module.d.ts.map +1 -1
- package/dist/os/resolver/resolver.module.js +2 -1
- package/dist/os/resolver/resolver.module.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts +1 -0
- package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-deviations.js +3 -0
- package/dist/os/rfc/handlers/implement-stamp-deviations.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-origin.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-origin.js +10 -2
- package/dist/os/rfc/handlers/implement-stamp-origin.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-outcome.d.ts +2 -0
- package/dist/os/rfc/handlers/implement-stamp-outcome.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-outcome.js +2 -0
- package/dist/os/rfc/handlers/implement-stamp-outcome.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.js +176 -59
- package/dist/os/rfc/handlers/implement-stamp.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 +28 -2
- package/dist/os/rfc/handlers/list-create.js.map +1 -1
- package/dist/os/rfc/reachable-symbol.d.ts.map +1 -1
- package/dist/os/rfc/reachable-symbol.js +4 -2
- 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 +23 -7
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/os/rfc/types.d.ts +22 -2
- package/dist/os/rfc/types.d.ts.map +1 -1
- package/dist/os/rfc/types.js +18 -2
- package/dist/os/rfc/types.js.map +1 -1
- package/dist/os/rfc/verifier/rfc-1391/support.d.ts.map +1 -1
- package/dist/os/rfc/verifier/rfc-1391/support.js +4 -0
- package/dist/os/rfc/verifier/rfc-1391/support.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.map +1 -1
- package/dist/os/session/handlers/session-audit-report.js +4 -0
- package/dist/os/session/handlers/session-audit-report.js.map +1 -1
- package/dist/os/session/handlers/session-audit.d.ts.map +1 -1
- package/dist/os/session/handlers/session-audit.js +4 -0
- package/dist/os/session/handlers/session-audit.js.map +1 -1
- package/dist/os/trajectory/handlers/journal-io.d.ts +9 -0
- package/dist/os/trajectory/handlers/journal-io.d.ts.map +1 -1
- package/dist/os/trajectory/handlers/journal-io.js +20 -2
- package/dist/os/trajectory/handlers/journal-io.js.map +1 -1
- package/dist/os/trajectory/handlers/outcome-record.d.ts.map +1 -1
- package/dist/os/trajectory/handlers/outcome-record.js +4 -1
- package/dist/os/trajectory/handlers/outcome-record.js.map +1 -1
- package/dist/os/trajectory/handlers/trajectory-index.d.ts.map +1 -1
- package/dist/os/trajectory/handlers/trajectory-index.js +30 -8
- package/dist/os/trajectory/handlers/trajectory-index.js.map +1 -1
- package/dist/os/trajectory/handlers/trajectory-recall.d.ts.map +1 -1
- package/dist/os/trajectory/handlers/trajectory-recall.js +7 -4
- package/dist/os/trajectory/handlers/trajectory-recall.js.map +1 -1
- package/dist/os/trajectory/index.d.ts.map +1 -1
- package/dist/os/trajectory/index.js +11 -0
- package/dist/os/trajectory/index.js.map +1 -1
- package/dist/os/trajectory/trajectory.module.d.ts.map +1 -1
- package/dist/os/trajectory/trajectory.module.js +16 -9
- package/dist/os/trajectory/trajectory.module.js.map +1 -1
- package/dist/os/werkstatt/handlers/session-close.d.ts.map +1 -1
- package/dist/os/werkstatt/handlers/session-close.js +3 -0
- package/dist/os/werkstatt/handlers/session-close.js.map +1 -1
- package/dist/os/werkstatt/handlers/session-engine.d.ts.map +1 -1
- package/dist/os/werkstatt/handlers/session-engine.js +3 -0
- package/dist/os/werkstatt/handlers/session-engine.js.map +1 -1
- package/dist/os/werkstatt/handlers/session-open.d.ts.map +1 -1
- package/dist/os/werkstatt/handlers/session-open.js +3 -0
- package/dist/os/werkstatt/handlers/session-open.js.map +1 -1
- package/dist/os/werkstatt/handlers/session-status.d.ts.map +1 -1
- package/dist/os/werkstatt/handlers/session-status.js +3 -0
- package/dist/os/werkstatt/handlers/session-status.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.map +1 -1
- package/dist/src/authority/delegations.js +5 -4
- 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 +1 -5
- package/dist/src/cli-flags.js.map +1 -1
- package/dist/src/compass/invariant-parser.d.ts.map +1 -1
- package/dist/src/compass/invariant-parser.js +2 -1
- package/dist/src/compass/invariant-parser.js.map +1 -1
- package/dist/src/config/forge-config.d.ts +17 -0
- package/dist/src/config/forge-config.d.ts.map +1 -1
- package/dist/src/config/forge-config.js +33 -10
- package/dist/src/config/forge-config.js.map +1 -1
- package/dist/src/formal/exhaustive.d.ts.map +1 -1
- package/dist/src/formal/exhaustive.js +3 -2
- package/dist/src/formal/exhaustive.js.map +1 -1
- package/dist/src/formal/index.d.ts.map +1 -1
- package/dist/src/formal/index.js +4 -0
- package/dist/src/formal/index.js.map +1 -1
- package/dist/src/formal/proof-runner.d.ts.map +1 -1
- package/dist/src/formal/proof-runner.js +4 -3
- package/dist/src/formal/proof-runner.js.map +1 -1
- package/dist/src/formal/proof-spec.d.ts.map +1 -1
- package/dist/src/formal/proof-spec.js +3 -2
- package/dist/src/formal/proof-spec.js.map +1 -1
- 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.map +1 -1
- package/dist/src/knowledge/schema.js +5 -4
- package/dist/src/knowledge/schema.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.js +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 +166 -26
- package/dist/src/onboarding/doctor.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/reachability/command-mentions.d.ts.map +1 -1
- package/dist/src/reachability/command-mentions.js +4 -2
- package/dist/src/reachability/command-mentions.js.map +1 -1
- package/dist/src/registry.d.ts +20 -0
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +129 -67
- package/dist/src/registry.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/maintainers/publishing.md +11 -5
- package/docs/reference/cli.md +128 -0
- package/docs/reference/profiles.md +1 -0
- package/os/agent/handlers/agent-tiers-validate.ts +5 -1
- package/os/agent/index.ts +4 -0
- package/os/authority/handlers/delegate.ts +2 -1
- package/os/authority/index.ts +2 -1
- package/os/checks/checks.module.ts +5 -1
- package/os/checks/handlers/contribution-report.test.ts +6 -0
- package/os/checks/handlers/contribution-report.ts +5 -4
- package/os/checks/handlers/counters-export.test.ts +6 -0
- package/os/checks/handlers/counters-export.ts +4 -0
- package/os/checks/handlers/counters-journal.test.ts +6 -0
- package/os/checks/handlers/counters-journal.ts +2 -1
- package/os/checks/handlers/counters-validate.test.ts +6 -0
- package/os/checks/handlers/counters-validate.ts +5 -1
- package/os/checks/handlers/variant-candidates.test.ts +6 -0
- package/os/checks/index.ts +12 -0
- package/os/compass/handlers/compass-docs-scaffold.ts +1 -1
- package/os/compass/handlers/compass-header-scaffold.ts +6 -1
- package/os/compass/handlers/compass-invariants-generate.ts +3 -2
- package/os/context/context.module.ts +6 -1
- package/os/context/handlers/context-assemble.test.ts +6 -0
- package/os/context/handlers/context-assemble.ts +5 -1
- package/os/context/handlers/context-slate-eval.test.ts +6 -0
- package/os/context/handlers/context-slate-eval.ts +4 -0
- package/os/context/handlers/index-build.test.ts +33 -0
- package/os/context/handlers/index-build.ts +8 -5
- package/os/context/handlers/no-model-deps.test.ts +6 -0
- package/os/context/handlers/slate-fill.test.ts +6 -0
- package/os/context/index.ts +12 -0
- package/os/gate/handlers/gate-probe-catalog.test.ts +6 -0
- package/os/gate/handlers/gate-probe-catalog.ts +4 -0
- package/os/gate/handlers/gate-probe.test.ts +6 -0
- package/os/gate/handlers/gate-probe.ts +4 -0
- package/os/gate/index.ts +12 -0
- package/os/instructions/budget.test.ts +6 -0
- package/os/instructions/instructions.module.ts +2 -1
- package/os/knowledge/handlers/knowledge-authz-probe.test.ts +21 -0
- package/os/knowledge/handlers/knowledge-authz-probe.ts +7 -3
- package/os/knowledge/handlers/knowledge-conflicts-resolve.ts +571 -0
- package/os/knowledge/handlers/knowledge-rebuild.test.ts +6 -0
- package/os/knowledge/handlers/knowledge-rebuild.ts +4 -0
- package/os/knowledge/index.ts +14 -0
- package/os/knowledge/knowledge.module.ts +36 -1
- package/os/queue/decision-ledger.test.ts +32 -1
- package/os/queue/manifest.ts +8 -7
- package/os/resolver/handlers/resolver-doors-audit.test.ts +3 -0
- package/os/resolver/resolver.module.ts +2 -1
- package/os/rfc/handlers/implement-stamp-deviations.ts +4 -1
- package/os/rfc/handlers/implement-stamp-origin.ts +10 -2
- package/os/rfc/handlers/implement-stamp-outcome.ts +4 -2
- package/os/rfc/handlers/implement-stamp-stale.test.ts +2 -1
- package/os/rfc/handlers/implement-stamp.ts +188 -58
- 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 +81 -0
- package/os/rfc/handlers/list-create.ts +34 -2
- package/os/rfc/handlers/validate-rules-rfc1334.test.ts +2 -1
- package/os/rfc/handlers/validate-rules-rfc1453.test.ts +2 -1
- package/os/rfc/handlers/validate-rules-rfc1454.test.ts +2 -1
- package/os/rfc/handlers/validate-rules-rfc1455.test.ts +2 -1
- package/os/rfc/reachable-symbol.ts +4 -2
- package/os/rfc/rfc-0000-template.md +16 -0
- package/os/rfc/rfc.module.ts +26 -7
- package/os/rfc/types.ts +32 -2
- 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/fixtures/no-report.proof.test.ts +4 -0
- package/os/rfc/verifier/rfc-1391/fixtures/small-domain.proof.test.ts +4 -0
- package/os/rfc/verifier/rfc-1391/support.ts +4 -0
- package/os/session/handlers/save.ts +5 -2
- package/os/session/handlers/session-audit-detectors.test.ts +6 -0
- package/os/session/handlers/session-audit-report.test.ts +6 -0
- package/os/session/handlers/session-audit-report.ts +4 -0
- package/os/session/handlers/session-audit.test.ts +6 -0
- package/os/session/handlers/session-audit.ts +4 -0
- package/os/trajectory/handlers/extract-units.test.ts +7 -1
- package/os/trajectory/handlers/journal-io.ts +20 -2
- package/os/trajectory/handlers/outcome-record.test.ts +6 -0
- package/os/trajectory/handlers/outcome-record.ts +4 -1
- package/os/trajectory/handlers/producer-trust.test.ts +6 -0
- package/os/trajectory/handlers/trajectory-index.test.ts +29 -0
- package/os/trajectory/handlers/trajectory-index.ts +31 -8
- package/os/trajectory/handlers/trajectory-recall.test.ts +27 -0
- package/os/trajectory/handlers/trajectory-recall.ts +7 -4
- package/os/trajectory/handlers/trajectory.test.ts +6 -0
- package/os/trajectory/handlers/verdict-binding.test.ts +40 -0
- package/os/trajectory/index.ts +12 -0
- package/os/trajectory/trajectory.module.ts +16 -9
- package/os/werkstatt/handlers/session-close.ts +3 -0
- package/os/werkstatt/handlers/session-engine.ts +3 -0
- package/os/werkstatt/handlers/session-open.ts +3 -0
- package/os/werkstatt/handlers/session-status.ts +3 -0
- 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 +17 -1
- package/skills/fo/fo-knowledge-distill/SKILL.md +6 -5
- package/skills/fo/fo-memory-sync/SKILL.md +3 -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-session-save/SKILL.md +2 -0
- package/skills/shared/grilling/SKILL.md +3 -0
- package/skills/shared/writing-great-skills/SKILL.md +12 -9
- package/src/authority/delegations.ts +5 -4
- package/src/cli-flags.ts +1 -5
- package/src/compass/invariant-parser.ts +2 -1
- package/src/config/forge-config.ts +40 -14
- package/src/formal/exhaustive.ts +3 -2
- package/src/formal/index.ts +4 -0
- package/src/formal/proof-runner.ts +4 -3
- package/src/formal/proof-spec.ts +3 -2
- 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 +5 -4
- package/src/knowledge/sync.ts +281 -7
- package/src/onboarding/agents-generate.ts +1 -1
- package/src/onboarding/compass-docs/semantic-layer-block.ts +1 -1
- package/src/onboarding/doctor.ts +184 -26
- package/src/onboarding/nested-agents-generate.ts +1 -1
- package/src/onboarding/nested-agents-templates.ts +1 -1
- package/src/onboarding/upgrade.ts +18 -10
- package/src/reachability/command-mentions.ts +4 -2
- package/src/registry.ts +153 -74
- package/src/tests/cli-flags.test.ts +1 -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/implement-stamp.test.ts +191 -8
- 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/session-handlers.test.ts +47 -0
- package/src/tests/skill-validate-knowledge.test.ts +93 -2
- package/src/tests/upgrade.test.ts +38 -0
- package/src/validators/skill-validate.ts +37 -9
|
@@ -56,3 +56,68 @@ status: active
|
|
|
56
56
|
**Situation:** Memory or session content contains API keys, passwords, or PII.
|
|
57
57
|
|
|
58
58
|
**Action:** Redact before importing. Replace with `<redacted>` placeholder. Never import raw secrets.
|
|
59
|
+
|
|
60
|
+
### K-0005: Combine compaction-chain sessions into one record
|
|
61
|
+
|
|
62
|
+
```knowledge-entry
|
|
63
|
+
id: K-0005
|
|
64
|
+
layer: L1
|
|
65
|
+
created: 2026-10-18
|
|
66
|
+
status: active
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Situation:** Two or more session transcripts form a continuation chain (context compaction, resume, same opening prompt with timestamps that abut, or an explicit task handoff where one session spawns another), or a completed session has a still-live continuation.
|
|
70
|
+
|
|
71
|
+
**Action:** Offer them as one combined `docs/sessions/` record covering the whole arc, naming each session id in `source.sessions`. If the tail session is live, import the completed portion with an explicit "in progress" marker and let the next sync pick up the rest — a later sync that finds new content in an already-imported session **updates that record in place**, it does not create a second file for the same session id (confirmed 2026-10-19: 5e2a513c continuation appended to its existing record; closed out 2026-10-23). Operator chose combined records four times (2026-10-15: 4fb22aac+2c9fbefe; 2026-10-18: 871402ac+e6120a13; 2026-10-18: 5e2a513c+446544ee task-handoff; 2026-10-23: de15db2f+503603ee+8b6dafa1 via `source.sessions` on the parent's self-saved record).
|
|
72
|
+
|
|
73
|
+
### K-0006: Check for self-saved transcripts before importing
|
|
74
|
+
|
|
75
|
+
```knowledge-entry
|
|
76
|
+
id: K-0006
|
|
77
|
+
layer: L1
|
|
78
|
+
created: 2026-10-23
|
|
79
|
+
status: active
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Situation:** A Claude Code session ran the session-end protocol (`saveSessions: true` → `session.save` / `fo-session-retro` step 0) and already wrote its own `docs/sessions/<date>-<hash>.md` record — typically with `summary: ""` and no `source:` block.
|
|
83
|
+
|
|
84
|
+
**Action:** Do NOT create a second record. Identify the self-saved record by matching its transcript content, commits, or the session's own "транскрипт сохранён: <path>" closing line against `docs/sessions/*.md`. Annotate it in place: add `source: {tool: claude-code, sessions: [<ids>]}` (include spawned children for chains per K-0005), fill `summary`, adjust `types`, and append any transcript tail the self-save missed (e.g. the closing-protocol output itself).
|
|
85
|
+
|
|
86
|
+
### K-0007: Recover compaction-lost arcs into the self-saved record
|
|
87
|
+
|
|
88
|
+
```knowledge-entry
|
|
89
|
+
id: K-0007
|
|
90
|
+
layer: L1
|
|
91
|
+
created: 2026-10-27
|
|
92
|
+
status: active
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Situation:** A self-saved `docs/sessions/` record (K-0006) does not cover the session's whole arc because Claude Code context compactions discarded the earlier portion before `session.save` ran — the record's first transcript entry starts mid-session.
|
|
96
|
+
|
|
97
|
+
**Action:** Recover the missing arc from the session JSONL itself: each compaction writes a "continued from a previous conversation" summary message listing requests, commits, and files. Insert the recovered portion into the existing record's Transcript before its first entry, prefixed by a `>` blockquote noting it was reconstructed from compaction summaries, update `commits`/`relatedArtifacts`/`decisions`/`date`/`duration` to cover the full arc. Do not create a second record (confirmed 2026-10-27: 19b39511's pre-09:00 arc — expert-audit plans + m000210 fixes + glossary-generator fix — prepended to 0ac736).
|
|
98
|
+
|
|
99
|
+
### K-0008: Verify claimed state in memory notes before importing
|
|
100
|
+
|
|
101
|
+
```knowledge-entry
|
|
102
|
+
id: K-0008
|
|
103
|
+
layer: L1
|
|
104
|
+
created: 2026-10-27
|
|
105
|
+
status: active
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Situation:** A memory note of `type: project` describes work-in-progress state ("drafted, implementation pending") for artifacts that live in the repo (RFCs, plans, missions).
|
|
109
|
+
|
|
110
|
+
**Action:** Check the repo before proposing import: if the described artifacts already reached their terminal state (RFC `implemented` + archived, plan executed), the note is stale — list in "Filtered out" with reason "stale — <artifacts> already <state>". Do not offer to import stale notes into `.agents/memory/daily/`; operator declined when asked (2026-10-27, formal-invariant-verification-batch vs implemented RFC-1390..1394; re-confirmed 2026-10-30, same note).
|
|
111
|
+
|
|
112
|
+
### K-0009: Self-save created after the sync record exists
|
|
113
|
+
|
|
114
|
+
```knowledge-entry
|
|
115
|
+
id: K-0009
|
|
116
|
+
layer: L1
|
|
117
|
+
created: 2026-10-30
|
|
118
|
+
status: active
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Situation:** The mirror image of K-0006 — a session ran its own `session.save` (creating a raw self-saved `docs/sessions/` record with `summary: ""` and no `source:` block) AFTER a fo-memory-sync run already created the annotated record for the same session id.
|
|
122
|
+
|
|
123
|
+
**Action:** The sync record stays canonical (it is richer: `source` block, summary, combined chain sessions). Merge any unique content from the self-save into the sync record if the operator asks for tail coverage, then delete the self-save as a duplicate — one record per session id (confirmed 2026-10-30: self-save 2026-10-26-08-00-00-27f385.md deleted, canonical 2026-10-26-11-15-00-a67dda.md kept; operator declined the tail merge. Re-confirmed 2026-10-30: cc3673 merged into canonical 9c753b WITH the tail — merge is wanted when the tail carries real new content like fixes and new RFC drafts; also delete the self-save's `.metrics.yaml` sibling).
|
|
@@ -5,3 +5,13 @@
|
|
|
5
5
|
# Learned Principles
|
|
6
6
|
|
|
7
7
|
<!-- Format: - principle: <text> | confirmations: N | project: <path-or-remote-or-all> -->
|
|
8
|
+
|
|
9
|
+
- principle: Sessions forming a compaction/resume/task-handoff chain are imported as one combined docs/sessions record, not one file per session id | confirmations: 5 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
|
|
10
|
+
- principle: A session that self-saved its transcript (session.save at session end) gets the existing record annotated with source tool/session ids + summary — never a duplicate import record | confirmations: 3 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
|
|
11
|
+
- principle: Operator imports the full relevant set (all sessions + memory notes) rather than cherry-picking — present everything, let them deselect | confirmations: 5 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
|
|
12
|
+
- principle: A self-saved record created after the sync record exists for the same session is a duplicate — merge its unique tail into the canonical sync record and delete the self-save (incl. its .metrics.yaml); skip the merge only when the tail is already durable elsewhere | confirmations: 2 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
|
|
13
|
+
- principle: When an imported record's "in progress" tail session has finished and the record already covers the file end, update the stale marker rather than re-importing | confirmations: 3 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
|
|
14
|
+
- principle: A memory note of type feedback encoding a repo-hygiene/incident rule routes to AGENTS.md (K-0003); operator-workflow preferences route to .agents/operator-profile.md | confirmations: 1 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
|
|
15
|
+
- principle: New content in an already-imported live session extends that record in place with an in-progress marker — never a second file for the same session id | confirmations: 2 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
|
|
16
|
+
- principle: A self-saved record missing its pre-compaction arc gets the missing portion recovered from in-JSONL compaction summaries and inserted before its first transcript entry — never a second record | confirmations: 1 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
|
|
17
|
+
- principle: A memory note describing pending work whose artifacts already reached terminal state in the repo is stale — skip it entirely, including the daily-memory fallback | confirmations: 2 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
|
|
@@ -4,3 +4,33 @@
|
|
|
4
4
|
# Q&A Log
|
|
5
5
|
|
|
6
6
|
<!-- Entries are appended by the skill during runs. Do not hand-edit. -->
|
|
7
|
+
|
|
8
|
+
[2026-10-15] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Import session records for the two Claude Code onboarding-rethink sessions (4fb22aac, 2c9fbefe) into docs/sessions/? All artifacts already committed. A: one combined record → docs/sessions/2026-10-14-23-41-00-4fb22a.md
|
|
9
|
+
|
|
10
|
+
[2026-10-15] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Also scan the Claude session from the sibling pipelines repo (possible W1a response context)? A: skip — scope stays on this repository
|
|
11
|
+
|
|
12
|
+
[2026-10-18] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Import which items from Claude Code? A: all sessions + memory — four docs/sessions records (0fc16e30, 8c92b044, fa620bee, 871402ac+e6120a13) and forge-document-first note → .agents/operator-profile.md
|
|
13
|
+
|
|
14
|
+
[2026-10-18] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: How to handle live session e6120a13 (idle, still running)? A: combine with completed 871402ac into one record marked "in progress" — second time operator chooses combined records for a compaction chain
|
|
15
|
+
|
|
16
|
+
[2026-10-18] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Import the task-handoff chain 5e2a513c → 446544ee (debate/papers analysis → RFC-1330..1334 drafts) as one or two records? A: one combined record → docs/sessions/2026-10-18-12-20-00-5e2a51.md — third time operator chooses combined records for a session chain
|
|
17
|
+
|
|
18
|
+
[2026-10-18] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Update the stale "still live" marker in 2026-10-16-15-26-00-871402 (e6120a13 since completed, no new content)? A: yes — flipped to "completed"; coverage already reached the file end
|
|
19
|
+
|
|
20
|
+
[2026-10-19] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Where to import memory note "never-export-git-dir-for-tests" (repo-hygiene rule + 2026-10-18 incident)? A: root AGENTS.md "Agent foot-gun hardening" section — first memory note routed to AGENTS.md instead of operator-profile
|
|
21
|
+
|
|
22
|
+
[2026-10-19] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: How to cover the new arc of still-live session 5e2a513c (pipeline + major publish + GIT_DIR incident)? A: extend the existing record 2026-10-18-12-20-00-5e2a51.md in place with an "in progress" section — do not create a second file for the same session id
|
|
23
|
+
|
|
24
|
+
[2026-10-23] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Import which items from Claude Code (5 new sessions + 5e2a513c tail)? A: all — new record for ebf9bab8 (2026-10-19-15-11-00-ebf9ba.md); 5e2a51 extended to "completed"; de15db2f+503603ee+8b6dafa1 and 0ad25410 turned out to have SELF-SAVED transcripts (session.save at session end) — annotated existing records 2026-10-18-09-00-00-245a5c.md and 2026-10-21-09-40-00-80a372.md with source/summary instead of creating duplicates
|
|
25
|
+
|
|
26
|
+
[2026-10-27] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Import which items from Claude Code (4 new sessions + 1 new memory note)? A: all three session actions — annotate 06edbb (9f417d7d), extend 0ac736 (19b39511) with the compaction-lost first arc recovered from in-session summaries, new combined record 2026-10-26-11-15-00-a67dda.md (a67ddad8 + spawned 67d135e5). Memory note formal-invariant-verification-batch SKIPPED as stale (claimed "implementation pending" but RFC-1390..1394 all implemented+archived) — verify claimed state against repo before import
|
|
27
|
+
|
|
28
|
+
[2026-10-27] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Save stale memory note to .agents/memory/daily anyway? A: no — skip entirely; stale pending-state notes mislead
|
|
29
|
+
|
|
30
|
+
[2026-10-30] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Import which items from Claude Code (1 new session 9c753bf4, a67ddad8 retro tail, duplicate self-save 27f385)? A: new record for 9c753bf4 only; a67ddad8 tail update declined (retro artifacts already durable in AGENTS.md/frictions.yaml); self-save 27f385 deleted — reverse K-0006: self-save created after the sync record exists, sync record stays canonical
|
|
31
|
+
|
|
32
|
+
[2026-10-30] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Re-add forge-document-first note to operator-profile (lost in the 10-30 rewrite)? A: no — knowledge already covered by PREFERENCES.md §Skill invocation tracking + AGENTS.md
|
|
33
|
+
|
|
34
|
+
[2026-10-30] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Append the 2026-10-29 retro tail to record a67dda (stale "ретро-протокол не выполнялся" line) after initially declining? A: yes — appended tail (F-0020..23, .env rule, 33ce96cbe, K-0009 dedupe note); stale record-state lines get fixed when surfaced
|
|
35
|
+
|
|
36
|
+
[2026-10-30] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Import which items from Claude Code (ddbbfb0c self-save, 9f80dc66, 9c753bf4 tail + cc3673 self-save)? A: all three — annotated 940b47 (source/summary/types/retro tail); 9f80dc66 turned out to have self-saved as d3940c — annotated in place instead of a new record (K-0006 again); cc3673 merged into canonical 9c753b (new arc: switcher fix 00a314a4e/8e324799f, RFC-1453..1455, retro F-0042..44) then deleted with its metrics — K-0009 second confirmation, this time WITH the tail merge (operator declined it earlier only because that tail was already durable elsewhere)
|
|
@@ -24,6 +24,7 @@ triggerPhrases: ["save this session", "enhance session transcript with annotatio
|
|
|
24
24
|
<item>RFC-1097: sweep — SKILL.md headers + classification fixes
|
|
25
25
|
|
|
26
26
|
Sweep batch 1: add Compass v2 headers to 45 SKILL.md files (purpose derived from frontmatter description). Fix non-skill-markdown exclusion to check filename not workspace-relative path (packages/AGENTS.md escaped it). Add .coverage to ignoredDirs.</item>
|
|
27
|
+
<item>RFC-1481: sync namespaces, rollout, and verification guidance</item>
|
|
27
28
|
</CHANGE_SUMMARY>
|
|
28
29
|
-->
|
|
29
30
|
|
|
@@ -74,6 +75,7 @@ Enhance saved session transcripts with semantic annotations, summaries, and qual
|
|
|
74
75
|
- `qa-log.md`: Log any questions asked and operator answers.
|
|
75
76
|
- `learned-principles.md`: New principles learned across sessions.
|
|
76
77
|
- `fix-patterns.md`: Patterns of errors in auto-extraction and their fixes.
|
|
78
|
+
- In a consumer workspace, allocate new local entries as `L-K-NNNN` (max existing local ordinal + 1); Forge source entries remain `K-NNNN`.
|
|
77
79
|
|
|
78
80
|
8. **Report** what was annotated/changed.
|
|
79
81
|
|
|
@@ -27,6 +27,7 @@ Sweep batch 1: add Compass v2 headers to 45 SKILL.md files (purpose derived from
|
|
|
27
27
|
recommended answers, no interview).</item>
|
|
28
28
|
<item>RFC-1455: fixed inputs bound to outcome probes — V-50/V-51 + skills</item>
|
|
29
29
|
<item>RFC-1460: recurring frictions escalate to mechanical measures — FRICTION-06/07/08, registry flips, session-retro escalation</item>
|
|
30
|
+
<item>RFC-1481: sync namespaces, rollout, and verification guidance</item>
|
|
30
31
|
</CHANGE_SUMMARY>
|
|
31
32
|
-->
|
|
32
33
|
|
|
@@ -43,6 +44,8 @@ Mode trigger: `emit` activates only when the invoking skill passes a queue manif
|
|
|
43
44
|
|
|
44
45
|
Read `learned-principles.md` (L2) at the start of each session to improve recommended answers. Apply only entries with `status: active`; skip entries with `status: stale`, `superseded`, or `archived`. Principles with `confirmations >= 3` may be applied autonomously — but re-evaluate if context changes.
|
|
45
46
|
|
|
47
|
+
When writing consumer-local knowledge entries, use the next `L-K-NNNN` ID (max existing local ordinal + 1). Upstream Forge source entries keep `K-NNNN`; do not hand-renumber collision cases — preview and use `forge knowledge.conflicts.resolve`.
|
|
48
|
+
|
|
46
49
|
Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
|
|
47
50
|
|
|
48
51
|
Ask the questions one at a time, waiting for feedback on each question before continuing. Asking multiple questions at once is bewildering.
|
|
@@ -20,6 +20,7 @@ languagePolicy: ref(PREFERENCES.md)
|
|
|
20
20
|
|
|
21
21
|
Sweep batch 1: add Compass v2 headers to 45 SKILL.md files (purpose derived from frontmatter description). Fix non-skill-markdown exclusion to check filename not workspace-relative path (packages/AGENTS.md escaped it). Add .coverage to ignoredDirs.</item>
|
|
22
22
|
<item>RFC-1247: close RFC-1247 review r2 — CHANGE_SUMMARY items on six touched skills, fo-handoff in AGENTS enumeration, glossary applied-instance pointer, recorded per-skill phrase split</item>
|
|
23
|
+
<item>RFC-1481: sync namespaces, rollout, and verification guidance</item>
|
|
23
24
|
</CHANGE_SUMMARY>
|
|
24
25
|
-->
|
|
25
26
|
|
|
@@ -135,15 +136,17 @@ Not every skill needs all three. `grilling` uses L0 and L2 only (no fix patterns
|
|
|
135
136
|
|
|
136
137
|
In addition to the three skill-local layers, there is a fourth tier: the **shared knowledge layer** at `packages/forge/skills/shared/knowledge/learned-principles.md`. This file holds promoted cross-skill principles with `shared/K-NNNN` identifiers.
|
|
137
138
|
|
|
139
|
+
In a consumer workspace, Forge-authored upstream entries retain `K-NNNN`; consumer-authored entries use `L-K-NNNN`, including entries in the consumer's shared-knowledge copy. `forge.skill.validate` accepts both for consumer pack skills and rejects `L-K-NNNN` in Forge source. `forge knowledge.conflicts.resolve` is the explicit remediation path for existing collisions.
|
|
140
|
+
|
|
138
141
|
- **Detection**: `doctor` reports cross-skill duplicate L2 entries via normalized-title matching (exact and bounded containment).
|
|
139
|
-
- **Promotion**: `fo-knowledge-distill` executes promotions under operator grilling — the principle moves to the shared layer with summed confirmations and `promotedFrom` provenance; each skill-local copy is rewritten to a pointer entry (`promotedTo: shared
|
|
140
|
-
- **Consumption**: knowledge-adopting skills read the shared layer at run start and cite
|
|
142
|
+
- **Promotion**: `fo-knowledge-distill` executes promotions under operator grilling — the principle moves to the shared layer with summed confirmations and `promotedFrom` provenance; each skill-local copy is rewritten to a pointer entry (`promotedTo: shared/<entry-id>`, `status: superseded`).
|
|
143
|
+
- **Consumption**: knowledge-adopting skills read the shared layer at run start and cite the canonical upstream or consumer-local shared ID.
|
|
141
144
|
- **Validation**: `doctor` validates the shared layer file for schema validity and id uniqueness (it is not inside a skill directory, so `skill.validate` does not reach it).
|
|
142
145
|
- **npm portability**: the shared layer ships as an empty template — accumulated promotions are project-specific.
|
|
143
146
|
|
|
144
147
|
### Entry format
|
|
145
148
|
|
|
146
|
-
Each knowledge entry is a `### K-NNNN: title` heading followed by a `knowledge-entry` YAML metadata block and a markdown body:
|
|
149
|
+
Each knowledge entry is a `### K-NNNN: title` heading followed by a `knowledge-entry` YAML metadata block and a markdown body. Consumer-local entries use `### L-K-NNNN: title`:
|
|
147
150
|
|
|
148
151
|
````markdown
|
|
149
152
|
### K-0001: Skip non-project sessions
|
|
@@ -165,15 +168,15 @@ status: active
|
|
|
165
168
|
|
|
166
169
|
| Field | Type | Required | Layers | Meaning |
|
|
167
170
|
| --- | --- | --- | --- | --- |
|
|
168
|
-
| `id` | `K-NNNN` | all | all | Unique 4-digit identifier within the file |
|
|
171
|
+
| `id` | `K-NNNN` upstream; `L-K-NNNN` consumer-local | all | all | Unique 4-digit identifier within the file |
|
|
169
172
|
| `layer` | `L0` \| `L1` \| `L2` | all | all | Knowledge layer |
|
|
170
173
|
| `created` | `YYYY-MM-DD` | all | all | Date the entry was first written |
|
|
171
174
|
| `lastConfirmedAt` | `YYYY-MM-DD` \| `null` | L2 only | L2 | Date of last operator confirmation |
|
|
172
175
|
| `confirmations` | integer ≥ 0 | L2 only | L2 | Confirmation counter for autonomous application |
|
|
173
176
|
| `expiresAt` | `YYYY-MM-DD` \| `null` | optional | all | Date after which the entry is stale |
|
|
174
|
-
| `supersedes` | `K-NNNN[]` | optional | all | Entries this one replaces (must resolve in same file) |
|
|
175
|
-
| `promotedTo` | `shared/K-NNNN` \| `null` | optional | all | Cross-file promotion target |
|
|
176
|
-
| `promotedFrom` | `<skill>/K-NNNN[]` | optional | shared | Provenance — which skill-local entries were promoted into this shared entry |
|
|
177
|
+
| `supersedes` | `K-NNNN[]` or `L-K-NNNN[]` | optional | all | Entries this one replaces (must resolve in same file) |
|
|
178
|
+
| `promotedTo` | `shared/K-NNNN` or `shared/L-K-NNNN` \| `null` | optional | all | Cross-file promotion target |
|
|
179
|
+
| `promotedFrom` | `<skill>/K-NNNN[]` or `<skill>/L-K-NNNN[]` | optional | shared | Provenance — which skill-local entries were promoted into this shared entry |
|
|
177
180
|
| `status` | `active` \| `stale` \| `superseded` \| `archived` | all | all | Lifecycle state |
|
|
178
181
|
|
|
179
182
|
#### Layer-specific rules
|
|
@@ -184,13 +187,13 @@ status: active
|
|
|
184
187
|
|
|
185
188
|
#### Knowledge-adjacent files
|
|
186
189
|
|
|
187
|
-
Files declared in `knowledge:` frontmatter that do not use `### K-NNNN:` headings and have no `<!-- knowledge-layer: ... -->` preamble are **knowledge-adjacent** — they are exempt from SKILL-19/SKILL-20. Examples: `forge-about.md`, `operator-profile-template.md`, `project-narrative-template.md`.
|
|
190
|
+
Files declared in `knowledge:` frontmatter that do not use `### K-NNNN:` or `### L-K-NNNN:` headings and have no `<!-- knowledge-layer: ... -->` preamble are **knowledge-adjacent** — they are exempt from SKILL-19/SKILL-20. Examples: `forge-about.md`, `operator-profile-template.md`, `project-narrative-template.md`.
|
|
188
191
|
|
|
189
192
|
#### Validation
|
|
190
193
|
|
|
191
194
|
`skill.validate` enforces:
|
|
192
195
|
- **SKILL-19**: entry metadata schema validity (errors) and legacy section warnings (migration window).
|
|
193
|
-
- **SKILL-20**: identifier uniqueness (
|
|
196
|
+
- **SKILL-20**: identifier uniqueness (K or consumer-local L-K format, no duplicates, `supersedes` references resolve, `promotedTo` format, and local IDs are forbidden in Forge-authored source).
|
|
194
197
|
- **SKILL-21**: hot (L2) and warm (L1) layer character budget warnings — warnings only, never build gates. Defaults: hot=4096, warm=8192. Override in `forge.yaml` under `bindings.knowledge.budgets`.
|
|
195
198
|
|
|
196
199
|
`doctor` reports legacy section counts and knowledge budget summaries as informational warnings.
|
|
@@ -12,12 +12,11 @@ policy plus audit evidence — not a cryptographic security boundary.</purpose>
|
|
|
12
12
|
</non-goals>
|
|
13
13
|
</MODULE_CONTRACT>
|
|
14
14
|
<KEY_DECISIONS>
|
|
15
|
-
<item>Registry absence is tolerance-neutral — ENOENT yields an empty registry;
|
|
16
|
-
<item>DelegationQuery
|
|
17
|
-
<item>sites: "workspace" covers every site;
|
|
15
|
+
<item>Registry absence is tolerance-neutral — ENOENT yields an empty registry; "no file" and "no grant" are identical.</item>
|
|
16
|
+
<item>DelegationQuery's optional grantedBy binds the query to the deciding human — provenance cannot be fabricated cross-grant.</item>
|
|
17
|
+
<item>sites: "workspace" covers every site; explicit id lists bound scope — site-scoped queries never match site-less grants.</item>
|
|
18
18
|
</KEY_DECISIONS>
|
|
19
19
|
<CHANGE_SUMMARY>
|
|
20
|
-
<item>RFC-1400/AMD-014: DELEGABLE_SCOPES gains translation.contract.approve — an operator-confirmed agent may approve a site translation contract under delegation.</item>
|
|
21
20
|
<item>RFC-1336: initial module — schema, scope catalog, loader, resolver, serializer.</item>
|
|
22
21
|
<item>RFC-1336: step 1: forge authority module — delegation registry schema + resolver, four authority.* commands, optional Ed25519 signing</item>
|
|
23
22
|
<item>RFC-1336: delegated editorial sign-off (RFC-1336 step 3)
|
|
@@ -32,6 +31,8 @@ delegate — a journaled no-op with no delegation, so the operator path is
|
|
|
32
31
|
unchanged. certify/promote precondition remediation now names an active
|
|
33
32
|
delegation when one covers the site.</item>
|
|
34
33
|
<item>RFC-1336: delegated rfc.decision/version.major/onboarding.decision + docs (RFC-1336 steps 4-5)</item>
|
|
34
|
+
<item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
|
|
35
|
+
<history>RFC-1400</history>
|
|
35
36
|
</CHANGE_SUMMARY>
|
|
36
37
|
*/
|
|
37
38
|
|
package/src/cli-flags.ts
CHANGED
|
@@ -11,13 +11,9 @@ with `TypeError: targetId.toLowerCase is not a function`.</purpose>
|
|
|
11
11
|
</non-goals>
|
|
12
12
|
</MODULE_CONTRACT>
|
|
13
13
|
<CHANGE_SUMMARY>
|
|
14
|
-
<item>Standalone port of kernel argv resolution for the forge CLI (RFC-0260 lineage): strict KERNEL-FLAG-01/02/03 + KERNEL-ARG-01 diagnostics for schema-carrying commands, legacy heuristic parse (with KERNEL-ARG-01) for schema-less commands; repeated single-value string flags diagnose instead of silently promoting to an array that crashes handlers; indexOf-based inline-value split preserves values containing "=" that split("=", 2) silently truncated.</item>
|
|
15
|
-
<item>Session-retro 2026-10-08: string[] flags greedily consume consecutive
|
|
16
|
-
bare tokens until the next --flag (`--files a b` → ["a","b"]), matching the
|
|
17
|
-
kernel argv parser; bare positionals without a preceding string[] flag still
|
|
18
|
-
emit KERNEL-ARG-01.</item>
|
|
19
14
|
<item>RFC-1389 (port of RFC-1381): bare `-m` rewrites to `--message` when the merged schema declares `message` — other `-x` tokens stay KERNEL-ARG-01, now with honest hints (a known declared short alias, the command's single unsatisfied required non-boolean flag, or a truthful see-`--help` fallback) instead of the fabricated `--id <token>` template; alias-shaped tokens are never consumed as flag values.</item>
|
|
20
15
|
<item>RFC-1395: port --output → --json alias into forge CLI parser</item>
|
|
16
|
+
<item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
|
|
21
17
|
</CHANGE_SUMMARY>
|
|
22
18
|
*/
|
|
23
19
|
|
|
@@ -13,7 +13,7 @@ cross-package consumers (e.g. werkstatt-site TEST-WEAKEN-10) via
|
|
|
13
13
|
</MODULE_CONTRACT>
|
|
14
14
|
<KEY_DECISIONS>
|
|
15
15
|
<item>A marker must open the comment payload — a mid-comment `@ai-invariant` mention is prose, not a declaration.</item>
|
|
16
|
-
<item>The statement runs over contiguous comment lines until
|
|
16
|
+
<item>The statement runs over contiguous comment lines until code, blank, delimiter, or a fresh marker; `(checked-by: …)` wraps likewise.</item>
|
|
17
17
|
<item>Statement identity is sha256 over whitespace-normalized text — re-indentation and reflow are not weakening; word changes are.</item>
|
|
18
18
|
</KEY_DECISIONS>
|
|
19
19
|
<CHANGE_SUMMARY>
|
|
@@ -28,6 +28,7 @@ numeric bound), bound @ai-invariant removed-reworded-unbound via the new
|
|
|
28
28
|
covers implementation files and proof specs. Warn-only until the census
|
|
29
29
|
is operator-accepted — TEST_WEAKEN_ENFORCED keeps {01..06}; EC-22 records
|
|
30
30
|
advisory rules in the Test-Weakened trailer.</item>
|
|
31
|
+
<item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
|
|
31
32
|
</CHANGE_SUMMARY>
|
|
32
33
|
*/
|
|
33
34
|
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
</non-goals>
|
|
7
7
|
</MODULE_CONTRACT>
|
|
8
8
|
<CHANGE_SUMMARY>
|
|
9
|
-
<item>RFC-1332: step 1 — verifyReproduction binding key; drop platform ids from pipeline skill text (SKILL-17)</item>
|
|
10
9
|
<item>RFC-1365: step 1 — contractProducers schema + conformance execution path</item>
|
|
11
10
|
<item>RFC-1391: make the formal verification tier checker-bound (RFC-1391)</item>
|
|
12
11
|
<item>RFC-1391: close RFC-1391 review r1 findings — evidence freshness, config classification, contract guards
|
|
@@ -18,7 +17,8 @@ required in formal.tools.command; spec/entry paths are confined to the
|
|
|
18
17
|
workspace; the exhaustive entry dispatches per packageManager; proved runs
|
|
19
18
|
record log, counterexample stays the refuted-path record.</item>
|
|
20
19
|
<item>RFC-1453: executed outcome probes, IMP-14 surface gate, outcome.serve + V-47/V-48</item>
|
|
21
|
-
<
|
|
20
|
+
<item>RFC-1481: close REVIEW-CODE-2026-11-01-11 findings on resolver safety, IO boundaries, and reporting</item>
|
|
21
|
+
<history>RFC-0391, RFC-0393, RFC-0537, RFC-0538, RFC-0539, RFC-0540, RFC-0543, RFC-0546, RFC-0639, RFC-0640, RFC-0643, RFC-0661, RFC-0662, RFC-0704, RFC-1097, RFC-1224, RFC-1332</history>
|
|
22
22
|
</CHANGE_SUMMARY>
|
|
23
23
|
*/
|
|
24
24
|
|
|
@@ -498,16 +498,13 @@ export function defaultForgeConfig(projectName: string, packageManager?: string)
|
|
|
498
498
|
// Loader
|
|
499
499
|
// ---------------------------------------------------------------------------
|
|
500
500
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
const raw = fs.readFileSync(configPath, "utf8");
|
|
501
|
+
/**
|
|
502
|
+
* Parse and schema-validate a forge.yaml document — the pure part of
|
|
503
|
+
* `loadForgeConfig` shared with WorkspaceIO-backed readers that must not touch
|
|
504
|
+
* the ambient filesystem. Recovers the declared profile id (RFC-1118) but does
|
|
505
|
+
* not resolve the profile catalog; callers set `profileResolution` themselves.
|
|
506
|
+
*/
|
|
507
|
+
export function parseForgeConfigDocument(raw: string, configPath: string): ForgeConfig {
|
|
511
508
|
let parsed: unknown;
|
|
512
509
|
try {
|
|
513
510
|
parsed = parseYaml(raw);
|
|
@@ -536,6 +533,24 @@ export function loadForgeConfig(workspaceRoot: string, forgeRootOverride?: strin
|
|
|
536
533
|
? String((rawProfile as { id: unknown }).id)
|
|
537
534
|
: undefined;
|
|
538
535
|
|
|
536
|
+
const config = { ...rawData } as unknown as ForgeConfig;
|
|
537
|
+
config.profileDeclaredId = profileId;
|
|
538
|
+
return config;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
export function loadForgeConfig(workspaceRoot: string, forgeRootOverride?: string): ForgeConfig {
|
|
542
|
+
const configPath = path.join(workspaceRoot, "forge.yaml");
|
|
543
|
+
|
|
544
|
+
if (!fs.existsSync(configPath)) {
|
|
545
|
+
throw new Error(
|
|
546
|
+
`forge.yaml not found at ${configPath}. Run 'forge create' to create project configuration.`,
|
|
547
|
+
);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
const raw = fs.readFileSync(configPath, "utf8");
|
|
551
|
+
const config = parseForgeConfigDocument(raw, configPath);
|
|
552
|
+
const profileId = config.profileDeclaredId;
|
|
553
|
+
|
|
539
554
|
// RFC-0643: load stack profile when `profile` field is present in forge.yaml
|
|
540
555
|
let loadedProfile: StackProfile | undefined;
|
|
541
556
|
let catalogAvailable = false;
|
|
@@ -555,9 +570,7 @@ export function loadForgeConfig(workspaceRoot: string, forgeRootOverride?: strin
|
|
|
555
570
|
}
|
|
556
571
|
}
|
|
557
572
|
|
|
558
|
-
const config = { ...rawData } as unknown as ForgeConfig;
|
|
559
573
|
// RFC-1118: preserve the declared id and its resolution status — never silently drop it
|
|
560
|
-
config.profileDeclaredId = profileId;
|
|
561
574
|
config.profileResolution = !profileId
|
|
562
575
|
? "absent"
|
|
563
576
|
: loadedProfile
|
|
@@ -654,6 +667,19 @@ export function resolveForgeRoot(workspaceRoot: string): string {
|
|
|
654
667
|
);
|
|
655
668
|
}
|
|
656
669
|
|
|
670
|
+
/**
|
|
671
|
+
* True when `forgeRoot` is a development checkout (monorepo `packages/forge`,
|
|
672
|
+
* or the forge repo itself) rather than an npm-installed package. The
|
|
673
|
+
* published tarball ships `src/` and `os/` via the `files` field, so source
|
|
674
|
+
* dirs alone cannot distinguish the two — the `node_modules` path segment
|
|
675
|
+
* can, because npm layouts always resolve through it. Source-scanning
|
|
676
|
+
* checks (autonomy-guard, dist-freshness) gate on this: an installed
|
|
677
|
+
* package's source is immutable, so violations are not actionable there.
|
|
678
|
+
*/
|
|
679
|
+
export function isForgeSourceCheckout(forgeRoot: string): boolean {
|
|
680
|
+
return !forgeRoot.split(/[\\/]/).includes("node_modules");
|
|
681
|
+
}
|
|
682
|
+
|
|
657
683
|
/**
|
|
658
684
|
* Resolve the forge package root from inside the package's own modules.
|
|
659
685
|
* Handles both source layout (`src/<dir>/` → package root is two levels up)
|
package/src/formal/exhaustive.ts
CHANGED
|
@@ -14,8 +14,8 @@ caller derives the verdict from the report — never from an exit code alone.
|
|
|
14
14
|
</non-goals>
|
|
15
15
|
</MODULE_CONTRACT>
|
|
16
16
|
<KEY_DECISIONS>
|
|
17
|
-
<item>Two-pass enumeration: a domain
|
|
18
|
-
<item>Report mode suppresses the throw
|
|
17
|
+
<item>Two-pass enumeration: a domain not iterable twice with equal counts is non-deterministic and refused.</item>
|
|
18
|
+
<item>Report mode suppresses the throw — a refuted run still writes its counterexample report.</item>
|
|
19
19
|
</KEY_DECISIONS>
|
|
20
20
|
<CHANGE_SUMMARY>
|
|
21
21
|
<item>RFC-1391: exhaustive runner + exhaustiveVerdict count/failure gate.</item>
|
|
@@ -28,6 +28,7 @@ config is error not unavailable, and both surfaces share one path; {entry} is
|
|
|
28
28
|
required in formal.tools.command; spec/entry paths are confined to the
|
|
29
29
|
workspace; the exhaustive entry dispatches per packageManager; proved runs
|
|
30
30
|
record log, counterexample stays the refuted-path record.</item>
|
|
31
|
+
<item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
|
|
31
32
|
</CHANGE_SUMMARY>
|
|
32
33
|
*/
|
|
33
34
|
|
package/src/formal/index.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/*
|
|
2
2
|
<MODULE_CONTRACT>
|
|
3
3
|
<purpose>RFC-1391: public surface of @warpgogol/forge/formal — proof-spec schema, verdict types, and the built-in exhaustive runner.</purpose>
|
|
4
|
+
<non-goals>
|
|
5
|
+
<item>TODO(compass): record the boundary this file must not take on.</item>
|
|
6
|
+
</non-goals>
|
|
4
7
|
</MODULE_CONTRACT>
|
|
5
8
|
<CHANGE_SUMMARY>
|
|
6
9
|
<item>RFC-1391: initial formal-tier export.</item>
|
|
7
10
|
<item>RFC-1391: make the formal verification tier checker-bound (RFC-1391)</item>
|
|
11
|
+
<item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
|
|
8
12
|
</CHANGE_SUMMARY>
|
|
9
13
|
*/
|
|
10
14
|
|
|
@@ -14,12 +14,11 @@ surfaces share one verdict path.
|
|
|
14
14
|
</non-goals>
|
|
15
15
|
</MODULE_CONTRACT>
|
|
16
16
|
<KEY_DECISIONS>
|
|
17
|
-
<item>specSha256/entrySha256 are computed whenever
|
|
18
|
-
<item>`exhaustive` runs
|
|
17
|
+
<item>specSha256/entrySha256 are computed whenever readable — evidence binds to bytes for every verdict.</item>
|
|
18
|
+
<item>`exhaustive` runs via vitest with FORGE_PROOF_REPORT — the report file, not the exit code, carries the verdict.</item>
|
|
19
19
|
<item>External tools map exit 0 → proved, non-zero → refuted (captured output persisted), ENOENT → unavailable, version-regex miss/mismatch → error.</item>
|
|
20
20
|
</KEY_DECISIONS>
|
|
21
21
|
<CHANGE_SUMMARY>
|
|
22
|
-
<item>RFC-1391: shared runProofCheck execution path (tool resolution, version pin, report parsing, log persistence).</item>
|
|
23
22
|
<item>RFC-1391: make the formal verification tier checker-bound (RFC-1391)</item>
|
|
24
23
|
<item>RFC-1391: close RFC-1391 review r1 findings — evidence freshness, config classification, contract guards
|
|
25
24
|
|
|
@@ -43,6 +42,8 @@ REVIEW-CODE-2026-10-24-06 (approved): log is now asserted on the exhaustive
|
|
|
43
42
|
refuted and no-report tests; external-tool timedOut persists partial output
|
|
44
43
|
as log (symmetric with exhaustive); log doc comments updated to reflect
|
|
45
44
|
all-post-spawn-verdicts attachment.</item>
|
|
45
|
+
<item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
|
|
46
|
+
<history>RFC-1391</history>
|
|
46
47
|
</CHANGE_SUMMARY>
|
|
47
48
|
*/
|
|
48
49
|
|
package/src/formal/proof-spec.ts
CHANGED
|
@@ -14,8 +14,8 @@ boundary; evidence binds to the spec and entry bytes via sha256.
|
|
|
14
14
|
<KEY_DECISIONS>
|
|
15
15
|
<item>`.strict()` — unknown keys are rejected: a proof spec is evidence, so silent stripping would hide author typos.</item>
|
|
16
16
|
<item>`domain.cardinality` stays schema-optional (external checkers need no declared domain); the `exhaustive` runner errors on its absence.</item>
|
|
17
|
-
<item>`assumptions`, `trustedBase`,
|
|
18
|
-
<item>`tool` is the closed ProofTool enum — the set grows only by RFC
|
|
17
|
+
<item>`assumptions`, `trustedBase`, `unverifiedBoundaries` are `.min(1)` — prove-everything specs are refused by shape.</item>
|
|
18
|
+
<item>`tool` is the closed ProofTool enum — the set grows only by RFC.</item>
|
|
19
19
|
</KEY_DECISIONS>
|
|
20
20
|
<CHANGE_SUMMARY>
|
|
21
21
|
<item>RFC-1391: forge/proof-spec@1 schema, ProofSpec/ProofTool/ProofVerdict/ProofCheckResult types.</item>
|
|
@@ -34,6 +34,7 @@ REVIEW-CODE-2026-10-24-06 (approved): log is now asserted on the exhaustive
|
|
|
34
34
|
refuted and no-report tests; external-tool timedOut persists partial output
|
|
35
35
|
as log (symmetric with exhaustive); log doc comments updated to reflect
|
|
36
36
|
all-post-spawn-verdicts attachment.</item>
|
|
37
|
+
<item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
|
|
37
38
|
</CHANGE_SUMMARY>
|
|
38
39
|
*/
|
|
39
40
|
|
package/src/index.ts
CHANGED
package/src/knowledge/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
<MODULE_CONTRACT>
|
|
3
|
-
<purpose>Barrel export for the knowledge module — parser, serializer, schema, and
|
|
3
|
+
<purpose>Barrel export for the knowledge module — parser, serializer, schema, lifecycle operations, and explicit conflict resolution.</purpose>
|
|
4
4
|
<non-goals>
|
|
5
5
|
<item>Do not re-export from @warpgogol/* — forge src/ is portable.</item>
|
|
6
6
|
</non-goals>
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
<CHANGE_SUMMARY>
|
|
9
9
|
<item>RFC-0660: initial knowledge module barrel export.</item>
|
|
10
10
|
<item>RFC-0663: added promote.ts exports for cross-skill duplicate detection and promotion planning.</item>
|
|
11
|
+
<item>RFC-1481: export content parsing, conflict planning, local-ID allocation, and explicit-IO resolution.</item>
|
|
11
12
|
</CHANGE_SUMMARY>
|
|
12
13
|
*/
|
|
13
14
|
|
|
14
|
-
export { parseKnowledgeFile } from "./parse.ts";
|
|
15
|
+
export { parseKnowledgeContent, parseKnowledgeFile } from "./parse.ts";
|
|
15
16
|
export { serializeKnowledgeFile } from "./serialize.ts";
|
|
16
17
|
export {
|
|
17
18
|
knowledgeEntryMetaSchema,
|
|
@@ -53,7 +54,15 @@ export {
|
|
|
53
54
|
} from "./promote.ts";
|
|
54
55
|
export {
|
|
55
56
|
planKnowledgeSync,
|
|
57
|
+
planKnowledgeConflictResolution,
|
|
58
|
+
resolveKnowledgeConflicts,
|
|
59
|
+
allocateLocalKnowledgeId,
|
|
56
60
|
syncKnowledgeFile,
|
|
61
|
+
type KnowledgeConflictResolution,
|
|
62
|
+
type KnowledgeConflictResolutionPlan,
|
|
63
|
+
type KnowledgeConflictIssue,
|
|
64
|
+
type KnowledgeConflictUnresolvedReason,
|
|
65
|
+
type KnowledgeReferenceRemap,
|
|
57
66
|
type KnowledgeSyncAction,
|
|
58
67
|
type KnowledgeSyncResult,
|
|
59
68
|
type KnowledgeSyncPlan,
|
package/src/knowledge/parse.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
</MODULE_CONTRACT>
|
|
9
9
|
<CHANGE_SUMMARY>
|
|
10
10
|
<item>RFC-0660: initial tolerant parser for structured knowledge entries.</item>
|
|
11
|
+
<item>RFC-1481: parse both upstream K-NNNN and consumer-local L-K-NNNN headings from explicit content.</item>
|
|
11
12
|
</CHANGE_SUMMARY>
|
|
12
13
|
*/
|
|
13
14
|
|
|
@@ -24,7 +25,7 @@ import {
|
|
|
24
25
|
type ParsedKnowledgeFile,
|
|
25
26
|
} from "./schema.ts";
|
|
26
27
|
|
|
27
|
-
const ENTRY_HEADING_PATTERN = /^###\s+(K-\d{4})\s*:\s*(.+)$/;
|
|
28
|
+
const ENTRY_HEADING_PATTERN = /^###\s+((?:L-)?K-\d{4})\s*:\s*(.+)$/;
|
|
28
29
|
const KNOWLEDGE_ENTRY_FENCE = "knowledge-entry";
|
|
29
30
|
const LAYER_COMMENT_PATTERN = /<!--\s*knowledge-layer:\s*(L[012])\s*-->/;
|
|
30
31
|
|
|
@@ -42,22 +43,7 @@ function detectLayer(content: string, fileName: string): KnowledgeLayer | null {
|
|
|
42
43
|
return FILENAME_LAYER_MAP[fileName] ?? null;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
export function
|
|
46
|
-
let content: string;
|
|
47
|
-
try {
|
|
48
|
-
content = fs.readFileSync(filePath, "utf-8");
|
|
49
|
-
} catch {
|
|
50
|
-
// File read errors (EISDIR, ENOENT, etc.) — return empty result
|
|
51
|
-
return {
|
|
52
|
-
path: filePath,
|
|
53
|
-
layer: null,
|
|
54
|
-
preamble: "",
|
|
55
|
-
entries: [],
|
|
56
|
-
legacySections: [],
|
|
57
|
-
parseIssues: [],
|
|
58
|
-
isKnowledgeAdjacent: true,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
46
|
+
export function parseKnowledgeContent(content: string, filePath: string): ParsedKnowledgeFile {
|
|
61
47
|
const fileName = path.basename(filePath);
|
|
62
48
|
const lines = content.split(/\r?\n/);
|
|
63
49
|
const layer = detectLayer(content, fileName);
|
|
@@ -225,3 +211,20 @@ export function parseKnowledgeFile(filePath: string): ParsedKnowledgeFile {
|
|
|
225
211
|
isKnowledgeAdjacent: false,
|
|
226
212
|
};
|
|
227
213
|
}
|
|
214
|
+
|
|
215
|
+
export function parseKnowledgeFile(filePath: string): ParsedKnowledgeFile {
|
|
216
|
+
try {
|
|
217
|
+
return parseKnowledgeContent(fs.readFileSync(filePath, "utf-8"), filePath);
|
|
218
|
+
} catch {
|
|
219
|
+
// File read errors (EISDIR, ENOENT, etc.) — return empty result
|
|
220
|
+
return {
|
|
221
|
+
path: filePath,
|
|
222
|
+
layer: null,
|
|
223
|
+
preamble: "",
|
|
224
|
+
entries: [],
|
|
225
|
+
legacySections: [],
|
|
226
|
+
parseIssues: [],
|
|
227
|
+
isKnowledgeAdjacent: true,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
}
|
package/src/knowledge/schema.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
<item>RFC-0660: initial knowledge entry metadata schema with L0/L1/L2 layer-specific refinements.</item>
|
|
11
11
|
<item>RFC-0663: added promotedFrom field for shared-layer provenance tracking.</item>
|
|
12
12
|
<item>RFC-1468: bind authz-relevant knowledge to authoritative sources — knowledge.rebuild + knowledge.authz.probe, KAUTHZ-01..03</item>
|
|
13
|
+
<item>RFC-1481: accept upstream K-NNNN and consumer-local L-K-NNNN entry IDs and references.</item>
|
|
13
14
|
</CHANGE_SUMMARY>
|
|
14
15
|
*/
|
|
15
16
|
|
|
@@ -18,12 +19,12 @@ import { z } from "zod";
|
|
|
18
19
|
export type KnowledgeLayer = "L0" | "L1" | "L2";
|
|
19
20
|
export type KnowledgeEntryStatus = "active" | "stale" | "superseded" | "archived";
|
|
20
21
|
|
|
21
|
-
const ENTRY_ID_PATTERN = /^K-\d{4}$/;
|
|
22
|
-
const PROMOTED_TO_PATTERN = /^shared\/K-\d{4}$/;
|
|
23
|
-
const PROMOTED_FROM_PATTERN = /^[a-z0-9-]+\/K-\d{4}$/;
|
|
22
|
+
const ENTRY_ID_PATTERN = /^(?:L-)?K-\d{4}$/;
|
|
23
|
+
const PROMOTED_TO_PATTERN = /^shared\/(?:L-)?K-\d{4}$/;
|
|
24
|
+
const PROMOTED_FROM_PATTERN = /^[a-z0-9-]+\/(?:L-)?K-\d{4}$/;
|
|
24
25
|
|
|
25
26
|
const baseMetaSchema = z.object({
|
|
26
|
-
id: z.string().regex(ENTRY_ID_PATTERN, "id must match ^K-\\d{4}$"),
|
|
27
|
+
id: z.string().regex(ENTRY_ID_PATTERN, "id must match ^(?:L-)?K-\\d{4}$"),
|
|
27
28
|
layer: z.enum(["L0", "L1", "L2"]),
|
|
28
29
|
created: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "created must be YYYY-MM-DD"),
|
|
29
30
|
lastConfirmedAt: z.union([z.string().regex(/^\d{4}-\d{2}-\d{2}$/), z.null()]).optional(),
|