@ybotok/loam 0.2.0-alpha.5 → 0.2.0-alpha.7
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 +1063 -0
- package/MIGRATING-from-OpenSpec.md +7 -4
- package/QUICKSTART.md +8 -3
- package/README.md +13 -7
- package/ROADMAP.md +285 -11
- package/SCHEMA.md +566 -45
- package/WORKFLOW.md +23 -10
- package/dist/commands/adopt/render.js +47 -8
- package/dist/commands/adopt/render.js.map +1 -1
- package/dist/commands/archive/plan/landscape.js +45 -1
- package/dist/commands/archive/plan/landscape.js.map +1 -1
- package/dist/commands/archive/plan/model/extending.js +85 -0
- package/dist/commands/archive/plan/model/extending.js.map +1 -0
- package/dist/commands/archive/run.js +53 -23
- package/dist/commands/archive/run.js.map +1 -1
- package/dist/commands/context/print.js +11 -1
- package/dist/commands/context/print.js.map +1 -1
- package/dist/commands/doctor.js +46 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/explore.js +12 -2
- package/dist/commands/explore.js.map +1 -1
- package/dist/commands/list/views.js +5 -1
- package/dist/commands/list/views.js.map +1 -1
- package/dist/commands/seed/commit.js +34 -1
- package/dist/commands/seed/commit.js.map +1 -1
- package/dist/commands/seed/plan.js +158 -13
- package/dist/commands/seed/plan.js.map +1 -1
- package/dist/commands/seed/seed.js +7 -2
- package/dist/commands/seed/seed.js.map +1 -1
- package/dist/commands/show/feature.js +2 -1
- package/dist/commands/show/feature.js.map +1 -1
- package/dist/commands/show/marks.js +3 -5
- package/dist/commands/show/marks.js.map +1 -1
- package/dist/commands/show/service.js +39 -18
- package/dist/commands/show/service.js.map +1 -1
- package/dist/commands/subsystem/edit.js +4 -2
- package/dist/commands/subsystem/edit.js.map +1 -1
- package/dist/commands/subsystem/move.js +55 -17
- package/dist/commands/subsystem/move.js.map +1 -1
- package/dist/commands/subsystem/sync.js +238 -87
- package/dist/commands/subsystem/sync.js.map +1 -1
- package/dist/commands/subsystem/txn/exclude.js +132 -0
- package/dist/commands/subsystem/txn/exclude.js.map +1 -0
- package/dist/commands/subsystem/txn/report.js +174 -0
- package/dist/commands/subsystem/txn/report.js.map +1 -0
- package/dist/commands/subsystem/txn/txn.js +126 -22
- package/dist/commands/subsystem/txn/txn.js.map +1 -1
- package/dist/commands/subsystem/txn/views.js +159 -19
- package/dist/commands/subsystem/txn/views.js.map +1 -1
- package/dist/commands/validate/arch-coverage.js +16 -9
- package/dist/commands/validate/arch-coverage.js.map +1 -1
- package/dist/commands/validate/checks/fleet-shape.js +30 -77
- package/dist/commands/validate/checks/fleet-shape.js.map +1 -1
- package/dist/commands/validate/checks/health-deps.js +9 -6
- package/dist/commands/validate/checks/health-deps.js.map +1 -1
- package/dist/commands/validate/checks/vocabulary.js +4 -19
- package/dist/commands/validate/checks/vocabulary.js.map +1 -1
- package/dist/commands/validate/feature.js +1 -1
- package/dist/commands/validate/feature.js.map +1 -1
- package/dist/commands/validate/fleet/census.js +37 -13
- package/dist/commands/validate/fleet/census.js.map +1 -1
- package/dist/commands/validate/fleet/landscape.js +131 -120
- package/dist/commands/validate/fleet/landscape.js.map +1 -1
- package/dist/commands/validate/fleet/load.js +66 -0
- package/dist/commands/validate/fleet/load.js.map +1 -1
- package/dist/commands/validate/fleet/map/attest.js +102 -0
- package/dist/commands/validate/fleet/map/attest.js.map +1 -0
- package/dist/commands/validate/fleet/map/bindings.js +109 -0
- package/dist/commands/validate/fleet/map/bindings.js.map +1 -0
- package/dist/commands/validate/fleet/map/consumers.js +219 -0
- package/dist/commands/validate/fleet/map/consumers.js.map +1 -0
- package/dist/commands/validate/fleet/map/isolation.js +116 -0
- package/dist/commands/validate/fleet/map/isolation.js.map +1 -0
- package/dist/commands/validate/fleet/map/usecases.js +56 -0
- package/dist/commands/validate/fleet/map/usecases.js.map +1 -0
- package/dist/commands/validate/fleet/scorecard/scorecard.js.map +1 -1
- package/dist/commands/validate/fleet/usecases/steps.js +49 -17
- package/dist/commands/validate/fleet/usecases/steps.js.map +1 -1
- package/dist/commands/validate/fleet/views/fleet-project.js +217 -0
- package/dist/commands/validate/fleet/views/fleet-project.js.map +1 -0
- package/dist/commands/validate/fleet/views/ids.js +45 -15
- package/dist/commands/validate/fleet/views/ids.js.map +1 -1
- package/dist/commands/validate/fleet/views/projects.js +258 -70
- package/dist/commands/validate/fleet/views/projects.js.map +1 -1
- package/dist/commands/validate/fleet/views/root-documents.js +99 -0
- package/dist/commands/validate/fleet/views/root-documents.js.map +1 -0
- package/dist/commands/validate/fleet/views/stale.js +32 -15
- package/dist/commands/validate/fleet/views/stale.js.map +1 -1
- package/dist/commands/validate/service/model/diverged.js +226 -0
- package/dist/commands/validate/service/model/diverged.js.map +1 -0
- package/dist/commands/validate/service/model/grade.js +163 -0
- package/dist/commands/validate/service/model/grade.js.map +1 -0
- package/dist/commands/validate/service/service.js +110 -34
- package/dist/commands/validate/service/service.js.map +1 -1
- package/dist/commands/validate/service/specs.js +39 -5
- package/dist/commands/validate/service/specs.js.map +1 -1
- package/dist/commands/validate/service/spine.js +41 -3
- package/dist/commands/validate/service/spine.js.map +1 -1
- package/dist/commands/validate/service/usecases/tags.js +113 -0
- package/dist/commands/validate/service/usecases/tags.js.map +1 -0
- package/dist/commands/validate/service/usecases/usecases.js +209 -0
- package/dist/commands/validate/service/usecases/usecases.js.map +1 -0
- package/dist/commands/validate/validate.js +10 -24
- package/dist/commands/validate/validate.js.map +1 -1
- package/dist/core/agent/agents-md/artifacts.js +1 -0
- package/dist/core/agent/agents-md/artifacts.js.map +1 -1
- package/dist/core/agent/agents-md/command-map.js +19 -5
- package/dist/core/agent/agents-md/command-map.js.map +1 -1
- package/dist/core/agent/agents-md/cycle.js +24 -9
- package/dist/core/agent/agents-md/cycle.js.map +1 -1
- package/dist/core/agent/agents-md/map/lenses/context.js +4 -3
- package/dist/core/agent/agents-md/map/lenses/context.js.map +1 -1
- package/dist/core/agent/agents-md/map/subsystem.js +70 -17
- package/dist/core/agent/agents-md/map/subsystem.js.map +1 -1
- package/dist/core/agent/agents-md/map/usecases.js +45 -3
- package/dist/core/agent/agents-md/map/usecases.js.map +1 -1
- package/dist/core/agent/agents-md/refusals.js +5 -3
- package/dist/core/agent/agents-md/refusals.js.map +1 -1
- package/dist/core/agent/agents-md.js +26 -7
- package/dist/core/agent/agents-md.js.map +1 -1
- package/dist/core/agent/support/report.js +39 -5
- package/dist/core/agent/support/report.js.map +1 -1
- package/dist/core/agent/workflows/adopt.js +123 -14
- package/dist/core/agent/workflows/adopt.js.map +1 -1
- package/dist/core/agent/workflows/check.js +34 -20
- package/dist/core/agent/workflows/check.js.map +1 -1
- package/dist/core/agent/workflows/closing.js +3 -1
- package/dist/core/agent/workflows/closing.js.map +1 -1
- package/dist/core/agent/workflows/reference/spine.js +12 -6
- package/dist/core/agent/workflows/reference/spine.js.map +1 -1
- package/dist/core/brief/brief.js +88 -19
- package/dist/core/brief/brief.js.map +1 -1
- package/dist/core/brief/checks.js +133 -7
- package/dist/core/brief/checks.js.map +1 -1
- package/dist/core/brief/landscape.js +212 -129
- package/dist/core/brief/landscape.js.map +1 -1
- package/dist/core/brief/map/extend.js +81 -0
- package/dist/core/brief/map/extend.js.map +1 -0
- package/dist/core/brief/map/owed.js +284 -0
- package/dist/core/brief/map/owed.js.map +1 -0
- package/dist/core/brief/targets.js +94 -29
- package/dist/core/brief/targets.js.map +1 -1
- package/dist/core/brief/unchecked.js +13 -3
- package/dist/core/brief/unchecked.js.map +1 -1
- package/dist/core/c4/likec4.js +23 -1
- package/dist/core/c4/likec4.js.map +1 -1
- package/dist/core/c4/parsed/deployment.js +5 -3
- package/dist/core/c4/parsed/deployment.js.map +1 -1
- package/dist/core/c4/parsed/view-ids.js +39 -1
- package/dist/core/c4/parsed/view-ids.js.map +1 -1
- package/dist/core/c4/prefetch/fleet.js +142 -0
- package/dist/core/c4/prefetch/fleet.js.map +1 -0
- package/dist/core/c4/project/architecture.js +77 -7
- package/dist/core/c4/project/architecture.js.map +1 -1
- package/dist/core/c4/project/batch.js +140 -0
- package/dist/core/c4/project/batch.js.map +1 -0
- package/dist/core/c4/project/documents.js +12 -6
- package/dist/core/c4/project/documents.js.map +1 -1
- package/dist/core/c4/project/load.js +85 -42
- package/dist/core/c4/project/load.js.map +1 -1
- package/dist/core/c4/project/staged.js +53 -15
- package/dist/core/c4/project/staged.js.map +1 -1
- package/dist/core/c4/resolve/attested.js +0 -0
- package/dist/core/c4/resolve/attested.js.map +1 -0
- package/dist/core/c4/resolve/service.js +8 -17
- package/dist/core/c4/resolve/service.js.map +1 -1
- package/dist/core/c4/resolve/steps.js +18 -0
- package/dist/core/c4/resolve/steps.js.map +1 -1
- package/dist/core/c4/root-project/exclude.js +352 -0
- package/dist/core/c4/root-project/exclude.js.map +1 -0
- package/dist/core/c4/service-model/documents.js +47 -0
- package/dist/core/c4/service-model/documents.js.map +1 -0
- package/dist/core/c4/service-model/fleet/extending.js +82 -0
- package/dist/core/c4/service-model/fleet/extending.js.map +1 -0
- package/dist/core/c4/service-model/load.js +165 -0
- package/dist/core/c4/service-model/load.js.map +1 -0
- package/dist/core/c4/service-model/renderer.js +128 -0
- package/dist/core/c4/service-model/renderer.js.map +1 -0
- package/dist/core/c4/service-model/shape.js +126 -0
- package/dist/core/c4/service-model/shape.js.map +1 -0
- package/dist/core/c4/service-model/slice.js +188 -0
- package/dist/core/c4/service-model/slice.js.map +1 -0
- package/dist/core/c4/source-scan.js +26 -0
- package/dist/core/c4/source-scan.js.map +1 -1
- package/dist/core/c4/splice/authored-source.js +60 -13
- package/dist/core/c4/splice/authored-source.js.map +1 -1
- package/dist/core/c4/splice/contract.js.map +1 -1
- package/dist/core/c4/splice/identity/declared.js +87 -0
- package/dist/core/c4/splice/identity/declared.js.map +1 -0
- package/dist/core/c4/splice/identity/edges.js +17 -0
- package/dist/core/c4/splice/identity/edges.js.map +1 -1
- package/dist/core/c4/splice/identity/existing.js +80 -0
- package/dist/core/c4/splice/identity/existing.js.map +1 -0
- package/dist/core/c4/splice/identity/interior.js +80 -0
- package/dist/core/c4/splice/identity/interior.js.map +1 -0
- package/dist/core/c4/splice/identity/owner.js +50 -0
- package/dist/core/c4/splice/identity/owner.js.map +1 -0
- package/dist/core/c4/splice/landscape-merge.js +154 -100
- package/dist/core/c4/splice/landscape-merge.js.map +1 -1
- package/dist/core/c4/splice/model/merge.js +140 -0
- package/dist/core/c4/splice/model/merge.js.map +1 -0
- package/dist/core/c4/splice/placement.js +14 -4
- package/dist/core/c4/splice/placement.js.map +1 -1
- package/dist/core/c4/workspace.js +2 -1
- package/dist/core/c4/workspace.js.map +1 -1
- package/dist/core/coherence/coherence.js +7 -0
- package/dist/core/coherence/coherence.js.map +1 -1
- package/dist/core/delta/delta.js +9 -0
- package/dist/core/delta/delta.js.map +1 -1
- package/dist/core/deployment/delta.js +16 -10
- package/dist/core/deployment/delta.js.map +1 -1
- package/dist/core/diff/base-state.js +21 -5
- package/dist/core/diff/base-state.js.map +1 -1
- package/dist/core/diff/victims.js +10 -1
- package/dist/core/diff/victims.js.map +1 -1
- package/dist/core/docs.js +29 -24
- package/dist/core/docs.js.map +1 -1
- package/dist/core/doctor/config.js +7 -3
- package/dist/core/doctor/config.js.map +1 -1
- package/dist/core/doctor/doctor.js +36 -8
- package/dist/core/doctor/doctor.js.map +1 -1
- package/dist/core/doctor/report.js.map +1 -1
- package/dist/core/doctor/reports/scan.js +242 -0
- package/dist/core/doctor/reports/scan.js.map +1 -0
- package/dist/core/explain/refusals.js +1 -1
- package/dist/core/explain/refusals.js.map +1 -1
- package/dist/core/explore/explore.js +44 -9
- package/dist/core/explore/explore.js.map +1 -1
- package/dist/core/fleet-context.js +47 -0
- package/dist/core/fleet-context.js.map +1 -1
- package/dist/core/gate/checks.js +5 -1
- package/dist/core/gate/checks.js.map +1 -1
- package/dist/core/gate/partners.js +65 -26
- package/dist/core/gate/partners.js.map +1 -1
- package/dist/core/kernel/ids/fqn/ancestors.js +65 -0
- package/dist/core/kernel/ids/fqn/ancestors.js.map +1 -0
- package/dist/core/pack/living.js +47 -13
- package/dist/core/pack/living.js.map +1 -1
- package/dist/core/pack/pack.js +9 -6
- package/dist/core/pack/pack.js.map +1 -1
- package/dist/core/projection/arch-slice.js +2 -2
- package/dist/core/projection/arch-slice.js.map +1 -1
- package/dist/core/repo/paths.js +45 -38
- package/dist/core/repo/paths.js.map +1 -1
- package/dist/core/repo/tree/render/body.js +45 -6
- package/dist/core/repo/tree/render/body.js.map +1 -1
- package/dist/core/repo/tree/render/projects.js +93 -35
- package/dist/core/repo/tree/render/projects.js.map +1 -1
- package/dist/core/repo/tree/render/service/header.js +125 -0
- package/dist/core/repo/tree/render/service/header.js.map +1 -0
- package/dist/core/repo/tree/render/service/peers.js +28 -0
- package/dist/core/repo/tree/render/service/peers.js.map +1 -0
- package/dist/core/repo/tree/render/service/view-id.js +67 -0
- package/dist/core/repo/tree/render/service/view-id.js.map +1 -0
- package/dist/core/repo/tree/render/service/views.js +78 -0
- package/dist/core/repo/tree/render/service/views.js.map +1 -0
- package/dist/core/repo/tree/render/stale.js +20 -4
- package/dist/core/repo/tree/render/stale.js.map +1 -1
- package/dist/core/repo/tree/render/views.js +149 -32
- package/dist/core/repo/tree/render/views.js.map +1 -1
- package/dist/core/repo/tree/walk.js +45 -2
- package/dist/core/repo/tree/walk.js.map +1 -1
- package/dist/core/scaffold/landscape.js +219 -9
- package/dist/core/scaffold/landscape.js.map +1 -1
- package/dist/core/staging/writes.js.map +1 -1
- package/dist/core/usecases/delta/claims.js +1 -0
- package/dist/core/usecases/delta/claims.js.map +1 -1
- package/dist/core/usecases/delta/overlay.js +4 -0
- package/dist/core/usecases/delta/overlay.js.map +1 -1
- package/dist/core/usecases/fleet.js +18 -6
- package/dist/core/usecases/fleet.js.map +1 -1
- package/dist/core/usecases/operations.js +7 -0
- package/dist/core/usecases/operations.js.map +1 -1
- package/dist/core/usecases/service/exclude.js +119 -0
- package/dist/core/usecases/service/exclude.js.map +1 -0
- package/dist/core/usecases/service/flows.js +161 -0
- package/dist/core/usecases/service/flows.js.map +1 -0
- package/dist/core/verify/checklist.js +42 -10
- package/dist/core/verify/checklist.js.map +1 -1
- package/dist/core/vocabulary/issue.js.map +1 -1
- package/dist/core/vocabulary/maturity.js +51 -1
- package/dist/core/vocabulary/maturity.js.map +1 -1
- package/examples/README.md +30 -8
- package/examples/docs/architecture/landscape.likec4 +47 -0
- package/examples/docs/architecture/services.likec4 +70 -0
- package/examples/docs/architecture/subsystems.likec4 +3 -0
- package/examples/docs/architecture/usecases/order-notification.likec4 +5 -2
- package/examples/docs/likec4.config.json +0 -1
- package/examples/docs/services/checkout-web/model.likec4 +39 -56
- package/examples/docs/services/order-service/arch.spec.md +13 -6
- package/examples/docs/services/order-service/model.likec4 +58 -70
- package/examples/docs/services/payment-service/arch.spec.md +7 -4
- package/examples/docs/services/payment-service/model.likec4 +38 -39
- package/examples/docs/services/platform/identity-service/arch.spec.md +7 -4
- package/examples/docs/services/platform/identity-service/model.likec4 +35 -37
- package/examples/docs/services/platform/notification-service/health.yaml +8 -3
- package/examples/docs/services/platform/notification-service/model.likec4 +43 -64
- package/package.json +1 -1
- package/examples/docs/services/checkout-web/likec4.config.json +0 -4
- package/examples/docs/services/order-service/likec4.config.json +0 -4
- package/examples/docs/services/payment-service/likec4.config.json +0 -4
- package/examples/docs/services/platform/identity-service/likec4.config.json +0 -4
- package/examples/docs/services/platform/notification-service/likec4.config.json +0 -4
|
@@ -15,8 +15,8 @@ export const SUBSYSTEM_COMMANDS = `- \`loam subsystem <verb>\` manages the group
|
|
|
15
15
|
[--owner]\` creates a group (an empty one is legal — its \`subsystem.yaml\` is a
|
|
16
16
|
marker, never a member list); \`move <name>... --into <sub|.>\` relocates
|
|
17
17
|
services and whole subtrees in ONE journaled transaction over the renames
|
|
18
|
-
plus
|
|
19
|
-
regenerated views
|
|
18
|
+
plus BOTH regenerated views files (\`--into .\` unfiles; the renames and the
|
|
19
|
+
regenerated views files are staged in git without committing, where git answers); \`rename <old> <new>\` renames a
|
|
20
20
|
group through the same transaction (services are never renamed — the id is
|
|
21
21
|
the identity); \`rm <name>\` removes an EMPTY group; \`list\` shows the tree
|
|
22
22
|
with member counts and the unfiled count (unfiled is permanent and normal —
|
|
@@ -24,25 +24,78 @@ export const SUBSYSTEM_COMMANDS = `- \`loam subsystem <verb>\` manages the group
|
|
|
24
24
|
additive keys \`services[].subsystem\`, \`subsystems[]\` and
|
|
25
25
|
\`unfiledServices\`); \`history <name>\` asks git how a service or subsystem
|
|
26
26
|
moved and answers nothing — exit 0, no finding — when git will not say;
|
|
27
|
-
\`sync\` regenerates
|
|
28
|
-
\`
|
|
29
|
-
\`services
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
\`
|
|
27
|
+
\`sync\` regenerates BOTH generated views files —
|
|
28
|
+
\`architecture/subsystems.likec4\` (one view per subsystem) and
|
|
29
|
+
\`architecture/services.likec4\` (one overview view per service the fleet map
|
|
30
|
+
draws) — the one repair for \`subsystem.views-stale\`, which grades each file
|
|
31
|
+
separately and names the one that drifted. It also maintains the RENDERER's
|
|
32
|
+
wiring for the service models. Which wiring a model needs is decided by the file's own
|
|
33
|
+
grammar, never by a config key: a model that declares its own
|
|
34
|
+
\`specification { element … }\` block STANDS ALONE — it cannot share a project
|
|
35
|
+
with the fleet map, since every kind it declares would be a duplicate there —
|
|
36
|
+
and a model with no such block EXTENDS the map with
|
|
37
|
+
\`extend <fully-qualified id> { … }\` and parses only INSIDE the root project.
|
|
38
|
+
So \`sync\` writes one create-only \`services/<…>/<id>/likec4.config.json\` per
|
|
39
|
+
STANDALONE model (never rewritten; the team may edit it; commit
|
|
40
|
+
the new files before a \`move\`, which refuses over untracked paths), DELETES one
|
|
41
|
+
sitting beside an EXTENDING model (that nested project claims the model out of
|
|
42
|
+
the root project, so \`likec4 validate .\` refuses without \`--project\` and,
|
|
43
|
+
wherever that project claims the model, \`export json --project fleet\` loses
|
|
44
|
+
the service's containers; \`--json\` lists what it removed as \`projects.removed\`), and rewrites
|
|
45
|
+
the root \`likec4.config.json\`'s \`exclude\` to hold \`services/<tree>/**\` for
|
|
46
|
+
exactly those models, keeping every entry that is not about \`services/\` in the
|
|
47
|
+
order the team wrote it. It rewrites that list when at least one extending model
|
|
48
|
+
exists, or when a standalone model's directory is not covered — an older repo
|
|
49
|
+
whose models all stand alone behind \`services/**\` is never touched. \`--json\`
|
|
50
|
+
carries the result as \`projects.exclude\`, and the text view prints one line when
|
|
51
|
+
it rewrote. Between them these repair four warnings:
|
|
52
|
+
\`service.likec4-config-missing\` (a standalone model with no project file),
|
|
53
|
+
\`service.likec4-config-stray\` (a project file beside an extending model),
|
|
54
|
+
\`service.model-excluded\` (an extending model the root \`exclude\` hides from the
|
|
55
|
+
renderer) and \`service.model-unexcluded\` (a standalone model it does not hide,
|
|
56
|
+
which blanks the whole root project). A flat fleet with no subsystems still owes
|
|
57
|
+
this run: the verb is the tree's, the files are the renderer's. A fleet whose
|
|
58
|
+
models all extend the map ends with ONE project and one picker entry, and
|
|
59
|
+
\`likec4 validate\` at the docs root needs no flag; each standalone model adds a
|
|
60
|
+
project, and with more than one \`likec4 validate\` needs \`--project <name>\`
|
|
61
|
+
(\`build\` and \`export\` take every project). A view id claimed twice inside one
|
|
62
|
+
project — the landscape and an extending model both minting it, or either
|
|
63
|
+
claiming a generated one — is
|
|
64
|
+
\`subsystem.view-id-collision\` — ids beginning \`subsystem_\` or \`service_\` are
|
|
65
|
+
loam's to mint. Each generated view is titled by its PATH —
|
|
39
66
|
every marked ancestor's label and its own, which the renderer reads as
|
|
40
67
|
folders — where a label is the marker's \`title\` or the directory name; the
|
|
41
|
-
marker's \`description\` rides along.
|
|
68
|
+
marker's \`description\` rides along. A per-service view is titled
|
|
69
|
+
\`<subsystem path> / <service id>\`, so it lands in the same folder as its
|
|
70
|
+
group, and a \`dynamic view\` you write under
|
|
71
|
+
\`services/<…>/<id>/usecases/\` titled \`<subsystem path> / <service id> / <use
|
|
72
|
+
case>\` lands beside it. So editing \`subsystem.yaml\` changes
|
|
42
73
|
what the renderer LABELS the group, a parent's title changes every view
|
|
43
|
-
beneath it, and either makes
|
|
74
|
+
beneath it, and either makes both files stale until the next \`sync\`. Neither
|
|
75
|
+
generated file is part of the fleet-project load
|
|
76
|
+
(\`c4.fleet-project-invalid\` reads every other \`.likec4\` the root project holds);
|
|
77
|
+
\`subsystem.views-stale\` is the only check that reads them, by content
|
|
78
|
+
comparison against the deterministic re-render, never by reading what a view
|
|
79
|
+
shows. Each per-service view is declared \`of\` its service's element, which is
|
|
80
|
+
what makes every other view — the fleet map, its subsystem view, its peers'
|
|
81
|
+
views — drill into it with no authored link. Each subsystem view
|
|
82
|
+
carries \`global style subsystems\` — written after its title, the one line
|
|
83
|
+
LikeC4 gives a view for borrowing a palette — exactly when the \`architecture/\`
|
|
84
|
+
project declares a global style with that id (\`global { styleGroup subsystems
|
|
85
|
+
{ style element.tag = #external { color gray } } }\`, in the landscape or in
|
|
86
|
+
ANY \`.likec4\` under \`architecture/\` the root \`exclude\` does not cover — a
|
|
87
|
+
\`palette.likec4\` beside the map counts); nothing otherwise, and loam never reads
|
|
88
|
+
what the group says. Declaring it is the whole opt-in and makes the file stale
|
|
89
|
+
once, until the next \`sync\`. When the project declares style groups under other
|
|
90
|
+
names only, the file opens with one comment line naming them and saying none is
|
|
91
|
+
\`subsystems\`, and the views carry the renderer's defaults — so declaring a group
|
|
92
|
+
under ANY name restales the file, because that comment is part of the bytes.
|
|
93
|
+
\`architecture/services.likec4\` reads a group named \`services\` the same way.
|
|
94
|
+
\`sync\` refuses to rewrite either file while \`architecture/\` does not parse
|
|
95
|
+
(\`action: "blocked"\`): fix the map first. Both are generated wholesale:
|
|
44
96
|
an authored diagram of the same services belongs in the landscape or in a
|
|
45
|
-
file of your own name, never here. \`
|
|
97
|
+
file of your own name, never here. \`--json\` reports the subsystem file as
|
|
98
|
+
\`path\`/\`action\` and the per-service one as \`serviceViews\`. \`loam adopt --subsystem <name>\` briefs a new
|
|
46
99
|
service's baseline directly into a group, so adoption need not land unfiled.
|
|
47
100
|
`;
|
|
48
101
|
//# sourceMappingURL=subsystem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subsystem.js","sourceRoot":"","sources":["../../../../../src/core/agent/agents-md/map/subsystem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG
|
|
1
|
+
{"version":3,"file":"subsystem.js","sourceRoot":"","sources":["../../../../../src/core/agent/agents-md/map/subsystem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyFjC,CAAC","sourcesContent":["/**\n * The `loam subsystem` half of the command map — its own section module\n * because command-map.ts sat against the file-line limit and the agents-md\n * package against the five-file cap, so the tree surface's documentation\n * lives one package down and is concatenated after the map.\n *\n * Same assembly contract as every section: ../agents-md.ts concatenates with\n * NO join separator, so this string starts at the first character of its\n * opening line and ends with the newline that closes its last one.\n */\nexport const SUBSYSTEM_COMMANDS = `- \\`loam subsystem <verb>\\` manages the grouping tree under \\`services/\\` — the\n navigable tree no identity depends on: a service id stays its leaf directory\n name, every join key is byte-identical before and after a move, and the tree\n carries no policy. Verbs: \\`new <name> [--under <sub>] [--title] [--description]\n [--owner]\\` creates a group (an empty one is legal — its \\`subsystem.yaml\\` is a\n marker, never a member list); \\`move <name>... --into <sub|.>\\` relocates\n services and whole subtrees in ONE journaled transaction over the renames\n plus BOTH regenerated views files (\\`--into .\\` unfiles; the renames and the\n regenerated views files are staged in git without committing, where git answers); \\`rename <old> <new>\\` renames a\n group through the same transaction (services are never renamed — the id is\n the identity); \\`rm <name>\\` removes an EMPTY group; \\`list\\` shows the tree\n with member counts and the unfiled count (unfiled is permanent and normal —\n a count, never a finding; \\`loam list --json\\` carries the same facts as\n additive keys \\`services[].subsystem\\`, \\`subsystems[]\\` and\n \\`unfiledServices\\`); \\`history <name>\\` asks git how a service or subsystem\n moved and answers nothing — exit 0, no finding — when git will not say;\n \\`sync\\` regenerates BOTH generated views files —\n \\`architecture/subsystems.likec4\\` (one view per subsystem) and\n \\`architecture/services.likec4\\` (one overview view per service the fleet map\n draws) — the one repair for \\`subsystem.views-stale\\`, which grades each file\n separately and names the one that drifted. It also maintains the RENDERER's\n wiring for the service models. Which wiring a model needs is decided by the file's own\n grammar, never by a config key: a model that declares its own\n \\`specification { element … }\\` block STANDS ALONE — it cannot share a project\n with the fleet map, since every kind it declares would be a duplicate there —\n and a model with no such block EXTENDS the map with\n \\`extend <fully-qualified id> { … }\\` and parses only INSIDE the root project.\n So \\`sync\\` writes one create-only \\`services/<…>/<id>/likec4.config.json\\` per\n STANDALONE model (never rewritten; the team may edit it; commit\n the new files before a \\`move\\`, which refuses over untracked paths), DELETES one\n sitting beside an EXTENDING model (that nested project claims the model out of\n the root project, so \\`likec4 validate .\\` refuses without \\`--project\\` and,\n wherever that project claims the model, \\`export json --project fleet\\` loses\n the service's containers; \\`--json\\` lists what it removed as \\`projects.removed\\`), and rewrites\n the root \\`likec4.config.json\\`'s \\`exclude\\` to hold \\`services/<tree>/**\\` for\n exactly those models, keeping every entry that is not about \\`services/\\` in the\n order the team wrote it. It rewrites that list when at least one extending model\n exists, or when a standalone model's directory is not covered — an older repo\n whose models all stand alone behind \\`services/**\\` is never touched. \\`--json\\`\n carries the result as \\`projects.exclude\\`, and the text view prints one line when\n it rewrote. Between them these repair four warnings:\n \\`service.likec4-config-missing\\` (a standalone model with no project file),\n \\`service.likec4-config-stray\\` (a project file beside an extending model),\n \\`service.model-excluded\\` (an extending model the root \\`exclude\\` hides from the\n renderer) and \\`service.model-unexcluded\\` (a standalone model it does not hide,\n which blanks the whole root project). A flat fleet with no subsystems still owes\n this run: the verb is the tree's, the files are the renderer's. A fleet whose\n models all extend the map ends with ONE project and one picker entry, and\n \\`likec4 validate\\` at the docs root needs no flag; each standalone model adds a\n project, and with more than one \\`likec4 validate\\` needs \\`--project <name>\\`\n (\\`build\\` and \\`export\\` take every project). A view id claimed twice inside one\n project — the landscape and an extending model both minting it, or either\n claiming a generated one — is\n \\`subsystem.view-id-collision\\` — ids beginning \\`subsystem_\\` or \\`service_\\` are\n loam's to mint. Each generated view is titled by its PATH —\n every marked ancestor's label and its own, which the renderer reads as\n folders — where a label is the marker's \\`title\\` or the directory name; the\n marker's \\`description\\` rides along. A per-service view is titled\n \\`<subsystem path> / <service id>\\`, so it lands in the same folder as its\n group, and a \\`dynamic view\\` you write under\n \\`services/<…>/<id>/usecases/\\` titled \\`<subsystem path> / <service id> / <use\n case>\\` lands beside it. So editing \\`subsystem.yaml\\` changes\n what the renderer LABELS the group, a parent's title changes every view\n beneath it, and either makes both files stale until the next \\`sync\\`. Neither\n generated file is part of the fleet-project load\n (\\`c4.fleet-project-invalid\\` reads every other \\`.likec4\\` the root project holds);\n \\`subsystem.views-stale\\` is the only check that reads them, by content\n comparison against the deterministic re-render, never by reading what a view\n shows. Each per-service view is declared \\`of\\` its service's element, which is\n what makes every other view — the fleet map, its subsystem view, its peers'\n views — drill into it with no authored link. Each subsystem view\n carries \\`global style subsystems\\` — written after its title, the one line\n LikeC4 gives a view for borrowing a palette — exactly when the \\`architecture/\\`\n project declares a global style with that id (\\`global { styleGroup subsystems\n { style element.tag = #external { color gray } } }\\`, in the landscape or in\n ANY \\`.likec4\\` under \\`architecture/\\` the root \\`exclude\\` does not cover — a\n \\`palette.likec4\\` beside the map counts); nothing otherwise, and loam never reads\n what the group says. Declaring it is the whole opt-in and makes the file stale\n once, until the next \\`sync\\`. When the project declares style groups under other\n names only, the file opens with one comment line naming them and saying none is\n \\`subsystems\\`, and the views carry the renderer's defaults — so declaring a group\n under ANY name restales the file, because that comment is part of the bytes.\n \\`architecture/services.likec4\\` reads a group named \\`services\\` the same way.\n \\`sync\\` refuses to rewrite either file while \\`architecture/\\` does not parse\n (\\`action: \"blocked\"\\`): fix the map first. Both are generated wholesale:\n an authored diagram of the same services belongs in the landscape or in a\n file of your own name, never here. \\`--json\\` reports the subsystem file as\n \\`path\\`/\\`action\\` and the per-service one as \\`serviceViews\\`. \\`loam adopt --subsystem <name>\\` briefs a new\n service's baseline directly into a group, so adoption need not land unfiled.\n`;\n"]}
|
|
@@ -23,7 +23,13 @@ export const USECASE_VIEWS = `- Business use cases are \`dynamic view\`s, and \`
|
|
|
23
23
|
tag the view \`#cap-<capability>\` to have it graded. The tag spells a declared
|
|
24
24
|
capability id with every \`/\` flattened to \`-\` (a LikeC4 tag name cannot carry a
|
|
25
25
|
slash), and it must be declared as a \`tag\` in the one \`specification\` block the
|
|
26
|
-
project has, since LikeC4 refuses an undeclared tag.
|
|
26
|
+
\`architecture/\` project has, since LikeC4 refuses an undeclared tag. loam grades
|
|
27
|
+
the fleet map as THAT project and nothing else — the landscape plus its
|
|
28
|
+
siblings, never a service model — so a hop here names SERVICE elements: a step
|
|
29
|
+
naming a container that a service's extending model declares resolves in the
|
|
30
|
+
renderer's wider root project and is \`landscape.invalid\` for loam, which takes
|
|
31
|
+
the whole fleet map down. Container-level flows live beside the model that
|
|
32
|
+
declares them (below). EITHER reserved prefix
|
|
27
33
|
opts a view in — a view carrying only \`#req-<requirement>\` is graded too, and
|
|
28
34
|
earns \`usecase.requirement-unresolved\` for the \`#cap-\` tag it is missing
|
|
29
35
|
rather than silence. An UNTAGGED dynamic view is somebody's hand-drawn diagram
|
|
@@ -38,6 +44,37 @@ export const USECASE_VIEWS = `- Business use cases are \`dynamic view\`s, and \`
|
|
|
38
44
|
hop written \`a <- b\` is attributed to the call it answers, so spell replies
|
|
39
45
|
that way rather than as fresh hops. Every message names the file the view was
|
|
40
46
|
written in, never the landscape.
|
|
47
|
+
- A flow behind ONE service's own requirement — the hop sequence over its
|
|
48
|
+
containers that an arch.spec.md \`Covers:\` names — lives in that service's own
|
|
49
|
+
LikeC4 project: any \`.likec4\` beside \`services/<…>/<svc>/model.likec4\`
|
|
50
|
+
(\`usecases/<name>.likec4\` by convention, or \`views.likec4\`), or a \`dynamic view\`
|
|
51
|
+
inside model.likec4 itself; loam reads exactly what the renderer's per-service
|
|
52
|
+
project reads. Never \`architecture/usecases/\`, which cannot resolve a container
|
|
53
|
+
and turns the whole fleet \`landscape.invalid\`. Tag it \`#req-<Requirement-ID>\`
|
|
54
|
+
(the id flattened as above). The tag has to be DECLARED where that project can
|
|
55
|
+
see it: in model.likec4's own \`specification\` block when the model declares one
|
|
56
|
+
and therefore stands alone; in \`architecture/landscape.likec4\`'s block when the
|
|
57
|
+
model EXTENDS the map, or in a tags-only \`specification { tag req-… }\` beside
|
|
58
|
+
the \`extend\`, which is legal and lands the tag in the project's specification.
|
|
59
|
+
Declaring it in BOTH is a duplicate, and the code is the one that lands where
|
|
60
|
+
the second declaration's FILE is: \`c4.invalid\` (an error, and the model's
|
|
61
|
+
grading is suspended behind it) when the tags-only block is in model.likec4,
|
|
62
|
+
\`usecase.flow-invalid\` when it is in a sibling. \`c4.fleet-project-invalid\` is
|
|
63
|
+
the fleet-scope class one step out — two SERVICES each declaring the same tag
|
|
64
|
+
locally, which no per-service project sees.
|
|
65
|
+
Then \`loam validate --service <svc>\` grades it — under
|
|
66
|
+
\`--all\`, per service: \`usecase.step-unbacked\` and \`usecase.step-contested\`
|
|
67
|
+
against model.likec4, \`usecase.requirement-unresolved\` against THIS service's
|
|
68
|
+
spec.md and arch.spec.md ids, and \`usecase.flow-invalid\` when a sibling file
|
|
69
|
+
breaks the project (model.likec4 is still graded alone). \`usecase.step-unlinked\`
|
|
70
|
+
never fires on a hop whose caller and provider resolve to the same service — a
|
|
71
|
+
service owes no operationId to itself — while a hop from such a flow into another
|
|
72
|
+
service's element (a stand-in the model declares for a sibling, with no
|
|
73
|
+
\`metadata { op }\`) still warns, exactly as on the fleet map. A \`#cap-\` tag on
|
|
74
|
+
such a flow is \`usecase.capability-unresolved\`: a capability is claimed on the
|
|
75
|
+
fleet map, never inside one service. A resolved service-local \`#req-\` keeps its
|
|
76
|
+
own grade and nothing else — it is not \`keptBy\`, not \`Covers:\`, and no feature
|
|
77
|
+
carries one yet.
|
|
41
78
|
- A FEATURE brings a flow the way it brings every other axis: write it at
|
|
42
79
|
\`features/<FEAT>/usecases/<name>.likec4\` — the same views-only document, in the
|
|
43
80
|
feature's own directory — and \`loam archive\` copies it into
|
|
@@ -52,9 +89,14 @@ export const USECASE_VIEWS = `- Business use cases are \`dynamic view\`s, and \`
|
|
|
52
89
|
that file — the merge is a whole-file copy, so edit the living one directly
|
|
53
90
|
instead) and \`usecase.flow-invalid\` (loam could not read the flows against that
|
|
54
91
|
post-merge map — most often a hop naming an element neither the living
|
|
55
|
-
landscape nor the delta declares
|
|
92
|
+
landscape nor the delta declares; the merge preview stages no service model, so
|
|
93
|
+
a container an extending model declares is not among them either). Do NOT put a
|
|
94
|
+
\`dynamic view\` inside
|
|
56
95
|
\`delta.likec4\`: that document re-declares the landscape's own identifiers and
|
|
57
96
|
carries its own \`specification\` block, so it cannot be read beside the map, and
|
|
58
|
-
the archive refuses it by name.
|
|
97
|
+
the archive refuses it by name. A feature's \`delta.likec4\` keeps that shape
|
|
98
|
+
whatever shape the service models take — \`features/**\` stays excluded from the
|
|
99
|
+
root LikeC4 project, and the delta is pointed at alone
|
|
100
|
+
(\`npx likec4 start features/<FEAT>\`).
|
|
59
101
|
`;
|
|
60
102
|
//# sourceMappingURL=usecases.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usecases.js","sourceRoot":"","sources":["../../../../../src/core/agent/agents-md/map/usecases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG
|
|
1
|
+
{"version":3,"file":"usecases.js","sourceRoot":"","sources":["../../../../../src/core/agent/agents-md/map/usecases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkF5B,CAAC","sourcesContent":["/**\n * The use-case axis of the command map — its own section module for\n * `./subsystem.ts`'s exact reason: command-map.ts sat against the file-line\n * limit and the agents-md package against the five-file cap, so a family added\n * to the `validate --all` cross-check documents itself one package down and is\n * concatenated after the map. The four `usecase.*` codes are what\n * test/codes-drift.test.ts finds here.\n *\n * They are LISTED and not glossed: their fix rows live in the /loam-check\n * table and `loam explain usecase.step-unbacked` prints them, so writing the\n * meanings out again here is the duplication ../../command-map.ts's header\n * describes. What stays is what `explain` does not say — how to opt a view in,\n * and that an untagged dynamic view is never graded at all.\n *\n * Same assembly contract as every section: ../../agents-md.ts concatenates with\n * NO join separator, so this string starts at the first character of its opening\n * line and ends with the newline that closes its last one.\n */\nexport const USECASE_VIEWS = `- Business use cases are \\`dynamic view\\`s, and \\`loam validate --all\\` grades the\n ones that opt in. Write the flow in a file of its own —\n \\`architecture/usecases/<name>.likec4\\`, a \\`views { }\\` block over the landscape's\n elements, which loam reads as ONE LikeC4 project together with the map — and\n tag the view \\`#cap-<capability>\\` to have it graded. The tag spells a declared\n capability id with every \\`/\\` flattened to \\`-\\` (a LikeC4 tag name cannot carry a\n slash), and it must be declared as a \\`tag\\` in the one \\`specification\\` block the\n \\`architecture/\\` project has, since LikeC4 refuses an undeclared tag. loam grades\n the fleet map as THAT project and nothing else — the landscape plus its\n siblings, never a service model — so a hop here names SERVICE elements: a step\n naming a container that a service's extending model declares resolves in the\n renderer's wider root project and is \\`landscape.invalid\\` for loam, which takes\n the whole fleet map down. Container-level flows live beside the model that\n declares them (below). EITHER reserved prefix\n opts a view in — a view carrying only \\`#req-<requirement>\\` is graded too, and\n earns \\`usecase.requirement-unresolved\\` for the \\`#cap-\\` tag it is missing\n rather than silence. An UNTAGGED dynamic view is somebody's hand-drawn diagram\n and is never graded — that opt-in is what lets a fleet full of existing\n diagrams upgrade without turning red, and \\`loam validate\\`, \\`loam diff\\`,\n \\`loam delta\\`, \\`loam status\\`, \\`loam context\\` and \\`loam list capabilities\\` all\n read the same opt-in, so a flow one of them sees is a flow all of them see. On a tagged\n view: \\`usecase.capability-unresolved\\`, \\`usecase.step-unbacked\\`,\n \\`usecase.step-contested\\` and \\`usecase.step-unlinked\\`. The first is silent\n while architecture/capabilities.yaml is absent or unreadable, like the rest of\n the capability axis; the three step codes are about the model, and a return\n hop written \\`a <- b\\` is attributed to the call it answers, so spell replies\n that way rather than as fresh hops. Every message names the file the view was\n written in, never the landscape.\n- A flow behind ONE service's own requirement — the hop sequence over its\n containers that an arch.spec.md \\`Covers:\\` names — lives in that service's own\n LikeC4 project: any \\`.likec4\\` beside \\`services/<…>/<svc>/model.likec4\\`\n (\\`usecases/<name>.likec4\\` by convention, or \\`views.likec4\\`), or a \\`dynamic view\\`\n inside model.likec4 itself; loam reads exactly what the renderer's per-service\n project reads. Never \\`architecture/usecases/\\`, which cannot resolve a container\n and turns the whole fleet \\`landscape.invalid\\`. Tag it \\`#req-<Requirement-ID>\\`\n (the id flattened as above). The tag has to be DECLARED where that project can\n see it: in model.likec4's own \\`specification\\` block when the model declares one\n and therefore stands alone; in \\`architecture/landscape.likec4\\`'s block when the\n model EXTENDS the map, or in a tags-only \\`specification { tag req-… }\\` beside\n the \\`extend\\`, which is legal and lands the tag in the project's specification.\n Declaring it in BOTH is a duplicate, and the code is the one that lands where\n the second declaration's FILE is: \\`c4.invalid\\` (an error, and the model's\n grading is suspended behind it) when the tags-only block is in model.likec4,\n \\`usecase.flow-invalid\\` when it is in a sibling. \\`c4.fleet-project-invalid\\` is\n the fleet-scope class one step out — two SERVICES each declaring the same tag\n locally, which no per-service project sees.\n Then \\`loam validate --service <svc>\\` grades it — under\n \\`--all\\`, per service: \\`usecase.step-unbacked\\` and \\`usecase.step-contested\\`\n against model.likec4, \\`usecase.requirement-unresolved\\` against THIS service's\n spec.md and arch.spec.md ids, and \\`usecase.flow-invalid\\` when a sibling file\n breaks the project (model.likec4 is still graded alone). \\`usecase.step-unlinked\\`\n never fires on a hop whose caller and provider resolve to the same service — a\n service owes no operationId to itself — while a hop from such a flow into another\n service's element (a stand-in the model declares for a sibling, with no\n \\`metadata { op }\\`) still warns, exactly as on the fleet map. A \\`#cap-\\` tag on\n such a flow is \\`usecase.capability-unresolved\\`: a capability is claimed on the\n fleet map, never inside one service. A resolved service-local \\`#req-\\` keeps its\n own grade and nothing else — it is not \\`keptBy\\`, not \\`Covers:\\`, and no feature\n carries one yet.\n- A FEATURE brings a flow the way it brings every other axis: write it at\n \\`features/<FEAT>/usecases/<name>.likec4\\` — the same views-only document, in the\n feature's own directory — and \\`loam archive\\` copies it into\n \\`architecture/usecases/\\` while \\`loam unarchive\\` takes it back. That is what lets\n an analyst add a cross-service requirement and an architect answer it with the\n flow that keeps it IN ONE CHANGE: the \\`#req-\\` tag resolves against this\n feature's own \\`capabilities/<cap>/spec.md\\` delta as well as the living tree, and\n \\`capability.uncovered\\` counts the flow as cover. The flow is graded against the\n map the same merge would leave behind, so a hop may name a service this\n feature's \\`delta.likec4\\` adds. Two refusals guard it, and \\`--approve\\` moves\n neither: \\`usecase.flow-exists\\` (the living \\`architecture/usecases/\\` already has\n that file — the merge is a whole-file copy, so edit the living one directly\n instead) and \\`usecase.flow-invalid\\` (loam could not read the flows against that\n post-merge map — most often a hop naming an element neither the living\n landscape nor the delta declares; the merge preview stages no service model, so\n a container an extending model declares is not among them either). Do NOT put a\n \\`dynamic view\\` inside\n \\`delta.likec4\\`: that document re-declares the landscape's own identifiers and\n carries its own \\`specification\\` block, so it cannot be read beside the map, and\n the archive refuses it by name. A feature's \\`delta.likec4\\` keeps that shape\n whatever shape the service models take — \\`features/**\\` stays excluded from the\n root LikeC4 project, and the delta is pointed at alone\n (\\`npx likec4 start features/<FEAT>\\`).\n`;\n"]}
|
|
@@ -227,9 +227,11 @@ follows is the other half — which command raises which:
|
|
|
227
227
|
workspace file, which loam never silently overwrites — pass \`--out\` or
|
|
228
228
|
\`--force\`) and \`invalid-option\`.
|
|
229
229
|
- \`loam seed --from fleet.yaml\`: \`seed-file-invalid\`, \`seed-duplicate-service\`,
|
|
230
|
-
\`seed-unknown-subsystem\`, \`seed-landscape-edited\`,
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
\`seed-unknown-subsystem\`, \`seed-landscape-edited\`, \`already-exists\` when a
|
|
231
|
+
generated views file in \`architecture/\` was written by somebody rather than by
|
|
232
|
+
loam (no \`// generated by loam\` first line — seed writes nothing at all in that
|
|
233
|
+
case), and \`unknown-service\` for a call endpoint nothing declares. An existing
|
|
234
|
+
service directory is never moved, and nothing is ever deleted.
|
|
233
235
|
- \`internal\` — an unexpected throw, the one code with no stable meaning.
|
|
234
236
|
|
|
235
237
|
\`--all\` reports a target per service, a target per feature in flight, and one target
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refusals.js","sourceRoot":"","sources":["../../../../src/core/agent/agents-md/refusals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqNvB,CAAC;AAEF;;2DAE2D","sourcesContent":["/**\n * What loam REFUSES: the OpenSpec migration surface, the containment and\n * unreadable-file findings, and the error-envelope codes. What happens to a\n * SHIPPED change — the archive gate, unarchive, and dropping a feature — is\n * the continuation section in ./shipped/archive-gate.ts, split there because\n * the two subjects had grown past one file's ceiling.\n *\n * Codes here are LISTED by the command that raises them, not glossed; the\n * meanings come from `loam explain <code>`, out of the running binary. See\n * ./command-map.ts's header for why the duplicated gloss left.\n *\n * THE ONE EXCEPTION IS THE FIRST BULLET. `loam explain` cannot answer\n * `openspec.*` or `mapping.*` — those commands grade a repository still in\n * another tool's shape, before it has a governed loop to look a code up from,\n * and the catalogue leaves them unanswered for that reason. Pointing this\n * section's reader at an explanation that does not exist is the exact failure\n * the pointer exists to prevent, so the migration notes stay written out here\n * until the catalogue reaches them. test/agent-contract.test.ts enforces the\n * boundary from the other side: every OTHER code backticked in AGENTS_MD must\n * resolve, so a family can never quietly lose its gloss and its explanation\n * at once.\n *\n * One section of the AGENTS.md template. ../agents-md.ts assembles the\n * document by PLAIN CONCATENATION — no join separator — so every section\n * starts at the first character of its opening line and ends with the newline\n * that closes its last one. Keep that shape when editing, or two sections glue\n * onto one line in every docs repo loam scaffolds from now on.\n */\nexport const REFUSALS = `- \\`loam audit-openspec <root>\\` is the read-only OpenSpec inventory; an explicit\n \\`--write-mapping\\` writes a non-overwriting, digest-bound decision skeleton\n outside the source tree. \\`loam migrate-openspec <root> --map <file>\\` validates\n that mapping and stays dry-run unless both \\`--apply\\` and an empty \\`--target\\`\n are supplied. Living/active shape diagnostics are \\`openspec.workspace-empty\\`\n (the audited root holds no living spec and no active change, so there is\n nothing to migrate and no verdict over it can be \\`ready\\`),\n \\`openspec.specs-missing\\`,\n \\`openspec.config-invalid\\`, \\`openspec.external-store-pointer\\`,\n \\`openspec.living-empty\\`, \\`openspec.living-requirements-outside-section\\`,\n \\`openspec.living-delta-section\\`, \\`openspec.nonstandard-living-spec\\` (markdown\n under \\`specs/\\` named neither spec.md nor design.md, so no capability reads\n it), \\`openspec.change-metadata-invalid\\`,\n \\`openspec.change-schema-unresolved\\`, \\`openspec.skip-specs-with-specs\\`,\n \\`openspec.change-no-specs\\`, \\`openspec.change-empty\\`,\n \\`openspec.change-without-delta-sections\\`,\n \\`openspec.change-requirements-outside-delta-sections\\`,\n \\`openspec.change-quoted-requirements\\` (requirements under a \\`## Requirements\\`\n heading INSIDE a change delta — the shape OpenSpec's own living-spec template\n mandates, and one that stages nothing, so loam refuses it rather than counting\n requirements it cannot route),\n \\`openspec.hidden-change-directory\\` (a dot-prefixed directory under\n \\`changes/\\` is not enumerated as a change, so nothing under it migrates —\n rename it or move it out; under \\`changes/archive/\\` the same code is an archive\n diagnostic and does not gate, because frozen history never blocks),\n \\`openspec.nonstandard-change-spec\\`, \\`openspec.renamed-malformed\\`,\n \\`openspec.requirement-id-invalid\\`, \\`openspec.requirement-id-repeated\\`,\n \\`openspec.requirement-id-duplicate\\` (a stable \\`Requirement-ID\\` that is\n malformed, declared twice, or shared by two requirements — identity is never\n inferred from an invalid declaration, so the RENAMED chain cannot be followed\n through it), \\`openspec.symlink-unsupported\\`, and \\`openspec.non-utf8-artifact\\`;\n the same shapes in frozen history are non-blocking archive diagnostics.\n Mapping refuses stale or incomplete decisions under \\`mapping.source-missing\\`,\n \\`mapping.source-root-mismatch\\`, \\`mapping.source-digest-mismatch\\`,\n \\`mapping.unknown-capability\\`, \\`mapping.unknown-requirement\\`,\n \\`mapping.requirement-allocation-missing\\`,\n \\`mapping.requirement-service-unknown\\`, \\`mapping.service-allocation-empty\\`,\n \\`mapping.unknown-change\\`, \\`mapping.change-title-missing\\`,\n \\`mapping.feature-id-invalid\\`, \\`mapping.feature-id-duplicate\\`,\n \\`mapping.unknown-rename\\`, \\`mapping.invalid-requirement-id\\`,\n \\`mapping.rename-source-missing\\`, \\`mapping.rename-source-ambiguous\\`,\n \\`mapping.rename-source-id-invalid\\`, \\`mapping.rename-target-conflict\\`,\n \\`mapping.rename-existing-id-conflict\\`, \\`mapping.rename-id-conflict\\`,\n \\`mapping.rename-double-source\\`, \\`mapping.rename-double-target\\`,\n \\`mapping.rename-chain\\`,\n \\`mapping.unknown-artifact\\`, and \\`mapping.invalid-artifact-disposition\\`.\n- Repository containment failures are explicit: \\`sources.path-outside\\` rejects a\n provenance source outside the service repo and \\`gherkin.path-outside\\` rejects a\n generated-suite target outside it. Federated verify recording refuses under\n \\`service-mismatch\\`, \\`unknown-service\\` or \\`repository-unavailable\\` when the\n selected service, fleet identity and repository commit cannot be bound safely,\n and under \\`record-federated\\` when the legacy all-at-once form would erase other\n repositories' attestations. \\`loam gherkin --service <id>\\` and\n \\`loam vouch --service <id>\\` answer that same wrong-repo pair\n (\\`repository-unavailable\\`, \\`service-mismatch\\`) for the same reason. Neither is\n \\`invalid-option\\`: the flags were right and the directory was wrong, so the fix\n is to re-run in the service's own checkout, never to re-read the invocation.\n- A file loam cannot read is reported, never skipped: \\`service.unreadable\\` and\n \\`feature.unreadable\\` (both errors) name the path and say that nothing about\n that target was checked while the rest of the fleet still was. The whole docs\n repo being unreachable is a refusal instead: \\`docs-missing\\` or\n \\`services-missing\\`.\n- Both modes read frontmatter (\\`frontmatter.missing\\`, \\`frontmatter.malformed\\`,\n \\`frontmatter.field-mismatch\\`,\n \\`frontmatter.status-unknown\\`, \\`frontmatter.field-missing\\`); a service's spec.md —\n and its arch.spec.md, same conventions — additionally carries the sources chain\n (\\`sources.absent\\`, \\`sources.path-missing\\`, \\`sources.empty\\`, \\`sources.skipped\\`,\n \\`sources.unvouched\\`, \\`sources.stale\\`) plus the two doc-side checks,\n \\`content.stale\\` and \\`sources.sampled-vouch\\`, which need no service repo and so\n fire from the docs repo too.\n- A service target run from the service's own repository also re-checks the\n \\`evidence_pins\\` its federated verification records carry, against the working\n tree: \\`evidence.checked\\` and \\`evidence.unpinned\\` are the confirmations,\n \\`evidence.unresolved\\`, \\`evidence.moved\\`, \\`evidence.line-changed\\`,\n \\`evidence.token-missing\\` and \\`evidence.record-unreadable\\` the warnings.\n Demote-only, by doctrine: a warn here is a reading priority for a reviewer,\n never a verdict change — no pin state moves \\`attested\\` or \\`verified\\` in\n either direction. From the docs repo the family is silent;\n \\`sources.unverifiable-from-here\\` already names that blind spot.\n- \\`loam archive\\` alone reports the breaches only the merge computation can see:\n \\`living.requirement-outside-requirements\\`, \\`openapi.op-modified\\`,\n \\`openapi.path-item-modified\\`, \\`openapi.component-modified\\`,\n \\`openapi.ref-unresolved\\`, \\`openapi.remove-marker-path-level\\`, the event\n axis's own trio \\`asyncapi.message-modified\\` / \\`asyncapi.channel-modified\\` /\n \\`asyncapi.operation-modified\\`, \\`asyncapi.ref-unresolved\\`,\n \\`asyncapi.remove-marker-inline\\` and \\`service.no-model\\`. Two of those are\n graded at validate time as well and are STRICTER here —\n \\`openapi.ref-unresolved\\` and \\`asyncapi.ref-unresolved\\` are warnings there and\n errors here, because the merged document is what would carry the dangling\n reference — so \\`loam explain\\` on either prints both contexts.\n\n\\`loam validate <target>\\` is the positional spelling of the first two: a feature id\nor a service id, tried in that order, so the feature wins when one name could be\nboth and \\`--service\\`/\\`--feature\\` force the reading. When the name really is both,\nthe run says so — \\`target.ambiguous\\` (warn) names the reading it took and the\nflag that forces the other, and \\`--json\\` carries \\`resolvedKind\\` — because a\nsilent precedence rule is a report about a target nobody asked for. The\npositional together with \\`--all\\`, \\`--service\\` or \\`--feature\\` is refused\n(\\`invalid-option\\`).\n\nTwo rendering levers change nothing else: \\`loam validate --errors-only\\` drops\nthe confirmations from the TEXT view (the \\`--json\\` payload is byte-identical),\nand \\`loam list --needs-work\\` narrows the service list to the ones with\nsomething missing — the adoption worklist. \\`loam list --needs-work --review-order\\`\norders that worklist by fan-in — the services the most other services depend on\nfirst: drawn call edges into each, plus event subscriptions (a drawn \\`consumes\\`\nedge, or a living \\`Consumes:\\` line naming a message it sends) — a count, never\na priority judgement — and its \\`--json\\` rows then additionally carry \\`fanIn\\`\nand \\`reviewRank\\`; without \\`--needs-work\\` the flag is refused (\\`invalid-option\\`).\n\nTwo campaign flags slice that same services section and change nothing about\nany row. \\`loam list --subsystem <name>\\` limits the listing to the services\nfiled under one subsystem, at any depth: \\`services[]\\`, the \\`maturity\\` rollup\nand \\`subsystems[]\\` reflect the slice (\\`unfiledServices\\` is omitted — it is a\nfleet-root fact), while every per-row fact — \\`fanIn\\`, \\`apiExpected\\`,\n\\`missing\\` — is still computed fleet-wide, so filtering changes which rows\nappear, never what a row says; with \\`--review-order\\` the filter applies first\nand \\`reviewRank\\` stays contiguous within the filtered worklist. The name\n\\`unfiled\\` selects the services filed under no subsystem while nothing in the\ntree claims that name (a real subsystem or service spelled \\`unfiled\\` wins).\nAn unknown name refuses \\`unknown-target\\` with close-name hints; a service\nname refuses \\`invalid-option\\`. \\`loam list --owners <path>\\` joins each listed\nservice's directory to the owning teams in the named CODEOWNERS file —\ndirectory-pattern rules only, last match wins, an owner-less directory rule\nCLEARING ownership for what it matches exactly as the forge reads it; a\nrecognised rule outside that subset (any other wildcard use, \\`*\\` included)\nis reported under \\`skippedRules\\`, never guessed at — and \\`--json\\` gains the additive \\`owners\\`\nkey (\\`path\\`, \\`teams[]\\` with each team's services in the listing's own\nfiltered-and-ordered row order, \\`unowned[]\\` listing the rows no rule matched,\n\\`skippedRules[]\\`), so the per-team arrays are the per-team campaign\nworklists. A CODEOWNERS path that cannot be read, or a line that cannot be\nparsed as \\`pattern owner…\\`, refuses \\`owners-unreadable\\` naming the path and\nline — fail-closed, exactly as \\`answers-unreadable\\` treats the other\nuser-named file. Either flag with the \\`features\\` or \\`capabilities\\` section\nis refused (\\`invalid-option\\`).\n\n\\`--strict\\` (every targeting mode, \\`--all\\` included) exits 1 when any error\nor warning exists — \\`ok\\`-severity findings are confirmations and never trip\nit. It changes the exit code and nothing else:\n\\`valid\\` still means \"no errors\", and the \\`--json\\` payload stays byte-for-byte\nwhat it was. The stricter grade is a per-invocation lever, visible in the CI\npipeline that passes the flag — deliberately not a per-repo profile.\n\n\\`loam delta <FEAT> --json\\` exits 1 when either authored document behind the brief\nfailed to parse — \\`architecture.errors\\` non-empty, or \\`openapi.unreadable\\` true —\nwith \\`ok: true\\` and the full payload intact: the empty C4 slice means the delta\ndid not parse, and an empty \\`api\\` beside \\`openapi.unreadable\\` means the contract\ndelta did not parse, neither of them \"this feature changes nothing there\". Branch\non the exit code before consuming either slice as a task brief.\n\nFindings with severity \\`ok\\` are confirmations, not work: \\`c4.valid\\`, \\`delta.valid\\`,\n\\`requirements.covered\\`, \\`api.covered\\`, \\`spine.resolved\\`, \\`event.covered\\`, \\`coherence.ok\\`,\n\\`landscape.matched\\`, \\`archedge.covered\\`, \\`sources.resolved\\`, \\`sources.current\\`,\n\\`sources.walked\\`, \\`gherkin.current\\`.\n\nA finding's \\`subject\\` names the service it is about. The envelope separates \\`ok\\` (the\ncommand ran) from \\`valid\\` (the docs pass). A refusal is \\`ok: false\\` with a stable\n\\`error.code\\`, and \\`loam explain <code>\\` has the meaning of every one of them. What\nfollows is the other half — which command raises which:\n\n- Before any command can read anything: \\`no-config\\`, \\`config-invalid\\`,\n \\`docs-missing\\`, \\`services-missing\\`, \\`unknown-target\\`, \\`invalid-option\\`.\n \\`invalid-option\\` covers flags that contradict each other AND a value that\n cannot be right — a \\`loam list\\` section that is not services or features, or a\n service id that is not a legal \\`services/<id>/\\` directory name.\n- Every JOURNALED writer — \\`archive\\`, \\`unarchive\\`, \\`rebase\\`, \\`vouch\\`, \\`new\\`,\n \\`gherkin\\`, \\`seed\\`, \\`subsystem\\` and \\`verify --record\\` — shares one transaction\n and therefore one set of refusals: \\`docs-busy\\`, \\`commit-interrupted\\`,\n \\`merge-failed\\` and \\`rollback-incomplete\\`. Learn them once and you have read\n them for all nine. \\`loam doctor\\` names the interrupted state as\n \\`doctor.commit-interrupted\\` and \\`loam validate\\` leads every mode with\n \\`docs.commit-interrupted\\` while the journal sits there; every journaled writer\n recovers a finished predecessor's journal on its next run and reports it as\n \\`recovered\\` in \\`--json\\`.\n- \\`loam new\\`: \\`already-exists\\` — also the answer when a concurrent \\`new\\` for the\n same id wins the race.\n- \\`loam vouch\\`: \\`sources-absent\\`, \\`sources-path-missing\\`, \\`vouch-raced\\`, and the\n wrong-repo pair \\`repository-unavailable\\` / \\`service-mismatch\\`, because\n \\`sources\\` resolve against the service's own checkout and from anywhere else\n those paths are somebody else's.\n- \\`loam archive\\`: \\`not-coherent\\`, \\`living-outside-requirements\\`,\n \\`archive-exists\\` — see the archive gate below.\n- \\`loam unarchive\\`: \\`feature-active\\`, \\`snapshot-missing\\`, \\`snapshot-stale\\`,\n \\`snapshot-corrupt\\`, \\`restore-failed\\` — see \"Taking an archive back\".\n- \\`loam gherkin\\`: \\`gherkin-conflict\\`, plus the same wrong-repo pair, refused\n before anything is written because the generated files land in the repo loam\n is standing in.\n- \\`loam subsystem\\`: \\`subsystem-not-empty\\`, \\`move-uncommitted\\`, \\`move-failed\\`,\n and \\`unknown-target\\` / \\`already-exists\\` / \\`invalid-option\\` for names that\n resolve to nothing, collide in the flat namespace, or break the grammar.\n \\`move-failed\\` is deliberately distinct from \\`merge-failed\\`: the move's own\n transaction rolled back cleanly, nothing changed, and re-running can work.\n- \\`loam verify --record\\` / \\`--results\\` / \\`--contract-results\\`:\n \\`answers-unreadable\\`, \\`answers-mismatch\\`, \\`answers-unevidenced\\`,\n \\`record-federated\\`, \\`record-unreadable\\` and \\`record-raced\\`. Two records for\n different services land in either order — the later one waits, then merges,\n and both attestations survive.\n- \\`loam open\\`: \\`no-members\\`, \\`binding-duplicate\\`, \\`already-exists\\` (the\n workspace file, which loam never silently overwrites — pass \\`--out\\` or\n \\`--force\\`) and \\`invalid-option\\`.\n- \\`loam seed --from fleet.yaml\\`: \\`seed-file-invalid\\`, \\`seed-duplicate-service\\`,\n \\`seed-unknown-subsystem\\`, \\`seed-landscape-edited\\`, and \\`unknown-service\\` for a\n call endpoint nothing declares. An existing service directory is never moved,\n and nothing is ever deleted.\n- \\`internal\\` — an unexpected throw, the one code with no stable meaning.\n\n\\`--all\\` reports a target per service, a target per feature in flight, and one target\nof kind \\`landscape\\` for the fleet-level checks that belong to no single service.\n\nThree different words for three different questions, and no command conflates them:\n\\`ok\\` — the command ran; \\`valid\\` — the documents pass (\\`validate\\`); \\`verified\\` —\nsomebody says the code was built and showed evidence (\\`verify\\`). A feature can be\nvalid and unverified, or verified and incoherent. Read the one you meant.\n`;\n\n/* The archive gate, unarchive, and dropping a feature continue in\n * ./shipped/archive-gate.ts — one document section split at its own subject\n * seam, concatenated after this one by ../agents-md.ts. */\n"]}
|
|
1
|
+
{"version":3,"file":"refusals.js","sourceRoot":"","sources":["../../../../src/core/agent/agents-md/refusals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuNvB,CAAC;AAEF;;2DAE2D","sourcesContent":["/**\n * What loam REFUSES: the OpenSpec migration surface, the containment and\n * unreadable-file findings, and the error-envelope codes. What happens to a\n * SHIPPED change — the archive gate, unarchive, and dropping a feature — is\n * the continuation section in ./shipped/archive-gate.ts, split there because\n * the two subjects had grown past one file's ceiling.\n *\n * Codes here are LISTED by the command that raises them, not glossed; the\n * meanings come from `loam explain <code>`, out of the running binary. See\n * ./command-map.ts's header for why the duplicated gloss left.\n *\n * THE ONE EXCEPTION IS THE FIRST BULLET. `loam explain` cannot answer\n * `openspec.*` or `mapping.*` — those commands grade a repository still in\n * another tool's shape, before it has a governed loop to look a code up from,\n * and the catalogue leaves them unanswered for that reason. Pointing this\n * section's reader at an explanation that does not exist is the exact failure\n * the pointer exists to prevent, so the migration notes stay written out here\n * until the catalogue reaches them. test/agent-contract.test.ts enforces the\n * boundary from the other side: every OTHER code backticked in AGENTS_MD must\n * resolve, so a family can never quietly lose its gloss and its explanation\n * at once.\n *\n * One section of the AGENTS.md template. ../agents-md.ts assembles the\n * document by PLAIN CONCATENATION — no join separator — so every section\n * starts at the first character of its opening line and ends with the newline\n * that closes its last one. Keep that shape when editing, or two sections glue\n * onto one line in every docs repo loam scaffolds from now on.\n */\nexport const REFUSALS = `- \\`loam audit-openspec <root>\\` is the read-only OpenSpec inventory; an explicit\n \\`--write-mapping\\` writes a non-overwriting, digest-bound decision skeleton\n outside the source tree. \\`loam migrate-openspec <root> --map <file>\\` validates\n that mapping and stays dry-run unless both \\`--apply\\` and an empty \\`--target\\`\n are supplied. Living/active shape diagnostics are \\`openspec.workspace-empty\\`\n (the audited root holds no living spec and no active change, so there is\n nothing to migrate and no verdict over it can be \\`ready\\`),\n \\`openspec.specs-missing\\`,\n \\`openspec.config-invalid\\`, \\`openspec.external-store-pointer\\`,\n \\`openspec.living-empty\\`, \\`openspec.living-requirements-outside-section\\`,\n \\`openspec.living-delta-section\\`, \\`openspec.nonstandard-living-spec\\` (markdown\n under \\`specs/\\` named neither spec.md nor design.md, so no capability reads\n it), \\`openspec.change-metadata-invalid\\`,\n \\`openspec.change-schema-unresolved\\`, \\`openspec.skip-specs-with-specs\\`,\n \\`openspec.change-no-specs\\`, \\`openspec.change-empty\\`,\n \\`openspec.change-without-delta-sections\\`,\n \\`openspec.change-requirements-outside-delta-sections\\`,\n \\`openspec.change-quoted-requirements\\` (requirements under a \\`## Requirements\\`\n heading INSIDE a change delta — the shape OpenSpec's own living-spec template\n mandates, and one that stages nothing, so loam refuses it rather than counting\n requirements it cannot route),\n \\`openspec.hidden-change-directory\\` (a dot-prefixed directory under\n \\`changes/\\` is not enumerated as a change, so nothing under it migrates —\n rename it or move it out; under \\`changes/archive/\\` the same code is an archive\n diagnostic and does not gate, because frozen history never blocks),\n \\`openspec.nonstandard-change-spec\\`, \\`openspec.renamed-malformed\\`,\n \\`openspec.requirement-id-invalid\\`, \\`openspec.requirement-id-repeated\\`,\n \\`openspec.requirement-id-duplicate\\` (a stable \\`Requirement-ID\\` that is\n malformed, declared twice, or shared by two requirements — identity is never\n inferred from an invalid declaration, so the RENAMED chain cannot be followed\n through it), \\`openspec.symlink-unsupported\\`, and \\`openspec.non-utf8-artifact\\`;\n the same shapes in frozen history are non-blocking archive diagnostics.\n Mapping refuses stale or incomplete decisions under \\`mapping.source-missing\\`,\n \\`mapping.source-root-mismatch\\`, \\`mapping.source-digest-mismatch\\`,\n \\`mapping.unknown-capability\\`, \\`mapping.unknown-requirement\\`,\n \\`mapping.requirement-allocation-missing\\`,\n \\`mapping.requirement-service-unknown\\`, \\`mapping.service-allocation-empty\\`,\n \\`mapping.unknown-change\\`, \\`mapping.change-title-missing\\`,\n \\`mapping.feature-id-invalid\\`, \\`mapping.feature-id-duplicate\\`,\n \\`mapping.unknown-rename\\`, \\`mapping.invalid-requirement-id\\`,\n \\`mapping.rename-source-missing\\`, \\`mapping.rename-source-ambiguous\\`,\n \\`mapping.rename-source-id-invalid\\`, \\`mapping.rename-target-conflict\\`,\n \\`mapping.rename-existing-id-conflict\\`, \\`mapping.rename-id-conflict\\`,\n \\`mapping.rename-double-source\\`, \\`mapping.rename-double-target\\`,\n \\`mapping.rename-chain\\`,\n \\`mapping.unknown-artifact\\`, and \\`mapping.invalid-artifact-disposition\\`.\n- Repository containment failures are explicit: \\`sources.path-outside\\` rejects a\n provenance source outside the service repo and \\`gherkin.path-outside\\` rejects a\n generated-suite target outside it. Federated verify recording refuses under\n \\`service-mismatch\\`, \\`unknown-service\\` or \\`repository-unavailable\\` when the\n selected service, fleet identity and repository commit cannot be bound safely,\n and under \\`record-federated\\` when the legacy all-at-once form would erase other\n repositories' attestations. \\`loam gherkin --service <id>\\` and\n \\`loam vouch --service <id>\\` answer that same wrong-repo pair\n (\\`repository-unavailable\\`, \\`service-mismatch\\`) for the same reason. Neither is\n \\`invalid-option\\`: the flags were right and the directory was wrong, so the fix\n is to re-run in the service's own checkout, never to re-read the invocation.\n- A file loam cannot read is reported, never skipped: \\`service.unreadable\\` and\n \\`feature.unreadable\\` (both errors) name the path and say that nothing about\n that target was checked while the rest of the fleet still was. The whole docs\n repo being unreachable is a refusal instead: \\`docs-missing\\` or\n \\`services-missing\\`.\n- Both modes read frontmatter (\\`frontmatter.missing\\`, \\`frontmatter.malformed\\`,\n \\`frontmatter.field-mismatch\\`,\n \\`frontmatter.status-unknown\\`, \\`frontmatter.field-missing\\`); a service's spec.md —\n and its arch.spec.md, same conventions — additionally carries the sources chain\n (\\`sources.absent\\`, \\`sources.path-missing\\`, \\`sources.empty\\`, \\`sources.skipped\\`,\n \\`sources.unvouched\\`, \\`sources.stale\\`) plus the two doc-side checks,\n \\`content.stale\\` and \\`sources.sampled-vouch\\`, which need no service repo and so\n fire from the docs repo too.\n- A service target run from the service's own repository also re-checks the\n \\`evidence_pins\\` its federated verification records carry, against the working\n tree: \\`evidence.checked\\` and \\`evidence.unpinned\\` are the confirmations,\n \\`evidence.unresolved\\`, \\`evidence.moved\\`, \\`evidence.line-changed\\`,\n \\`evidence.token-missing\\` and \\`evidence.record-unreadable\\` the warnings.\n Demote-only, by doctrine: a warn here is a reading priority for a reviewer,\n never a verdict change — no pin state moves \\`attested\\` or \\`verified\\` in\n either direction. From the docs repo the family is silent;\n \\`sources.unverifiable-from-here\\` already names that blind spot.\n- \\`loam archive\\` alone reports the breaches only the merge computation can see:\n \\`living.requirement-outside-requirements\\`, \\`openapi.op-modified\\`,\n \\`openapi.path-item-modified\\`, \\`openapi.component-modified\\`,\n \\`openapi.ref-unresolved\\`, \\`openapi.remove-marker-path-level\\`, the event\n axis's own trio \\`asyncapi.message-modified\\` / \\`asyncapi.channel-modified\\` /\n \\`asyncapi.operation-modified\\`, \\`asyncapi.ref-unresolved\\`,\n \\`asyncapi.remove-marker-inline\\` and \\`service.no-model\\`. Two of those are\n graded at validate time as well and are STRICTER here —\n \\`openapi.ref-unresolved\\` and \\`asyncapi.ref-unresolved\\` are warnings there and\n errors here, because the merged document is what would carry the dangling\n reference — so \\`loam explain\\` on either prints both contexts.\n\n\\`loam validate <target>\\` is the positional spelling of the first two: a feature id\nor a service id, tried in that order, so the feature wins when one name could be\nboth and \\`--service\\`/\\`--feature\\` force the reading. When the name really is both,\nthe run says so — \\`target.ambiguous\\` (warn) names the reading it took and the\nflag that forces the other, and \\`--json\\` carries \\`resolvedKind\\` — because a\nsilent precedence rule is a report about a target nobody asked for. The\npositional together with \\`--all\\`, \\`--service\\` or \\`--feature\\` is refused\n(\\`invalid-option\\`).\n\nTwo rendering levers change nothing else: \\`loam validate --errors-only\\` drops\nthe confirmations from the TEXT view (the \\`--json\\` payload is byte-identical),\nand \\`loam list --needs-work\\` narrows the service list to the ones with\nsomething missing — the adoption worklist. \\`loam list --needs-work --review-order\\`\norders that worklist by fan-in — the services the most other services depend on\nfirst: drawn call edges into each, plus event subscriptions (a drawn \\`consumes\\`\nedge, or a living \\`Consumes:\\` line naming a message it sends) — a count, never\na priority judgement — and its \\`--json\\` rows then additionally carry \\`fanIn\\`\nand \\`reviewRank\\`; without \\`--needs-work\\` the flag is refused (\\`invalid-option\\`).\n\nTwo campaign flags slice that same services section and change nothing about\nany row. \\`loam list --subsystem <name>\\` limits the listing to the services\nfiled under one subsystem, at any depth: \\`services[]\\`, the \\`maturity\\` rollup\nand \\`subsystems[]\\` reflect the slice (\\`unfiledServices\\` is omitted — it is a\nfleet-root fact), while every per-row fact — \\`fanIn\\`, \\`apiExpected\\`,\n\\`missing\\` — is still computed fleet-wide, so filtering changes which rows\nappear, never what a row says; with \\`--review-order\\` the filter applies first\nand \\`reviewRank\\` stays contiguous within the filtered worklist. The name\n\\`unfiled\\` selects the services filed under no subsystem while nothing in the\ntree claims that name (a real subsystem or service spelled \\`unfiled\\` wins).\nAn unknown name refuses \\`unknown-target\\` with close-name hints; a service\nname refuses \\`invalid-option\\`. \\`loam list --owners <path>\\` joins each listed\nservice's directory to the owning teams in the named CODEOWNERS file —\ndirectory-pattern rules only, last match wins, an owner-less directory rule\nCLEARING ownership for what it matches exactly as the forge reads it; a\nrecognised rule outside that subset (any other wildcard use, \\`*\\` included)\nis reported under \\`skippedRules\\`, never guessed at — and \\`--json\\` gains the additive \\`owners\\`\nkey (\\`path\\`, \\`teams[]\\` with each team's services in the listing's own\nfiltered-and-ordered row order, \\`unowned[]\\` listing the rows no rule matched,\n\\`skippedRules[]\\`), so the per-team arrays are the per-team campaign\nworklists. A CODEOWNERS path that cannot be read, or a line that cannot be\nparsed as \\`pattern owner…\\`, refuses \\`owners-unreadable\\` naming the path and\nline — fail-closed, exactly as \\`answers-unreadable\\` treats the other\nuser-named file. Either flag with the \\`features\\` or \\`capabilities\\` section\nis refused (\\`invalid-option\\`).\n\n\\`--strict\\` (every targeting mode, \\`--all\\` included) exits 1 when any error\nor warning exists — \\`ok\\`-severity findings are confirmations and never trip\nit. It changes the exit code and nothing else:\n\\`valid\\` still means \"no errors\", and the \\`--json\\` payload stays byte-for-byte\nwhat it was. The stricter grade is a per-invocation lever, visible in the CI\npipeline that passes the flag — deliberately not a per-repo profile.\n\n\\`loam delta <FEAT> --json\\` exits 1 when either authored document behind the brief\nfailed to parse — \\`architecture.errors\\` non-empty, or \\`openapi.unreadable\\` true —\nwith \\`ok: true\\` and the full payload intact: the empty C4 slice means the delta\ndid not parse, and an empty \\`api\\` beside \\`openapi.unreadable\\` means the contract\ndelta did not parse, neither of them \"this feature changes nothing there\". Branch\non the exit code before consuming either slice as a task brief.\n\nFindings with severity \\`ok\\` are confirmations, not work: \\`c4.valid\\`, \\`delta.valid\\`,\n\\`requirements.covered\\`, \\`api.covered\\`, \\`spine.resolved\\`, \\`event.covered\\`, \\`coherence.ok\\`,\n\\`landscape.matched\\`, \\`archedge.covered\\`, \\`sources.resolved\\`, \\`sources.current\\`,\n\\`sources.walked\\`, \\`gherkin.current\\`.\n\nA finding's \\`subject\\` names the service it is about. The envelope separates \\`ok\\` (the\ncommand ran) from \\`valid\\` (the docs pass). A refusal is \\`ok: false\\` with a stable\n\\`error.code\\`, and \\`loam explain <code>\\` has the meaning of every one of them. What\nfollows is the other half — which command raises which:\n\n- Before any command can read anything: \\`no-config\\`, \\`config-invalid\\`,\n \\`docs-missing\\`, \\`services-missing\\`, \\`unknown-target\\`, \\`invalid-option\\`.\n \\`invalid-option\\` covers flags that contradict each other AND a value that\n cannot be right — a \\`loam list\\` section that is not services or features, or a\n service id that is not a legal \\`services/<id>/\\` directory name.\n- Every JOURNALED writer — \\`archive\\`, \\`unarchive\\`, \\`rebase\\`, \\`vouch\\`, \\`new\\`,\n \\`gherkin\\`, \\`seed\\`, \\`subsystem\\` and \\`verify --record\\` — shares one transaction\n and therefore one set of refusals: \\`docs-busy\\`, \\`commit-interrupted\\`,\n \\`merge-failed\\` and \\`rollback-incomplete\\`. Learn them once and you have read\n them for all nine. \\`loam doctor\\` names the interrupted state as\n \\`doctor.commit-interrupted\\` and \\`loam validate\\` leads every mode with\n \\`docs.commit-interrupted\\` while the journal sits there; every journaled writer\n recovers a finished predecessor's journal on its next run and reports it as\n \\`recovered\\` in \\`--json\\`.\n- \\`loam new\\`: \\`already-exists\\` — also the answer when a concurrent \\`new\\` for the\n same id wins the race.\n- \\`loam vouch\\`: \\`sources-absent\\`, \\`sources-path-missing\\`, \\`vouch-raced\\`, and the\n wrong-repo pair \\`repository-unavailable\\` / \\`service-mismatch\\`, because\n \\`sources\\` resolve against the service's own checkout and from anywhere else\n those paths are somebody else's.\n- \\`loam archive\\`: \\`not-coherent\\`, \\`living-outside-requirements\\`,\n \\`archive-exists\\` — see the archive gate below.\n- \\`loam unarchive\\`: \\`feature-active\\`, \\`snapshot-missing\\`, \\`snapshot-stale\\`,\n \\`snapshot-corrupt\\`, \\`restore-failed\\` — see \"Taking an archive back\".\n- \\`loam gherkin\\`: \\`gherkin-conflict\\`, plus the same wrong-repo pair, refused\n before anything is written because the generated files land in the repo loam\n is standing in.\n- \\`loam subsystem\\`: \\`subsystem-not-empty\\`, \\`move-uncommitted\\`, \\`move-failed\\`,\n and \\`unknown-target\\` / \\`already-exists\\` / \\`invalid-option\\` for names that\n resolve to nothing, collide in the flat namespace, or break the grammar.\n \\`move-failed\\` is deliberately distinct from \\`merge-failed\\`: the move's own\n transaction rolled back cleanly, nothing changed, and re-running can work.\n- \\`loam verify --record\\` / \\`--results\\` / \\`--contract-results\\`:\n \\`answers-unreadable\\`, \\`answers-mismatch\\`, \\`answers-unevidenced\\`,\n \\`record-federated\\`, \\`record-unreadable\\` and \\`record-raced\\`. Two records for\n different services land in either order — the later one waits, then merges,\n and both attestations survive.\n- \\`loam open\\`: \\`no-members\\`, \\`binding-duplicate\\`, \\`already-exists\\` (the\n workspace file, which loam never silently overwrites — pass \\`--out\\` or\n \\`--force\\`) and \\`invalid-option\\`.\n- \\`loam seed --from fleet.yaml\\`: \\`seed-file-invalid\\`, \\`seed-duplicate-service\\`,\n \\`seed-unknown-subsystem\\`, \\`seed-landscape-edited\\`, \\`already-exists\\` when a\n generated views file in \\`architecture/\\` was written by somebody rather than by\n loam (no \\`// generated by loam\\` first line — seed writes nothing at all in that\n case), and \\`unknown-service\\` for a call endpoint nothing declares. An existing\n service directory is never moved, and nothing is ever deleted.\n- \\`internal\\` — an unexpected throw, the one code with no stable meaning.\n\n\\`--all\\` reports a target per service, a target per feature in flight, and one target\nof kind \\`landscape\\` for the fleet-level checks that belong to no single service.\n\nThree different words for three different questions, and no command conflates them:\n\\`ok\\` — the command ran; \\`valid\\` — the documents pass (\\`validate\\`); \\`verified\\` —\nsomebody says the code was built and showed evidence (\\`verify\\`). A feature can be\nvalid and unverified, or verified and incoherent. Read the one you meant.\n`;\n\n/* The archive gate, unarchive, and dropping a feature continue in\n * ./shipped/archive-gate.ts — one document section split at its own subject\n * seam, concatenated after this one by ../agents-md.ts. */\n"]}
|
|
@@ -18,12 +18,26 @@ loam has no server or database. Delete it and the documents still make sense.
|
|
|
18
18
|
|
|
19
19
|
\`architecture/landscape.likec4\` is the fleet map, and
|
|
20
20
|
\`architecture/adrs/\` optional system-level decisions — only their links are graded.
|
|
21
|
-
\`architecture/subsystems.likec4\`
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
\`architecture/subsystems.likec4\` and \`architecture/services.likec4\` are both
|
|
22
|
+
GENERATED by \`loam subsystem sync\` — one view per subsystem from the directory
|
|
23
|
+
tree under \`services/\`, and one overview view per service the fleet map draws.
|
|
24
|
+
Scoping aids, never hand-edited and never a second fleet map; each is stale
|
|
25
|
+
(\`subsystem.views-stale\`, one finding per file) until the next \`sync\`. Their one
|
|
26
|
+
styling opt-in is a \`global { styleGroup subsystems { … } }\` — or
|
|
27
|
+
\`styleGroup services\` — declared in any \`.likec4\` under \`architecture/\`, which
|
|
28
|
+
\`sync\` then references. A diagram you author belongs in the landscape or in a
|
|
29
|
+
file of your own name beside it; an authored view \`of\` an element the generated
|
|
30
|
+
file also draws is legal, and the file that sorts first wins the default
|
|
31
|
+
drill-down target while both stay reachable.
|
|
25
32
|
\`services/<id>/\` holds a boundary's living \`model.likec4\`, \`spec.md\`,
|
|
26
|
-
\`arch.spec.md\`, OpenAPI, AsyncAPI, runbook and health facts
|
|
33
|
+
\`arch.spec.md\`, OpenAPI, AsyncAPI, runbook and health facts — and
|
|
34
|
+
\`services/<…>/<id>/usecases/*.likec4\`, the slot for a \`dynamic view\` over that
|
|
35
|
+
service's OWN containers, tagged \`#req-<Requirement-ID>\`; a flow that crosses
|
|
36
|
+
services lives in \`architecture/usecases/\` and is tagged \`#cap-\` instead. Title
|
|
37
|
+
a service use case \`'<subsystem path> / <service id> / <use case>'\` — LikeC4
|
|
38
|
+
splits a view title on \`/\` into browser folders, so that convention lands the
|
|
39
|
+
flow in the same folder as the generated overview of its service. Nothing grades
|
|
40
|
+
the title, and nothing grades the slot's absence: presence is never owed.
|
|
27
41
|
\`features/<FEAT>/\` holds a change in flight: \`intent.md\`, \`delta.likec4\`,
|
|
28
42
|
per-service requirement and contract deltas, and \`verification.yaml\`.
|
|
29
43
|
\`features/archive/\` is shipped history.
|
|
@@ -78,7 +92,10 @@ decision or human-only act; the user does not have to type every loam command.
|
|
|
78
92
|
If loam or an agent integration behaves unexpectedly, invoke \`/loam-report\` (or
|
|
79
93
|
load \`$loam-report\` on a skills-only host). It collects a sanitized, reproducible
|
|
80
94
|
Markdown report under \`loam-reports/\` without repairing the repository, retrying a
|
|
81
|
-
writer or uploading anything.
|
|
95
|
+
writer or uploading anything. Reports are numbered — \`loam-reports/NNN-YYYY-MM-DD-<slug>.md\`,
|
|
96
|
+
cited by ordinal — and carry a \`Status:\` line, so \`loam doctor\` counts the
|
|
97
|
+
directory and says which ordinal the next report takes. This is support, not a
|
|
98
|
+
seventh lifecycle step.
|
|
82
99
|
|
|
83
100
|
## The cycle
|
|
84
101
|
|
|
@@ -86,7 +103,9 @@ writer or uploading anything. This is support, not a seventh lifecycle step.
|
|
|
86
103
|
\`loam init --docs <path-to-docs-repo> --service <id>\`, then \`loam doctor\`.
|
|
87
104
|
1. **Adopt** — for an undocumented boundary load \`loam instructions loam-adopt
|
|
88
105
|
<id>\`, then use \`loam adopt --service <id> --json\`. Write drafts; a person,
|
|
89
|
-
never an agent, later vouches for them.
|
|
106
|
+
never an agent, later vouches for them. Draw the map's edges in the same pass:
|
|
107
|
+
the brief's \`landscape.touched\` is the only place an edgeless element is named,
|
|
108
|
+
and \`landscape.service-isolated\` (fleet scope) goes quiet on the first edge.
|
|
90
109
|
2. **Understand** — start or resume with \`loam status --json\`; its ordered
|
|
91
110
|
\`next[]\` is the work queue. Read \`next[0].execution\`: run it only when
|
|
92
111
|
\`runnable\` is true; otherwise use \`kind\`, \`cwd\`, \`needs\` and \`after\`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents-md.js","sourceRoot":"","sources":["../../../src/core/agent/agents-md.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiKnB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,eAAe,CAAC,YAAY,CAAC,KAAK,WAAW,EAAE,CAAC","sourcesContent":["/**\n * The small, always-loaded orientation contract for a loam docs repository.\n *\n * Detailed grammars and workflows live behind `loam instructions`: those pages\n * describe the binary that is about to run, while this file is written once and\n * may be loaded into every agent turn for years. Keep only enough here to form\n * the next question, find the relevant page, and avoid an unsafe write.\n */\nimport { agentsStampLine } from \"./agents-stamp.js\";\nimport { LOAM_VERSION } from \"../envelope/version.js\";\n\nconst ORIENTATION = `# Working in this docs repo\n\nThis is a **loam** docs repo: plain files are the shared source of truth for a governed software\nfleet's architecture, requirements, contracts and verification evidence. A service may be a modular monolith, a network service, a CLI or a worker.\nloam has no server or database. Delete it and the documents still make sense.\n\n## What is where\n\n\\`architecture/landscape.likec4\\` is the fleet map, and\n\\`architecture/adrs/\\` optional system-level decisions — only their links are graded.\n\\`architecture/subsystems.likec4\\` is GENERATED by \\`loam subsystem sync\\` from the\ndirectory tree under \\`services/\\` — one view per subsystem, a scoping aid, never\nhand-edited and never a second fleet map. A diagram you author belongs in the\nlandscape or in a file of your own name beside it.\n\\`services/<id>/\\` holds a boundary's living \\`model.likec4\\`, \\`spec.md\\`,\n\\`arch.spec.md\\`, OpenAPI, AsyncAPI, runbook and health facts.\n\\`features/<FEAT>/\\` holds a change in flight: \\`intent.md\\`, \\`delta.likec4\\`,\nper-service requirement and contract deltas, and \\`verification.yaml\\`.\n\\`features/archive/\\` is shipped history.\n\nLiving documents are the complete current state. A feature document is a diff\nagainst them, reviewed as a diff; \\`loam archive\\` folds it into living state.\nDo not hand-edit the living landscape to add a feature change.\n\n## Linking between documents\n\nDocuments join with **standard markdown links** whose targets are real relative\npaths, for example \\`[decision](../adrs/ADR-001.md)\\`. They render in pull-request\nreview instead of showing literal brackets,\nand make “does this link resolve” a filesystem question; \\`[[Wikilinks]]\\` would\nrequire shortest-unique-path guessing.\nObsidian supports markdown links, autocomplete and rename-tracking when its\nwikilink setting is off. \\`link.unresolved\\` grades missing targets and CASE\n**is** graded; links outside this repository, \\`#section\\` targets, a fenced code\nblock or an inline code span are deliberately not graded.\n\n## \\`loam.json\\` — the wiring\n\nEvery repository commits its own \\`loam.json\\`:\n\n\\`{ \"docsDir\": \"../docs\", \"service\": \"payment-service\", \"gherkinDir\": \"features\" }\\`\n\n\\`docsDir\\` is stored exactly as it was passed and resolved against the directory\nholding the \\`loam.json\\`, so a relative path survives a clone; an absolute one\nraises \\`doctor.docs-absolute\\`. \\`service\\` binds a service checkout to the one boundary\nit may write evidence for. \\`gherkinDir\\` is optional. \\`agentTools\\` and\n\\`agentProfile\\` record which agent surfaces and workflow subset init manages;\n\\`agentFiles\\` records digests so unchanged generated pointers can refresh while\ncustomized ones remain untouched. With no config, loam refuses with \\`no-config\\`\nrather than guessing.\n\n\\`loam init --docs <dir>\\` **joins** an existing docs repo. Add \\`--create\\` only\nwhen creating a new one; a typo must not scaffold a second source of truth.\n\n## Starting from chat\n\nThere are two equivalent entry points into the same version-matched protocol.\nPrefer the explicit one when a user wants a predictable lifecycle: invoke\n\\`/loam-feature <FEAT> \"<title>\"\\` to propose, \\`/loam-implement <FEAT> [service]\\`\nto build, \\`/loam-check\\` and \\`/loam-verify <FEAT>\\` to grade it, and\n\\`/loam-ship <FEAT>\\` to finish. Most hosts use that flat slash\nspelling; Gemini uses \\`/loam:feature\\`, Amazon Q uses \\`@loam-feature\\`, and a\nskills-only host can invoke \\`$loam-feature\\`. Natural-language requests may load\nthe matching Agent Skill instead. Once either entry point is selected, the agent\ndrives the internal status/edit/validate loop and asks the user only for a real\ndecision or human-only act; the user does not have to type every loam command.\n\nIf loam or an agent integration behaves unexpectedly, invoke \\`/loam-report\\` (or\nload \\`$loam-report\\` on a skills-only host). It collects a sanitized, reproducible\nMarkdown report under \\`loam-reports/\\` without repairing the repository, retrying a\nwriter or uploading anything. This is support, not a seventh lifecycle step.\n\n## The cycle\n\n0. **Wire the repo** — in each service checkout run\n \\`loam init --docs <path-to-docs-repo> --service <id>\\`, then \\`loam doctor\\`.\n1. **Adopt** — for an undocumented boundary load \\`loam instructions loam-adopt\n <id>\\`, then use \\`loam adopt --service <id> --json\\`. Write drafts; a person,\n never an agent, later vouches for them.\n2. **Understand** — start or resume with \\`loam status --json\\`; its ordered\n \\`next[]\\` is the work queue. Read \\`next[0].execution\\`: run it only when\n \\`runnable\\` is true; otherwise use \\`kind\\`, \\`cwd\\`, \\`needs\\` and \\`after\\`\n to complete the edit or external-repo step. Use \\`loam list --json\\`, \\`loam show <id> --json\\`\n and \\`loam explore <id> --json\\` before proposing a change. Never propose a\n change to a service you have not read.\n3. **Scaffold** — load \\`loam instructions loam-feature <FEAT>\\`, then run\n \\`loam new <FEAT> --title \"...\" --touches <service>\\`.\n4. **Author** — fill the scaffolded TODOs and run \\`loam rebase <FEAT>\\` after\n reading the living baselines. The exact joins and authoring grammars are in\n the reference pages below.\n5. **Check** — load \\`loam instructions loam-check --no-fix-tables\\`, run\n \\`loam validate <FEAT> --json\\`, and use \\`loam explain <code>\\` for reported\n codes. \\`loam dependencies --json\\` names features that must archive first.\n6. **Build** — load \\`loam instructions loam-implement <FEAT>\\`.\n \\`loam delta <FEAT> --service <id> --json\\` is one service's task; in that\n service checkout, \\`loam gherkin <FEAT>\\` emits its executable scenarios.\n7. **Verify** — \\`loam verify <FEAT> --json\\` is the checklist. Record evidence\n from each affected service's own checkout. Read\n \\`loam instructions loam-done-check\\` before recording anything.\n8. **Ship** — load \\`loam instructions loam-ship <FEAT>\\`; begin with\n \\`loam archive <FEAT> --dry-run --json\\`, then archive only after the code is\n merged and the plan is the one reviewed.\n\n## Reading loam's output\n\nEvery command takes \\`--json\\`. The envelope has \\`contractVersion\\`, \\`ok\\` and,\non refusal, \\`error.code\\`. Unknown flags are \\`invalid-option\\`; \\`--help\\` and\n\\`--version\\` pass through. Branch on stable codes, never message prose.\n\nValidation \\`findings[]\\` carry \\`severity\\`; archive-related findings also carry\n\\`gates\\`. Severity and gating are two different questions: errors invalidate,\nwhile \\`gates: true\\` makes archive refuse — archive is gated on coherence, so a\ngating finding stops it whatever its severity. Advisory warnings never block.\n\\`--approve\\` overrides the gating issues — only those that are judgement calls —\nand never a mechanical loss. For example \\`delta.requirement-not-merged\\` warns but gates;\n\\`living.requirement-outside-requirements\\` cannot be approved, while\n\\`openapi.op-modified\\` is reviewable.\n\n\\`loam status --json\\` orders executable next actions. Findings include structured\n\\`locations[]\\`; use their paths instead of extracting filenames from prose.\n\\`loam show <FEAT> --json\\` includes a \\`review\\` pack with intent, architecture,\ncontracts, dependencies, verification, blockers and the same next actions.\n\\`loam explain <code> --json\\`\nreturns one code's meaning and fix; \\`loam explain --codes --json\\` lists them.\nWhich codes an INVOCATION can raise is in \\`loam instructions loam-codes\\`.\n\n## The identity rule\n\nA service is the element whose \\`metadata { service '<id>' }\\` matches its\n\\`services/<id>/\\` directory. An exact element id is the legacy fallback. Never\ninfer identity from display names or containment. Relationships join to contracts\nthrough exact ids: OpenAPI \\`operationId\\`, requirement \\`Operations:\\`, and C4\n\\`metadata { op '...' }\\`. Consult \\`loam instructions loam-spine\\` before editing\na join.\n\n## Reference pages — fetch when needed\n\n- \\`loam instructions loam-codes\\` — finding/refusal inventory and fixes.\n- \\`loam instructions loam-spine\\` — operation, message, coverage, permission,\n capability and baseline joins.\n- \\`loam instructions loam-authoring\\` — arch requirements, generated Gherkin\n and frontmatter/vouch grammar.\n- \\`loam instructions loam-done-check\\` — verification evidence and verdicts.\n\nBare \\`loam instructions\\` lists the six workflows, the separate \\`loam-report\\`\nsupport protocol and these references. Generated agent command/skill files are\nsmall pointers to them, so the runtime page wins if an old pointer disagrees with\nthe installed binary. MCP clients can read the same pages as\n\\`loam://orientation\\` and \\`loam://instructions/<name>\\` resources.\n\n## Safety and hand-back\n\nloam's writers are journaled, but the lifecycle still matters. Do not run\n\\`loam vouch\\` for a human, do not invent evidence, do not archive before code is\nmerged, and do not edit generated files under \\`<gherkinDir>/loam/\\` by hand.\n\\`loam unarchive <FEAT>\\` is the supported undo. To abandon a feature that was\nnever archived, review it and use \\`git rm -r features/<FEAT>\\`; loam deliberately\nhas no destructive drop command.\n\nFinish by reporting remaining warnings, unverifiable claims, files or directories\nyou did not inspect, and the exact human action still owed.\n`;\n\nexport const AGENTS_MD = `${agentsStampLine(LOAM_VERSION)}\\n${ORIENTATION}`;\n"]}
|
|
1
|
+
{"version":3,"file":"agents-md.js","sourceRoot":"","sources":["../../../src/core/agent/agents-md.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoLnB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,eAAe,CAAC,YAAY,CAAC,KAAK,WAAW,EAAE,CAAC","sourcesContent":["/**\n * The small, always-loaded orientation contract for a loam docs repository.\n *\n * Detailed grammars and workflows live behind `loam instructions`: those pages\n * describe the binary that is about to run, while this file is written once and\n * may be loaded into every agent turn for years. Keep only enough here to form\n * the next question, find the relevant page, and avoid an unsafe write.\n */\nimport { agentsStampLine } from \"./agents-stamp.js\";\nimport { LOAM_VERSION } from \"../envelope/version.js\";\n\nconst ORIENTATION = `# Working in this docs repo\n\nThis is a **loam** docs repo: plain files are the shared source of truth for a governed software\nfleet's architecture, requirements, contracts and verification evidence. A service may be a modular monolith, a network service, a CLI or a worker.\nloam has no server or database. Delete it and the documents still make sense.\n\n## What is where\n\n\\`architecture/landscape.likec4\\` is the fleet map, and\n\\`architecture/adrs/\\` optional system-level decisions — only their links are graded.\n\\`architecture/subsystems.likec4\\` and \\`architecture/services.likec4\\` are both\nGENERATED by \\`loam subsystem sync\\` — one view per subsystem from the directory\ntree under \\`services/\\`, and one overview view per service the fleet map draws.\nScoping aids, never hand-edited and never a second fleet map; each is stale\n(\\`subsystem.views-stale\\`, one finding per file) until the next \\`sync\\`. Their one\nstyling opt-in is a \\`global { styleGroup subsystems { … } }\\` — or\n\\`styleGroup services\\` — declared in any \\`.likec4\\` under \\`architecture/\\`, which\n\\`sync\\` then references. A diagram you author belongs in the landscape or in a\nfile of your own name beside it; an authored view \\`of\\` an element the generated\nfile also draws is legal, and the file that sorts first wins the default\ndrill-down target while both stay reachable.\n\\`services/<id>/\\` holds a boundary's living \\`model.likec4\\`, \\`spec.md\\`,\n\\`arch.spec.md\\`, OpenAPI, AsyncAPI, runbook and health facts — and\n\\`services/<…>/<id>/usecases/*.likec4\\`, the slot for a \\`dynamic view\\` over that\nservice's OWN containers, tagged \\`#req-<Requirement-ID>\\`; a flow that crosses\nservices lives in \\`architecture/usecases/\\` and is tagged \\`#cap-\\` instead. Title\na service use case \\`'<subsystem path> / <service id> / <use case>'\\` — LikeC4\nsplits a view title on \\`/\\` into browser folders, so that convention lands the\nflow in the same folder as the generated overview of its service. Nothing grades\nthe title, and nothing grades the slot's absence: presence is never owed.\n\\`features/<FEAT>/\\` holds a change in flight: \\`intent.md\\`, \\`delta.likec4\\`,\nper-service requirement and contract deltas, and \\`verification.yaml\\`.\n\\`features/archive/\\` is shipped history.\n\nLiving documents are the complete current state. A feature document is a diff\nagainst them, reviewed as a diff; \\`loam archive\\` folds it into living state.\nDo not hand-edit the living landscape to add a feature change.\n\n## Linking between documents\n\nDocuments join with **standard markdown links** whose targets are real relative\npaths, for example \\`[decision](../adrs/ADR-001.md)\\`. They render in pull-request\nreview instead of showing literal brackets,\nand make “does this link resolve” a filesystem question; \\`[[Wikilinks]]\\` would\nrequire shortest-unique-path guessing.\nObsidian supports markdown links, autocomplete and rename-tracking when its\nwikilink setting is off. \\`link.unresolved\\` grades missing targets and CASE\n**is** graded; links outside this repository, \\`#section\\` targets, a fenced code\nblock or an inline code span are deliberately not graded.\n\n## \\`loam.json\\` — the wiring\n\nEvery repository commits its own \\`loam.json\\`:\n\n\\`{ \"docsDir\": \"../docs\", \"service\": \"payment-service\", \"gherkinDir\": \"features\" }\\`\n\n\\`docsDir\\` is stored exactly as it was passed and resolved against the directory\nholding the \\`loam.json\\`, so a relative path survives a clone; an absolute one\nraises \\`doctor.docs-absolute\\`. \\`service\\` binds a service checkout to the one boundary\nit may write evidence for. \\`gherkinDir\\` is optional. \\`agentTools\\` and\n\\`agentProfile\\` record which agent surfaces and workflow subset init manages;\n\\`agentFiles\\` records digests so unchanged generated pointers can refresh while\ncustomized ones remain untouched. With no config, loam refuses with \\`no-config\\`\nrather than guessing.\n\n\\`loam init --docs <dir>\\` **joins** an existing docs repo. Add \\`--create\\` only\nwhen creating a new one; a typo must not scaffold a second source of truth.\n\n## Starting from chat\n\nThere are two equivalent entry points into the same version-matched protocol.\nPrefer the explicit one when a user wants a predictable lifecycle: invoke\n\\`/loam-feature <FEAT> \"<title>\"\\` to propose, \\`/loam-implement <FEAT> [service]\\`\nto build, \\`/loam-check\\` and \\`/loam-verify <FEAT>\\` to grade it, and\n\\`/loam-ship <FEAT>\\` to finish. Most hosts use that flat slash\nspelling; Gemini uses \\`/loam:feature\\`, Amazon Q uses \\`@loam-feature\\`, and a\nskills-only host can invoke \\`$loam-feature\\`. Natural-language requests may load\nthe matching Agent Skill instead. Once either entry point is selected, the agent\ndrives the internal status/edit/validate loop and asks the user only for a real\ndecision or human-only act; the user does not have to type every loam command.\n\nIf loam or an agent integration behaves unexpectedly, invoke \\`/loam-report\\` (or\nload \\`$loam-report\\` on a skills-only host). It collects a sanitized, reproducible\nMarkdown report under \\`loam-reports/\\` without repairing the repository, retrying a\nwriter or uploading anything. Reports are numbered — \\`loam-reports/NNN-YYYY-MM-DD-<slug>.md\\`,\ncited by ordinal — and carry a \\`Status:\\` line, so \\`loam doctor\\` counts the\ndirectory and says which ordinal the next report takes. This is support, not a\nseventh lifecycle step.\n\n## The cycle\n\n0. **Wire the repo** — in each service checkout run\n \\`loam init --docs <path-to-docs-repo> --service <id>\\`, then \\`loam doctor\\`.\n1. **Adopt** — for an undocumented boundary load \\`loam instructions loam-adopt\n <id>\\`, then use \\`loam adopt --service <id> --json\\`. Write drafts; a person,\n never an agent, later vouches for them. Draw the map's edges in the same pass:\n the brief's \\`landscape.touched\\` is the only place an edgeless element is named,\n and \\`landscape.service-isolated\\` (fleet scope) goes quiet on the first edge.\n2. **Understand** — start or resume with \\`loam status --json\\`; its ordered\n \\`next[]\\` is the work queue. Read \\`next[0].execution\\`: run it only when\n \\`runnable\\` is true; otherwise use \\`kind\\`, \\`cwd\\`, \\`needs\\` and \\`after\\`\n to complete the edit or external-repo step. Use \\`loam list --json\\`, \\`loam show <id> --json\\`\n and \\`loam explore <id> --json\\` before proposing a change. Never propose a\n change to a service you have not read.\n3. **Scaffold** — load \\`loam instructions loam-feature <FEAT>\\`, then run\n \\`loam new <FEAT> --title \"...\" --touches <service>\\`.\n4. **Author** — fill the scaffolded TODOs and run \\`loam rebase <FEAT>\\` after\n reading the living baselines. The exact joins and authoring grammars are in\n the reference pages below.\n5. **Check** — load \\`loam instructions loam-check --no-fix-tables\\`, run\n \\`loam validate <FEAT> --json\\`, and use \\`loam explain <code>\\` for reported\n codes. \\`loam dependencies --json\\` names features that must archive first.\n6. **Build** — load \\`loam instructions loam-implement <FEAT>\\`.\n \\`loam delta <FEAT> --service <id> --json\\` is one service's task; in that\n service checkout, \\`loam gherkin <FEAT>\\` emits its executable scenarios.\n7. **Verify** — \\`loam verify <FEAT> --json\\` is the checklist. Record evidence\n from each affected service's own checkout. Read\n \\`loam instructions loam-done-check\\` before recording anything.\n8. **Ship** — load \\`loam instructions loam-ship <FEAT>\\`; begin with\n \\`loam archive <FEAT> --dry-run --json\\`, then archive only after the code is\n merged and the plan is the one reviewed.\n\n## Reading loam's output\n\nEvery command takes \\`--json\\`. The envelope has \\`contractVersion\\`, \\`ok\\` and,\non refusal, \\`error.code\\`. Unknown flags are \\`invalid-option\\`; \\`--help\\` and\n\\`--version\\` pass through. Branch on stable codes, never message prose.\n\nValidation \\`findings[]\\` carry \\`severity\\`; archive-related findings also carry\n\\`gates\\`. Severity and gating are two different questions: errors invalidate,\nwhile \\`gates: true\\` makes archive refuse — archive is gated on coherence, so a\ngating finding stops it whatever its severity. Advisory warnings never block.\n\\`--approve\\` overrides the gating issues — only those that are judgement calls —\nand never a mechanical loss. For example \\`delta.requirement-not-merged\\` warns but gates;\n\\`living.requirement-outside-requirements\\` cannot be approved, while\n\\`openapi.op-modified\\` is reviewable.\n\n\\`loam status --json\\` orders executable next actions. Findings include structured\n\\`locations[]\\`; use their paths instead of extracting filenames from prose.\n\\`loam show <FEAT> --json\\` includes a \\`review\\` pack with intent, architecture,\ncontracts, dependencies, verification, blockers and the same next actions.\n\\`loam explain <code> --json\\`\nreturns one code's meaning and fix; \\`loam explain --codes --json\\` lists them.\nWhich codes an INVOCATION can raise is in \\`loam instructions loam-codes\\`.\n\n## The identity rule\n\nA service is the element whose \\`metadata { service '<id>' }\\` matches its\n\\`services/<id>/\\` directory. An exact element id is the legacy fallback. Never\ninfer identity from display names or containment. Relationships join to contracts\nthrough exact ids: OpenAPI \\`operationId\\`, requirement \\`Operations:\\`, and C4\n\\`metadata { op '...' }\\`. Consult \\`loam instructions loam-spine\\` before editing\na join.\n\n## Reference pages — fetch when needed\n\n- \\`loam instructions loam-codes\\` — finding/refusal inventory and fixes.\n- \\`loam instructions loam-spine\\` — operation, message, coverage, permission,\n capability and baseline joins.\n- \\`loam instructions loam-authoring\\` — arch requirements, generated Gherkin\n and frontmatter/vouch grammar.\n- \\`loam instructions loam-done-check\\` — verification evidence and verdicts.\n\nBare \\`loam instructions\\` lists the six workflows, the separate \\`loam-report\\`\nsupport protocol and these references. Generated agent command/skill files are\nsmall pointers to them, so the runtime page wins if an old pointer disagrees with\nthe installed binary. MCP clients can read the same pages as\n\\`loam://orientation\\` and \\`loam://instructions/<name>\\` resources.\n\n## Safety and hand-back\n\nloam's writers are journaled, but the lifecycle still matters. Do not run\n\\`loam vouch\\` for a human, do not invent evidence, do not archive before code is\nmerged, and do not edit generated files under \\`<gherkinDir>/loam/\\` by hand.\n\\`loam unarchive <FEAT>\\` is the supported undo. To abandon a feature that was\nnever archived, review it and use \\`git rm -r features/<FEAT>\\`; loam deliberately\nhas no destructive drop command.\n\nFinish by reporting remaining warnings, unverifiable claims, files or directories\nyou did not inspect, and the exact human action still owed.\n`;\n\nexport const AGENTS_MD = `${agentsStampLine(LOAM_VERSION)}\\n${ORIENTATION}`;\n"]}
|
|
@@ -63,11 +63,31 @@ more for secrets before handing it back.
|
|
|
63
63
|
|
|
64
64
|
## Write one separate report
|
|
65
65
|
|
|
66
|
-
Create \`loam-reports/YYYY-MM-DD-<short-slug>.md\`
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
Create \`loam-reports/NNN-YYYY-MM-DD-<short-slug>.md\` in the directory holding the \`loam.json\` that
|
|
67
|
+
resolved — or, when a \`loam.json\` was found but does not parse, beside that file, so a report about
|
|
68
|
+
the broken config joins the corpus already there; only when there is no config file at or above you
|
|
69
|
+
is it the directory you run in.
|
|
70
|
+
\`loam doctor --json\` hands you that whole directory — that root WITH \`loam-reports/\`
|
|
71
|
+
already on the end — as \`reports.dir\`: write inside the path it gives, never joined onto
|
|
72
|
+
\`loam-reports/\` a second time. \`NNN\` is an ordinal of at least three digits, zero-padded, one more
|
|
73
|
+
than the highest already in that directory — read \`reports.next\` from the same output, which says
|
|
74
|
+
\`001\` when the directory is empty or absent, and widens past three digits rather than reusing a
|
|
75
|
+
number once the corpus gets there. Use a short neutral slug based on the symptom, not a customer,
|
|
76
|
+
person or secret. Never
|
|
77
|
+
overwrite a different incident: a path that already exists means a concurrent report claimed that
|
|
78
|
+
ordinal, so take the next one rather than adding a suffix. That check is on the PATH, and the
|
|
79
|
+
promise is about the ordinal, so re-run \`loam doctor --json\` after writing: if two entries carry
|
|
80
|
+
the same \`ordinal\`, the one with the later \`Recorded\` timestamp renames itself to the next free
|
|
81
|
+
number. The ordinal is the report's handle —
|
|
82
|
+
cite one by its number in a commit message, an issue, or another report's cross-references, and
|
|
83
|
+
never by filename, which is free to be renamed. The ordinal is unique within that directory, not
|
|
84
|
+
across a fleet: a service repository and the docs repository each number their own, so when two
|
|
85
|
+
repositories are in play cite \`<repo>/loam-reports/NNN\`.
|
|
86
|
+
|
|
87
|
+
Reports are ordinary project files so the team can review or commit them deliberately, but
|
|
88
|
+
do not upload, submit an issue, send telemetry, or contact any service automatically.
|
|
89
|
+
\`loam doctor\` reads the directory — how many reports it holds, how many are in each status, and
|
|
90
|
+
which ordinal comes next — and that is a local read of local files: nothing is transmitted.
|
|
71
91
|
|
|
72
92
|
Use this shape, omitting only fields that truly cannot be known and marking them \`not collected\`:
|
|
73
93
|
|
|
@@ -75,6 +95,7 @@ Use this shape, omitting only fields that truly cannot be known and marking them
|
|
|
75
95
|
|
|
76
96
|
- Recorded: <ISO-8601 timestamp>
|
|
77
97
|
- Classification: <one value above>
|
|
98
|
+
- Status: open
|
|
78
99
|
- Repository role: <docs | service | combined | unresolved>
|
|
79
100
|
- loam version: <version>
|
|
80
101
|
- Entry point: <chat command, skill, or CLI command; sanitized>
|
|
@@ -91,6 +112,19 @@ Use this shape, omitting only fields that truly cannot be known and marking them
|
|
|
91
112
|
## Missing evidence
|
|
92
113
|
## Sanitization
|
|
93
114
|
|
|
115
|
+
\`Status\` is written as \`open\` and stays the report's own record of where it got to. The vocabulary
|
|
116
|
+
is \`open\`, \`sent\` (handed to loam's author — the person forwarding a report sets this, never the
|
|
117
|
+
agent writing it), \`fixed in <version>\`, and \`superseded by <NNN>\` naming the report that
|
|
118
|
+
replaced this one. Close a report by editing its own \`Status\` line: there is no index to keep in
|
|
119
|
+
step, and \`loam doctor\` counts the directory by reading that line's first word, so
|
|
120
|
+
\`fixed in 0.2.0-alpha.5\` counts as fixed. It reads that line from the HEADER FIELD BLOCK only —
|
|
121
|
+
the lines above the first \`##\` heading, quoted code skipped in either markdown spelling: a fence
|
|
122
|
+
(closed only by a run of the same character at least as long as the one that opened it, so a
|
|
123
|
+
\`\`\` inside a \`\`\`\` block is content) and an indented block, which is the shape THIS template is
|
|
124
|
+
printed in above. So a report that quotes this template, however it quotes it, still counts as
|
|
125
|
+
whatever its own header says. A report written before this
|
|
126
|
+
field existed has no \`Status\` line and counts as unstated.
|
|
127
|
+
|
|
94
128
|
In \`Machine contract\`, include exit code plus the stable envelope fields and relevant finding
|
|
95
129
|
codes/locations; do not paste an entire large JSON payload. In \`Sanitization\`, list the kinds of
|
|
96
130
|
values removed without revealing them. If no workaround is known, say so rather than inventing one.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../../../src/core/agent/support/report.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAmB;IACzC,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,uFAAuF;IACzF,YAAY,EAAE,EAAE;IAChB,OAAO,EACL,oOAAoO;IACtO,UAAU,EAAE,+BAA+B;IAC3C,YAAY,EAAE,EAAE;IAChB,KAAK,EAAE;QACL,+EAA+E;QAC/E,iFAAiF;QACjF,yFAAyF;QACzF,gFAAgF;QAChF,wFAAwF;KACzF;IACD,IAAI,EAAE
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../../../src/core/agent/support/report.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAmB;IACzC,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,uFAAuF;IACzF,YAAY,EAAE,EAAE;IAChB,OAAO,EACL,oOAAoO;IACtO,UAAU,EAAE,+BAA+B;IAC3C,YAAY,EAAE,EAAE;IAChB,KAAK,EAAE;QACL,+EAA+E;QAC/E,iFAAiF;QACjF,yFAAyF;QACzF,gFAAgF;QAChF,wFAAwF;KACzF;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmHP;CACA,CAAC","sourcesContent":["import type { CommandContent } from \"../contract.js\";\n\n/**\n * The incident-reporting protocol: preserve a small, sanitized reproducer when\n * loam or its agent integration behaves unexpectedly, without turning loam\n * into a telemetry service or retrying a risky write.\n */\nexport const LOAM_REPORT: CommandContent = {\n name: \"loam-report\",\n description:\n \"Record unexpected loam or agent behavior as a sanitized, reproducible Markdown report\",\n argumentHint: \"\",\n purpose:\n \"Collect one unexpected loam or agent-integration incident into a separate, reviewable Markdown file. This is local diagnostics only: redact secrets, never upload automatically, and never repeat a writer merely to reproduce it.\",\n invocation: \"loam instructions loam-report\",\n placeholders: [],\n spine: [\n \"preserve the user's original symptom and expected result before investigating\",\n \"collect the binary version, wiring diagnosis and the smallest safe reproduction\",\n \"classify the failure without repairing, retrying a writer or changing project documents\",\n \"sanitize commands, paths and output, then write one report under loam-reports/\",\n \"hand back the report path, classification and any evidence that could not be collected\",\n ],\n body: `Record one incident where loam, a generated command/skill, or the agent following it\nbehaved unexpectedly. The result is a local diagnostic document, not a repair and not telemetry.\nDo not change architecture/spec files while collecting it.\n\n## Preserve the symptom first\n\nBefore running anything, write down the user's original request, what they expected, what actually\nhappened, the command or chat entry point involved, and whether any files may already have changed.\nDo not improve or reinterpret the failing command yet: a cleaned-up command is not a reproduction.\n\nClassify the incident as one of these, using \\`inconclusive\\` until the evidence supports another:\n\n- \\`loam-product\\` — the binary violated its documented contract or produced internally inconsistent output;\n- \\`project-data\\` — the binary correctly reported invalid, incomplete or stale repository documents;\n- \\`agent-workflow\\` — the generated command/skill was missing, stale, misrouted or followed incorrectly;\n- \\`host-infrastructure\\` — permissions, filesystem, process, shell or tool-host behavior prevented the run;\n- \\`inconclusive\\` — the available evidence does not distinguish the above.\n\n## Collect only safe evidence\n\n1. Run \\`loam --version\\` and record the result.\n2. Run \\`loam doctor --json\\`. If it succeeds, keep \\`healthy\\`, the finding codes and their structured\n locations/fixes, the resolved repository role, and the write-path state. If it refuses, keep\n \\`error.code\\` and the sanitized message. Do not apply the fixes during reporting.\n3. When the repository is wired, run \\`loam status --json\\` and keep only the state and next-action\n rows relevant to this incident. A refusal is evidence too; keep its \\`error.code\\`.\n4. Re-run the original operation only when it is read-only and safe. Never re-run \\`init\\`, \\`new\\`,\n \\`rebase\\`, \\`subsystem\\`, \\`archive\\`, \\`unarchive\\`, \\`vouch\\`, a recording form of \\`verify\\`, or\n any other writer merely to make it fail twice. For a writer, record its original exit/output and\n inspect \\`doctor\\`, \\`status\\` and version only. Do not repair, roll back or delete anything unless\n the user separately asks for that action.\n5. Prefer the JSON envelope: record \\`contractVersion\\`, \\`ok\\`, \\`command\\`, \\`error.code\\`, finding\n codes and \\`locations[]\\`. Quote only the smallest stdout/stderr excerpt that demonstrates the\n symptom. State what was omitted.\n\n## Sanitize before writing\n\nNever include credentials, tokens, cookies, authorization headers, private keys, environment dumps,\nor values of variables whose names contain \\`TOKEN\\`, \\`SECRET\\`, \\`PASSWORD\\`, \\`AUTH\\`, \\`COOKIE\\` or\n\\`KEY\\`. Replace each value with \\`<redacted>\\`. Replace the user's home directory with \\`<home>\\` and\nprefer repository-relative paths. Do not copy source files, architecture/spec bodies, or a complete\ncommand output when a code and short excerpt prove the same fact. Review the finished report once\nmore for secrets before handing it back.\n\n## Write one separate report\n\nCreate \\`loam-reports/NNN-YYYY-MM-DD-<short-slug>.md\\` in the directory holding the \\`loam.json\\` that\nresolved — or, when a \\`loam.json\\` was found but does not parse, beside that file, so a report about\nthe broken config joins the corpus already there; only when there is no config file at or above you\nis it the directory you run in.\n\\`loam doctor --json\\` hands you that whole directory — that root WITH \\`loam-reports/\\`\nalready on the end — as \\`reports.dir\\`: write inside the path it gives, never joined onto\n\\`loam-reports/\\` a second time. \\`NNN\\` is an ordinal of at least three digits, zero-padded, one more\nthan the highest already in that directory — read \\`reports.next\\` from the same output, which says\n\\`001\\` when the directory is empty or absent, and widens past three digits rather than reusing a\nnumber once the corpus gets there. Use a short neutral slug based on the symptom, not a customer,\nperson or secret. Never\noverwrite a different incident: a path that already exists means a concurrent report claimed that\nordinal, so take the next one rather than adding a suffix. That check is on the PATH, and the\npromise is about the ordinal, so re-run \\`loam doctor --json\\` after writing: if two entries carry\nthe same \\`ordinal\\`, the one with the later \\`Recorded\\` timestamp renames itself to the next free\nnumber. The ordinal is the report's handle —\ncite one by its number in a commit message, an issue, or another report's cross-references, and\nnever by filename, which is free to be renamed. The ordinal is unique within that directory, not\nacross a fleet: a service repository and the docs repository each number their own, so when two\nrepositories are in play cite \\`<repo>/loam-reports/NNN\\`.\n\nReports are ordinary project files so the team can review or commit them deliberately, but\ndo not upload, submit an issue, send telemetry, or contact any service automatically.\n\\`loam doctor\\` reads the directory — how many reports it holds, how many are in each status, and\nwhich ordinal comes next — and that is a local read of local files: nothing is transmitted.\n\nUse this shape, omitting only fields that truly cannot be known and marking them \\`not collected\\`:\n\n # loam problem report: <short title>\n\n - Recorded: <ISO-8601 timestamp>\n - Classification: <one value above>\n - Status: open\n - Repository role: <docs | service | combined | unresolved>\n - loam version: <version>\n - Entry point: <chat command, skill, or CLI command; sanitized>\n - Side effects observed: <none known | paths changed | unknown>\n\n ## Summary\n ## Expected\n ## Actual\n ## Minimal safe reproduction\n ## Machine contract\n ## Doctor and status evidence\n ## Files changed or write state\n ## Workaround\n ## Missing evidence\n ## Sanitization\n\n\\`Status\\` is written as \\`open\\` and stays the report's own record of where it got to. The vocabulary\nis \\`open\\`, \\`sent\\` (handed to loam's author — the person forwarding a report sets this, never the\nagent writing it), \\`fixed in <version>\\`, and \\`superseded by <NNN>\\` naming the report that\nreplaced this one. Close a report by editing its own \\`Status\\` line: there is no index to keep in\nstep, and \\`loam doctor\\` counts the directory by reading that line's first word, so\n\\`fixed in 0.2.0-alpha.5\\` counts as fixed. It reads that line from the HEADER FIELD BLOCK only —\nthe lines above the first \\`##\\` heading, quoted code skipped in either markdown spelling: a fence\n(closed only by a run of the same character at least as long as the one that opened it, so a\n\\`\\`\\` inside a \\`\\`\\`\\` block is content) and an indented block, which is the shape THIS template is\nprinted in above. So a report that quotes this template, however it quotes it, still counts as\nwhatever its own header says. A report written before this\nfield existed has no \\`Status\\` line and counts as unstated.\n\nIn \\`Machine contract\\`, include exit code plus the stable envelope fields and relevant finding\ncodes/locations; do not paste an entire large JSON payload. In \\`Sanitization\\`, list the kinds of\nvalues removed without revealing them. If no workaround is known, say so rather than inventing one.\n\nFinish by telling the user the report path, classification, whether project files changed, and which\nevidence was unavailable. Keep diagnosis separate from certainty: a plausible cause belongs under\n\\`Summary\\` as a hypothesis until the reproduction proves it.\n`,\n};\n"]}
|