semantic-atlas 2.1.0 → 2.1.3

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.
Files changed (49) hide show
  1. package/.agents/skills/semantic-atlas/SKILL.md +133 -73
  2. package/.agents/skills/semantic-atlas/agents/openai.yaml +2 -2
  3. package/.agents/skills/semantic-atlas-maintenance/SKILL.md +106 -58
  4. package/.agents/skills/semantic-atlas-maintenance/agents/openai.yaml +1 -1
  5. package/.agents/skills/semantic-atlas-maintenance/references/reconciliation.md +66 -5
  6. package/README.md +47 -17
  7. package/README.zh-CN.md +213 -0
  8. package/dist/cli/observation-commands.d.ts +2 -1
  9. package/dist/cli/observation-commands.d.ts.map +1 -1
  10. package/dist/cli/observation-commands.js +19 -1
  11. package/dist/cli/observation-commands.js.map +1 -1
  12. package/dist/cli/reconciliation-command.d.ts +2 -1
  13. package/dist/cli/reconciliation-command.d.ts.map +1 -1
  14. package/dist/cli/reconciliation-command.js +32 -8
  15. package/dist/cli/reconciliation-command.js.map +1 -1
  16. package/dist/cli/run-cli.d.ts.map +1 -1
  17. package/dist/cli/run-cli.js +20 -4
  18. package/dist/cli/run-cli.js.map +1 -1
  19. package/dist/contracts/cli.d.ts +10 -0
  20. package/dist/contracts/cli.d.ts.map +1 -1
  21. package/dist/contracts/observation.d.ts +110 -1
  22. package/dist/contracts/observation.d.ts.map +1 -1
  23. package/dist/contracts/observation.js +70 -0
  24. package/dist/contracts/observation.js.map +1 -1
  25. package/dist/contracts/reconciliation.d.ts +11 -1
  26. package/dist/contracts/reconciliation.d.ts.map +1 -1
  27. package/dist/index.d.ts +4 -4
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/observations/observation-application.d.ts +6 -0
  32. package/dist/observations/observation-application.d.ts.map +1 -1
  33. package/dist/observations/observation-application.js +34 -1
  34. package/dist/observations/observation-application.js.map +1 -1
  35. package/dist/observations/observation-store.d.ts +8 -1
  36. package/dist/observations/observation-store.d.ts.map +1 -1
  37. package/dist/observations/observation-store.js +22 -4
  38. package/dist/observations/observation-store.js.map +1 -1
  39. package/dist/reconciliation/reconciliation-service.d.ts +1 -0
  40. package/dist/reconciliation/reconciliation-service.d.ts.map +1 -1
  41. package/dist/reconciliation/reconciliation-service.js +56 -3
  42. package/dist/reconciliation/reconciliation-service.js.map +1 -1
  43. package/docs/architecture.md +87 -47
  44. package/docs/evaluation.md +24 -12
  45. package/docs/index.md +6 -5
  46. package/docs/map-format.md +6 -4
  47. package/docs/observations.md +74 -32
  48. package/docs/product-contract.md +79 -49
  49. package/package.json +3 -2
@@ -1,24 +1,33 @@
1
1
  ---
2
2
  name: semantic-atlas
3
- description: Query a repository's advisory business map before broad source discovery for business-changing feature, bug, refactor, and impact-analysis tasks. Use in repositories with docs/business-map files to find likely owners, collaborators, data, invariants, interfaces, and source anchors, then confirm every change-controlling claim in current evidence.
3
+ description: Build source-supported business understanding and make maintenance decisions for business-changing engineering tasks, with or without an existing business map. Use for features, bugs, refactors, reviews, and impact analysis to find or establish business boundaries, collaborators, data, invariants, interfaces, and source entry points before broad discovery, then decide whether stable shared knowledge needs maintenance.
4
4
  compatibility: Requires Node.js 24+, a bundled or PATH-compatible semantic-atlas CLI, and repository source access.
5
5
  ---
6
6
 
7
7
  # Semantic Atlas
8
8
 
