@mnstry/atelier 0.2.0-alpha.12 → 0.2.0-alpha.14
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 +894 -0
- package/README.md +159 -6
- package/contracts/atelier-adoption-policy.v2.schema.json +55 -0
- package/contracts/atelier-architecture.v1.schema.json +258 -0
- package/contracts/atelier-boundary-delegations.v1.schema.json +161 -0
- package/contracts/atelier-boundary-owner-keys.v1.schema.json +98 -0
- package/contracts/atelier-build.v1.schema.json +1076 -0
- package/contracts/atelier-capability.v1.schema.json +1252 -0
- package/contracts/atelier-coordination.v1.schema.json +1050 -0
- package/contracts/atelier-evidence-navigation.v1.schema.json +603 -0
- package/contracts/atelier-harness.v1.schema.json +234 -0
- package/contracts/atelier-ingestion.v1.schema.json +806 -0
- package/contracts/atelier-inquiry.v1.schema.json +1772 -0
- package/contracts/atelier-instruction-adoption.v1.schema.json +490 -0
- package/contracts/atelier-interaction.v1.schema.json +553 -0
- package/contracts/atelier-judgment.v1.schema.json +690 -0
- package/contracts/atelier-knowledge.v1.schema.json +1512 -0
- package/contracts/atelier-learning.v1.schema.json +1095 -0
- package/contracts/atelier-migration.v3.schema.json +64 -0
- package/contracts/atelier-personal-workspace-manifest.v1.schema.json +87 -0
- package/contracts/atelier-personal-workspace-overlay.v1.schema.json +299 -0
- package/contracts/atelier-template-adoption.v1.schema.json +223 -0
- package/contracts/atelier-template-profile.v1.schema.json +1168 -0
- package/contracts/atelier-trackable.v1.schema.json +781 -0
- package/contracts/atelier-upgrade-plan.v3.schema.json +532 -0
- package/docs/architecture.md +89 -0
- package/docs/assurance-controls.md +2 -2
- package/docs/blocks/capability-stewardship.md +17 -0
- package/docs/blocks/claims.md +16 -3
- package/docs/blocks/inquiry-harnesses.md +19 -0
- package/docs/blocks/learning-harnesses.md +17 -0
- package/docs/capability-stewardship.md +267 -0
- package/docs/coordination.md +51 -0
- package/docs/decision-practices.md +111 -0
- package/docs/decisions.md +29 -0
- package/docs/evidence-navigation.md +237 -0
- package/docs/exact-upgrades.md +3 -2
- package/docs/ingestion.md +181 -0
- package/docs/inquiry-harnesses.md +210 -0
- package/docs/install.md +80 -3
- package/docs/intake-and-guides.md +5 -0
- package/docs/integration-contract-decisions.md +24 -2
- package/docs/interaction-and-reflection.md +72 -0
- package/docs/knowledge-graph.md +20 -0
- package/docs/knowledge-health/api.md +30 -0
- package/docs/knowledge-health/assessment/api.md +96 -0
- package/docs/knowledge-health/assessment/capabilities.md +40 -0
- package/docs/knowledge-health/assessment/evaluation.md +27 -0
- package/docs/knowledge-health/assessment/facilitator.md +30 -0
- package/docs/knowledge-health/assessment/quickstart.md +61 -0
- package/docs/knowledge-health/assessment/troubleshooting.md +23 -0
- package/docs/knowledge-health/devday/facilitator.md +16 -0
- package/docs/knowledge-health/devday/participant-response.md +22 -0
- package/docs/knowledge-health/devday/public-default.md +107 -0
- package/docs/knowledge-health/devday/quickstart.md +18 -0
- package/docs/knowledge-health/devday/support.md +22 -0
- package/docs/knowledge-health/exercise.md +17 -0
- package/docs/knowledge-health/facilitator.md +20 -0
- package/docs/knowledge-health/quickstart.md +94 -0
- package/docs/knowledge-health/readme.md +15 -0
- package/docs/knowledge-health/support.md +34 -0
- package/docs/knowledge-setup.md +248 -0
- package/docs/knowledge-workspace.md +264 -0
- package/docs/learning-harnesses.md +237 -0
- package/docs/learning.md +215 -0
- package/docs/local-services.md +223 -19
- package/docs/obsidian-contract.md +246 -15
- package/docs/obsidian-plugin.md +252 -7
- package/docs/obsidian.md +874 -52
- package/docs/optional-ingestion.md +83 -0
- package/docs/personal-workspace.md +266 -0
- package/docs/practical-judgment.md +92 -0
- package/docs/progressive-ingestion-acceptance.md +89 -0
- package/docs/progressive-ingestion.md +235 -0
- package/docs/project-command-inventory.md +1 -0
- package/docs/release-engineering.md +50 -0
- package/docs/repo-boundary-guard.md +120 -3
- package/docs/research-starter-quickstart.md +66 -0
- package/docs/research-starter.md +114 -0
- package/docs/semantic-ingestion.md +198 -0
- package/docs/semantic-operation.md +318 -0
- package/docs/skill-steward.md +6 -0
- package/docs/template-profile.md +164 -0
- package/docs/template-upgrades.md +114 -0
- package/docs/trackables.md +111 -0
- package/docs/upgrade.md +219 -2
- package/fixtures/atelier-architecture/binding/invalid/document.json +19 -0
- package/fixtures/atelier-architecture/binding/valid/document.json +19 -0
- package/fixtures/atelier-architecture/catalog/invalid/document.json +290 -0
- package/fixtures/atelier-architecture/catalog/valid/document.json +343 -0
- package/fixtures/atelier-build-contract/attempt/invalid/document.json +20 -0
- package/fixtures/atelier-build-contract/attempt/valid/document.json +19 -0
- package/fixtures/atelier-build-contract/candidate/invalid/document.json +24 -0
- package/fixtures/atelier-build-contract/candidate/valid/document.json +23 -0
- package/fixtures/atelier-build-contract/decision/invalid/document.json +31 -0
- package/fixtures/atelier-build-contract/decision/valid/document.json +30 -0
- package/fixtures/atelier-build-contract/delivery/invalid/document.json +18 -0
- package/fixtures/atelier-build-contract/delivery/valid/document.json +17 -0
- package/fixtures/atelier-build-contract/gate/invalid/document.json +22 -0
- package/fixtures/atelier-build-contract/gate/valid/document.json +21 -0
- package/fixtures/atelier-build-contract/ledger/invalid/document.json +270 -0
- package/fixtures/atelier-build-contract/ledger/valid/document.json +269 -0
- package/fixtures/atelier-build-contract/objective/invalid/document.json +73 -0
- package/fixtures/atelier-build-contract/objective/valid/document.json +72 -0
- package/fixtures/atelier-build-contract/progress/invalid/document.json +18 -0
- package/fixtures/atelier-build-contract/progress/valid/document.json +17 -0
- package/fixtures/atelier-capability-contract/adoption/invalid/document.json +71 -0
- package/fixtures/atelier-capability-contract/adoption/valid/document.json +70 -0
- package/fixtures/atelier-capability-contract/event/invalid/document.json +18 -0
- package/fixtures/atelier-capability-contract/event/valid/document.json +17 -0
- package/fixtures/atelier-capability-contract/journal/invalid/document.json +382 -0
- package/fixtures/atelier-capability-contract/journal/valid/document.json +381 -0
- package/fixtures/atelier-capability-contract/notice/invalid/document.json +8 -0
- package/fixtures/atelier-capability-contract/notice/valid/document.json +7 -0
- package/fixtures/atelier-capability-contract/package/invalid/document.json +59 -0
- package/fixtures/atelier-capability-contract/package/valid/document.json +58 -0
- package/fixtures/atelier-capability-contract/plan/invalid/document.json +107 -0
- package/fixtures/atelier-capability-contract/plan/valid/document.json +106 -0
- package/fixtures/atelier-capability-contract/release/invalid/document.json +85 -0
- package/fixtures/atelier-capability-contract/release/valid/document.json +84 -0
- package/fixtures/atelier-capability-contract/state/invalid/document.json +316 -0
- package/fixtures/atelier-capability-contract/state/valid/document.json +315 -0
- package/fixtures/atelier-coordination/dependency/invalid/document.json +37 -0
- package/fixtures/atelier-coordination/dependency/valid/document.json +36 -0
- package/fixtures/atelier-coordination/directive/invalid/document.json +25 -0
- package/fixtures/atelier-coordination/directive/valid/document.json +24 -0
- package/fixtures/atelier-coordination/disposition/invalid/document.json +34 -0
- package/fixtures/atelier-coordination/disposition/valid/document.json +33 -0
- package/fixtures/atelier-coordination/outcome/invalid/document.json +39 -0
- package/fixtures/atelier-coordination/outcome/valid/document.json +38 -0
- package/fixtures/atelier-coordination/recovery/invalid/document.json +34 -0
- package/fixtures/atelier-coordination/recovery/valid/document.json +33 -0
- package/fixtures/atelier-harness-contract/handoff/invalid/document.json +25 -0
- package/fixtures/atelier-harness-contract/handoff/valid/document.json +24 -0
- package/fixtures/atelier-ingestion/invalid/authority.json +19 -0
- package/fixtures/atelier-ingestion/semantic-baseline.json +26 -0
- package/fixtures/atelier-ingestion/semantic-operation.json +75 -0
- package/fixtures/atelier-ingestion/valid/plan-input.json +18 -0
- package/fixtures/atelier-inquiry-contract/assessment/invalid/document.json +41 -0
- package/fixtures/atelier-inquiry-contract/assessment/valid/document.json +40 -0
- package/fixtures/atelier-inquiry-contract/bundle/invalid/document.json +51 -0
- package/fixtures/atelier-inquiry-contract/bundle/valid/document.json +50 -0
- package/fixtures/atelier-inquiry-contract/campaign/invalid/document.json +17 -0
- package/fixtures/atelier-inquiry-contract/campaign/valid/document.json +16 -0
- package/fixtures/atelier-inquiry-contract/decision/invalid/document.json +22 -0
- package/fixtures/atelier-inquiry-contract/decision/valid/document.json +21 -0
- package/fixtures/atelier-inquiry-contract/feedback/invalid/document.json +19 -0
- package/fixtures/atelier-inquiry-contract/feedback/valid/document.json +18 -0
- package/fixtures/atelier-inquiry-contract/handoff/invalid/document.json +92 -0
- package/fixtures/atelier-inquiry-contract/handoff/valid/document.json +91 -0
- package/fixtures/atelier-inquiry-contract/hypothesis/invalid/document.json +20 -0
- package/fixtures/atelier-inquiry-contract/hypothesis/valid/document.json +19 -0
- package/fixtures/atelier-inquiry-contract/ledger/invalid/document.json +680 -0
- package/fixtures/atelier-inquiry-contract/ledger/valid/document.json +679 -0
- package/fixtures/atelier-inquiry-contract/legacy-assessment/invalid/document.json +19 -0
- package/fixtures/atelier-inquiry-contract/legacy-assessment/valid/document.json +18 -0
- package/fixtures/atelier-inquiry-contract/request/invalid/document.json +50 -0
- package/fixtures/atelier-inquiry-contract/request/valid/document.json +49 -0
- package/fixtures/atelier-inquiry-contract/source/invalid/document.json +18 -0
- package/fixtures/atelier-inquiry-contract/source/valid/document.json +17 -0
- package/fixtures/atelier-inquiry-contract/withdrawal/invalid/document.json +16 -0
- package/fixtures/atelier-inquiry-contract/withdrawal/valid/document.json +15 -0
- package/fixtures/atelier-instruction-adoption/context-receipt/invalid/document.json +18 -0
- package/fixtures/atelier-instruction-adoption/context-receipt/valid/document.json +17 -0
- package/fixtures/atelier-instruction-adoption/plan/invalid/document.json +63 -0
- package/fixtures/atelier-instruction-adoption/plan/valid/document.json +62 -0
- package/fixtures/atelier-instruction-adoption/receipt/invalid/document.json +22 -0
- package/fixtures/atelier-instruction-adoption/receipt/valid/document.json +21 -0
- package/fixtures/atelier-instruction-adoption/state/invalid/document.json +30 -0
- package/fixtures/atelier-instruction-adoption/state/valid/document.json +29 -0
- package/fixtures/atelier-interaction/act/invalid/document.json +25 -0
- package/fixtures/atelier-interaction/act/valid/document.json +24 -0
- package/fixtures/atelier-interaction/assessment/invalid/document.json +32 -0
- package/fixtures/atelier-interaction/assessment/valid/document.json +31 -0
- package/fixtures/atelier-interaction/observation/invalid/document.json +22 -0
- package/fixtures/atelier-interaction/observation/valid/document.json +21 -0
- package/fixtures/atelier-interaction/policy/invalid/document.json +20 -0
- package/fixtures/atelier-interaction/policy/valid/document.json +19 -0
- package/fixtures/atelier-judgment/case/invalid/document.json +76 -0
- package/fixtures/atelier-judgment/case/valid/document.json +75 -0
- package/fixtures/atelier-judgment/decision/invalid/document.json +38 -0
- package/fixtures/atelier-judgment/decision/valid/document.json +37 -0
- package/fixtures/atelier-judgment/native-decision.md +3 -0
- package/fixtures/atelier-judgment/practice-reconsideration/definition.json +92 -0
- package/fixtures/atelier-judgment/practice-reconsideration/scenario.json +435 -0
- package/fixtures/atelier-knowledge-contract/activation/invalid/document.json +26 -0
- package/fixtures/atelier-knowledge-contract/activation/valid/document.json +25 -0
- package/fixtures/atelier-knowledge-contract/contribution/invalid/document.json +34 -0
- package/fixtures/atelier-knowledge-contract/contribution/valid/document.json +33 -0
- package/fixtures/atelier-knowledge-contract/domain/invalid/document.json +41 -0
- package/fixtures/atelier-knowledge-contract/domain/valid/document.json +40 -0
- package/fixtures/atelier-knowledge-contract/domain-revision/invalid/document.json +46 -0
- package/fixtures/atelier-knowledge-contract/domain-revision/valid/document.json +45 -0
- package/fixtures/atelier-knowledge-contract/evaluation/invalid/document.json +21 -0
- package/fixtures/atelier-knowledge-contract/evaluation/valid/document.json +20 -0
- package/fixtures/atelier-knowledge-contract/ledger/invalid/document.json +318 -0
- package/fixtures/atelier-knowledge-contract/ledger/valid/document.json +317 -0
- package/fixtures/atelier-knowledge-contract/relation/invalid/document.json +25 -0
- package/fixtures/atelier-knowledge-contract/relation/valid/document.json +24 -0
- package/fixtures/atelier-knowledge-contract/review/invalid/document.json +18 -0
- package/fixtures/atelier-knowledge-contract/review/valid/document.json +17 -0
- package/fixtures/atelier-knowledge-contract/withdrawal/invalid/document.json +16 -0
- package/fixtures/atelier-knowledge-contract/withdrawal/valid/document.json +15 -0
- package/fixtures/atelier-learning/invalid/authority.json +14 -0
- package/fixtures/atelier-learning/valid/capture.json +13 -0
- package/fixtures/atelier-personal-workspace-contract/manifest/invalid/authority-key.json +17 -0
- package/fixtures/atelier-personal-workspace-contract/manifest/invalid/nonempty-ext.json +25 -0
- package/fixtures/atelier-personal-workspace-contract/manifest/invalid/wrong-schema.json +22 -0
- package/fixtures/atelier-personal-workspace-contract/manifest/valid/manifest.json +22 -0
- package/fixtures/atelier-personal-workspace-contract/overlay/invalid/authority-key.json +25 -0
- package/fixtures/atelier-personal-workspace-contract/overlay/invalid/unknown-top-level-field.json +27 -0
- package/fixtures/atelier-personal-workspace-contract/overlay/invalid/wrong-schema.json +24 -0
- package/fixtures/atelier-trackable/definition/invalid/document.json +15 -0
- package/fixtures/atelier-trackable/definition/valid/document.json +14 -0
- package/fixtures/atelier-trackable/request/invalid/document.json +23 -0
- package/fixtures/atelier-trackable/request/valid/document.json +22 -0
- package/fixtures/boundary-delegations/invalid/authority-key.v1.json +30 -0
- package/fixtures/boundary-delegations/invalid/push-operation.v1.json +28 -0
- package/fixtures/boundary-delegations/invalid/unsigned.v1.json +25 -0
- package/fixtures/boundary-delegations/valid/empty.v1.json +4 -0
- package/fixtures/boundary-delegations/valid/signed-operator.v1.json +30 -0
- package/fixtures/boundary-owner-keys/invalid/wrong-algorithm.v1.json +15 -0
- package/fixtures/boundary-owner-keys/invalid/wrong-curve.v1.json +15 -0
- package/fixtures/boundary-owner-keys/valid/one-owner.v1.json +17 -0
- package/fixtures/capability-packages/adoption.example.json +70 -0
- package/fixtures/capability-packages/evidence-review/capability-package.json +58 -0
- package/fixtures/capability-packages/evidence-review/capability-release.json +84 -0
- package/fixtures/capability-packages/evidence-review/evaluation.md +15 -0
- package/fixtures/capability-packages/evidence-review/skills/evidence-review/SKILL.md +22 -0
- package/fixtures/capability-packages/evidence-review/skills/evidence-review/references/ledger.md +7 -0
- package/fixtures/capability-packages/research/capability-package.json +88 -0
- package/fixtures/capability-packages/research/capability-release.json +134 -0
- package/fixtures/capability-packages/research/evaluation.md +15 -0
- package/fixtures/capability-packages/research/skills/research-integrate/SKILL.md +29 -0
- package/fixtures/capability-packages/research/skills/research-integrate/references/integration.md +10 -0
- package/fixtures/capability-packages/research/skills/research-plan/SKILL.md +27 -0
- package/fixtures/capability-packages/research/skills/research-plan/references/inquiries.md +26 -0
- package/fixtures/capability-packages/research/skills/research-synthesize/SKILL.md +23 -0
- package/fixtures/capability-packages/research/skills/research-synthesize/references/synthesis.md +12 -0
- package/fixtures/evidence-navigation/invalid/duplicate-operation.json +16 -0
- package/fixtures/evidence-navigation/invalid/instruction-kind.json +36 -0
- package/fixtures/evidence-navigation/invalid/invalid-digest.json +36 -0
- package/fixtures/evidence-navigation/invalid/invalid-time.json +36 -0
- package/fixtures/evidence-navigation/invalid/missing-attribution.json +35 -0
- package/fixtures/evidence-navigation/invalid/reserved-extension.json +19 -0
- package/fixtures/evidence-navigation/invalid/unattributed-acceptance.json +36 -0
- package/fixtures/evidence-navigation/invalid/uncoerced-version.json +16 -0
- package/fixtures/evidence-navigation/invalid/unknown-currency.json +17 -0
- package/fixtures/evidence-navigation/invalid/unknown-selector-field.json +37 -0
- package/fixtures/evidence-navigation/invalid/unsupported-operation.json +15 -0
- package/fixtures/evidence-navigation/valid/claim.json +36 -0
- package/fixtures/evidence-navigation/valid/host.json +16 -0
- package/fixtures/evidence-navigation/valid/profile.json +16 -0
- package/fixtures/evidence-navigation/valid/snapshot.json +17 -0
- package/fixtures/harness-packages/build-harness/capability-package.json +61 -0
- package/fixtures/harness-packages/build-harness/capability-release.json +82 -0
- package/fixtures/harness-packages/build-harness/evaluation.md +3 -0
- package/fixtures/harness-packages/build-harness/skills/atelier-build-harness/SKILL.md +59 -0
- package/fixtures/harness-packages/knowledge-harness/capability-package.json +61 -0
- package/fixtures/harness-packages/knowledge-harness/capability-release.json +82 -0
- package/fixtures/harness-packages/knowledge-harness/evaluation.md +3 -0
- package/fixtures/harness-packages/knowledge-harness/skills/atelier-knowledge-harness/SKILL.md +60 -0
- package/fixtures/harnesses/learning-cycle.json +780 -0
- package/fixtures/inquiry/workshop.json +675 -0
- package/fixtures/inquiry-packages/discovery-harness/capability-package.json +61 -0
- package/fixtures/inquiry-packages/discovery-harness/capability-release.json +82 -0
- package/fixtures/inquiry-packages/discovery-harness/evaluation.md +3 -0
- package/fixtures/inquiry-packages/discovery-harness/skills/atelier-discovery-harness/SKILL.md +48 -0
- package/fixtures/inquiry-packages/research-harness/capability-package.json +61 -0
- package/fixtures/inquiry-packages/research-harness/capability-release.json +82 -0
- package/fixtures/inquiry-packages/research-harness/evaluation.md +3 -0
- package/fixtures/inquiry-packages/research-harness/skills/atelier-research-harness/SKILL.md +43 -0
- package/fixtures/knowledge-health/calibration-suite.json +26 -0
- package/fixtures/knowledge-health/calibration-trial.json +37 -0
- package/fixtures/knowledge-health/corrected/checklist.md +18 -0
- package/fixtures/knowledge-health/devday/participant-record.json +19 -0
- package/fixtures/knowledge-health/expected-summary.json +27 -0
- package/fixtures/knowledge-health/workshop/README.md +20 -0
- package/fixtures/knowledge-health/workshop/atelier.project.json +7 -0
- package/fixtures/knowledge-health/workshop/knowledge-plan.json +65 -0
- package/fixtures/knowledge-health/workshop/records/checklist.md +18 -0
- package/fixtures/knowledge-health/workshop/records/workshop.md +18 -0
- package/fixtures/knowledge-health/workshop/repo-access.v1.json +5 -0
- package/fixtures/knowledge-health/workspace/atelier.project.json +18 -0
- package/fixtures/knowledge-health/workspace/knowledge-plan.json +74 -0
- package/fixtures/knowledge-health/workspace/records/checklist.md +18 -0
- package/fixtures/knowledge-health/workspace/records/pilot.md +16 -0
- package/fixtures/knowledge-health/workspace/repo-access.v1.json +9 -0
- package/fixtures/personal-workspace/overlay.json +24 -0
- package/fixtures/templates/local-library.v1.json +76 -0
- package/fixtures/templates/upgrade-contracts/adoption-policy.v2/invalid.json +16 -0
- package/fixtures/templates/upgrade-contracts/adoption-policy.v2/valid.json +13 -0
- package/fixtures/templates/upgrade-contracts/migration.v3/invalid.json +24 -0
- package/fixtures/templates/upgrade-contracts/migration.v3/valid.json +21 -0
- package/fixtures/templates/upgrade-contracts/template-adoption.v1/invalid.json +60 -0
- package/fixtures/templates/upgrade-contracts/template-adoption.v1/valid.json +57 -0
- package/fixtures/templates/upgrade-contracts/upgrade-plan.v3/invalid.json +85 -0
- package/fixtures/templates/upgrade-contracts/upgrade-plan.v3/valid.json +82 -0
- package/package.json +60 -5
- package/plugins/obsidian/main.js +57 -8
- package/plugins/obsidian/manifest.json +1 -1
- package/skills/claude/atelier-build-harness/SKILL.md +59 -0
- package/skills/claude/atelier-coordination/SKILL.md +32 -0
- package/skills/claude/atelier-discovery-harness/SKILL.md +48 -0
- package/skills/claude/atelier-guided-upgrade/SKILL.md +29 -0
- package/skills/claude/atelier-interaction/SKILL.md +34 -0
- package/skills/claude/atelier-knowledge-harness/SKILL.md +60 -0
- package/skills/claude/atelier-knowledge-setup/SKILL.md +72 -0
- package/skills/claude/atelier-practical-judgment/SKILL.md +64 -0
- package/skills/claude/atelier-research-harness/SKILL.md +43 -0
- package/skills/claude/atelier-skill-steward/SKILL.md +53 -0
- package/skills/claude/atelier-trackables/SKILL.md +40 -0
- package/skills/codex/atelier-build-harness/SKILL.md +59 -0
- package/skills/codex/atelier-coordination/SKILL.md +32 -0
- package/skills/codex/atelier-discovery-harness/SKILL.md +48 -0
- package/skills/codex/atelier-guided-upgrade/SKILL.md +29 -0
- package/skills/codex/atelier-interaction/SKILL.md +34 -0
- package/skills/codex/atelier-knowledge-harness/SKILL.md +60 -0
- package/skills/codex/atelier-knowledge-setup/SKILL.md +72 -0
- package/skills/codex/atelier-practical-judgment/SKILL.md +64 -0
- package/skills/codex/atelier-research-harness/SKILL.md +43 -0
- package/skills/codex/atelier-skill-steward/SKILL.md +53 -0
- package/skills/codex/atelier-trackables/SKILL.md +40 -0
- package/src/architecture/catalog.mjs +355 -0
- package/src/architecture/index.mjs +93 -0
- package/src/boundary/content-rules.mjs +536 -69
- package/src/boundary/delegation-command.mjs +158 -0
- package/src/boundary/delegation.mjs +396 -0
- package/src/boundary/policy.mjs +185 -64
- package/src/build/git.mjs +18 -0
- package/src/build/index.mjs +3 -0
- package/src/build/ledger.mjs +88 -0
- package/src/capabilities/adoption.mjs +381 -0
- package/src/capabilities/evidence.mjs +140 -0
- package/src/capabilities/files.mjs +124 -0
- package/src/capabilities/index.mjs +4 -0
- package/src/capabilities/instructions.mjs +250 -0
- package/src/capabilities/package.mjs +136 -0
- package/src/cli/command-failure.mjs +36 -0
- package/src/cli/execute-command.mjs +16 -2
- package/src/cli/run.mjs +66 -9
- package/src/coauthor/store.mjs +43 -2
- package/src/collaboration/proposals.mjs +189 -0
- package/src/commands/architecture.mjs +27 -0
- package/src/commands/boundary.mjs +3 -0
- package/src/commands/capability.mjs +73 -0
- package/src/commands/enroll.mjs +3 -0
- package/src/commands/harness.mjs +79 -0
- package/src/commands/ingest.mjs +39 -0
- package/src/commands/init.mjs +4 -1
- package/src/commands/inquiry.mjs +66 -0
- package/src/commands/knowledge-semantic.mjs +128 -0
- package/src/commands/knowledge.mjs +119 -0
- package/src/commands/learn.mjs +61 -0
- package/src/commands/obsidian.mjs +772 -65
- package/src/commands/practice.mjs +24 -0
- package/src/commands/setup.mjs +22 -2
- package/src/commands/trackable.mjs +19 -0
- package/src/contracts/corpus.mjs +30 -0
- package/src/coordination/index.mjs +110 -0
- package/src/evidence-navigation/contracts.mjs +60 -0
- package/src/evidence-navigation/evaluate.mjs +69 -0
- package/src/evidence-navigation/generation.mjs +22 -0
- package/src/evidence-navigation/index.mjs +2 -0
- package/src/evidence-navigation/local.mjs +167 -0
- package/src/evidence-navigation/schema.generated.mjs +604 -0
- package/src/evidence-navigation/types.mjs +12 -0
- package/src/export/atelier-export-contract.mjs +35 -8
- package/src/graph/enroll.mjs +248 -0
- package/src/graph/graph.mjs +30 -6
- package/src/graph/knowledge-graph.mjs +77 -9
- package/src/harnesses/contracts.mjs +41 -0
- package/src/harnesses/exchange.mjs +154 -0
- package/src/harnesses/feedback.mjs +16 -0
- package/src/harnesses/history.mjs +37 -0
- package/src/harnesses/index.mjs +4 -0
- package/src/harnesses/store.mjs +29 -0
- package/src/ingestion/contracts.mjs +41 -0
- package/src/ingestion/evaluation.mjs +119 -0
- package/src/ingestion/optional/composition/index.mjs +171 -0
- package/src/ingestion/optional/evaluation/index.mjs +219 -0
- package/src/ingestion/optional/graphify/composition-binding.mjs +60 -0
- package/src/ingestion/optional/graphify/composition_receiving.py +185 -0
- package/src/ingestion/optional/graphify/graphify_supplier.py +938 -0
- package/src/ingestion/optional/graphify/json_bridge.py +163 -0
- package/src/ingestion/optional/graphify/native-closure-pins.json +275 -0
- package/src/ingestion/optional/graphify/native-pins.json +306 -0
- package/src/ingestion/optional/graphify/query_receiving.py +209 -0
- package/src/ingestion/optional/index.mjs +9 -0
- package/src/ingestion/optional/jev/bridge.mjs +166 -0
- package/src/ingestion/optional/jev/composition-binding.mjs +116 -0
- package/src/ingestion/optional/jev/judgments.mjs +174 -0
- package/src/ingestion/optional/jev/native-translation.mjs +32 -0
- package/src/ingestion/optional/lightrag/atelier_lightrag_supplier/__init__.py +7 -0
- package/src/ingestion/optional/lightrag/atelier_lightrag_supplier/adapter.py +966 -0
- package/src/ingestion/optional/lightrag/atelier_lightrag_supplier/artifacts.py +101 -0
- package/src/ingestion/optional/lightrag/atelier_lightrag_supplier/projection.py +146 -0
- package/src/ingestion/optional/lightrag/composition-binding.mjs +67 -0
- package/src/ingestion/optional/vanilla/composition-binding.mjs +102 -0
- package/src/ingestion/optional/vanilla/index.mjs +218 -0
- package/src/ingestion/optional/vanilla/native-normalization.mjs +187 -0
- package/src/ingestion/processors.mjs +218 -0
- package/src/ingestion/semantic.mjs +203 -0
- package/src/ingestion/store.mjs +372 -0
- package/src/inquiry/beliefs.mjs +32 -0
- package/src/inquiry/contracts.mjs +23 -0
- package/src/inquiry/index.mjs +5 -0
- package/src/inquiry/ledger.mjs +135 -0
- package/src/inquiry/lenses.mjs +15 -0
- package/src/inquiry/projection.mjs +77 -0
- package/src/inquiry/store.mjs +35 -0
- package/src/intake/read-scope.mjs +12 -0
- package/src/intake/store.mjs +69 -6
- package/src/interaction/index.mjs +91 -0
- package/src/judgment/index.mjs +82 -0
- package/src/judgment/practice-evaluation.mjs +70 -0
- package/src/judgment/practice.mjs +144 -0
- package/src/knowledge/context.mjs +217 -0
- package/src/knowledge/index.mjs +5 -0
- package/src/knowledge/ingestion.mjs +79 -0
- package/src/knowledge/intake.mjs +33 -0
- package/src/knowledge/ledger.mjs +110 -0
- package/src/knowledge/participatory/guidance.mjs +36 -0
- package/src/knowledge/participatory/guided-contribution.mjs +44 -0
- package/src/knowledge/participatory/index.mjs +2 -0
- package/src/knowledge/participatory/installed-workshop.mjs +108 -0
- package/src/knowledge/plan.mjs +67 -0
- package/src/knowledge/projection.mjs +43 -0
- package/src/knowledge/semantic-operation.mjs +567 -0
- package/src/knowledge/sessions.mjs +467 -0
- package/src/knowledge/workspace.mjs +295 -0
- package/src/knowledge-health/assessment.mjs +165 -0
- package/src/knowledge-health/capabilities.mjs +350 -0
- package/src/knowledge-health/context.mjs +62 -0
- package/src/knowledge-health/example.mjs +47 -0
- package/src/knowledge-health/index.mjs +10 -0
- package/src/knowledge-health/owner-join.mjs +88 -0
- package/src/knowledge-health/proof/common.mjs +24 -0
- package/src/knowledge-health/proof/installed-check.mjs +100 -0
- package/src/knowledge-health/proof/native-readback.mjs +37 -0
- package/src/knowledge-health/proof/rehearse.mjs +68 -0
- package/src/knowledge-health/proof/validate-participant.mjs +17 -0
- package/src/knowledge-health/proof/verify-native-capture.mjs +14 -0
- package/src/knowledge-health/proof/workshop-check.mjs +36 -0
- package/src/knowledge-health/rule-identity.mjs +49 -0
- package/src/knowledge-health/workshop-composition.mjs +19 -0
- package/src/knowledge-health/workshop-profile.mjs +176 -0
- package/src/knowledge-health/workshop.mjs +99 -0
- package/src/learning/adapters.mjs +68 -0
- package/src/learning/assistance.mjs +127 -0
- package/src/learning/contracts.mjs +65 -0
- package/src/learning/store.mjs +272 -0
- package/src/personal-workspace/index.mjs +391 -0
- package/src/personal-workspace/selection.mjs +401 -0
- package/src/project/config.mjs +8 -0
- package/src/project/durable-state.mjs +3 -1
- package/src/project/file-class.mjs +1 -1
- package/src/project/path-match.mjs +2 -1
- package/src/projection/obsidian/edits/apply.mjs +55 -16
- package/src/projection/obsidian/materialize/prepare-view.mjs +87 -5
- package/src/projection/obsidian/personal-workspace.mjs +519 -0
- package/src/projection/obsidian/proposals/adapter.mjs +79 -17
- package/src/projection/obsidian/proposals/observation.mjs +50 -4
- package/src/projection/obsidian/publication/publisher.mjs +214 -18
- package/src/projection/obsidian/publication/vault-list.mjs +4 -3
- package/src/projection/obsidian/recovery/index.mjs +4 -1
- package/src/projection/obsidian/recovery/store.mjs +160 -7
- package/src/projection/obsidian/selection-ui/contribution.mjs +6 -5
- package/src/projection/project.mjs +3 -2
- package/src/readiness/readiness.mjs +10 -3
- package/src/reflection/index.mjs +56 -0
- package/src/runtime/obsidian/app-production-seams.mjs +48 -16
- package/src/runtime/obsidian/app-registration.mjs +175 -28
- package/src/runtime/obsidian/app-restart.mjs +154 -0
- package/src/runtime/obsidian/engine.mjs +437 -56
- package/src/runtime/obsidian/extension-points.mjs +1 -1
- package/src/runtime/obsidian/index.mjs +10 -7
- package/src/runtime/obsidian/launch-plan.mjs +7 -4
- package/src/runtime/obsidian/lifecycle.mjs +108 -23
- package/src/runtime/obsidian/login-item.mjs +335 -0
- package/src/runtime/obsidian/machine-settings.mjs +119 -12
- package/src/runtime/obsidian/observation.mjs +36 -4
- package/src/runtime/obsidian/opening.mjs +173 -38
- package/src/runtime/obsidian/personal-selection.mjs +125 -0
- package/src/runtime/obsidian/pipeline.mjs +115 -6
- package/src/runtime/obsidian/plugin-channel.mjs +11 -3
- package/src/runtime/obsidian/plugin-choice.mjs +16 -4
- package/src/runtime/obsidian/plugin-drift.mjs +59 -11
- package/src/runtime/obsidian/plugin-presence.mjs +14 -1
- package/src/runtime/obsidian/private-lock.mjs +39 -4
- package/src/runtime/obsidian/process-identity.mjs +20 -10
- package/src/runtime/obsidian/project-views.mjs +282 -0
- package/src/runtime/obsidian/questions.mjs +48 -0
- package/src/runtime/obsidian/release-watch.mjs +56 -0
- package/src/runtime/obsidian/service-main.mjs +148 -19
- package/src/runtime/obsidian/service-manager-production.mjs +61 -0
- package/src/runtime/obsidian/service-managers.mjs +275 -0
- package/src/runtime/obsidian/service-record.mjs +87 -23
- package/src/runtime/obsidian/service.mjs +102 -9
- package/src/runtime/obsidian/startup-adapters.mjs +59 -21
- package/src/runtime/obsidian/unheld-evidence.mjs +84 -0
- package/src/runtime/obsidian/vault-location.mjs +300 -0
- package/src/runtime/obsidian/view-counts.mjs +34 -0
- package/src/runtime/obsidian/view-permission.mjs +334 -0
- package/src/server/local-sidecar.mjs +169 -2
- package/src/server/server.mjs +28 -2
- package/src/template-bindings/project.mjs +92 -0
- package/src/templates/profile.mjs +225 -0
- package/src/trackables/domain.mjs +175 -0
- package/src/trackables/store.mjs +114 -0
- package/src/ui/control-system.mjs +201 -0
- package/src/ui/html-primitives.mjs +3 -0
- package/src/ui/knowledge-page.mjs +1388 -0
- package/src/upgrade/closure-diagnostics.mjs +135 -0
- package/src/upgrade/closure.mjs +649 -0
- package/src/upgrade/explanation.mjs +1 -1
- package/src/upgrade/template-participant.mjs +171 -0
- package/src/upgrade/transaction.mjs +72 -25
- package/src/upgrade/upgrade.mjs +20 -7
- package/templates/external-project-workspace/pack-lifecycle.json +7 -1
- package/templates/knowledge-workspace/.gitattributes +2 -0
- package/templates/knowledge-workspace/AGENTS.md +27 -0
- package/templates/knowledge-workspace/README.md +44 -0
- package/templates/knowledge-workspace/atelier.project.json +22 -0
- package/templates/knowledge-workspace/gitignore +6 -0
- package/templates/knowledge-workspace/knowledge-plan.json +111 -0
- package/templates/knowledge-workspace/knowledge-plan.schema.json +281 -0
- package/templates/knowledge-workspace/records/forecast.md +22 -0
- package/templates/knowledge-workspace/records/inspection.md +25 -0
- package/templates/knowledge-workspace/records/telescope.md +24 -0
- package/templates/knowledge-workspace/repo-access.v1.json +9 -0
package/src/cli/run.mjs
CHANGED
|
@@ -14,6 +14,8 @@ export const commandMap = new Map([
|
|
|
14
14
|
['export:dry-run', ['src/validate-atelier-export-dry-run.mjs']],
|
|
15
15
|
['dry-run', ['src/validate-atelier-export-dry-run.mjs']],
|
|
16
16
|
['graph', ['src/commands/graph.mjs']],
|
|
17
|
+
['knowledge', ['src/commands/knowledge.mjs']],
|
|
18
|
+
['enroll', ['src/commands/enroll.mjs']],
|
|
17
19
|
['project', ['src/commands/project.mjs']],
|
|
18
20
|
['build', ['src/commands/project.mjs']],
|
|
19
21
|
['dev', ['src/commands/server.mjs']],
|
|
@@ -61,7 +63,15 @@ export const commandMap = new Map([
|
|
|
61
63
|
['sync', ['src/commands/sync.mjs']],
|
|
62
64
|
['review', ['src/commands/review.mjs']],
|
|
63
65
|
['coauthor', ['src/commands/coauthor.mjs']],
|
|
66
|
+
['architecture', ['src/commands/architecture.mjs']],
|
|
67
|
+
['trackable', ['src/commands/trackable.mjs']],
|
|
68
|
+
['practice', ['src/commands/practice.mjs']],
|
|
64
69
|
['skills', ['src/commands/skills.mjs']],
|
|
70
|
+
['capability', ['src/commands/capability.mjs']],
|
|
71
|
+
['inquiry', ['src/commands/inquiry.mjs']],
|
|
72
|
+
['harness', ['src/commands/harness.mjs']],
|
|
73
|
+
['learn', ['src/commands/learn.mjs']],
|
|
74
|
+
['ingest', ['src/commands/ingest.mjs']],
|
|
65
75
|
['obsidian', ['src/commands/obsidian.mjs']],
|
|
66
76
|
])
|
|
67
77
|
|
|
@@ -105,6 +115,10 @@ Core commands:
|
|
|
105
115
|
adopt Add Atelier to an existing repo/workspace.
|
|
106
116
|
setup --yes Repair ignored local machine state.
|
|
107
117
|
graph [--check] Build or check the knowledge graph.
|
|
118
|
+
knowledge check|context|evaluate Check an ontology plan and select bounded evidence.
|
|
119
|
+
knowledge dashboard|session Inspect guided work and retain private drafts.
|
|
120
|
+
knowledge semantic OPERATION Record a host-run semantic extraction for review.
|
|
121
|
+
enroll documents Write private sidecars for documents missing one.
|
|
108
122
|
project [--check] Build or check the workspace projection.
|
|
109
123
|
build [--check] Build or check a realm portal.
|
|
110
124
|
dev Run the local Atelier sidecar.
|
|
@@ -136,6 +150,7 @@ Core commands:
|
|
|
136
150
|
upgrade explain --plan Explain saved changes and consent without writes.
|
|
137
151
|
upgrade apply --plan --confirm Apply the selected plan through commit hooks.
|
|
138
152
|
upgrade status|recover Inspect receipts or preview recovery.
|
|
153
|
+
upgrade closure --npm-root Plan a consumer dependency-closure check; reads only, proves nothing.
|
|
139
154
|
upgrade --dry-run Plan a legacy package/template upgrade.
|
|
140
155
|
upgrade --apply Apply a branch-based reviewable upgrade.
|
|
141
156
|
lock check|write Verify or create atelier.lock.json.
|
|
@@ -143,7 +158,15 @@ Core commands:
|
|
|
143
158
|
review run|history|handoff Evidence-bound local human review.
|
|
144
159
|
review export|inspect|packs Preview inspection bundles and pack lifecycle.
|
|
145
160
|
coauthor start|read|event|recover Save and resume private authoring drafts.
|
|
161
|
+
architecture catalog|entry|resolve Inspect responsibility names and consumer bindings.
|
|
162
|
+
trackable preview|execute|view Follow adopted definitions and occurrence evidence.
|
|
163
|
+
practice plan|apply|status|context Adopt scoped instruction guidance and inspect use.
|
|
146
164
|
skills audit|observe|candidates|sync Audit and manage local skill projections.
|
|
165
|
+
capability seal|plan|apply|status Publish local capability bundles and govern adoption.
|
|
166
|
+
harness Govern knowledge and build workflows.
|
|
167
|
+
inquiry append|handoff|status|graph Run the local Discovery and Research Harness workflow.
|
|
168
|
+
learn capture|propose|decide|activate|withdraw Manage scoped lessons and their evidence.
|
|
169
|
+
ingest plan|run|status|query Preserve selected sources and search bounded evidence.
|
|
147
170
|
config check Validate project config.
|
|
148
171
|
extension-pack validate Validate declared extension packs.
|
|
149
172
|
extension-pack list List declared extension packs.
|
|
@@ -168,7 +191,22 @@ Machine-local repo paths belong in
|
|
|
168
191
|
|
|
169
192
|
export function buildCommandHelpText(command, brand = DEFAULT_BRAND) {
|
|
170
193
|
const c = brand.command
|
|
194
|
+
const serverHelp = (name) => `Usage: ${c} ${name} [--project ./atelier.project.json] [--port=PORT] [--review] [--knowledge]
|
|
195
|
+
|
|
196
|
+
Serves the project's built projection on 127.0.0.1 in the foreground until stopped. It builds nothing: run ${c} graph, then ${c} build, with the same --project path first. The port is --port=PORT, else the PORT environment variable, else 8137; 0 picks a free port, and the address printed on start names it. --review also serves the local review workspace at /review (docs/local-review.md). --knowledge adds guided knowledge dashboards and private coauthoring at /knowledge (docs/knowledge-workspace.md).`
|
|
171
197
|
const help = {
|
|
198
|
+
capability: `Usage: ${c} capability seal|verify|inventory|plan|apply|status|observe|candidates|recover|fleet|graph|profiles
|
|
199
|
+
Run ${c} capability help for options. Releases stay local; adoption is per repository
|
|
200
|
+
and requires an exact plan digest. Installed bytes, host loading and successful
|
|
201
|
+
exercise are separate evidence. No model execution or tool permission grants.`,
|
|
202
|
+
ingest: `Usage: ${c} ingest plan|run|status|query
|
|
203
|
+
|
|
204
|
+
Read one bounded UTF-8 JSON object {workspaceId,input} from stdin inside the intended Git workspace. Plans bind explicit sources, scope and budgets. Run performs bounded local text, CSV and JSON extraction. Query returns source-bound lexical evidence with partial coverage; it does not synthesize or accept claims. Private state stays in ignored .atelier-local/. See docs/ingestion.md.`,
|
|
205
|
+
learn: `Usage: ${c} learn capture|propose|decide|activate|withdraw|list|context|render|graph|export|plan
|
|
206
|
+
|
|
207
|
+
Read a bounded JSON object from stdin in the intended Git workspace. Every request includes workspaceId. Writes include actor, requestId, expectedRevision and input. Context and render include query. Local actor identity is asserted, not authenticated. State stays in ignored .atelier-local/. Accepted content becomes context only after explicit activation for a named harness; no permission grant, file installation or sending occurs. See docs/learning.md.`,
|
|
208
|
+
dev: serverHelp('dev'),
|
|
209
|
+
server: serverHelp('server'),
|
|
172
210
|
skills: `Usage: ${c} skills audit|observe|candidates|sync
|
|
173
211
|
Audit bundled skills or --root DIR [--peer DIR].
|
|
174
212
|
Sync previews by default; applying requires --apply --confirm PLAN_DIGEST.
|
|
@@ -176,12 +214,22 @@ Observations are local metadata, never automatic telemetry.`,
|
|
|
176
214
|
coauthor: `Usage: ${c} coauthor start|read|event|recover
|
|
177
215
|
|
|
178
216
|
Read one JSON request from stdin (maximum 1 MiB). Start takes {"config":{"id":"SESSION","fields":[{"id":"FIELD","source":{"ref":"packet.md","digest":"SHA256"}}]}}. Read/recover take {"sessionId":"SESSION"}. Event takes {"sessionId":"SESSION","event":{"id":"UNIQUE","expectedRevision":0,"type":"answer","text":"ANSWER"}}. Run from the intended Git workspace with ignored .atelier-local/. Saves are private drafts, never canonical source edits.`,
|
|
179
|
-
|
|
217
|
+
knowledge: `Usage: ${c} knowledge check|context|evaluate|dashboard [--project FILE] [--plan FILE]
|
|
218
|
+
${c} knowledge session start|read|event|recover|list [--project FILE] [--plan FILE]
|
|
219
|
+
${c} knowledge semantic begin|status|reconcile|complete|proposals|contribution|relation|record|cascade|context|project
|
|
220
|
+
|
|
221
|
+
Start with ${c} init --template knowledge-workspace --target DIR.
|
|
222
|
+
check reports ontology-to-question coverage against the current canonical graph.
|
|
223
|
+
context --question TEXT [--mode graph|lexical] [--max-bytes N] prints a bounded JSON packet of complete active Markdown sources.
|
|
224
|
+
evaluate compares lexical and graph selection on the plan's pinned evidence cases; exit 1 means missing or stale expected evidence, missing relationships, or an expected abstention that retrieved or omitted matching evidence.
|
|
225
|
+
The packet is local operator context, may contain private material, and grants no sharing or execution authority. Payload bytes are exact; token estimates are not measured usage. Session operations read JSON on stdin (except list); saved answers are private drafts.
|
|
226
|
+
semantic reads one JSON object {workspaceId, run, request} on stdin (at most 256 KiB) in the intended Git workspace, the one ingest uses. Each operation accepts exactly its documented request fields: required fields non-null, every field of its declared kind; anything else refuses as SEMANTIC_OPERATION_INVALID before anything is written. Formats such as timestamps are the runner's to check. Atelier calls no model: the host supplies its raw output, candidates and usage (null when unknown), and every interpretation stays pending until receiver records accept it; those records are caller assertions, not authenticated identity. Failures print {ok:false, code, error}, with recorded or captured details for reopening when the runner attached them. See docs/knowledge-setup.md, docs/knowledge-workspace.md and docs/semantic-operation.md.`,
|
|
227
|
+
init: `Usage: ${c} init [--template private-domain|shared-project|sample-workspace|distribution|external-project|knowledge-workspace] [--target DIR] [--actor ID]
|
|
180
228
|
|
|
181
229
|
Creates tracked starter files and an Atelier lockfile. It does not install hooks unless asked separately. An unrecognized --template exits 1 and writes nothing; omit --template for the blank scaffold.`,
|
|
182
|
-
adopt: `Usage: ${c} adopt [--profile single-repo|private-domain|shared-project|multi-repo|monorepo|control-workspace] [--target DIR] [--yes]
|
|
230
|
+
adopt: `Usage: ${c} adopt [--profile single-repo|private-domain|shared-project|multi-repo|monorepo|control-workspace] [--target DIR] [--include PATTERN] [--exclude PATTERN] [--enroll-documents [--audience private]] [--yes]
|
|
183
231
|
|
|
184
|
-
Creates or checks a tracked atelier.project.json for an existing workspace and writes machine-local path bindings only to ignored local overlay files.`,
|
|
232
|
+
Creates or checks a tracked atelier.project.json for an existing workspace and writes machine-local path bindings only to ignored local overlay files. --include and --exclude record setup.include and setup.exclude, path patterns relative to the project config that scope which files the knowledge graph reads. --enroll-documents then runs ${c} enroll documents.`,
|
|
185
233
|
setup: `Usage: ${c} setup --yes [--project ./atelier.project.json]
|
|
186
234
|
|
|
187
235
|
Ensures ignored local Atelier state exists, verifies ignore coverage, and records unambiguous local repo path bindings.`,
|
|
@@ -194,6 +242,9 @@ check --staged judges the staged diff. push-check reads pre-push ref updates on
|
|
|
194
242
|
graph: `Usage: ${c} graph [--check] [--project ./atelier.project.json]
|
|
195
243
|
|
|
196
244
|
Builds or checks the project knowledge graph from tracked sources plus ignored local path bindings.`,
|
|
245
|
+
enroll: `Usage: ${c} enroll documents [--audience private] [--dry-run] [--json] [--project ./atelier.project.json]
|
|
246
|
+
|
|
247
|
+
Writes a minimal <file>.kg.json sidecar next to every .html, .pdf and .docx document the knowledge graph reads that has none, so ${c} graph can pass. Each sidecar classifies its document for --audience (default private), which the repository's boundary policy must allow, and keeps the domain, lifecycle and status the graph infers. An existing sidecar, even one Git ignores, is never changed, and sources are never changed. --dry-run lists what would be written.`,
|
|
197
248
|
readiness: `Usage:
|
|
198
249
|
${c} readiness [--check] [--project ./atelier.project.json]
|
|
199
250
|
${c} readiness protocols [--json]
|
|
@@ -229,22 +280,28 @@ Assembles a local feedback report under ignored .atelier-local/feedback/ (mode 0
|
|
|
229
280
|
announcements: `Usage: ${c} announcements list [--dir DIR] [--public-key FILE] | verify <file> [--public-key FILE] [--json] | show <file> [--public-key FILE]
|
|
230
281
|
|
|
231
282
|
MNSTRY announcements are a pull-only channel: signed JSON documents under announcements/ in the repository. The trust anchor is always the committed MNSTRY key, or one you pass explicitly with --public-key; --dir changes only where documents are read from and never which key verifies them. Every run names the key and keyId it used. The kit never fetches anything — receiving announcements is the git pull you chose to run, and show refuses to print a body whose signature does not verify.`,
|
|
232
|
-
obsidian: `Usage: ${c} obsidian status|scope|audience|mode|policy|service|open|apply|conflicts|apply-policy|selection|proposals [--project atelier.project.json] [--data-root DIR] [--json]
|
|
283
|
+
obsidian: `Usage: ${c} obsidian status|settings|location|scope|view|audience|mode|policy|service|open|uninstall|plugin|apply|conflicts|apply-policy|selection|proposals [--project atelier.project.json | --personal-home DIR] [--data-root DIR] [--json] [--no-input]
|
|
233
284
|
|
|
234
285
|
${c} obsidian status
|
|
286
|
+
${c} obsidian settings
|
|
287
|
+
${c} obsidian location show | set DIR [--allow-synced-location]
|
|
235
288
|
${c} obsidian scope list | scope show ID
|
|
236
|
-
${c} obsidian
|
|
289
|
+
${c} obsidian view add ID (--all | --folder PATH [--folder PATH ...] [--repo R] | --tag T) [--expand DEPTH:MAX] [--default] [--allow-empty] [--yes]
|
|
290
|
+
${c} obsidian audience show | set me|A,B | clear
|
|
237
291
|
${c} obsidian mode show | set manual|automatic
|
|
238
|
-
${c} obsidian policy show | install FILE | revoke
|
|
239
|
-
${c} obsidian service start [--consent-actor ID] --adapter=obsidian-cli | status | stop | unit --print --adapter=obsidian-cli
|
|
240
|
-
${c} obsidian
|
|
292
|
+
${c} obsidian policy show | install FILE | revoke | digest FILE
|
|
293
|
+
${c} obsidian service start [--consent-actor ID] [--adapter=obsidian-cli] | status | stop | unit --print [--adapter=obsidian-cli]
|
|
294
|
+
${c} obsidian service unit --install [--consent-actor ID] [--adapter=obsidian-cli] | unit --remove
|
|
295
|
+
${c} obsidian open [--scope ID] [--consent-actor ID] [--allow-stale] [--restart-obsidian] [--wait-ms MS] [--adapter=obsidian-cli]
|
|
296
|
+
${c} obsidian uninstall
|
|
297
|
+
${c} obsidian plugin show [--scope ID] | on [--scope ID] [--adapter=obsidian-cli]
|
|
241
298
|
${c} obsidian apply list | show EDIT | run EDIT [--actor ID] | recover
|
|
242
299
|
${c} obsidian conflicts [ID]
|
|
243
300
|
${c} obsidian apply-policy create FILE | show | revoke
|
|
244
301
|
${c} obsidian selection resolve ID | persist ID [allow-empty] | show ID | list
|
|
245
302
|
${c} obsidian proposals list | show OPERATION
|
|
246
303
|
|
|
247
|
-
|
|
304
|
+
Every input is an argument. view add changes the project configuration, which you commit: it shows the change and how many notes the view would show, and asks a person at a terminal first (--yes answers beforehand); anyone else's command is their consent, and nothing is ever committed. With --json exactly one JSON document is printed, for a refusal too. status, settings, location show, scope, audience show, mode show, policy show, policy digest, plugin show and service status are read-only. open reports current only when the owned maintenance service ticked after the request, the view's trusted generation is the prepared one and reads back byte for byte, and the installed Obsidian meets the minimum version and answers for that vault; every other outcome is typed and exits 3. Reaching the installed app is never a default: open, service start and service unit need --adapter=obsidian-cli once for a workspace, which remembers it (never used under the test runner). service unit --install installs a login item on macOS (a launchd agent) or Linux (a systemd user unit) so maintenance starts when you log in, under a consent that covers startup; it runs the package installed in the project and is refused from a package runner's cache. Once installed, the service is started through it, and service start replaces a service of an earlier release. service unit --remove removes it and starts the service for this session only. uninstall removes the login item and stops the service, and keeps vaults, private state, the project file and Obsidian's vault list. Obsidian's own settings file is written only while no Obsidian runs, and every write is shown in open's answer: the view's vault is added to its list with a backup of the file as it was, its command line is turned on (cli: true), and for an Obsidian that never started the file is created. A running Obsidian that open cannot reach (its command line turned off, or no vault open) is quit and started again only with --restart-obsidian, which no other flag implies; otherwise open names that flag. --wait-ms bounds open's wait for maintenance's tick. The first start of the maintenance service records who allowed it: --consent-actor ID, or for a person at a terminal the account's name; --json, --no-input, CI or ATELIER_NONINTERACTIVE=1 mean nobody is at a terminal. Audiences (audience set me: only you, with the notes that carry no classification, which no other list shows), mode, the apply policy and what was decided are private machine settings, never project configuration and never a note. apply, conflicts, apply-policy, selection and proposals are contributed operations registered from modules shipped under src/runtime/obsidian/contributions/; the built-in names cannot be replaced. While no apply operation is registered every apply reports apply-unavailable. --personal-home DIR, given instead of --project, follows the generation last confirmed in that private home of a personal workspace; nothing here confirms one, and while none is confirmed and current nothing is published and status, open and service start refuse with the reason. Who may see its vaults stays this machine's audience setting, none by default. Exit codes: 0 done, 1 internal error, 2 refusal or usage, 3 ran and the answer is not success.`,
|
|
248
305
|
sync: `Usage:
|
|
249
306
|
${c} sync enroll --repo DIR [--project atelier.project.json] [--git ABSOLUTE_PATH]
|
|
250
307
|
${c} sync status --repo DIR
|
package/src/coauthor/store.mjs
CHANGED
|
@@ -57,8 +57,7 @@ export function createCoauthorStore({ workspaceRoot = process.cwd() } = {}) {
|
|
|
57
57
|
const lockPath = path.join(directory(), 'operation.lock');
|
|
58
58
|
return withPrivateLock(lockPath, operation);
|
|
59
59
|
}
|
|
60
|
-
function load(id) {
|
|
61
|
-
const result = ledger().eventsFor(aggregate(id));
|
|
60
|
+
function load(id, result = ledger().eventsFor(aggregate(id))) {
|
|
62
61
|
if (!result.ok) throw new Error(result.error);
|
|
63
62
|
if (!result.events.length) throw new Error('coauthor session not found');
|
|
64
63
|
let state;
|
|
@@ -151,6 +150,48 @@ export function createCoauthorStore({ workspaceRoot = process.cwd() } = {}) {
|
|
|
151
150
|
});
|
|
152
151
|
},
|
|
153
152
|
read(id) { return load(id).state; },
|
|
153
|
+
// Owning readback of the existing immutable values and verified event chain.
|
|
154
|
+
// Read only: missing values are unknown/unavailable, never repaired here.
|
|
155
|
+
readSavedFields(id) {
|
|
156
|
+
return locked(() => {
|
|
157
|
+
const state = load(id).state;
|
|
158
|
+
const values = state.saved.map(saved => {
|
|
159
|
+
const parents = ['.atelier-local', 'coauthor', 'values', contentDigest(id)];
|
|
160
|
+
let dir = root;
|
|
161
|
+
for (const part of parents) {
|
|
162
|
+
dir = path.join(dir, part);
|
|
163
|
+
const info = fs.lstatSync(dir);
|
|
164
|
+
if (!info.isDirectory() || info.isSymbolicLink()) throw new Error('redirected saved-value directory refused');
|
|
165
|
+
}
|
|
166
|
+
const raw = readText(path.join(dir, `${contentDigest(saved.receipt.requestId)}.json`));
|
|
167
|
+
const value = JSON.parse(raw);
|
|
168
|
+
validate(value, 'draft');
|
|
169
|
+
const expected = { schema: 'atelier-coauthor-draft@v1', status: 'draft', text: saved.text, receipt: saved.receipt };
|
|
170
|
+
if (raw !== canonicalize(expected) || canonicalize(value) !== canonicalize(expected)) throw new Error('saved value differs from owning event receipt');
|
|
171
|
+
return value;
|
|
172
|
+
});
|
|
173
|
+
return { state, values };
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
// One verified ledger snapshot for a bounded history listing. Keep failures
|
|
177
|
+
// per aggregate, and do not cache across calls or trust a caller's events.
|
|
178
|
+
readMany(ids) {
|
|
179
|
+
if (!Array.isArray(ids) || ids.length > 200 || ids.some(id => typeof id !== 'string' || !id))
|
|
180
|
+
throw new Error('session ids required and bounded');
|
|
181
|
+
if (!ids.length) return new Map();
|
|
182
|
+
const all = ledger().readAll();
|
|
183
|
+
const groups = new Map();
|
|
184
|
+
if (all.ok) for (const record of all.events) {
|
|
185
|
+
if (!groups.has(record.aggregateId)) groups.set(record.aggregateId, []);
|
|
186
|
+
groups.get(record.aggregateId).push(record);
|
|
187
|
+
}
|
|
188
|
+
return new Map(ids.map(id => {
|
|
189
|
+
try {
|
|
190
|
+
const state = load(id, all.ok ? { ok: true, events: groups.get(aggregate(id)) || [] } : all).state;
|
|
191
|
+
return [id, { ok: true, state }];
|
|
192
|
+
} catch (error) { return [id, { ok: false, error: error.message }]; }
|
|
193
|
+
}));
|
|
194
|
+
},
|
|
154
195
|
dispatch(id, event) {
|
|
155
196
|
return locked(() => {
|
|
156
197
|
if (['receipt', 'failed'].includes(event?.type)) throw new Error('receipt and failure events are store-owned');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import crypto from 'node:crypto'
|
|
2
2
|
import fs from 'node:fs'
|
|
3
3
|
import path from 'node:path'
|
|
4
|
+
import { canonicalize } from '../attestation/jcs.mjs'
|
|
4
5
|
import { createCollaborationEventLedger } from './event-ledger.mjs'
|
|
5
6
|
import {
|
|
6
7
|
atomicReplacePrivateText,
|
|
@@ -12,6 +13,7 @@ export const ATELIER_PROPOSAL_SCHEMA = 'atelier-proposal@v1'
|
|
|
12
13
|
export const ATELIER_PROPOSALS_SCHEMA = 'atelier-proposals@v1'
|
|
13
14
|
export const PROPOSAL_REVIEW_STATUSES = new Set(['reviewed', 'accepted', 'rejected', 'superseded'])
|
|
14
15
|
export const COPY_ONLY_PROPOSAL_CAPABILITY = 'proposal.copy-only'
|
|
16
|
+
export const WORKSHOP_HANDOFF_RETENTION_KIND = 'workshop-handoff'
|
|
15
17
|
const PROPOSAL_ID_PATTERN = /^proposal-[a-z0-9]+(?:-[a-z0-9]+)*$/
|
|
16
18
|
|
|
17
19
|
function nowIso() {
|
|
@@ -383,6 +385,190 @@ export function createProposalStore({
|
|
|
383
385
|
return { ok: true, status: 200, record, diagnostics }
|
|
384
386
|
}
|
|
385
387
|
|
|
388
|
+
const RETAINED_FIELD_LIMITS = { sessionId: 120, viewId: 120, path: 500, action: 120, intent: 500, actor: 160 }
|
|
389
|
+
const sha256Hex = (text) => crypto.createHash('sha256').update(text, 'utf8').digest('hex')
|
|
390
|
+
|
|
391
|
+
// The original saved receipt that names one retained handoff. Nothing is
|
|
392
|
+
// trimmed: a value that is not already usable is not an identity.
|
|
393
|
+
function retentionIdentity(receipt) {
|
|
394
|
+
if (!isRecord(receipt)) return null
|
|
395
|
+
const { sessionId, requestId, valueDigest } = receipt
|
|
396
|
+
if (typeof sessionId !== 'string' || !sessionId || sessionId.length > 120) return null
|
|
397
|
+
if (typeof requestId !== 'string' || !requestId || requestId.length > 200) return null
|
|
398
|
+
if (typeof valueDigest !== 'string' || !/^[a-f0-9]{64}$/.test(valueDigest)) return null
|
|
399
|
+
return { kind: WORKSHOP_HANDOFF_RETENTION_KIND, sessionId, requestId, valueDigest }
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// The value digest is not part of the id, so another value saved under the
|
|
403
|
+
// same original request meets the first record and is refused.
|
|
404
|
+
function retainedProposalId(identity) {
|
|
405
|
+
return proposalId(canonicalize({ kind: identity.kind, sessionId: identity.sessionId, requestId: identity.requestId }))
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// The digest covers exactly what the record holds, so a lookup recomputes it.
|
|
409
|
+
function retainedDigest(record) {
|
|
410
|
+
const proposal = record.proposal
|
|
411
|
+
return sha256Hex(canonicalize({
|
|
412
|
+
sessionId: proposal.sessionId,
|
|
413
|
+
viewId: proposal.viewId,
|
|
414
|
+
path: proposal.path,
|
|
415
|
+
action: proposal.action,
|
|
416
|
+
intent: proposal.intent,
|
|
417
|
+
actor: record.retention.actor,
|
|
418
|
+
diff: record.diff,
|
|
419
|
+
payload: record.payload,
|
|
420
|
+
}))
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// Lookup by the original saved receipt. Only the ledger answers: a
|
|
424
|
+
// compatibility snapshot is never a retained outcome, and a ledger that
|
|
425
|
+
// cannot be read is unknown, not absent.
|
|
426
|
+
function lookupRetainedProposal(receipt) {
|
|
427
|
+
const identity = retentionIdentity(receipt)
|
|
428
|
+
if (!identity) {
|
|
429
|
+
return { ok: false, status: 422, outcome: 'refused', error: 'selected draft receipt is not usable as a retention identity' }
|
|
430
|
+
}
|
|
431
|
+
const id = retainedProposalId(identity)
|
|
432
|
+
const found = materializedProposal(id)
|
|
433
|
+
if (!found.ok && found.status === 404) {
|
|
434
|
+
return fs.existsSync(proposalPath(id))
|
|
435
|
+
? { ok: false, status: 409, outcome: 'unknown', id, error: 'a snapshot exists for this receipt without a ledger record; inspect it before retrying' }
|
|
436
|
+
: { ok: true, status: 200, outcome: 'not-found', id, record: null }
|
|
437
|
+
}
|
|
438
|
+
if (!found.ok) return { ok: false, status: found.status, outcome: 'unknown', id, error: found.error }
|
|
439
|
+
const kept = found.record?.retention
|
|
440
|
+
let digest = null
|
|
441
|
+
try {
|
|
442
|
+
digest = isRecord(kept) ? retainedDigest(found.record) : null
|
|
443
|
+
} catch {
|
|
444
|
+
digest = null
|
|
445
|
+
}
|
|
446
|
+
if (
|
|
447
|
+
!isRecord(kept) || kept.kind !== identity.kind || kept.sessionId !== identity.sessionId ||
|
|
448
|
+
kept.requestId !== identity.requestId || digest === null || digest !== kept.payloadDigest
|
|
449
|
+
) {
|
|
450
|
+
return { ok: false, status: 422, outcome: 'unknown', id, error: 'the retained proposal does not match its own receipt identity or digest' }
|
|
451
|
+
}
|
|
452
|
+
if (kept.valueDigest !== identity.valueDigest) {
|
|
453
|
+
return { ok: false, status: 409, outcome: 'conflict', id, error: 'a different value is already retained for this original receipt' }
|
|
454
|
+
}
|
|
455
|
+
return { ok: true, status: 200, outcome: 'retained', id, record: found.record }
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// The handoff as it was retained, for readback after a lost reply or a
|
|
459
|
+
// source change.
|
|
460
|
+
function retainedHandoff(record) {
|
|
461
|
+
const proposal = record.proposal
|
|
462
|
+
return {
|
|
463
|
+
sessionId: proposal.sessionId,
|
|
464
|
+
viewId: proposal.viewId,
|
|
465
|
+
path: proposal.path,
|
|
466
|
+
action: proposal.action,
|
|
467
|
+
actor: record.retention.actor,
|
|
468
|
+
intent: proposal.intent,
|
|
469
|
+
directWrite: false,
|
|
470
|
+
applyEndpoint: null,
|
|
471
|
+
diff: JSON.parse(record.diff),
|
|
472
|
+
proposal: record.payload,
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
// Retain one server-derived handoff once, keyed by its original saved
|
|
477
|
+
// receipt. The caller derives the handoff; this store never trims or cuts
|
|
478
|
+
// it. A field that would not fit is refused, and the ledger's own line
|
|
479
|
+
// ceiling refuses the rest. A retained record is `proposed`: it is neither a
|
|
480
|
+
// review decision nor a source change.
|
|
481
|
+
function retainProposal(handoff = {}) {
|
|
482
|
+
if (!isRecord(handoff) || !isRecord(handoff.proposal) || !isRecord(handoff.diff)) {
|
|
483
|
+
return { ok: false, status: 422, outcome: 'refused', error: 'handoff shape is not supported' }
|
|
484
|
+
}
|
|
485
|
+
const authority = validateCopyOnlyProposalAuthority({ ...handoff.proposal, ...handoff })
|
|
486
|
+
if (!authority.ok || handoff.directWrite !== false || handoff.applyEndpoint !== null) {
|
|
487
|
+
return { ok: false, status: 409, outcome: 'refused', error: 'proposal authority refused: a retained handoff is copy-only' }
|
|
488
|
+
}
|
|
489
|
+
for (const [field, max] of Object.entries(RETAINED_FIELD_LIMITS)) {
|
|
490
|
+
const value = handoff[field]
|
|
491
|
+
if (typeof value !== 'string' || !value || value !== value.trim() || value.length > max) {
|
|
492
|
+
return { ok: false, status: 413, outcome: 'refused', error: `handoff ${field} cannot be retained without changing it` }
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
const identity = retentionIdentity(handoff.proposal.selectedDraftReceipt)
|
|
496
|
+
if (!identity || identity.sessionId !== handoff.sessionId) {
|
|
497
|
+
return { ok: false, status: 422, outcome: 'refused', error: 'selected draft receipt is not usable as a retention identity' }
|
|
498
|
+
}
|
|
499
|
+
let record
|
|
500
|
+
try {
|
|
501
|
+
const diffText = JSON.stringify(handoff.diff, null, 2)
|
|
502
|
+
if (diffText.length > 50000) {
|
|
503
|
+
return { ok: false, status: 413, outcome: 'refused', error: 'handoff diff cannot be retained without truncation' }
|
|
504
|
+
}
|
|
505
|
+
const createdAt = nowIso()
|
|
506
|
+
record = {
|
|
507
|
+
schema: ATELIER_PROPOSAL_SCHEMA,
|
|
508
|
+
workspaceId,
|
|
509
|
+
proposal: {
|
|
510
|
+
id: retainedProposalId(identity),
|
|
511
|
+
status: 'proposed',
|
|
512
|
+
createdAt,
|
|
513
|
+
updatedAt: createdAt,
|
|
514
|
+
sessionId: handoff.sessionId,
|
|
515
|
+
viewId: handoff.viewId,
|
|
516
|
+
path: handoff.path,
|
|
517
|
+
action: handoff.action,
|
|
518
|
+
intent: handoff.intent,
|
|
519
|
+
reason: '',
|
|
520
|
+
storage: {
|
|
521
|
+
kind: 'local',
|
|
522
|
+
ignored: true,
|
|
523
|
+
},
|
|
524
|
+
authority: copyOnlyActionSummary(handoff.action),
|
|
525
|
+
eventVersion: 1,
|
|
526
|
+
},
|
|
527
|
+
diff: diffText,
|
|
528
|
+
payload: handoff.proposal,
|
|
529
|
+
retention: { ...identity, actor: handoff.actor, receipt: handoff.proposal.selectedDraftReceipt },
|
|
530
|
+
}
|
|
531
|
+
record.retention.payloadDigest = retainedDigest(record)
|
|
532
|
+
} catch {
|
|
533
|
+
return { ok: false, status: 422, outcome: 'refused', error: 'handoff cannot be canonicalized' }
|
|
534
|
+
}
|
|
535
|
+
const unknown = (error) => ({ ok: false, status: 409, outcome: 'unknown', error })
|
|
536
|
+
const settle = (known) => {
|
|
537
|
+
if (known.outcome !== 'retained') return known
|
|
538
|
+
return known.record.retention.payloadDigest === record.retention.payloadDigest
|
|
539
|
+
? { ok: true, status: 200, outcome: 'existing', record: known.record, diagnostics: [] }
|
|
540
|
+
: { ok: false, status: 409, outcome: 'conflict', error: 'a different handoff is already retained for this original receipt' }
|
|
541
|
+
}
|
|
542
|
+
const known = lookupRetainedProposal(identity)
|
|
543
|
+
if (known.outcome !== 'not-found') return settle(known)
|
|
544
|
+
const appended = eventLedger.append({
|
|
545
|
+
aggregateId: record.proposal.id,
|
|
546
|
+
expectedVersion: 0,
|
|
547
|
+
type: 'proposal-created',
|
|
548
|
+
actor: handoff.actor,
|
|
549
|
+
at: record.proposal.createdAt,
|
|
550
|
+
payload: { record },
|
|
551
|
+
})
|
|
552
|
+
if (!appended.ok) {
|
|
553
|
+
// A version conflict means another writer appended first. Read back the
|
|
554
|
+
// original identity; never append again.
|
|
555
|
+
if (appended.status === 409) {
|
|
556
|
+
const again = lookupRetainedProposal(identity)
|
|
557
|
+
return again.outcome === 'retained'
|
|
558
|
+
? settle(again)
|
|
559
|
+
: unknown('the append conflicted and the original receipt could not be read back; repeat the same request')
|
|
560
|
+
}
|
|
561
|
+
return { ok: false, status: appended.status, outcome: appended.status === 413 ? 'refused' : 'unknown', error: appended.error }
|
|
562
|
+
}
|
|
563
|
+
// Retention is acknowledged only from the ledger's own readback.
|
|
564
|
+
const back = lookupRetainedProposal(identity)
|
|
565
|
+
if (back.outcome !== 'retained' || back.record.retention.payloadDigest !== record.retention.payloadDigest) {
|
|
566
|
+
return unknown('the retained proposal could not be read back after its append; repeat the same request')
|
|
567
|
+
}
|
|
568
|
+
const diagnostics = writeSnapshotProjectionWith(snapshotWriter, proposalPath(record.proposal.id), back.record)
|
|
569
|
+
return { ok: true, status: 200, outcome: 'created', record: back.record, diagnostics }
|
|
570
|
+
}
|
|
571
|
+
|
|
386
572
|
function reviewProposal(id, body = {}) {
|
|
387
573
|
const read = readProposal(id)
|
|
388
574
|
if (!read.ok) return read
|
|
@@ -457,6 +643,9 @@ export function createProposalStore({
|
|
|
457
643
|
readProposal,
|
|
458
644
|
listProposals,
|
|
459
645
|
createProposal,
|
|
646
|
+
lookupRetainedProposal,
|
|
647
|
+
retainedHandoff,
|
|
648
|
+
retainProposal,
|
|
460
649
|
reviewProposal,
|
|
461
650
|
}
|
|
462
651
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { architectureEntry, responsibilityCatalog, resolveBehaviorBinding } from '../architecture/index.mjs'
|
|
2
|
+
import { reportCommandFailure, parseJsonRequest } from '../cli/command-failure.mjs'
|
|
3
|
+
|
|
4
|
+
try {
|
|
5
|
+
const [command, name, ...rest] = process.argv.slice(2)
|
|
6
|
+
if (rest.length) throw new Error('unexpected architecture arguments')
|
|
7
|
+
let result
|
|
8
|
+
if (command === 'catalog' && name === undefined) result = responsibilityCatalog()
|
|
9
|
+
else if (command === 'entry' && name !== undefined) {
|
|
10
|
+
result = architectureEntry(name)
|
|
11
|
+
if (!result) throw new Error('unknown architecture name')
|
|
12
|
+
} else if (command === 'resolve' && name === undefined) {
|
|
13
|
+
const chunks = []; let bytes = 0
|
|
14
|
+
for await (const chunk of process.stdin) {
|
|
15
|
+
bytes += chunk.length
|
|
16
|
+
if (bytes > 256 * 1024) throw new Error('architecture request exceeds limit')
|
|
17
|
+
chunks.push(chunk)
|
|
18
|
+
}
|
|
19
|
+
const value = parseJsonRequest(Buffer.concat(chunks), 'architecture request')
|
|
20
|
+
if (!value || Object.keys(value).sort().join(',') !== 'binding,consumers') throw new Error('binding and consumers required')
|
|
21
|
+
result = resolveBehaviorBinding(value)
|
|
22
|
+
if (!result.resolved) process.exitCode = 1
|
|
23
|
+
} else throw new Error('Usage: atelier architecture catalog|entry NAME|resolve (JSON stdin)')
|
|
24
|
+
console.log(JSON.stringify(result, null, 2))
|
|
25
|
+
} catch (error) {
|
|
26
|
+
reportCommandFailure(error)
|
|
27
|
+
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
runBoundaryInstallHooksCommand,
|
|
7
7
|
runBoundaryPushCheckCommand,
|
|
8
8
|
} from '../boundary/policy.mjs'
|
|
9
|
+
import { runBoundaryDelegationCommand } from '../boundary/delegation-command.mjs'
|
|
9
10
|
|
|
10
11
|
const args = parseArgs(process.argv.slice(2))
|
|
11
12
|
const subcommand = args._[0] || 'check'
|
|
@@ -19,6 +20,8 @@ if (subcommand === 'check' || subcommand === 'doctor') {
|
|
|
19
20
|
runBoundaryAuditCommand(rest('audit'))
|
|
20
21
|
} else if (subcommand === 'install-hooks') {
|
|
21
22
|
runBoundaryInstallHooksCommand(rest('install-hooks'))
|
|
23
|
+
} else if (subcommand === 'delegation') {
|
|
24
|
+
runBoundaryDelegationCommand(rest('delegation'))
|
|
22
25
|
} else {
|
|
23
26
|
console.error(`Unknown boundary command: ${subcommand}`)
|
|
24
27
|
process.exit(1)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
import * as capability from '../capabilities/index.mjs'
|
|
5
|
+
import { jsonAt } from '../capabilities/files.mjs'
|
|
6
|
+
import { reportCommandFailure } from '../cli/command-failure.mjs'
|
|
7
|
+
|
|
8
|
+
const USAGE = `Usage: atelier capability <command> [options]
|
|
9
|
+
|
|
10
|
+
seal --package DIR Seal a local package, without overwriting a release.
|
|
11
|
+
verify --package DIR [--digest SHA] Verify all payload bytes; no publisher authentication.
|
|
12
|
+
inventory --surfaces FILE Read only the explicitly listed skill surfaces.
|
|
13
|
+
plan --adoption FILE [--source DIR ...] [--tool ID ...] [--notices FILE]
|
|
14
|
+
apply --adoption FILE [--source DIR ...] [--tool ID ...] [--notices FILE] --confirm PLAN_DIGEST
|
|
15
|
+
status [--session ID] Separate installation and caller-reported host evidence.
|
|
16
|
+
observe --event FILE Record a content-free, version-bound evidence reference.
|
|
17
|
+
candidates Propose cause-specific review from repeated evidence.
|
|
18
|
+
recover [--confirm PLAN_DIGEST] Preview recovery; exact confirmation restores prior state.
|
|
19
|
+
fleet --repo DIR [--repo DIR ...] Inspect explicitly selected repositories independently.
|
|
20
|
+
graph --namespace ID [--audience private|team|public]
|
|
21
|
+
Emit draft graph source documents as JSON for review.
|
|
22
|
+
profiles Show repository host projection profiles and their limits.
|
|
23
|
+
|
|
24
|
+
All output is JSON. --workspace DIR defaults to the current repository.
|
|
25
|
+
No command downloads packages, executes their scripts, probes a host, or grants tool authority.
|
|
26
|
+
The --tool values are caller observations of available tools, not permission grants.
|
|
27
|
+
Exit codes: 0 success, 1 refusal or blocked plan, 2 usage error.`
|
|
28
|
+
|
|
29
|
+
const COMMANDS = {
|
|
30
|
+
seal: ['package'], verify: ['package', 'digest'], inventory: ['surfaces'],
|
|
31
|
+
plan: ['adoption', 'source', 'tool', 'notices'], apply: ['adoption', 'source', 'tool', 'notices', 'confirm'],
|
|
32
|
+
status: ['session'], observe: ['event'], candidates: [], recover: ['confirm'],
|
|
33
|
+
fleet: ['repo'], graph: ['namespace', 'audience'], profiles: [],
|
|
34
|
+
}
|
|
35
|
+
const argv = process.argv.slice(2), command = argv.shift()
|
|
36
|
+
if (['--help', '-h', 'help'].includes(command) || argv.includes('--help')) { console.log(USAGE); process.exit(0) }
|
|
37
|
+
function usage(message) { console.error(`${message}\n\n${USAGE}`); process.exit(2) }
|
|
38
|
+
if (!Object.hasOwn(COMMANDS, command ?? '')) usage('unknown capability command')
|
|
39
|
+
const options = {}, repeated = new Set(['source', 'tool', 'repo'])
|
|
40
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
41
|
+
const match = /^--([a-z-]+)(?:=(.*))?$/.exec(argv[index])
|
|
42
|
+
if (!match || ![...COMMANDS[command], 'workspace', 'json'].includes(match[1])) usage('unknown capability option')
|
|
43
|
+
const key = match[1]
|
|
44
|
+
if (key === 'json') { if (match[2] !== undefined) usage('--json does not take a value'); continue }
|
|
45
|
+
const value = match[2] ?? argv[++index]
|
|
46
|
+
if (!value || value.startsWith('--')) usage('option requires a value')
|
|
47
|
+
if (repeated.has(key)) (options[key] ??= []).push(value)
|
|
48
|
+
else { if (options[key] !== undefined) usage('duplicate option'); options[key] = value }
|
|
49
|
+
}
|
|
50
|
+
function required(name) { if (!options[name]) usage(`--${name} is required`); return options[name] }
|
|
51
|
+
function read(file) { const absolute = path.resolve(file); return jsonAt(fs.realpathSync(path.dirname(absolute)), path.basename(absolute)) }
|
|
52
|
+
const common = { workspaceRoot: options.workspace ?? process.cwd() }
|
|
53
|
+
try {
|
|
54
|
+
let result
|
|
55
|
+
if (command === 'seal') result = capability.sealCapabilityRelease({ packageRoot: required('package') })
|
|
56
|
+
if (command === 'verify') result = capability.verifyCapabilityRelease({ packageRoot: required('package'), expectedDigest: options.digest })
|
|
57
|
+
if (command === 'inventory') result = capability.inventorySkillSurfaces({ surfaces: read(required('surfaces')) })
|
|
58
|
+
if (['plan', 'apply'].includes(command)) {
|
|
59
|
+
const settings = { ...common, adoption: read(required('adoption')), sources: options.source ?? [], availableTools: options.tool ?? [], notices: options.notices ? read(options.notices) : [] }
|
|
60
|
+
result = command === 'plan' ? capability.planCapabilityAdoption(settings) : capability.applyCapabilityAdoption({ ...settings, confirm: required('confirm') })
|
|
61
|
+
if (result.applyAllowed === false) process.exitCode = 1
|
|
62
|
+
}
|
|
63
|
+
if (command === 'status') result = capability.capabilityEvidenceStatus({ ...common, session: options.session ?? null })
|
|
64
|
+
if (command === 'observe') result = capability.recordCapabilityEvent({ ...common, event: read(required('event')) })
|
|
65
|
+
if (command === 'candidates') result = capability.capabilityImprovementCandidates(common)
|
|
66
|
+
if (command === 'recover') result = options.confirm ? capability.recoverCapabilityAdoption({ ...common, confirm: options.confirm }) : capability.inspectCapabilityRecovery(common)
|
|
67
|
+
if (command === 'fleet') result = capability.inspectCapabilityFleet({ workspaces: required('repo') })
|
|
68
|
+
if (command === 'graph') result = capability.capabilityGraphSources({ ...common, namespace: required('namespace'), audience: options.audience ?? 'private' })
|
|
69
|
+
if (command === 'profiles') result = capability.HOST_PROFILES
|
|
70
|
+
console.log(JSON.stringify(result, null, 2))
|
|
71
|
+
} catch (error) {
|
|
72
|
+
reportCommandFailure(error, 'stdout')
|
|
73
|
+
}
|