@davidorex/pi-context 0.30.0 → 0.32.0

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 (90) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/README.md +27 -11
  3. package/dist/block-api.d.ts +13 -0
  4. package/dist/block-api.d.ts.map +1 -1
  5. package/dist/block-api.js +28 -3
  6. package/dist/block-api.js.map +1 -1
  7. package/dist/content-hash.d.ts +13 -0
  8. package/dist/content-hash.d.ts.map +1 -1
  9. package/dist/content-hash.js +16 -0
  10. package/dist/content-hash.js.map +1 -1
  11. package/dist/context-dir.d.ts +12 -0
  12. package/dist/context-dir.d.ts.map +1 -1
  13. package/dist/context-dir.js +14 -0
  14. package/dist/context-dir.js.map +1 -1
  15. package/dist/context-sdk.d.ts +71 -33
  16. package/dist/context-sdk.d.ts.map +1 -1
  17. package/dist/context-sdk.js +547 -149
  18. package/dist/context-sdk.js.map +1 -1
  19. package/dist/context.d.ts +213 -2
  20. package/dist/context.d.ts.map +1 -1
  21. package/dist/context.js +119 -5
  22. package/dist/context.js.map +1 -1
  23. package/dist/index.d.ts +595 -9
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +2225 -55
  26. package/dist/index.js.map +1 -1
  27. package/dist/lens-view.d.ts +0 -5
  28. package/dist/lens-view.d.ts.map +1 -1
  29. package/dist/lens-view.js +43 -1
  30. package/dist/lens-view.js.map +1 -1
  31. package/dist/migration-registry-loader.d.ts +36 -12
  32. package/dist/migration-registry-loader.d.ts.map +1 -1
  33. package/dist/migration-registry-loader.js +79 -17
  34. package/dist/migration-registry-loader.js.map +1 -1
  35. package/dist/migrations-store.d.ts +45 -18
  36. package/dist/migrations-store.d.ts.map +1 -1
  37. package/dist/migrations-store.js +56 -22
  38. package/dist/migrations-store.js.map +1 -1
  39. package/dist/ops-registry.d.ts +16 -0
  40. package/dist/ops-registry.d.ts.map +1 -1
  41. package/dist/ops-registry.js +352 -117
  42. package/dist/ops-registry.js.map +1 -1
  43. package/dist/pending-blocked-store.d.ts +83 -0
  44. package/dist/pending-blocked-store.d.ts.map +1 -0
  45. package/dist/pending-blocked-store.js +93 -0
  46. package/dist/pending-blocked-store.js.map +1 -0
  47. package/dist/promote-item.d.ts.map +1 -1
  48. package/dist/promote-item.js +41 -12
  49. package/dist/promote-item.js.map +1 -1
  50. package/dist/roadmap-plan.d.ts +121 -99
  51. package/dist/roadmap-plan.d.ts.map +1 -1
  52. package/dist/roadmap-plan.js +281 -345
  53. package/dist/roadmap-plan.js.map +1 -1
  54. package/dist/schema-merge.d.ts +26 -0
  55. package/dist/schema-merge.d.ts.map +1 -0
  56. package/dist/schema-merge.js +176 -0
  57. package/dist/schema-merge.js.map +1 -0
  58. package/dist/status-vocab.d.ts +12 -2
  59. package/dist/status-vocab.d.ts.map +1 -1
  60. package/dist/status-vocab.js +14 -1
  61. package/dist/status-vocab.js.map +1 -1
  62. package/package.json +2 -1
  63. package/samples/blocks/milestone.json +3 -0
  64. package/samples/blocks/session-notes.json +1 -0
  65. package/samples/conception.json +358 -15
  66. package/samples/migrations.json +8 -0
  67. package/samples/schemas/context-contracts.schema.json +4 -0
  68. package/samples/schemas/conventions.schema.json +4 -0
  69. package/samples/schemas/decisions.schema.json +4 -0
  70. package/samples/schemas/features.schema.json +4 -0
  71. package/samples/schemas/framework-gaps.schema.json +5 -1
  72. package/samples/schemas/issues.schema.json +30 -2
  73. package/samples/schemas/layer-plans.schema.json +6 -2
  74. package/samples/schemas/milestone.schema.json +79 -0
  75. package/samples/schemas/phase.schema.json +4 -0
  76. package/samples/schemas/rationale.schema.json +4 -0
  77. package/samples/schemas/requirements.schema.json +4 -0
  78. package/samples/schemas/research.schema.json +5 -1
  79. package/samples/schemas/session-notes.schema.json +89 -0
  80. package/samples/schemas/spec-reviews.schema.json +4 -0
  81. package/samples/schemas/story.schema.json +8 -0
  82. package/samples/schemas/tasks.schema.json +4 -0
  83. package/samples/schemas/verification.schema.json +4 -0
  84. package/samples/schemas/work-orders.schema.json +6 -2
  85. package/schemas/config.schema.json +101 -3
  86. package/schemas/migrations.schema.json +25 -0
  87. package/schemas/pending-blocked.schema.json +190 -0
  88. package/skill-narrative.md +14 -10
  89. package/skills/pi-context/SKILL.md +127 -49
  90. package/skills/pi-context/references/bundled-resources.md +7 -2
