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