9
- Use the tracked business map as a compact navigation prior. Treat all returned
10
- nodes, relations, summaries, and anchors as investigation leads; current
11
- source, tests, tracked product documents, and required runtime evidence decide
12
- what an engineering change may claim and do.
9
+ Build the smallest current-evidence business model needed to make an accurate
10
+ engineering decision. An existing map is a compact navigation prior. Missing,
11
+ incomplete, stale, or contradicted map knowledge changes the discovery route;
12
+ it does not remove the need to understand the business boundary.
13
13
 
14
- ## Choose The Workflow
14
+ Current source, tests, tracked product documents, and required runtime evidence
15
+ decide what an engineering change may claim and do. Treat map results as
16
+ investigation leads.
15
17
 
16
- Use this workflow when a task can change business behavior, ownership, shared
17
- data, an invariant, or an interface. Begin ordinary repository work directly
18
- when the task is purely mechanical and its exact source boundary is already
19
- established, such as formatting, a local rename, or generated-file refresh.
18
+ ## Choose The Workflow From The Task
20
19
 
21
- ## Query The Smallest Useful Neighborhood
20
+ Use this workflow when work can change or depend on business behavior,
21
+ ownership, shared data, an invariant, or an interface. This includes feature,
22
+ bug, refactor, impact-analysis, and independent-review work whose correct scope
23
+ requires business judgment.
24
+
25
+ Begin ordinary repository work directly when the task is purely mechanical and
26
+ its exact source boundary is already established, such as formatting, a local
27
+ rename, or generated-file refresh. This is a complete stopping decision and
28
+ produces no shared business-knowledge maintenance work.
29
+
30
+ ## Probe Existing Business Knowledge
22
31
 
23
32
  1. Read the task contract and repository instructions. Resolve the repository
24
33
  root and keep all commands in the task's assigned worktree.
@@ -26,7 +35,7 @@ established, such as formatting, a local rename, or generated-file refresh.
26
35
  an exact business name or stable task vocabulary over a framework, folder,
27
36
  class, or method name.
28
37
  3. Before broad source discovery, run the Skill's identity- and
29
- contract-checking adapter:
38
+ contract-checking adapter whether or not map documents are present:
30
39
 