package/dist/index.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
+ import { type RegistryAdditions } from "./context.js";
3
+ import type { DispatchContext } from "./dispatch-context.js";
4
+ import { type SchemaConflict } from "./schema-merge.js";
2
5
  /**
3
6
  * Thrown by `initProject` when an existing `.pi-context.json` bootstrap pointer
4
7
  * declares a different `contextDir` than the caller is requesting. Pre-FGAP-179
@@ -48,21 +51,602 @@ export interface InstallResult {
48
51
  updated: string[];
49
52
  skipped: string[];
50
53
  notFound: string[];
54
+ preserved: string[];
55
+ /**
56
+ * FGAP-029 safe re-sync (slice S4) — SCHEMA --update outcomes.
57
+ * - `resynced`: an installed schema re-synced from the catalog where no
58
+ * block-item migration was required (same `version` as installed — a
59
+ * description-only / non-versioned drift — OR a version bump whose block
60
+ * file is absent / holds zero items, so no items needed migrating).
61
+ * - `migrated`: a version-bumped schema re-synced AND the populated block's
62
+ * items forward-migrated through the shipped migration chain + re-validated
63
+ * against the new schema (block re-written via the migration path).
64
+ * - `blocked`: a version-bumped schema REFUSED — no shipped migration chain
65
+ * reaches the catalog version, OR the migrated items would not validate
66
+ * against the new schema. BOTH the schema file AND the block file are left
67
+ * byte-unchanged (forward-migrate-or-refuse; never strand items under a
68
+ * schema they fail).
69
+ */
70
+ resynced: string[];
71
+ migrated: string[];
72
+ blocked: string[];
73
+ /**
74
+ * Ceremony-entry identity establishment (DEC-0020): the `substrate_id` this
75
+ * run minted + persisted + registered because the config lacked one. Absent
76
+ * when identity was already established (never re-minted).
77
+ */
78
+ substrateIdEstablished?: string;
51
79
  }
52
80
  /**
53
- * /context install opt-in mechanism (DEC-0011). Reads config.installed_schemas
54
- * and config.installed_blocks, copies declared assets from the package
55
- * samples catalog (samples/, keyed by conception.json's block_kinds) into the
56
- * project's substrate root + schemas dir.
81
+ * One per-item validation failure mapped from an AJV `ErrorObject`, in the
82
+ * minimal shape the blocked-diagnostic surfaces consume (TASK-048 / FGAP-077).
83
+ * `itemId` is the failing block item's `id` when the AJV `instancePath` resolves
84
+ * to one (envelope-level errors leave it undefined); `instancePath` is AJV's raw
85
+ * JSON pointer; `keyword` + `message` carry the constraint that failed and its
86
+ * AJV text. The shape is deliberately minimal — no full `params` plumbing.
87
+ */
88
+ export interface BlockValidationFailure {
89
+ itemId?: string;
90
+ instancePath: string;
91
+ keyword: string;
92
+ message: string;
93
+ }
94
+ /**
95
+ * Per-schema blocked-resync diagnostic detail (TASK-048 / FGAP-077). Carried by
96
+ * `simulateResyncOutcome` / `resyncSchema` on the blocked arms and surfaced via
97
+ * `UpdateResult.blockedDetail`, so a refused catalog-ahead resync reports WHY it
98
+ * refused — distinguishing a missing migration chain from items that fail the
99
+ * catalog schema, with the version pair and (for validation failures) the per-
100
+ * item failures naming id / field / constraint.
101
+ * - `no-migration-chain`: no shipped chain reaches `to` from `from`; the
102
+ * version pair is carried, `failures` omitted.
103
+ * - `validation-failed`: the in-memory forward-migrate + re-validate threw an
104
+ * AJV ValidationError; the version pair is carried, `failures` lists the
105
+ * per-item constraint failures.
106
+ * - `write-failed`: a NON-validation throw at the resync write boundary (e.g.
107
+ * the mandatory identity stamp refusing a substrate with no `substrate_id`,
108
+ * or an unreadable catalog body) — FGAP-115. The items were NOT flagged
109
+ * invalid; `failures` carries a single `{instancePath:"", keyword:"error"}`
110
+ * entry whose `message` is the thrown error. A `write-failed` refusal
111
+ * inscribes NO failure markers and persists NO pending-blocked record —
112
+ * those are validation-only consequences (the resolve-blocked remedy fixes
113
+ * items, which is not the problem here).
114
+ */
115
+ export interface BlockedDetail {
116
+ name: string;
117
+ reason: "no-migration-chain" | "validation-failed" | "write-failed";
118
+ from?: string;
119
+ to?: string;
120
+ failures?: BlockValidationFailure[];
121
+ /**
122
+ * content_hash of the pinned pre-marker block bytes, set ONLY when the live
123
+ * update actually inscribed git-style failure markers into this schema's block
124
+ * file (TASK-052 / FGAP-081). `renderBlocked` keys its past-tense "markers were
125
+ * written INTO the block file" claim on this field's presence: a dryRun preview
126
+ * (writes nothing) and a `no-migration-chain` entry (never marked) leave it
127
+ * omitted, so the rendered guidance for those does not falsely claim a write.
128
+ */
129
+ premarker_hash?: string;
130
+ }
131
+ /**
132
+ * Read the verbatim bundled catalog `*.schema.json` body for a named
133
+ * block_kind. Resolves the catalog via the shared `resolveCatalog()` (same
134
+ * `samplesRoot` + `canonical_id`→`schema_path` map the installer and the drift
135
+ * detector use), then reads the catalog schema file's raw bytes. The returned
136
+ * `text` is the unparsed source (raw JSON Schema — properties/definitions/$id),
137
+ * NOT the `read-samples-catalog` projection, so an operator can diff it locally
138
+ * against the installed `<substrate>/schemas/<name>.schema.json` without
139
+ * touching node_modules (STORY-010 / FGAP-079, TASK-050).
140
+ *
141
+ * Read-only and substrate-independent: it touches only the package's bundled
142
+ * `samplesRoot` and takes no cwd, so no installed schema, block, or config is
143
+ * reachable from this path. Throws on an unknown kind, matching the unknown-kind
144
+ * throw idiom in validateBlockItemsAgainstCatalog / resolveConflict.
145
+ */
146
+ export declare function readCatalogSchemaText(kindName: string): {
147
+ kind: string;
148
+ schemaPath: string;
149
+ text: string;
150
+ };
151
+ /**
152
+ * Validate ONE installed block's items against the CATALOG schema version,
153
+ * read-only (TASK-048 — FGAP-077). The standalone diagnostic underneath the
154
+ * `validate-block-items` op: it answers "would these items pass the catalog
155
+ * schema (after the shipped forward-migration, when the block lags the catalog
156
+ * version)?" WITHOUT writing anything — no schema overwrite, no block re-write, no
157
+ * migration registration.
158
+ *
159
+ * Resolution mirrors the catalog-ahead resync path so the diagnostic predicts the
160
+ * same pass/fail `resyncSchema` would reach:
161
+ * - resolve the block_kind via `resolveCatalog().byId` (an unknown block throws
162
+ * a field-named Error); read the catalog schema body off `samplesRoot`.
163
+ * - load the installed block via `installedBlockDestPath` (a missing block file
164
+ * throws field-named).
165
+ * - when the block's declared envelope `schema_version` is a string differing
166
+ * from the catalog `version` AND a shipped chain reaches the catalog version,
167
+ * forward-migrate the block IN MEMORY through a FRESH registry seeded from the
168
+ * substrate's existing decls + the chain's absent edges (deduped on
169
+ * (schemaName, fromVersion)); otherwise validate as-is. No registry warming.
170
+ * - `validate(catalogSchema, data, blockName)` in try/catch → pass:
171
+ * `{valid:true, failures:[]}`; ValidationError → `{valid:false, failures}`
172
+ * mapped against the (migrated) data; any other throw → a single synthetic
173
+ * `{instancePath:"", keyword:"error", message:String(err)}` failure.
57
174
  *
58
- * - Default behavior is skip-if-exists. With overwrite=true, replaces the
59
- * destination file and reports as "updated" rather than "installed".
60
- * - Sources missing from the samples catalog are reported as "notFound".
61
- * - Empty install lists are not an error — the result is a clean no-op.
175
+ * Returns `{ block, from?, to?, valid, failures }`: `from`/`to` are the block's
176
+ * declared version and the catalog version (each undefined when unreadable).
177
+ * NEVER writes.
62
178
  */
