semantic-atlas 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -101,6 +101,25 @@ export declare const baselineEvaluationPlanSchema: z.ZodObject<{
101
101
  }, z.core.$strict>;
102
102
  }, z.core.$strict>>;
103
103
  }, z.core.$strict>;
104
+ export declare const knowledgeCaptureDecisionSchema: z.ZodObject<{
105
+ outcome: z.ZodEnum<{
106
+ persist: "persist";
107
+ reuse: "reuse";
108
+ transient: "transient";
109
+ unverified: "unverified";
110
+ }>;
111
+ summary: z.ZodString;
112
+ }, z.core.$strict>;
113
+ export declare const knowledgeCaptureAdjudicationSchema: z.ZodObject<{
114
+ outcome: z.ZodEnum<{
115
+ persist: "persist";
116
+ reuse: "reuse";
117
+ transient: "transient";
118
+ unverified: "unverified";
119
+ }>;
120
+ correct: z.ZodBoolean;
121
+ notes: z.ZodString;
122
+ }, z.core.$strict>;
104
123
  export declare const evaluationFailureClassificationSchema: z.ZodEnum<{
105
124
  "missed-dependency": "missed-dependency";
106
125
  "incorrect-answer": "incorrect-answer";
@@ -136,6 +155,47 @@ export declare const evaluationRunSchema: z.ZodObject<{
136
155
  policy: z.ZodLiteral<"fresh-agent-shell-allowlist-v4">;
137
156
  commands: z.ZodArray<z.ZodString>;
138
157
  }, z.core.$strict>;
158
+ skillDiscovery: z.ZodOptional<z.ZodObject<{
159
+ delivery: z.ZodLiteral<"repository">;
160
+ promptInjection: z.ZodLiteral<false>;
161
+ mainSkillLoaded: z.ZodLiteral<true>;
162
+ statusBeforeSource: z.ZodLiteral<true>;
163
+ mapBeforeSource: z.ZodLiteral<true>;
164
+ decisiveSourceRead: z.ZodLiteral<true>;
165
+ decisiveSourceFiles: z.ZodArray<z.ZodString>;
166
+ knowledgeCaptureDecision: z.ZodObject<{
167
+ outcome: z.ZodEnum<{
168
+ persist: "persist";
169
+ reuse: "reuse";
170
+ transient: "transient";
171
+ unverified: "unverified";
172
+ }>;
173
+ summary: z.ZodString;
174
+ }, z.core.$strict>;
175
+ conditionalReferences: z.ZodObject<{
176
+ snapshotBootstrap: z.ZodDiscriminatedUnion<[z.ZodObject<{
177
+ outcome: z.ZodLiteral<"not-required">;
178
+ }, z.core.$strict>, z.ZodObject<{
179
+ outcome: z.ZodLiteral<"loaded-after-trigger">;
180
+ triggerCommandSequence: z.ZodNumber;
181
+ loadCommandSequence: z.ZodNumber;
182
+ }, z.core.$strict>], "outcome">;
183
+ resultRouting: z.ZodDiscriminatedUnion<[z.ZodObject<{
184
+ outcome: z.ZodLiteral<"not-required">;
185
+ }, z.core.$strict>, z.ZodObject<{
186
+ outcome: z.ZodLiteral<"loaded-after-trigger">;
187
+ triggerCommandSequence: z.ZodNumber;
188
+ loadCommandSequence: z.ZodNumber;
189
+ }, z.core.$strict>], "outcome">;
190
+ graphPatch: z.ZodDiscriminatedUnion<[z.ZodObject<{
191
+ outcome: z.ZodLiteral<"not-loaded">;
192
+ }, z.core.$strict>, z.ZodObject<{
193
+ outcome: z.ZodLiteral<"loaded-after-source">;
194
+ sourceCommandSequence: z.ZodNumber;
195
+ loadCommandSequence: z.ZodNumber;
196
+ }, z.core.$strict>], "outcome">;
197
+ }, z.core.$strict>;
198
+ }, z.core.$strict>>;
139
199
  }, z.core.$strict>;
