archctx-contracts 0.15.0 → 0.16.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": "archcontext.capabilities/v1",
3
- "package": { "name": "archctx", "version": "0.15.0" },
3
+ "package": { "name": "archctx", "version": "0.16.0" },
4
4
  "protocols": {
5
5
  "projectionRequest": "archcontext.projection-request/v1",
6
6
  "projectionResult": "archcontext.projection-result/v3",
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": "archcontext.product-version-manifest/v1",
3
3
  "product": {
4
4
  "name": "archctx",
5
- "version": "0.15.0",
5
+ "version": "0.16.0",
6
6
  "distribution": "one-package"
7
7
  },
8
8
  "packageManager": "bun@1.4.4",
@@ -12,25 +12,25 @@
12
12
  "surfaces": {
13
13
  "cli": {
14
14
  "packageName": "@archcontext/surfaces",
15
- "version": "0.15.0",
15
+ "version": "0.16.0",
16
16
  "entrypoint": "archctx"
17
17
  },
18
18
  "daemon": {
19
19
  "packageName": "@archcontext/local-runtime",
20
- "version": "0.15.0",
20
+ "version": "0.16.0",
21
21
  "entrypoint": "archctx daemon start",
22
22
  "rpcSchemaVersion": "archcontext.runtime-rpc/v2"
23
23
  },
24
24
  "mcp": {
25
25
  "packageName": "@archcontext/surfaces",
26
- "version": "0.15.0",
26
+ "version": "0.16.0",
27
27
  "entrypoint": "archctx mcp",
28
28
  "transport": "stdio"
29
29
  }
30
30
  },
31
31
  "schemas": {
32
32
  "schemaSetVersion": "2026-06-25.al0-ledger",
33
- "contractsPackageVersion": "0.15.0"
33
+ "contractsPackageVersion": "0.16.0"
34
34
  },
35
35
  "runtime": {
36
36
  "localRpc": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archctx-contracts",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/src/failure.ts CHANGED
@@ -58,7 +58,8 @@ const policies: Record<string, Policy> = {
58
58
  "projection-manifest-invalid": { code: "AC_PRECONDITION_FAILED", message: "The committed projection manifest violates its contract." },
59
59
  "architecture-model-ignored": { code: "AC_PRECONDITION_FAILED", action: "commit-architecture-model", message: "Git ignore rules exclude architecture model paths, so the model cannot be committed and a manifest digest cannot rebuild it. Remove or narrow the rule, commit the model, then retry adoption. The diagnostic command prints each deciding rule.", facts: { pathCount: "uint", paths: "optional:diagnosticPaths", commands: "optional:diagnosticCommands", omittedPathCount: "uint" } },
60
60
  "projection-footprint-uncovered": { code: "AC_PRECONDITION_FAILED", message: "Declared source footprints lack a projection target." },
61
- "index-missing": { code: "AC_CODE_FACTS_UNAVAILABLE", message: "Required code facts have no available index. Run codegraph init." },
61
+ "index-missing": { code: "AC_CODE_FACTS_UNAVAILABLE", message: "Required code facts have no available index. Run codegraph init, or in a linked worktree run archctx sync after archctx sync in the primary checkout has published a base index." },
62
+ "index-base-building": { code: "AC_CODE_FACTS_UNAVAILABLE", message: "This worktree has no index and the primary checkout is publishing its first base index. Retry after it finishes.", retryable: true },
62
63
  "index-open-failed": { code: "AC_CODE_FACTS_UNAVAILABLE", message: "The CodeGraph index exists but could not be opened and read read-only. Run archctx doctor --json.", action: "inspect-diagnostics", retryable: false },
63
64
  "code-facts-not-ready": { code: "AC_CODE_FACTS_NOT_READY", message: "Repository code facts are not ready. Run archctx doctor --json and follow the reported action.", facts: { issues: "codeFactsIssues" } },
64
65
  "checkpoint-input-invalid": { code: "AC_SCHEMA_INVALID", message: "Checkpoint arguments violate the declared input schema.", fields: ["issueCount"], action: "correct-command-arguments" },
package/src/ports.ts CHANGED
@@ -20,12 +20,39 @@ export interface RepositorySnapshot {
20
20
  modelDigest?: string;
21
21
  }
22
22
 
23
+ /**
24
+ * What a sync did to the repository's shared CodeGraph base index (#608). `published`: a new base
25
+ * is current. `current`: the base already names this `HEAD`. `skipped-busy`: another refresh holds
26
+ * the lock. `skipped-moved`: a build ran, the index revision moved or `HEAD` moved during the
27
+ * snapshot. `skipped-unborn`: `HEAD` names no commit. `not-primary`: a linked worktree never
28
+ * publishes. `skipped-unverifiable`: the SDK resolves another database than `.codegraph/codegraph.db`.
29
+ * `skipped-unproven`: `current.json` has no creation record, or `refresh.lock` is stale; archctx
30
+ * replaces or removes neither, and lists it in `codeGraphKept`. `failed`: the snapshot or the
31
+ * publish failed; the sync itself still succeeded.
32
+ */
33
+ /**
34
+ * A path at a name the base index uses that archctx left in place, with how to clean it up by hand.
35
+ * archctx removes only what it created in the same run, so leftovers of a crashed seed, old
36
+ * unreferenced snapshots, a stale `refresh.lock` and an unproven `current.json` stay.
37
+ */
38
+ export interface CodeGraphKeptPathV1 {
39
+ path: string;
40
+ kind: "abandoned-staging" | "staging-not-removed" | "unreferenced-snapshot" | "snapshot-not-removed" | "stale-refresh-lock" | "unproven-pointer";
41
+ cleanup: string;
42
+ }
43
+
44
+ export type CodeGraphBaseRefreshV1 = "published" | "current" | "skipped-busy" | "skipped-moved" | "skipped-unborn" | "skipped-unverifiable" | "skipped-unproven" | "not-primary" | "failed";
45
+
23
46
  export interface CodeFactsSnapshot {
24
47
  provider: "codegraph";
25
48
  version: string;
26
49
  schemaDigest: string;
27
50
  indexedAt: string;
28
51
  workspaceDigest: string;
52
+ /** Set by a provider that refreshes the base index after its sync. */
53
+ codeGraphBase?: CodeGraphBaseRefreshV1;
54
+ /** Paths at names the base index uses that archctx left in place for hand cleanup. */
55
+ codeGraphKept?: CodeGraphKeptPathV1[];
29
56
  }
30
57
 
31
58
  export interface NormalizedSymbol {
@@ -109,12 +136,24 @@ export interface SourceSelector {
109
136
  }
110
137
 
111
138
  export interface CodeFactsPort {
112
- /** Read-only compatibility check before the existing incremental sync. No retry or rebuild. */
113
- assertCanSync?(workspaceRoot: string): void;
114
- ensureReady(workspace: WorkspaceRef): Promise<CodeFactsSnapshot>;
139
+ /**
140
+ * Runs before a command's incremental sync: seeds a missing index from the repository's base
141
+ * index (#608), then refuses an incompatible one. No retry or rebuild.
142
+ */
143
+ prepareSync?(workspaceRoot: string): void;
144
+ /**
145
+ * Makes `workspace`'s facts readable. An existing index is verified read-only, on the first call
146
+ * and every later one. Only a command that owns a sync passes `syncOnMiss`, which syncs the
147
+ * workspace once when this port has not verified it yet.
148
+ */
149
+ ensureReady(workspace: WorkspaceRef, options?: { syncOnMiss?: boolean }): Promise<CodeFactsSnapshot>;
115
150
  sync(input: { workspace: WorkspaceRef; changedPaths?: string[] }): Promise<CodeFactsSnapshot>;
116
- buildTaskContext(input: { task: string; maxSymbols: number; includeSource: boolean; changedPaths?: string[] }): Promise<NormalizedCodeContext>;
117
- findSymbols(query: SymbolQuery): Promise<NormalizedSymbol[]>;
151
+ /**
152
+ * Reads facts of `workspace`'s own index only, after `ensureReady` or `sync` of that workspace;
153
+ * a workspace with no successful sync, or whose index changed since it was verified, is refused.
154
+ */
155
+ buildTaskContext(input: { workspace: WorkspaceRef; task: string; maxSymbols: number; includeSource: boolean; changedPaths?: string[] }): Promise<NormalizedCodeContext>;
156
+ findSymbols(query: SymbolQuery, workspace: WorkspaceRef): Promise<NormalizedSymbol[]>;
118
157
  resolveEvidence(selectors: SourceSelector[]): Promise<ObservedEvidence[]>;
119
158
  }
120
159
 
@@ -1,5 +1,5 @@
1
1
  export const ARCHCONTEXT_PRODUCT_NAME = "archctx";
2
- export const ARCHCONTEXT_PRODUCT_VERSION = "0.15.0";
2
+ export const ARCHCONTEXT_PRODUCT_VERSION = "0.16.0";
3
3
  export const ARCHCONTEXT_PACKAGE_MANAGER = "bun@1.4.4";
4
4
  export const ARCHCONTEXT_NODE_RANGE = ">=22.22 <26";
5
5
  export const LOCAL_RUNTIME_RPC_SCHEMA_VERSION = "archcontext.runtime-rpc/v2";