179
+ export declare function validateBlockItemsAgainstCatalog(cwd: string, blockName: string): {
180
+ block: string;
181
+ from?: string;
182
+ to?: string;
183
+ valid: boolean;
184
+ failures: BlockValidationFailure[];
185
+ };
63
186
  export declare function installContext(cwd: string, options?: {
64
187
  overwrite?: boolean;
65
188
  }): InstallResult;
189
+ /**
190
+ * One installed-schema's drift classification, produced by the read-only
191
+ * `checkStatus` detector. `state` summarizes the three-way comparison between
192
+ * the S2 install baseline (config.installed_from.assets[name].content_hash),
193
+ * the catalog's current schema file, and the currently-installed schema file:
194
+ *
195
+ * - `in-sync` — baseline === catalog-now === installed-now
196
+ * - `catalog-ahead` — catalog-now ≠ baseline, installed-now === baseline
197
+ * (the package shipped a newer schema; local copy
198
+ * still matches the baseline it was installed from)
199
+ * - `locally-modified`— installed-now ≠ baseline, catalog-now === baseline
200
+ * (someone edited the installed schema on disk)
201
+ * - `both-diverged` — both catalog-now and installed-now ≠ baseline
202
+ * - `no-baseline` — no baseline recorded for this schema (pre-S2 install,
203
+ * or never installed) — drift is undecidable
204
+ * - `missing-catalog` — the catalog source file is absent / unhashable
205
+ * - `missing-installed` — the installed dest file is absent / unhashable
206
+ *
207
+ * `baseline_version` is the version captured in the baseline asset;
208
+ * `catalog_version` is the catalog schema file's own declared `version`;
209
+ * `installed_modified` is true when the installed file differs from the
210
+ * baseline content (covers locally-modified + both-diverged).
211
+ */
212
+ export interface CheckStatusAsset {
213
+ name: string;
214
+ state: "in-sync" | "catalog-ahead" | "locally-modified" | "both-diverged" | "no-baseline" | "missing-catalog" | "missing-installed";
215
+ baseline_version?: string;
216
+ catalog_version?: string;
217
+ installed_modified?: boolean;
218
+ /**
219
+ * True for an asset whose CATALOG copy has moved past the install baseline
220
+ * (states `catalog-ahead` / `both-diverged`) — i.e. the installed schema is
221
+ * behind the catalog. Absent (undefined) on not-behind assets. (FGAP-078 /
222
+ * STORY-007: "report which installed schemas are behind the catalog".)
223
+ */
224
+ behind?: boolean;
225
+ /**
226
+ * The version gap for a `behind` asset (FGAP-078). `from`/`to` are the
227
+ * baseline and catalog versions (either may be undefined when a schema body
228
+ * omits `version`). `basis` distinguishes a declared version bump
229
+ * (`from !== to`, both present) from a content-only drift (same or
230
+ * undefined versions, yet the content hash moved — `catalog-ahead` is a hash
231
+ * comparison, so a behind asset can have an unchanged version string).
232
+ * Absent (undefined) on not-behind assets.
233
+ */
234
+ version_delta?: {
235
+ from?: string;
236
+ to?: string;
237
+ basis: "version-bump" | "content-only";
238
+ };
239
+ }
240
+ /**
241
+ * Result of the read-only `checkStatus` drift detector: a per-schema
242
+ * classification plus a state-keyed summary count (with a `total`). Writes
243
+ * nothing.
244
+ */
245
+ export interface CheckStatusReport {
246
+ perAsset: CheckStatusAsset[];
247
+ summary: Record<CheckStatusAsset["state"], number> & {
248
+ total: number;
249
+ };
250
+ }
251
+ /**
252
+ * PURE-READ drift detector for `/context check-status` (FGAP-029 safe
253
+ * re-sync, slice S3). Compares, per installed schema, the S2 install baseline
254
+ * against the catalog's current schema file and the currently-installed schema
255
+ * file, classifies the drift, and RETURNS the report. Writes NOTHING anywhere —
256
+ * no config write, no file copy, no mkdir; only reads. One designed exception:
257
+ * like every ceremony entry point it seeds the catalog's `config` migration
258
+ * chain into `migrations.json` (idempotent) before its first config read — the
259
+ * heal semantic, consistent with idempotent re-init healing — so a
260
+ * version-lagging legacy substrate is diagnosable instead of throwing.
261
+ *
262
+ * For each `config.installed_schemas` entry:
263
+ * - baseline = config.installed_from?.assets?.[name]?.content_hash
264
+ * - catalog-now = computeFileContentHash(samplesRoot/<kind.schema_path>)
265
+ * (state `missing-catalog` when the source file is absent
266
+ * or unhashable)
267
+ * - installed-now = computeFileContentHash(installedSchemaDestPath(destRoot,name))
268
+ * (state `missing-installed` when the dest file is absent
269
+ * or unhashable)
270
+ *
271
+ * Each file-hash read is wrapped in try/catch so a corrupt file degrades to a
272
+ * `missing-*` / diverged classification rather than throwing — mirroring S2's
273
+ * safety default. A schema whose name has no catalog block_kind is reported
274
+ * `missing-catalog`.
275
+ */
276
+ export declare function checkStatus(cwd: string): CheckStatusReport;
277
+ /**
278
+ * Render a `CheckStatusReport` (from the read-only `checkStatus` detector) as a
279
+ * scannable per-state grouping for `/context check-status`. Groups the
280
+ * affected schema names under each non-empty state, then a total line. Mirrors
281
+ * the install-handler `lines.push` style.
282
+ */
283
+ export declare function renderCheckStatus(report: CheckStatusReport): string;
284
+ /**
285
+ * The per-schema action plan produced by `updateContext` (FEAT-006 T1 — TASK-034 /
286
+ * DEC-0017). `updateContext` classifies every installed schema via the read-only
287
+ * `checkStatus` detector, then routes by drift state:
288
+ *
289
+ * - `resynced` / `migrated`: a `catalog-ahead` schema (the package shipped a
290
+ * newer schema; the local copy still matches the baseline it was installed
291
+ * from) was brought current through the SAME `resyncSchema` path `/context
292
+ * install --update` uses. `resyncSchema` reports `resynced` (same-version /
293
+ * versionless drift, or a version bump with no items to migrate) vs
294
+ * `migrated` (a version bump whose populated block forward-migrated +
295
+ * re-validated); `updateContext` records the schema name under the
296
+ * corresponding array. A `catalog-ahead` schema whose `resyncSchema` returns
297
+ * `blocked` (no shipped chain, or migrated items fail the new schema) is
298
+ * recorded under `blocked` — schema, block, and migrations.json all left
299
+ * byte-unchanged (per `resyncSchema`'s blocked guarantee).
300
+ * - `refused`: a `locally-modified` or `both-diverged` schema — the installed
301
+ * file was edited on disk. This first increment (DEC-0017) REFUSES to
302
+ * overwrite a locally-modified schema: no `resyncSchema` call, no copy, no
303
+ * write of any kind for these. The schema name is recorded here so the
304
+ * operator can reconcile; an automatic three-way merge is the deferred
305
+ * follow-on (TASK-036), out of scope for T1.
306
+ * - `reported`: a schema whose drift is undecidable or whose files are absent
307
+ * (`no-baseline` / `missing-catalog` / `missing-installed`). Recorded with
308
+ * its `state` (no write attempted) so the operator sees why it was not acted
309
+ * on.
310
+ * - `inSync`: an `in-sync` schema — already current, recorded as a no-action.
311
+ *
312
+ * `dryRun: true` performs NO writes (no `resyncSchema` call) — the action plan is
313
+ * computed from `checkStatus` alone, so the `resynced`/`migrated`/`blocked`
314
+ * arrays carry the schemas that WOULD be acted on (every `catalog-ahead` schema
315
+ * is reported under `resynced` in the preview, since the resync outcome is not
316
+ * computed without running it), and `refused`/`reported`/`inSync` are identical
317
+ * to the live run. Nothing on disk changes under `dryRun`.
318
+ */
319
+ export interface UpdateResult {
320
+ /** Substrate-resolution / config-load failure (no schemas processed). */
321
+ error?: string;
322
+ /** When true, no writes were performed — the plan is a preview only. */
323
+ dryRun: boolean;
324
+ /** `catalog-ahead` schemas re-synced verbatim (same-version / no-item-migration). */
325
+ resynced: string[];
326
+ /** `catalog-ahead` schemas whose populated block forward-migrated + re-validated. */
327
+ migrated: string[];
328
+ /** `catalog-ahead` schemas whose resync was refused by `resyncSchema` (no safe migration). */
329
+ blocked: string[];
330
+ /**
331
+ * Per-schema blocked-resync diagnostic detail (TASK-048 — FGAP-077), one entry
332
+ * per name in `blocked`. Each carries the refusal `reason` (`no-migration-chain`
333
+ * — no shipped chain reaches the catalog version — vs `validation-failed` — the
334
+ * forward-migrated items fail the catalog schema), the installed→catalog version
335
+ * pair, and (for `validation-failed`) the per-item `failures` naming the failing
336
+ * item id, field (the `instancePath`), constraint `keyword`, and AJV `message`.
337
+ * Under `dryRun` this is the predicted detail; the live run reports the detail
338
+ * `resyncSchema` produced on refusal. The `blocked: string[]` list is unchanged.
339
+ */
340
+ blockedDetail: BlockedDetail[];
341
+ /** `locally-modified` / `both-diverged` schemas — refused, never overwritten (DEC-0017). */
342
+ refused: string[];
343
+ /**
344
+ * `locally-modified` / `both-diverged` schemas whose recorded base, local
345
+ * body, and catalog body merged conflict-free (TASK-036 — FEAT-006 T3). The
346
+ * merged body was written (live run) or validated only (`dryRun`).
347
+ */
348
+ merged: string[];
349
+ /**
350
+ * `locally-modified` / `both-diverged` schemas whose 3-way merge surfaced
351
+ * irreconcilable per-path disagreements (the merge declined to write); each
352
+ * entry carries the schema `name` + its `conflicts` for reconciliation.
353
+ */
354
+ conflicts: Array<{
355
+ name: string;
356
+ conflicts: SchemaConflict[];
357
+ }>;
358
+ /** `no-baseline` / `missing-catalog` / `missing-installed` schemas — reported, not acted on. */
359
+ reported: Array<{
360
+ name: string;
361
+ state: CheckStatusAsset["state"];
362
+ }>;
363
+ /** `in-sync` schemas — already current, no action. */
364
+ inSync: string[];
365
+ /**
366
+ * Catalog-new config-registry entries this run additively propagated into the
367
+ * substrate config (TASK-038 — FEAT-006 T5). Per registry, the identity-keyed
368
+ * ids brought current (`relation_types` / `block_kinds` by `canonical_id`,
369
+ * `invariants` / `lenses` by `id`). User-authored entries absent from the
370
+ * catalog, and existing entries whose body diverges from the catalog, are
371
+ * preserved untouched and never listed here (additive-only). Under `dryRun`
372
+ * the arrays report what WOULD be added; nothing is written.
373
+ */
374
+ registryAdditions: RegistryAdditions;
375
+ /**
376
+ * Migration declarations this run registered into the substrate's
377
+ * migrations.json (FGAP-050). A version-bump `catalog-ahead` re-sync registers
378
+ * the shipped catalog chain's not-already-present decls before migrating; each
379
+ * appears here as `{ schema, from, to }`. Mirrors `registryAdditions`: under
380
+ * `dryRun` this lists what WOULD be registered (computed read-only from the
381
+ * catalog chain minus the decls already on disk); nothing is written. A
382
+ * same-version resync or a `blocked` (rolled-back) outcome contributes nothing.
383
+ */
384
+ migrationsRegistered: Array<{
385
+ schema: string;
386
+ from: string;
387
+ to: string;
388
+ }>;
389
+ /**
390
+ * Partial-application legibility (FGAP-076). Present EXACTLY when this run
391
+ * both refused something (`blocked` / `refused` / `conflicts` non-empty) AND
392
+ * applied something (`resynced` / `migrated` / `merged` /
393
+ * `migrationsRegistered` / any `registryAdditions` array non-empty) — the
394
+ * per-component decision model (a blocked schema rolls back only itself; the
395
+ * additive registry propagation writes regardless) means those can co-occur
396
+ * in one run, and without this field a caller reading `blocked` can conclude
397
+ * nothing was applied while config.json in fact changed. `applied` /
398
+ * `notApplied` mirror the underlying channels (`notApplied.conflicts` carries
399
+ * the conflicted schema NAMES; per-path detail stays on `conflicts`);
400
+ * `summary` is the one-line operator-legible statement naming what was
401
+ * applied alongside what was refused and why. Computed for live AND `dryRun`
402
+ * runs — under `dryRun` it is the predicted partiality of the previewed plan
403
+ * (nothing written), which the summary states explicitly. A fully-clean or
404
+ * fully-refused run carries no field.
405
+ */
406
+ partialApplication?: {
407
+ applied: {
408
+ resynced: string[];
409
+ migrated: string[];
410
+ merged: string[];
411
+ registryAdditions: RegistryAdditions;
412
+ migrationsRegistered: Array<{
413
+ schema: string;
414
+ from: string;
415
+ to: string;
416
+ }>;
417
+ };
418
+ notApplied: {
419
+ blocked: string[];
420
+ refused: string[];
421
+ conflicts: string[];
422
+ };
423
+ summary: string;
424
+ };
425
+ /**
426
+ * Ceremony-entry identity establishment (DEC-0020): the `substrate_id` this
427
+ * LIVE run minted + persisted + registered because the config lacked one, so
428
+ * the run's stamping writes proceed instead of refusing. Absent when
429
+ * identity was already established (never re-minted) and always absent under
430
+ * `dryRun` (a preview performs no stamping write, so nothing is established).
431
+ */
432
+ substrateIdEstablished?: string;
433
+ }
434
+ /**
435
+ * `/context update` engine (FEAT-006 T1 — TASK-034 / DEC-0017). Brings the
436
+ * installed substrate MODEL (schemas) current with the packaged catalog by
437
+ * consulting the read-only `checkStatus` drift detector per installed schema and
438
+ * routing each by its drift `state`:
439
+ *
440
+ * - `in-sync` → no-op (recorded under `inSync`).
441
+ * - `catalog-ahead` → re-sync via the EXISTING `resyncSchema` (the SAME
442
+ * call shape `/context install --update`'s schema loop
443
+ * uses for that asset: `resyncSchema(destRoot,
444
+ * samplesRoot, sourceFile, destFile, name)` with
445
+ * `sourceFile = samplesRoot/<kind.schema_path>` and
446
+ * `destFile = installedSchemaDestPath(destRoot,
447
+ * name)`). Its `resynced`/`migrated`/`blocked` outcome
448
+ * routes into the matching array.
449
+ * - `locally-modified` /
450
+ * `both-diverged` → REFUSE-AND-REPORT: do NOT call `resyncSchema`, do NOT
451
+ * overwrite; record under `refused`. The first increment
452
+ * (DEC-0017) never clobbers a locally-edited schema; the
453
+ * three-way merge is deferred (TASK-036).
454
+ * [TASK-036 — FEAT-006 T3, now implemented]: the merge is no
455
+ * longer deferred. BASE is reconstructed from the baseline's
456
+ * content-addressed body (`getObject(destRoot,
457
+ * installed_from.assets[name].content_hash)`) and key/path-
458
+ * merged with OURS (installed file) + THEIRS (catalog file)
459
+ * via `mergeSchema`. Conflict-free → write via
460
+ * `writeSchemaCheckedForDir` (meta-validated; `dryRun`
461
+ * validates without writing), record under `merged`; any
462
+ * conflict → record `{name, conflicts}` under `conflicts`,
463
+ * write NOTHING; no retrievable base body / parse / merge /
464
+ * validation throw → fall back to `refused`. An auto-merged
465
+ * body is base-refreshed post-loop like a resync.
466
+ * - `no-baseline` /
467
+ * `missing-catalog` /
468
+ * `missing-installed` → record under `reported` (with the state) — undecidable
469
+ * or absent, not acted on.
470
+ *
471
+ * When `dryRun` is true NO writes occur: `checkStatus` is consulted and the action
472
+ * plan is computed, but `resyncSchema` is NOT invoked. For each `catalog-ahead`
473
+ * schema the dryRun arm calls `simulateResyncOutcome`, which mirrors
474
+ * `resyncSchema`'s decision arms 1:1 over an IN-MEMORY forward-migration +
475
+ * re-validation (FGAP-066 / TASK-046) and predicts the precise outcome bucket —
476
+ * `resynced` / `migrated` / `blocked` — the live path would land, so the schema is
477
+ * pushed onto `result[outcome]` rather than unconditionally onto `resynced`. The
478
+ * would-register migration decls it returns (the same FGAP-050 read-only set:
479
+ * catalog chain minus the decls already on disk; empty on a blocked prediction)
480
+ * are surfaced onto `migrationsRegistered` without writing. The live path mutates
481
+ * only via `resyncSchema` (the catalog-ahead branch) and surfaces the decls it
482
+ * appended onto `migrationsRegistered`; `installContext` and its install handler
483
+ * are NOT touched.
484
+ * Resolves the catalog / dest paths through the SAME `resolveCatalog` +
485
+ * `installedSchemaDestPath` helpers the installer + detector use.
486
+ */
487
+ export declare function updateContext(cwd: string, { dryRun }?: {
488
+ dryRun?: boolean;
489
+ }): UpdateResult;
490
+ /**
491
+ * Stamp an in-memory schema `body` as the install baseline
492
+ * (`config.installed_from.assets[name]`) for one schema (TASK-037 — FEAT-006 T4
493
+ * / FGAP-069). The shared stamp mechanics extracted from
494
+ * `refreshBaselineForSchema`: compute the content_hash of `body`, store it into
495
+ * the content-addressed object store (`putObject`) under that hash, set
496
+ * `config.installed_from.assets[name] = { content_hash, version }` (refreshing
497
+ * `at`), and write the config. Self-contained + idempotent: it owns its config
498
+ * load + write. Returns the stamped `content_hash`, or `null` (no write) when
499
+ * the substrate dir is unresolvable or the config carries no `installed_from`.
500
+ *
501
+ * Two callers stamp via this: `refreshBaselineForSchema` (re-baselines the
502
+ * ON-DISK body — `update`'s post-loop refresh) and `resolveConflict` (advances
503
+ * the baseline to the CATALOG body so the next `update` re-derives a resolved
504
+ * schema as `locally-modified`, not a recurring conflict).
505
+ */
506
+ export declare function stampBaselineFromBody(cwd: string, name: string, body: Record<string, unknown>, version: string): string | null;
507
+ /**
508
+ * Re-stamp the install baseline (`config.installed_from.assets[name]`) for one
509
+ * schema from its CURRENT on-disk body (TASK-037 — FEAT-006 T4). Self-contained
510
+ * + idempotent. Used by `updateContext`'s post-loop refresh to re-baseline each
511
+ * brought-current schema (resynced / migrated / auto-merged) so a follow-up
512
+ * `/context check-status` reports it `in-sync`:
513
+ *
514
+ * - returns `false` (no write) when the installed schema file is absent, OR
515
+ * its freshly-computed `content_hash` already equals the recorded baseline
516
+ * hash (a true no-op — nothing was reconciled / written).
517
+ * - otherwise delegates the stamp to `stampBaselineFromBody` (object-store
518
+ * put + `assets[name]` set + config write from the on-disk body + its
519
+ * declared version) and returns `true`.
520
+ *
521
+ * This is a pure idempotent re-stamp action (re-stamps the on-disk body as the
522
+ * new baseline; false when the file is absent or its hash already equals the
523
+ * baseline). Mirrors `updateContext`'s post-loop refresh body for ONE name.
524
+ */
525
+ export declare function refreshBaselineForSchema(cwd: string, name: string): boolean;
526
+ /**
527
+ * Reconciliation-commit op (FGAP-069) — completes the caller-as-reconciler model
528
+ * end-to-end. After `update` surfaces a both-diverged schema CONFLICT, the
529
+ * calling agent reconciles the conflicting paths into a resolved body R and runs
530
+ * this op. It does two things atomically per call:
531
+ *
532
+ * 1. WRITES R, when a `schema` is supplied: parse-if-string (mirroring the
533
+ * write-schema op's tolerant JSON-string handling) then
534
+ * `writeSchemaCheckedForDir(destRoot, name, R, "replace", ctx)` (AJV
535
+ * meta-validate + nested-id guard + atomic write). When `schema` is omitted
536
+ * the current on-disk body is treated as already reconciled — no write.
537
+ * 2. ADVANCES the merge base to the CATALOG body (theirs): it reads the
538
+ * catalog source schema, stamps it as the install baseline via
539
+ * `stampBaselineFromBody`. This is the fix the bare write-schema lacks —
540
+ * with the baseline advanced to the catalog, the next `update`'s 3-way
541
+ * check resolves the schema as `locally-modified` (base === catalog ≠ R),
542
+ * and `mergeSchema(base=catalog, ours=R, theirs=catalog)` takes R via the
543
+ * `base === theirs → ours` rule → auto-merge, zero conflicts, R preserved.
544
+ * Without this advance, the baseline stays at the original pre-conflict
545
+ * body and `update` re-derives the SAME both-diverged conflict forever.
546
+ *
547
+ * Throws a clear error when the substrate dir is unresolvable, the config /
548
+ * catalog kind for `name` is missing, or the catalog source schema is absent —
549
+ * the base cannot be advanced without a catalog body to advance it to.
550
+ *
551
+ * Returns `{ schemaName, wroteSchema, baseAdvancedTo }`: `wroteSchema` is true
552
+ * iff a `schema` was supplied and written; `baseAdvancedTo` is the content_hash
553
+ * of the catalog body now stamped as the baseline.
554
+ */
555
+ export declare function resolveConflict(cwd: string, name: string, schema?: unknown, ctx?: DispatchContext): {
556
+ schemaName: string;
557
+ wroteSchema: boolean;
558
+ baseAdvancedTo: string;
559
+ };
560
+ /**
561
+ * Blocked-resolution commit op (TASK-051 — FGAP-080) — the resolution half of
562
+ * the blocked-resync loop `update` opens. After `update` REFUSES a catalog-ahead
563
+ * resync (blocked) it persists a pending-blocked record pinning the TARGET
564
+ * catalog schema body (in the object store) + the migration chain reaching it.
565
+ * The calling agent then fixes the block's failing items (or widens the local
566
+ * schema) and runs THIS op to commit the resolution against the SAME pinned
567
+ * target the run blocked on — so a subsequent `update` converges (in-sync)
568
+ * instead of re-blocking.
569
+ *
570
+ * Flow:
571
+ * 1. Load the pending-blocked record; an absent entry for `name` throws a
572
+ * field-named error (run `update` first to produce one).
573
+ * 2. Retrieve the pinned target schema body by its `target_hash` from the
574
+ * object store; a missing object throws (the pin is the resolution contract).
575
+ * 3. Re-validate the CURRENT block against the PINNED target body: load the
576
+ * installed block, forward-migrate its items IN MEMORY through the entry's
577
+ * chain when the block's declared `schema_version` differs from the target
578
+ * `to` version (a FRESH registry seeded existing-decls-first + the chain,
579
+ * mirroring validateBlockItemsAgainstCatalog), then `validate`.
580
+ * 4. FAIL → return `{ resolved: false, failures }` and WRITE NOTHING — the
581
+ * pending record stays intact so the caller can correct + retry.
582
+ * 5. PASS → in order: register the chain decls not already on disk (collecting
583
+ * the registered set), write the target schema (replace), advance the
584
+ * migrated block's `schema_version` envelope to `to` + persist it (skipping
585
+ * the block write when it had no items — schema still written, base still
586
+ * advanced, mirroring the live no-items handling), advance the merge base to
587
+ * the target body, and clear the entry from pending-blocked.json (removing
588
+ * the file when it becomes empty). Return `{ resolved: true,
589
+ * registeredMigrations, baseAdvancedTo }`.
590
+ *
591
+ * Throws (no write) when the substrate dir is unresolvable, no pending entry
592
+ * names `name`, or the pinned target object is missing.
593
+ */
594
+ export declare function resolveBlocked(cwd: string, name: string, ctx?: DispatchContext): {
595
+ schemaName: string;
596
+ resolved: false;
597
+ failures: BlockValidationFailure[];
598
+ substrateIdEstablished?: string;
599
+ } | {
600
+ schemaName: string;
601
+ resolved: true;
602
+ registeredMigrations: Array<{
603
+ schema: string;
604
+ from: string;
605
+ to: string;
606
+ }>;
607
+ baseAdvancedTo: string | null;
608
+ substrateIdEstablished?: string;
609
+ };
610
+ /**
611
+ * Render an `UpdateResult["conflicts"]` set as a readable conflict report
612
+ * (TASK-037 — FEAT-006 T4 / FGAP-069) — the surface the `update` op + CLI hand
613
+ * to the CALLING agent, which reconciles each conflict into a resolved body and
614
+ * commits it via the `resolve-conflict` op (writes the body AND advances the
615
+ * merge base to the catalog so `update` stops re-reporting it; no subordinate
616
+ * resolver is spawned). Mirrors `renderCheckStatus`'s grouping
617
+ * style: one section per conflicting schema `name`, then each irreconcilable
618
+ * `{ path, base, ours, theirs }` with its three values JSON-compacted for a
619
+ * side-by-side scan, then a trailing guidance line stating how to apply a
620
+ * reconciliation. Pure: no I/O, no writes.
621
+ */
622
+ export declare function renderConflicts(conflicts: UpdateResult["conflicts"]): string;
623
+ /**
624
+ * Render the per-schema blocked-resync diagnostic (TASK-048 — FGAP-077) as a
625
+ * readable report the CLI surfaces below `update`'s output when a catalog-ahead
626
+ * resync was refused. One section per blocked schema `name`:
627
+ * - header `blocked: <name> (<from> -> <to>)` (the installed→catalog version
628
+ * pair; `?` substitutes a missing version).
629
+ * - `no-migration-chain` → one line `no migration chain reaches <to> from
630
+ * <from>`.
631
+ * - `validation-failed` → one line per failing item, naming the item id (or the
632
+ * `instancePath` when no id resolved), the field (the tail of `instancePath`),
633
+ * and the constraint phrased keyword-aware — MIRRORING the CLI's
634
+ * `formatAjvError` keyword switch (required / type / enum / additionalProperties
635
+ * fall through to the raw message), reproduced here rather than imported to
636
+ * avoid a pi-context → pi-context-cli dependency cycle (render.ts imports this
637
+ * package). A failure carrying no AJV `keyword` mapping prints its raw message.
638
+ *
639
+ * TASK-052 / FGAP-081: a LIVE `update` that blocks a `validation-failed` resync
640
+ * inscribes git-style failure markers INTO the block file at the offending items —
641
+ * and ONLY then does the trailing guidance claim, in the past tense, that markers
642
+ * "were written INTO the block file(s)". That claim is keyed on the per-entry
643
+ * `premarker_hash` (set only when markers were actually inscribed): a dryRun preview
644
+ * writes nothing and a `no-migration-chain` entry is never marked, so neither carries
645
+ * `premarker_hash` — for those the report keeps each entry's reason line + neutral
646
+ * fix-then-resolve guidance WITHOUT the past-tense write claim. In all cases the
647
+ * schema + `migrations.json` stay byte-unchanged. Pure: no I/O, no writes.
648
+ */
649
+ export declare function renderBlocked(blockedDetail: BlockedDetail[]): string;
66
650
  /**
67
651
  * Bootstrap a new substrate dir + flip the pointer in one operation. The
68
652
  * shared engine behind `/context switch -c <new-dir>` and the
@@ -148,9 +732,11 @@ export declare function archiveSubstrate(cwd: string, targetDir: string): {
148
732
  };
149
733
  declare const extension: (pi: ExtensionAPI) => void;
150
734
  export default extension;
735
+ export { counterEndpoint, mergeCatalogRegistries, primaryEndpoint, type RegistryAdditions } from "./context.js";
151
736
  export { contextRegistryPath, invalidateRegistry, loadRegistry, REGISTRY_FILE_VERSION, type RegistryEntry, type RegistryFile, registerSubstrate, resolveAlias, resolveSubstrateDir, writeRegistry, } from "./context-registry.js";
152
737
  export type { CompleteTaskResult, ItemLocation, ResolvedRef, ResolveStatus } from "./context-sdk.js";
153
738
  export { blockStructure, buildIdIndex, CONTEXT_BLOCK_TYPES, completeTask, findAppendableBlocks, resolveItemById, resolveRef, schemaInfo, schemaVocabulary, } from "./context-sdk.js";
154
739
  export { type RenameKind, type RenameReport, renameCanonicalId } from "./rename-canonical-id.js";
155
- export { listRoadmaps, loadRoadmap, type PhaseSpec, type PhaseStatus, type PhaseView, type RoadmapSpec, type RoadmapView, renderRoadmap, resolveStatusVocabulary, rollupPhaseStatus, topoSort, validateRoadmaps, } from "./roadmap-plan.js";
740
+ export { loadRoadmap, type MilestoneRoadmapView, type MilestoneView, type PhaseRollupView, type PhaseStatus, renderRoadmap, resolveStatusVocabulary, rollupPhaseStatus, type TaskRow, topoSort, validateRoadmap, } from "./roadmap-plan.js";
741
+ export type { SchemaConflict } from "./schema-merge.js";
156
742
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAA2B,MAAM,iCAAiC,CAAC;AAqM7F;;;;;;;;;;;;;;GAcG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;IAClD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBACf,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAU/C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CA0DrG;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;;;;;;GAUG;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