140
200
  startedAt: z.ZodISODateTime;
141
201
  finishedAt: z.ZodISODateTime;
@@ -143,12 +203,17 @@ export declare const evaluationRunSchema: z.ZodObject<{
143
203
  sourceTokenMethod: z.ZodString;
144
204
  sourceOpens: z.ZodArray<z.ZodObject<{
145
205
  sequence: z.ZodNumber;
206
+ commandSequence: z.ZodOptional<z.ZodNumber>;
207
+ exitCode: z.ZodOptional<z.ZodNumber>;
146
208
  file: z.ZodString;
147
209
  sourceTokens: z.ZodNumber;
148
210
  }, z.core.$strict>>;
149
211
  atlasCalls: z.ZodArray<z.ZodObject<{
150
212
  sequence: z.ZodNumber;
151
213
  command: z.ZodString;
214
+ commandSequence: z.ZodOptional<z.ZodNumber>;
215
+ exitCode: z.ZodOptional<z.ZodNumber>;
216
+ output: z.ZodOptional<z.ZodString>;
152
217
  }, z.core.$strict>>;
153
218
  atlasHandling: z.ZodArray<z.ZodObject<{
154
219
  sequence: z.ZodNumber;
@@ -162,6 +227,10 @@ export declare const evaluationRunSchema: z.ZodObject<{
162
227
  }>;
163
228
  action: z.ZodString;
164
229
  }, z.core.$strict>>;
230
+ skillLoads: z.ZodOptional<z.ZodArray<z.ZodObject<{
231
+ sequence: z.ZodNumber;
232
+ file: z.ZodString;
233
+ }, z.core.$strict>>>;
165
234
  }, z.core.$strict>;
166
235
  answer: z.ZodObject<{
167
236
  response: z.ZodString;
@@ -170,6 +239,15 @@ export declare const evaluationRunSchema: z.ZodObject<{
170
239
  file: z.ZodString;
171
240
  name: z.ZodString;
172
241
  }, z.core.$strict>>;
242
+ knowledgeCaptureDecision: z.ZodOptional<z.ZodObject<{
243
+ outcome: z.ZodEnum<{
244
+ persist: "persist";
245
+ reuse: "reuse";
246
+ transient: "transient";
247
+ unverified: "unverified";
248
+ }>;
249
+ summary: z.ZodString;
250
+ }, z.core.$strict>>;
173
251
  }, z.core.$strict>;
174
252
  adjudication: z.ZodObject<{
175
253
  correct: z.ZodBoolean;
@@ -183,6 +261,16 @@ export declare const evaluationRunSchema: z.ZodObject<{
183
261
  "unsupported-source": "unsupported-source";
184
262
  "protocol-violation": "protocol-violation";
185
263
  }>>;
264
+ knowledgeCaptureDecision: z.ZodOptional<z.ZodObject<{
265
+ outcome: z.ZodEnum<{
266
+ persist: "persist";
267
+ reuse: "reuse";
268
+ transient: "transient";
269
+ unverified: "unverified";
270
+ }>;
271
+ correct: z.ZodBoolean;
272
+ notes: z.ZodString;
273
+ }, z.core.$strict>>;
186
274
  }, z.core.$strict>;
187
275
  }, z.core.$strict>;
188
276
  export type EvaluationCase = z.infer<typeof evaluationCaseSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/eva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EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,sBAAsB,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC,wBAAwB,CAAC,CAAC;CACjF;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,OAAO,GACd,oBAAoB,CAgDtB"}
@@ -92,12 +92,17 @@ export const baselineEvaluationPlanSchema = evaluationPlanSchema.superRefine((pl
92
92
  });