31
40
  ```bash
32
41
  node "<skill-directory>/scripts/query-context.mjs" \
@@ -35,41 +44,56 @@ established, such as formatting, a local rename, or generated-file refresh.
35
44
 
36
45
  A package-bundled adapter invokes that package's CLI directly. A managed
37
46
  user Skill first requires the PATH CLI version recorded by `setup`, then
38
- verifies the v1 `context` envelope. This keeps an older command with the
47
+ verifies the v1 `context` envelope. This prevents an older command with the
39
48
  same executable name from being interpreted as the current product.
40
49
 
41
- 4. Read the selected concept, ancestors, direct children, incoming and outgoing
42
- relations, endpoint summaries, and anchors. Record them as hypotheses.
43
- 5. Query a returned stable ID only when a direct owner, upstream action,
44
- downstream consumer, shared data concept, invariant, or interface could
45
- change the implementation scope. Stop expanding when the current task has a
46
- source-confirmable boundary; a complete graph traversal is not required.
50
+ 4. Preserve the selector and bounded outcome for the task observation. When a
51
+ context is returned, record the selected stable IDs as hypotheses.
52
+
53
+ ## Build The Business Model With Or Without A Map
47
54
 
48
- ## Route Map Outcomes
55
+ Route the probe result into one current-evidence investigation:
49
56
 
50
57
  - A successful context result supplies likely business scope and source entry
51
- points. Open the most decisive anchors first, then follow current imports,
52
- callers, consumers, tests, and product documents as the behavior requires.
58
+ points. Open the most decisive anchors first. Query another returned stable
59
+ ID only when an owner, upstream action, downstream consumer, shared data
60
+ concept, invariant, or interface could change the implementation scope.
53
61
  - `CONCEPT_AMBIGUOUS` supplies explicit candidates. Compare their stable IDs,
54
- names, kinds, and task meaning, then query the matching ID. When current
55
- behavior is needed to choose, search only the task term and candidate
56
- vocabulary before selecting.
57
- - `CONCEPT_NOT_FOUND` and `MAP_NOT_FOUND` are bounded map outcomes. Continue
58
- with ordinary source discovery using user vocabulary, likely product docs,
59
- and progressively narrower source searches.
62
+ names, kinds, and task meaning, then query the matching ID. Use bounded source
63
+ evidence when current behavior is needed to choose.
64
+ - `CONCEPT_NOT_FOUND` means the repository has a map without this vocabulary.
65
+ Search current product documents and source using the task term, likely
66
+ business synonyms, and directly observed collaborators.
67
+ - `MAP_NOT_FOUND` means the repository has no configured shared business map.
68
+ When the map is absent, build the smallest source-supported business model needed for the task.
69
+ Start from the user-visible outcome, identify only the owning business scope,
70
+ actions, data, rules, and interfaces that current evidence requires, and stop
71
+ when the engineering boundary is source-confirmable. Limit this model to
72
+ business meaning supported by the current task rather than repository-folder
73
+ structure or a complete taxonomy.
60
74
  - `MAP_DOCUMENT_INVALID`, an unavailable CLI, or an infrastructure failure
61
- makes the map unavailable for this task. Preserve the error as context and
62
- continue through the repository's normal discovery workflow.
63
- - A node with no anchors still provides business vocabulary and relations.
64
- Search its stable name, aliases, neighboring concepts, and interface terms,
65
- then follow current code structure.
66
- - A missing or stale file, directory, document, symbol, or search anchor weakens
67
- that navigation hint. Use the node meaning and direct relations for a bounded
68
- search, and confirm the replacement location in current evidence.
75
+ makes map knowledge unavailable for this task. Preserve the failure, build
76
+ the same bounded current-evidence model, and report observation recording as
77
+ unavailable when the CLI boundary cannot accept it.
78
+ - A node without anchors still supplies business vocabulary and relations.
79
+ Search its name, aliases, neighboring concepts, and interface terms, then
80
+ follow current code structure.
81
+ - A missing or stale anchor weakens only that navigation hint. Use current
82
+ evidence to find the replacement location without discarding unrelated
83
+ stable business meaning.
84
+
85
+ For a mapless task, the observation query records the bounded outcome:
86
+
87
+ ```json
88
+ {
89
+ "selector": "<business term>",
90
+ "outcome": "map_not_found"
91
+ }
92
+ ```
69
93
 
70
- ## Build A Current-Evidence Model
94
+ ## Confirm The Current-Evidence Model
71
95
 
72
- For every map statement that could control the change:
96
+ For every statement that could control the change:
73
97
 
74
98
  1. Open current source or tests that implement or exercise the behavior.
75
99
  2. Open the tracked product document when it owns the durable rule or outcome.
@@ -77,10 +101,9 @@ For every map statement that could control the change:
77
101
  consume relation when that relation expands the required scope.
78
102
  4. Use runtime evidence when the conclusion depends on deployed state rather
79
103
  than repository behavior.
80
- 5. Classify each relevant hypothesis as confirmed, contradicted, or unresolved.
81
- Let confirmed current evidence control the implementation. Replace a
82
- contradicted relation with the source-supported collaborator in the
83
- task-specific model. Keep unresolved statements out of decisive conclusions.
104
+ 5. Classify relevant map hypotheses as confirmed, missing, stale,
105
+ contradicted, or unresolved. Let confirmed current evidence control the
106
+ task. Keep unresolved statements out of decisive conclusions.
84
107
 
85
108
  Trace a downstream symptom toward its confirmed upstream cause before editing.
86
109
  For shared data or interfaces, inspect every confirmed producer and consumer
@@ -94,26 +117,60 @@ collaborators, add regression coverage at the public behavior boundary, run
94
117
  the repository's required checks, and review the final diff against the task
95
118
  scope.
96
119
 
97
- Final conclusions identify the business boundary, the decisive current
98
- evidence, the implemented or proposed scope, and relevant verification. Phrase
99
- map-only statements as leads or uncertainty rather than current behavior.
100
-
101
- ## Record The Task Observation
102
-
103
- For business-changing work, read [references/observations.md](references/observations.md)
104
- and record one task observation after the engineering result and verification
105
- are known. Use a stable observation ID for the run and reuse the same complete
106
- document when retrying an interrupted submission.
107
-
108
- The task observation records the map-query outcome, selected concepts,
109
- current-evidence dispositions, map-update candidates, and any explicit human
110
- correction. Independent review owns accuracy judgments, so the task document
111
- contains investigation evidence rather than a correctness verdict.
112
-
113
- Submit the complete JSON document through the installed CLI:
120
+ Final engineering conclusions identify the business boundary, decisive current
121
+ evidence, implementation or review scope, and verification. Phrase map-only
122
+ statements as leads or uncertainty rather than current behavior.
123
+
124
+ ## Decide Post-Task Business-Knowledge Maintenance
125
+
126
+ After the engineering or review result is known, choose one maintenance disposition:
127
+
128
+ - `candidate`: current evidence establishes stable business meaning that the
129
+ shared map omits or represents incorrectly. Record one or more domain-owned
130
+ map-update candidates with decisive evidence.
131
+ - `already_represented`: the shared map still expresses the stable business
132
+ meaning needed by the task. Record no candidate.
133
+ - `implementation_local`: the result changes only helpers, framework wiring,
134
+ source organization, tests, or another non-durable implementation detail.
135
+ Record no candidate.
136
+ - `unresolved`: available evidence cannot establish durable business identity,
137
+ ownership, or relation direction. Preserve the uncertainty without proposing
138
+ a canonical edit.
139
+
140
+ A no-change disposition is a complete result when current shared knowledge
141
+ already represents the durable meaning or the change is implementation-local.
142
+ Add concepts and relations only when current evidence supports their accuracy.
143
+
144
+ For a repository without a map, use `candidate` only when current evidence
145
+ establishes a stable business domain and a bounded reusable concept or relation.
146
+ Use `unresolved` when one task cannot support that identity. Limit bootstrap
147
+ knowledge to the stable meaning established by the current task.
148
+
149
+ ## Record Accuracy Evidence
150
+
151
+ For business-changing work, read
152
+ [references/observations.md](references/observations.md) after the engineering
153
+ or review result and verification are known.
154
+
155
+ - For engineering and analysis work, record one task observation. It contains
156
+ the map-query outcome, selected concepts, current-evidence dispositions,
157
+ map-update candidates from a `candidate` maintenance disposition, and any
158
+ explicit human correction.
159
+ - For independent review, record one review observation that references the
160
+ existing task observation and contains the accuracy verdict. Keep the task
161
+ observation immutable. When no task observation is available, report the
162
+ missing accuracy-evidence link separately from the review verdict.
163
+
164
+ Independent review owns accuracy judgments, so task observations contain
165
+ investigation evidence rather than correctness verdicts. Generate one stable
166
+ observation ID for the run and reuse the same complete document when retrying an
167
+ interrupted submission.
168
+
169
+ Submit the matching complete JSON document through the installed CLI:
114
170
 
115
171
  ```text