93
93
  const sourceOpenSchema = z.strictObject({
94
94
  sequence: z.number().int().positive(),
95
+ commandSequence: z.number().int().positive().optional(),
96
+ exitCode: z.number().int().optional(),
95
97
  file: relativeSourcePathSchema,
96
98
  sourceTokens: z.number().int().nonnegative(),
97
99
  });
98
100
  const atlasCallSchema = z.strictObject({
99
101
  sequence: z.number().int().positive(),
100
102
  command: z.string().min(1),
103
+ commandSequence: z.number().int().positive().optional(),
104
+ exitCode: z.number().int().optional(),
105
+ output: z.string().min(1).optional(),
101
106
  });
102
107
  const atlasHandlingSchema = z.strictObject({
103
108
  sequence: z.number().int().positive(),
@@ -111,6 +116,61 @@ const atlasHandlingSchema = z.strictObject({
111
116
  ]),
112
117
  action: z.string().min(1),
113
118
  });
119
+ const skillLoadSchema = z.strictObject({
120
+ sequence: z.number().int().positive(),
121
+ file: relativeSourcePathSchema.regex(/^\.agents\/skills\/semantic-atlas\/(?:SKILL\.md|references\/[a-z0-9-]+\.md)$/u),
122
+ });
123
+ const knowledgeCaptureOutcomeSchema = z.enum([
124
+ "persist",
125
+ "reuse",
126
+ "transient",
127
+ "unverified",
128
+ ]);
129
+ export const knowledgeCaptureDecisionSchema = z.strictObject({
130
+ outcome: knowledgeCaptureOutcomeSchema,
131
+ summary: z.string().min(1),
132
+ });
133
+ export const knowledgeCaptureAdjudicationSchema = z.strictObject({
134
+ outcome: knowledgeCaptureOutcomeSchema,
135
+ correct: z.boolean(),
136
+ notes: z.string().min(1),
137
+ });
138
+ const skillDiscoverySchema = z.strictObject({
139
+ delivery: z.literal("repository"),
140
+ promptInjection: z.literal(false),
141
+ mainSkillLoaded: z.literal(true),
142
+ statusBeforeSource: z.literal(true),
143
+ mapBeforeSource: z.literal(true),
144
+ decisiveSourceRead: z.literal(true),
145
+ decisiveSourceFiles: z.array(relativeSourcePathSchema).min(1),
146
+ knowledgeCaptureDecision: knowledgeCaptureDecisionSchema,
147
+ conditionalReferences: z.strictObject({
148
+ snapshotBootstrap: z.discriminatedUnion("outcome", [
149
+ z.strictObject({ outcome: z.literal("not-required") }),
150
+ z.strictObject({
151
+ outcome: z.literal("loaded-after-trigger"),
152
+ triggerCommandSequence: z.number().int().positive(),
153
+ loadCommandSequence: z.number().int().positive(),
154
+ }),
155
+ ]),
156
+ resultRouting: z.discriminatedUnion("outcome", [
157
+ z.strictObject({ outcome: z.literal("not-required") }),
158
+ z.strictObject({
159
+ outcome: z.literal("loaded-after-trigger"),
160
+ triggerCommandSequence: z.number().int().positive(),
161
+ loadCommandSequence: z.number().int().positive(),
162
+ }),
163
+ ]),
164
+ graphPatch: z.discriminatedUnion("outcome", [
165
+ z.strictObject({ outcome: z.literal("not-loaded") }),
166
+ z.strictObject({
167
+ outcome: z.literal("loaded-after-source"),
168
+ sourceCommandSequence: z.number().int().positive(),
169
+ loadCommandSequence: z.number().int().positive(),
170
+ }),
171
+ ]),
172
+ }),
173
+ });
114
174
  export const evaluationFailureClassificationSchema = z.enum([
115
175
  "missed-dependency",
116
176
  "incorrect-answer",
@@ -145,6 +205,7 @@ export const evaluationRunSchema = z
145
205
  policy: z.literal(FRESH_AGENT_COMMAND_AUDIT_POLICY),
146
206
  commands: z.array(z.string().min(1)).min(1),
147
207
  }),
208
+ skillDiscovery: skillDiscoverySchema.optional(),
148
209
  }),
149
210
  startedAt: z.iso.datetime(),
150
211
  finishedAt: z.iso.datetime(),
@@ -153,16 +214,19 @@ export const evaluationRunSchema = z
153
214
  sourceOpens: z.array(sourceOpenSchema).min(1),
154
215
  atlasCalls: z.array(atlasCallSchema),
155
216
  atlasHandling: z.array(atlasHandlingSchema),
217
+ skillLoads: z.array(skillLoadSchema).optional(),
156
218
  }),
157
219
  answer: z.strictObject({
158
220
  response: z.string().min(1),
159
221
  reportedFiles: z.array(relativeSourcePathSchema),
160
222
  reportedSymbols: z.array(symbolReferenceSchema),
223
+ knowledgeCaptureDecision: knowledgeCaptureDecisionSchema.optional(),
161
224
  }),
162
225
  adjudication: z.strictObject({
163
226
  correct: z.boolean(),
164
227
  notes: z.string().min(1),
165
228
  failureClassifications: z.array(evaluationFailureClassificationSchema),
229
+ knowledgeCaptureDecision: knowledgeCaptureAdjudicationSchema.optional(),
166
230
  }),
167
231
  })
168
232
  .superRefine((run, context) => {
@@ -187,6 +251,80 @@ export const evaluationRunSchema = z
187
251
  path: ["observations", "atlasHandling"],
188
252
  });
189
253
  }