116
172
  semantic-atlas observe task --stdin [--repo <repository-root>]
173
+ semantic-atlas observe review --stdin [--repo <repository-root>]
117
174
  ```
118
175
 
119
176
  Report the recorded or idempotent outcome with the engineering result. When
@@ -121,20 +178,23 @@ the observation command fails, the engineering result remains unchanged;
121
178
  report the observation failure separately so review can distinguish delivery
122
179
  evidence from missing accuracy evidence.
123
180
 
124
- ## Report Durable Map Observations Separately
181
+ ## Hand Off Canonical Maintenance
125
182
 
126
- Ordinary task completion does not require editing `docs/business-map`. When
127
- current evidence reveals a stable missing concept, stale anchor, or
128
- contradicted relation, add a separate map-update candidate to the task report:
183
+ Keep canonical map editing in a separate maintenance change after stable reviewed source is available.
184
+ The `semantic-atlas-maintenance` Skill rechecks retained candidates by business
185
+ domain, edits one owning YAML surface, validates the complete graph, renders the
186
+ changed neighborhood, and submits the Git diff for independent review.
129
187
 
130
- ```text
131
- Map-update candidate: <node, relation, or anchor>
132
- Business domain: <stable domain ID>
133
- Disposition: <confirmed, contradicted, or unresolved>
134
- Current evidence: <repository-relative source, test, or product document>
135
- Durable correction: <concise proposed business meaning>
136
- ```
188
+ A post-integration maintenance run can examine retained candidates from
189
+ business-changing results; an empty or no-change run is successful. Periodic
190
+ reconciliation remains a fallback for accumulated drift, missed observations,
191
+ and changes outside the normal engineering workflow. The understanding and
192
+ maintenance contracts run independently of task orchestrators.
193
+
194
+ ## Report The Result
137
195
 
138
- Keep the candidate separate from the engineering conclusion so later periodic
139
- reconciliation can accept, refine, or discard it through the repository's
140
- normal Git review workflow.
196
+ Report the business boundary, decisive current evidence, engineering scope,
197
+ verification, accuracy-observation outcome, and maintenance disposition. For
198
+ `candidate`, include the business domain, proposed durable correction, and
199
+ evidence. For `already_represented`, `implementation_local`, or `unresolved`,
200
+ state the evidence-based reason and record no map-update candidate.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Semantic Atlas"
3
- short_description: "Guide engineering work from business context to current evidence"
4
- default_prompt: "Use $semantic-atlas to map this business-changing task to current repository evidence before implementing it."
3
+ short_description: "Build current-evidence business context for engineering work"
4
+ default_prompt: "Use $semantic-atlas to understand this business-changing task with or without an existing business map, verify it in current evidence, and decide whether shared knowledge needs maintenance."
@@ -1,75 +1,82 @@
1
1
  ---
2
2
  name: semantic-atlas-maintenance
3
- description: Reconcile retained Semantic Atlas map-update candidates for one business domain into a source-supported, normally reviewed docs/business-map YAML change. Use for periodic map maintenance, drift cleanup, candidate triage, and domain-scoped reconciliation in repositories with a Semantic Atlas business map and local observations.
3
+ description: Reconcile current Semantic Atlas candidates for one business domain into a source-supported reviewed map update or evidence conclusion, then record the result after integration. Use for post-integration maintenance, initial-domain bootstrap, drift cleanup, candidate triage, and domain-scoped reconciliation with or without an existing business map.
4
4
  compatibility: Requires Node.js 24+, Git, the current semantic-atlas CLI, retained local observations, and repository source access.
5
5
  ---
6
6
 
7
7
  # Semantic Atlas Maintenance
8
8
 
9
- Turn retained investigation leads into one bounded, current-evidence map change.
10
- The candidate report preserves why a correction was proposed; current source,
11
- tests, tracked product documents, and required runtime evidence decide whether
12
- the canonical map changes.
9
+ Turn current candidate leads for one business domain into one independently
10
+ reviewable map update or evidence conclusion. Current source, tests, tracked product documents,
11
+ and required runtime evidence decide the result. Candidate
12
+ provenance explains where to investigate; it does not authorize a map edit.
13
13
 
14
- ## Prepare The Candidate Set
14
+ Read [references/reconciliation.md](references/reconciliation.md) before
15
+ classifying candidates. It defines evidence meaning, durable-content tests,
16
+ duplicate handling, maintenance-observation fields, and stopping conditions.
17
+
18
+ ## Work Phase
15
19
 
16
- 1. Resolve the repository root and keep the maintenance work in its assigned
17
- worktree.
18
- 2. Run the read-only report:
20
+ ### Load Current Actionable Candidates
21
+
22
+ 1. Resolve the repository root and work only in the assigned worktree.
23
+ 2. Run:
19
24
 
20
25
  ```bash
21
26
  semantic-atlas reconcile candidates --repo <absolute-repository-root>
22
27
  ```
23
28
 
24
- 3. Confirm the response is the v1 `reconcile candidates` envelope. Read each
25
- candidate's business-domain ownership, task evidence, `confirmed`,
26
- `contradicted`, or `unresolved` disposition, duplicate provenance, and
27
- linked independent reviews.
28
- 4. When the report contains no candidates, finish with a no-change result. An
29
- empty report is a complete maintenance outcome.
29
+ 3. Confirm the v1 `reconcile candidates` envelope. Select one business domain
30
+ from `data.domains`. Read each origin's exact `taskObservationId` and
31
+ `candidateIndex`, task evidence, linked independent reviews, duplicate
32
+ provenance, and any earlier unresolved maintenance history.
33
+ Treat task-time `confirmed`, `contradicted`, and `unresolved` dispositions as
34
+ investigation inputs rather than maintenance conclusions.
35
+ 4. When `data.domains` is empty, finish with a no-change result. A positive
36
+ `waitingForEvidenceOccurrences` means prior investigation remains retained
37
+ but does not justify immediately repeating the same work.
30
38
 
31
- ## Select One Business Domain
39
+ ### Confirm Current Business Meaning
32
40
 
33
- Choose one business domain for the run. Keep candidates from other domains in
34
- the retained report for later maintenance. Within the selected domain, use
35
- linked approved reviews and repeated provenance to prioritize investigation;
36
- they strengthen the trail but remain evidence to verify rather than automatic
37
- map authority.
41
+ Open every decisive current source, test, or tracked product document named by
42
+ the selected origins. Follow current callers and collaborators when a proposed
43
+ relation changes both endpoints. Use runtime evidence when deployed state owns
44
+ the conclusion.
38
45
 
39
- Read [references/reconciliation.md](references/reconciliation.md) before
40
- classifying candidates. It defines the evidence meaning, durable-content test,
41
- duplicate handling, and clean stopping conditions.
46
+ Classify every selected origin:
42
47
 
43
- ## Confirm Current Business Meaning
48
+ - `accepted`: current evidence supports the proposed durable correction;
49
+ - `refined`: current evidence supports a narrower or differently worded durable
50
+ correction;
51
+ - `discarded`: current evidence shows implementation-local, obsolete, or
52
+ unsupported meaning that does not belong in the shared map;
53
+ - `unresolved`: available evidence cannot yet establish stable business meaning.
44
54
 
45
- 1. Open the selected domain's current `docs/business-map/*.yaml` owner.
46
- 2. Open every decisive current source, test, or tracked product document named
47
- by the candidate origins. Follow current callers or collaborators when the
48
- proposed relation changes both business endpoints.
49
- 3. Classify each candidate for this maintenance run:
50
- - `accepted`: current evidence supports the proposed durable correction;
51
- - `refined`: current evidence supports a narrower or differently worded
52
- durable correction;
53
- - `discarded`: the observation is implementation-local, stale in a way that
54
- no longer matters, or unsupported by current evidence;
55
- - `unresolved`: available evidence cannot decide stable business meaning.
56
- 4. Keep discarded and unresolved candidates outside the canonical map. Record
57
- their evidence-based reason in the maintenance result.
55
+ Keep discarded and unresolved results outside the canonical map. A correct
56
+ discard or unresolved conclusion is a complete work result and may have no Git
57
+ change.
58
58
 
59
- ## Edit One Owning YAML
59
+ ### Resolve And Edit One Owning YAML
60
60
 
61
- Apply accepted and refined corrections to one owning YAML surface for the
62
- selected business domain. Preserve stable node IDs when business identity is
63
- unchanged, use the source concept's owning file for directed relations, and
64
- keep anchors as navigation hints rather than current-behavior claims.
61
+ - Edit the selected domain's existing owning `docs/business-map/*.yaml` file.
62
+ - When the graph exists without an owning file for this domain, create one
63
+ domain-owned YAML that participates in complete-graph validation.
64
+ - When no map documents exist, create one initial business-domain YAML under
65
+ `docs/business-map/`. Establish its stable domain ID, title, summary, root
66
+ node, and only the bounded accepted or refined meaning supported by current
67
+ evidence. Preserve `MAP_NOT_FOUND` as the explicit bootstrap condition.
65
68
 
66
- Repeated origins for one duplicate candidate produce one map edit. Preserve
67
- all originating task and review IDs in the maintenance result so independent
68
- review can trace why the edit exists.
69
+ Limit the initial map to stable meaning supported by the selected candidates and current evidence.
69
70
 
70
- ## Validate The Normal Git Change
71
+ Limit the run to one owning YAML. Preserve stable node IDs when business
72
+ identity is unchanged, declare directed relations from the source concept's
73
+ owning file, and keep anchors as navigation hints. One duplicate candidate
74
+ group produces one map edit while its maintenance draft retains every exact
75
+ origin.
71
76
 
72
- Run the supported product boundaries after the edit:
77
+ ### Validate And Prepare The Review Candidate
78
+
79
+ When the map changes, run:
73
80
 
74
81
  ```bash
75
82
  semantic-atlas validate --repo <absolute-repository-root>
@@ -79,15 +86,56 @@ git diff --check
79
86
  git diff -- docs/business-map/<owning-file>.yaml
80
87
  ```
81
88
 
82
- Inspect the rendered projection for the changed neighborhood. Confirm the Git
83
- diff changes one owning YAML surface and leaves retained observations
84
- unchanged. Submit the ordinary map change for independent review; the reviewer
85
- checks durable business meaning, relation direction, evidence support, complete
86
- graph validity, and the one-domain boundary.
89
+ Inspect the changed neighborhood in the Viewer. Confirm the Git diff changes at
90
+ most one owning YAML and leaves retained observations unchanged. Commit the map
91
+ candidate through the host workflow.
92
+
93
+ Prepare, but do not record, one maintenance-observation JSON document. It
94
+ contains the maintenance task/run identity, selected `businessDomainId`, every
95
+ exact candidate source, classification, reason, and current evidence. Accepted
96
+ or refined results reserve `mapChange.owningMapPath`; the Integration Phase adds
97
+ the real `mergedCommit`.
98
+
99
+ Do not record a terminal maintenance observation during the Work Phase. At this
100
+ point the classification and YAML are proposals that have not completed
101
+ independent review and integration.
102
+
103
+ Report the selected domain, origins, classifications, evidence, owning YAML,
104
+ validation and render results, Git candidate, and the prepared observation to
105
+ the host workflow.
87
106
 
88
- ## Report The Result
107
+ ## Review Phase
108
+
109
+ Use the host workflow's ordinary independent review. Review durable business
110
+ meaning, relation direction, evidence support, complete-graph validity, exact
111
+ candidate coverage, one-domain ownership, and whether discarded or unresolved
112
+ conclusions correctly avoid a map edit.
113
+
114
+ Changes requested return to the normal Work Phase. Approval authorizes the host
115
+ workflow to enter Integration Phase; it does not itself consume candidates.
116
+
117
+ ## Integration Phase
118
+
119
+ 1. Re-read the approved work and review evidence.
120
+ 2. When a map candidate exists, merge it through the repository's normal Git
121
+ flow and capture the actual `mergedCommit`. Put that commit and the one
122
+ `owningMapPath` into `mapChange`.
123
+ 3. When every result is discarded or unresolved, keep `mapChange` absent and
124
+ continue only after the no-change conclusion has passed independent review.
125
+ 4. Send the complete JSON document through standard input:
126
+
127
+ ```bash
128
+ semantic-atlas observe maintenance --stdin --repo <absolute-repository-root>
129
+ ```
89
130
 
90
- Report the selected business domain, candidate origins, each maintenance
91
- classification and decisive evidence, the owning YAML file, validation and
92
- render results, the Git diff, and any discarded or unresolved leads. Separate
93
- the proposed map change from independent-review approval and later merge.
131
+ 5. Require a `recorded` or `idempotent` success response before reporting the
132
+ maintenance task complete. Reuse the exact observation ID and document on an
133
+ uncertain retry. The same ID with changed content is a conflict.
134
+ 6. Rerun `semantic-atlas reconcile candidates --repo` when confirming the
135
+ result. Accepted, refined, and discarded origins disappear from actionable
136
+ candidates. Unresolved origins remain retained as waiting for new evidence
137
+ and do not immediately schedule the same work again.
138
+
139
+ If the map merged but observation recording failed, preserve the merged Git
140
+ result and keep the task incomplete. Resume or retry the Integration Phase with
141
+ the exact same observation document until the idempotent record succeeds.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Semantic Atlas Maintenance"
3
3
  short_description: "Review one domain's map candidates against current evidence"
4
- default_prompt: "Use $semantic-atlas-maintenance to reconcile retained candidates for one business domain into a reviewed map change."
4
+ default_prompt: "Use $semantic-atlas-maintenance to reconcile retained candidates for one business domain into a reviewed map update or initial map."
@@ -14,6 +14,8 @@ Every origin retains:
14
14
  - the task's map queries and current-evidence dispositions;
15
15
  - any task or review human correction;
16
16
  - every linked independent review and its accuracy assessment.
17
+ - earlier unresolved maintenance classifications and current evidence, when
18
+ the candidate group has become actionable again through a new origin.
17
19
 
18
20
  `confirmed` says task-time evidence supported the proposed correction.
19
21
  `contradicted` says current evidence contradicted the mapped statement that the
@@ -43,14 +45,73 @@ and leave the candidate unresolved until the owning authority can decide it.
43
45
  relation direction are confirmed.
44
46
  - A missing concept can be added when current evidence establishes stable
45
47
  business identity, ownership, and meaning rather than only a source symbol.
48
+ - A repository with `MAP_NOT_FOUND` can begin with one domain-owned map when
49
+ current evidence establishes that domain and the selected bounded concepts.
50
+ Cross-domain relations wait until both stable endpoints can join one valid
51
+ graph.
46
52
  - A duplicate candidate keeps all provenance but produces one YAML edit.
47
53
  - A transient or implementation-local observation is discarded with a concise
48
54
  evidence-backed reason and produces no map change.
49
55
 
50
56
  ## Keep One Review Surface
51
57
 
52
- Edit one owning `docs/business-map/*.yaml` file for the selected domain. Validate
53
- the complete graph because relation endpoints and containment remain
54
- repository-wide even when the Git diff is local. Render the changed graph and
55
- inspect the selected neighborhood. The final Git diff is the independent
56
- review surface; retained observation artifacts stay unchanged.
58
+ Edit or create one owning `docs/business-map/*.yaml` file for the selected
59
+ domain. An initial map contains only the stable domain and bounded accepted
60
+ meaning supported by current evidence. Validate the complete graph because
61
+ relation endpoints and containment remain repository-wide even when the Git
62
+ diff is local. Render the changed graph and inspect the selected neighborhood.
63
+ The final Git diff is the independent review surface; retained observation
64
+ artifacts stay unchanged.
65
+
66
+ ## Record The Reviewed Outcome
67
+
68
+ One maintenance result identifies an exact source with both
69
+ `taskObservationId` and zero-based `candidateIndex`. Repeated summaries do not
70
+ replace this identity. The command rejects a missing source or a source owned by
71
+ another `businessDomainId`.
72
+
73
+ Use this shape after independent review and integration:
74
+
75
+ ```json
76
+ {
77
+ "schemaVersion": 1,
78
+ "id": "maintenance-observation-id",
79
+ "recordedAt": "2026-08-31T08:00:00.000Z",
80
+ "maintenance": {
81
+ "taskId": "maintenance-task-id",
82
+ "runId": "integration-run-id"
83
+ },
84
+ "businessDomainId": "commerce",
85
+ "results": [
86
+ {
87
+ "candidate": {
88
+ "taskObservationId": "task-observation-id",
89
+ "candidateIndex": 0
90
+ },
91
+ "status": "accepted",
92
+ "reason": "Current source confirms the durable business meaning.",
93
+ "evidence": [
94
+ { "kind": "source", "reference": "src/orders/place-order.ts" }
95
+ ]
96
+ }
97
+ ],
98
+ "mapChange": {
99
+ "owningMapPath": "docs/business-map/commerce.yaml",
100
+ "mergedCommit": "MERGED_COMMIT_HEX"
101
+ }
102
+ }
103
+ ```
104
+
105
+ Replace `MERGED_COMMIT_HEX` with the full hexadecimal commit that actually
106
+ merged the reviewed map change before submitting the observation.
107
+
108
+ `accepted` and `refined` require `mapChange`; a document containing only
109
+ `discarded` and `unresolved` results omits it. Every result needs a concise
110
+ reason and at least one current evidence reference. One document lists each
111
+ exact candidate source once.
112
+
113
+ The reconciliation report exposes only actionable groups in `domains`.
114
+ `waitingForEvidenceOccurrences` counts unresolved sources for which no new
115
+ origin has appeared. A new origin with the same domain, kind, and summary makes
116
+ the group actionable again and returns the earlier unresolved history beside
117
+ the new evidence.