254
+ if (run.protocol.runnerVersion === "fresh-agent-runner-v5") {
255
+ const skillLoads = run.observations.skillLoads ?? [];
256
+ if (run.answer.knowledgeCaptureDecision === undefined) {
257
+ context.addIssue({
258
+ code: "custom",
259
+ message: "A discovery run must retain a structured knowledge-capture decision",
260
+ path: ["answer", "knowledgeCaptureDecision"],
261
+ });
262
+ }
263
+ const captureAdjudication = run.adjudication.knowledgeCaptureDecision;
264
+ if (captureAdjudication === undefined) {
265
+ context.addIssue({
266
+ code: "custom",
267
+ message: "A discovery run must retain independent knowledge-capture adjudication",
268
+ path: ["adjudication", "knowledgeCaptureDecision"],
269
+ });
270
+ }
271
+ else {
272
+ if (run.answer.knowledgeCaptureDecision !== undefined
273
+ && captureAdjudication.outcome !== run.answer.knowledgeCaptureDecision.outcome) {
274
+ context.addIssue({
275
+ code: "custom",
276
+ message: "The knowledge-capture adjudication must evaluate the answer decision",
277
+ path: ["adjudication", "knowledgeCaptureDecision", "outcome"],
278
+ });
279
+ }
280
+ if (!captureAdjudication.correct && run.adjudication.correct) {
281
+ context.addIssue({
282
+ code: "custom",
283
+ message: "An incorrect knowledge-capture decision makes the run incorrect",
284
+ path: ["adjudication", "correct"],
285
+ });
286
+ }
287
+ if (!captureAdjudication.correct
288
+ && !run.adjudication.failureClassifications.includes("protocol-violation")) {
289
+ context.addIssue({
290
+ code: "custom",
291
+ message: "An incorrect knowledge-capture decision requires protocol-violation",
292
+ path: ["adjudication", "failureClassifications"],
293
+ });
294
+ }
295
+ }
296
+ if (run.observations.sourceOpens.some((sourceOpen) => (sourceOpen.commandSequence === undefined || sourceOpen.exitCode !== 0))) {
297
+ context.addIssue({
298
+ code: "custom",
299
+ message: "A discovery run must bind every source observation to a successful command",
300
+ path: ["observations", "sourceOpens"],
301
+ });
302
+ }
303
+ if (run.mode === "atlas" && (run.protocol.skillDiscovery === undefined
304
+ || skillLoads[0]?.file !== ".agents/skills/semantic-atlas/SKILL.md")) {
305
+ context.addIssue({
306
+ code: "custom",
307
+ message: "A discovery run must load and audit the repository Semantic Atlas Skill",
308
+ path: ["protocol", "skillDiscovery"],
309
+ });
310
+ }
311
+ if (run.mode === "atlas" && run.observations.atlasCalls.some((call) => (call.commandSequence === undefined
312
+ || call.exitCode === undefined
313
+ || call.output === undefined))) {
314
+ context.addIssue({
315
+ code: "custom",
316
+ message: "A discovery run must retain replayable Atlas command envelopes",
317
+ path: ["observations", "atlasCalls"],
318
+ });
319
+ }
320
+ if (run.mode === "no-atlas" && (run.protocol.skillDiscovery !== undefined || skillLoads.length > 0)) {
321
+ context.addIssue({
322
+ code: "custom",
323
+ message: "A no-atlas run cannot load or audit the candidate Skill",
324
+ path: ["observations", "skillLoads"],
325
+ });
326
+ }
327
+ }
190
328
  if (run.adjudication.correct === (run.adjudication.failureClassifications.length > 0)) {
191
329
  context.addIssue({
192
330
  code: "custom",
@@ -204,6 +342,7 @@ export const evaluationRunSchema = z
204
342
  addSequenceIssues(run.observations.sourceOpens, context, "sourceOpens");
205
343
  addSequenceIssues(run.observations.atlasCalls, context, "atlasCalls");
206
344
  addSequenceIssues(run.observations.atlasHandling, context, "atlasHandling");
345
+ addSequenceIssues(run.observations.skillLoads ?? [], context, "skillLoads");
207
346
  });
208
347
  export function summarizeEvaluationRun(rawCase, rawRun) {
209
348
  const evaluationCase = evaluationCaseSchema.parse(rawCase);
@@ -25,13 +25,14 @@ For each case and mode:
25
25
 
26
26
  1. Check out the exact fixture revision recorded by the case.
27
27
  2. Start a new agent conversation with no prior task or repository context. Record the agent product and model. Disable host Skills, plugins, apps, hooks, MCP servers, memory, multi-agent delegation, and Skill search while preserving the local Codex authentication and model-provider configuration needed to execute the run.
28
- 3. Give the agent the case prompt and repository only. Keep the oracle and the other mode's result outside the agent context.
29
- 4. Keep model, agent instructions, tool policy, fixture revision, and task prompt identical for the paired runs. The only workflow difference is whether the Semantic Atlas Skill and CLI are available.
28
+ 3. Give the agent the case prompt and repository only. Keep the oracle, the other mode's result, the Semantic Atlas Skill name, and the Skill body out of the task prompt.
29
+ 4. Keep model, agent instructions, tool policy, fixture revision, and task prompt identical for the paired runs. In `atlas` mode, install the candidate under the fixture's ignored `.agents/skills/semantic-atlas` directory and expose the packaged CLI; in `no-atlas` mode, provide neither. Codex must select the candidate through its repository Skill discovery and description matching.
30
30
  5. In `no-atlas` mode, use normal source and shell tools and record zero Atlas calls. In `atlas` mode, record each Semantic Atlas command.
31
- 6. Record a `sourceOpens` event whenever repository source text is returned to the agent, including file reads and search snippets. Split multi-file tool output into one event per file.
31
+ 6. Record candidate `SKILL.md` and conditional-reference reads separately as `skillLoads`. Record a `sourceOpens` event whenever repository source text is returned to the agent, including file reads and search snippets. Bind each source event to the successful observer command's global sequence and exit status; failed commands cannot establish source confirmation. Skill instruction text does not count as source context.
32
32
  7. Record the number of source tokens exposed by each event using the execution environment's source-input accounting. Put the stable method/version in `sourceTokenMethod`. Count repeated reads again in token totals.
33
- 8. Save the agent's reported files and symbols. An evaluator who did not guide the run compares the answer with the oracle and records correctness plus notes.
34
- 9. Publish the complete Codex shell-command sequence with the run, then validate and summarize the baseline with `pnpm evaluation:validate` or pass additional run paths to `scripts/validate-evaluation.ts --baseline`.
33
+ 8. Save the agent's reported files, symbols, and structured knowledge-capture decision. Give an evaluator who did not guide the run the hidden oracle plus a bounded summary derived from the retained Atlas envelopes, successful source observations, result handling, and replayed discovery proof. The evaluator judges both the answer and whether `persist`, `reuse`, `transient`, or `unverified` matches that evidence. It records the evaluated outcome, a separate decision verdict and notes, overall correctness, and failure classifications. A wrong knowledge-capture decision makes the run incorrect with `protocol-violation`.
34
+ 9. Audit the complete Codex shell-command sequence. An Atlas run is valid only when it loads the repository Skill, runs `status` before source reads, queries the map before source reads, and opens decisive source afterward. A decisive source file must come from a successful trace-backed observer read or search and occur in the final reported evidence and hidden oracle. Retain each Atlas JSON envelope at its global command sequence, the structured `persist`, `reuse`, `transient`, or `unverified` knowledge-capture decision, and the ordered conditional-reference loads. Every matching state trigger, including one observed after an earlier source read, requires the reference procedure to be loaded; when later source fallback occurs, the load must precede that fallback. A `persist` decision requires GraphPatch authoring after decisive source confirmation; every other decision requires GraphPatch authoring to remain unloaded.
35
+ 10. Publish the complete command and discovery evidence, then validate and summarize the baseline with `pnpm evaluation:validate` or pass additional run paths to `scripts/validate-evaluation.ts --baseline`.
35
36
 
36
37
  A run is invalid when it lacks exact source-token accounting, is not a fresh context, uses a different fixture revision, sees its oracle, contains an Atlas call in `no-atlas` mode, reads a host instruction, or uses a shell command outside the versioned allowlist. Invalid runs are repeated rather than estimated.
37
38
 
@@ -51,6 +52,24 @@ permitted shell expansion. The runner rejects failed audits before adjudication,
51
52
  and published-result validation re-audits every recorded command sequence and
52
53
  its derived Atlas calls.
53
54
 
55
+ Runner v5 adds repository-native Skill discovery evidence. It copies the
56
+ candidate Skill into only the Atlas fixture through a Git-local ignore rule,
57
+ never injects its body into the task prompt, separates `skillLoads` from measured
58
+ source, binds every retained Atlas envelope and source observation to the complete
59
+ command timeline, and derives the status-map-source workflow audit in
60
+ `protocol.skillDiscovery`. Discovery uses only successful trace-backed source
61
+ commands, and state-triggered references remain mandatory after source inspection
62
+ as well as before the first source fallback.
63
+ The runner and published-artifact validator use the same derivation, compare the
64
+ stored proof exactly, and require state-triggered references between the matching
65
+ Atlas result and source fallback. They also replay the structured knowledge-capture
66
+ decision so a missing or unnecessary GraphPatch load fails validation. Independent
67
+ adjudication separately evaluates the decision's business meaning from bounded
68
+ retained evidence rather than trusting the Agent's label. The public run contract
69
+ binds the adjudicated outcome to the answer; a negative decision verdict must make
70
+ the run incorrect and carry `protocol-violation`. The source command allowlist
71
+ remains unchanged.
72
+
54
73
  ## Metrics
55
74
 
56
75
  - Required-file recall is the fraction of oracle files present in `answer.reportedFiles`.
@@ -85,12 +104,34 @@ percent). Atlas runs recorded 61 routed partial, unknown, or related boundary
85
104
  events and no uncertainty-handling failure. The fixed gate passed without being
86
105
  changed after results were collected.
87
106
 
107
+ These retained artifacts establish the frozen comparative gate; they predate
108
+ runner v5 and do not by themselves prove implicit Skill discovery. New candidate
109
+ runs must also carry the v5 discovery evidence described above.
110
+
111
+ The separately retained
112
+ `evaluation/results/fresh-agent-discovery-v5/location-nestjs-provider-atlas.json`
113
+ is a complete runner-v5 Atlas run over the same synthetic fixture. A fresh
114
+ ephemeral Codex context discovered the repository Skill without prompt-body
115
+ injection, completed the status-map-source workflow, and bound two decisive
116
+ source observations to successful global commands. Snapshot bootstrap, result
117
+ routing, and GraphPatch authoring each have a matching timeline proof. A second
118
+ fresh context independently adjudicated both the answer and the structured
119
+ knowledge-capture decision from retained evidence. This artifact proves the
120
+ discovery protocol; it does not replace or alter the frozen 24-run comparative
121
+ metrics.
122
+
88
123
  Validate the published records with:
89
124
 
90
125
  ```sh
91
126
  pnpm evaluation:results
92
127
  ```
93
128
 
129
+ Validate the retained runner-v5 discovery artifact with:
130
+
131
+ ```sh
132
+ pnpm evaluation:discovery
133
+ ```
134
+
94
135
  `pnpm evaluation:run` rebuilds the deterministic fixture repositories, runs 24
95
136
  new ephemeral Codex contexts plus an independent adjudication context, and
96
137
  replaces the published run records and report. It requires a working local
@@ -21,22 +21,22 @@ Atlas interprets CodeGraph results through its own world-graph contract. Replaci
21
21
 
22
22
  ## Agent workflow
23
23
 
24
- ### First use
25
-
26
- 1. The calling agent invokes `semantic-atlas status` in a target worktree.
27
- 2. If the current worktree has no usable world snapshot, the agent invokes `semantic-atlas index`.
28
- 3. Atlas creates local generated state under `<worktree>/.atlas/` and invokes the embedded CodeGraph SDK to build the structural graph.
29
- 4. In the same index lifecycle, Atlas records the repository snapshot, rebinds evidence, derives validity, and makes one unified world graph queryable.
30
- 5. The agent uses `map roots`, `map search`, `map children`, and `map show` to obtain business context connected to bounded structural evidence.
31
- 6. The agent opens authoritative source where evidence is stale, unresolved, unsupported, or insufficient and performs engineering work outside Atlas.
32
- 7. After relevant source changes, the agent reindexes, inspects `changes`, and submits verified business knowledge with `learn --stdin` against the current snapshot.
33
-
34
- ### Recurring use
35
-
36
- 1. The agent checks `status` before trusting stored knowledge.
37
- 2. A current world map is queried before broad source search.
38
- 3. Source edits, tests, Git operations, review, and natural-language reasoning remain normal agent work.
39
- 4. Reindexing updates the structural projection and invalidates only business assertions whose evidence can no longer be rebound.
24
+ ### Required business-understanding loop
25
+
26
+ 1. For every supported task that implements, fixes, debugs, refactors, reviews, traces, or assesses business behavior, the agent identifies the exact target worktree and invokes `semantic-atlas status` before broad source discovery.
27
+ 2. Atlas commands run serially. A missing, stale, failed, or incomplete snapshot loads the bootstrap procedure and invokes `semantic-atlas index`; a current complete snapshot proceeds directly to map queries.
28
+ 3. The agent queries `map roots`, `map search`, `map children`, and `map show` before broad source search, using current locations, relationships, evidence, owners, candidates, and unknown boundaries as a bounded source seed set.
29
+ 4. The agent confirms answer-controlling and change-controlling behavior in authoritative source. Source edits, tests, Git operations, review, and natural-language reasoning remain normal engineering work outside Atlas.
30
+ 5. After relevant source changes, the agent reindexes, inspects `changes`, re-queries affected concepts, and confirms the refreshed projection against source and tests.
31
+ 6. Before completing the task, the agent makes a knowledge-capture decision. Every newly discovered durable, verified business concept and supported relationship caused by missing or insufficient map knowledge is submitted with `learn --stdin` and verified through `map show`; transient and unverified observations remain task context.
32
+
33
+ Detailed bootstrap, abnormal-result routing, and GraphPatch procedures are state-conditioned Skill references rather than permanently loaded first-use instructions.
34
+
35
+ ### Incremental and explicit bootstrap
36
+
37
+ A normal task adds only the verified business knowledge needed for its relevant capability. This makes ordinary work incrementally improve later map queries without turning each task into a repository-wide mapping exercise.
38
+
39
+ An explicit project-initialization request begins at current structural roots, selects a stated bounded set of representative domain paths, confirms their interfaces, operations, data, invariants, and verification in source, then learns a reusable initial business map. Unsupported or unknown behavior remains an explicit boundary.
40
40
 
41
41
  ## Responsibility boundary
42
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semantic-atlas",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "A local, revision-aware project world model for AI coding agents.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -45,34 +45,33 @@
45
45
  "engines": {
46
46
  "node": ">=22.12.0 <25"
47
47
  },
48
- "packageManager": "pnpm@11.5.1",
49
48
  "publishConfig": {
50
49
  "access": "public",
51
50
  "provenance": true
52
51
  },
52
+ "dependencies": {
53
+ "@colbymchenry/codegraph": "1.5.0",
54
+ "zod": "^4.1.12"
55
+ },
56
+ "devDependencies": {
57
+ "@types/node": "^22.10.0",
58
+ "tiktoken": "1.0.22",
59
+ "tsx": "^4.20.6",
60
+ "typescript": "^5.9.0",
61
+ "vitest": "^3.2.0"
62
+ },
53
63
  "scripts": {
54
64
  "build": "tsc -p tsconfig.build.json",
55
65
  "test": "vitest run",
56
66
  "test:watch": "vitest",
57
67
  "typecheck": "tsc -p tsconfig.json",
58
68
  "evaluation:validate": "tsx scripts/validate-evaluation.ts --baseline evaluation/cases/plan.json evaluation/examples/no-atlas-run.json",
69
+ "evaluation:discovery": "tsx scripts/validate-evaluation.ts evaluation/cases/plan.json evaluation/results/fresh-agent-discovery-v5/location-nestjs-provider-atlas.json",
59
70
  "evaluation:run": "tsx scripts/run-fresh-agent-evaluation.ts",
60
71
  "evaluation:results": "tsx scripts/validate-evaluation.ts --baseline --comparison --report evaluation/results/fresh-agent-v1/report.json evaluation/cases/plan.json evaluation/results/fresh-agent-v1/runs/*.json",
61
72
  "validation:backend": "tsx scripts/validate-embedded-backend.ts",
62
73
  "package:verify": "tsx scripts/verify-package.ts",
63
74
  "contracts:generate": "tsx scripts/generate-contracts.ts",
64
- "contracts:check": "tsx scripts/generate-contracts.ts --check",
65
- "prepack": "tsx scripts/generate-contracts.ts --check && tsc -p tsconfig.build.json"
66
- },
67
- "dependencies": {
68
- "@colbymchenry/codegraph": "1.5.0",
69
- "zod": "^4.1.12"
70
- },
71
- "devDependencies": {
72
- "@types/node": "^22.10.0",
73
- "tiktoken": "1.0.22",
74
- "tsx": "^4.20.6",
75
- "typescript": "^5.9.0",
76
- "vitest": "^3.2.0"
75
+ "contracts:check": "tsx scripts/generate-contracts.ts --check"
77
76
  }
78
- }
77
+ }