It links module-versions to each other and knows nothing about nodes; which machine runs what stays the control plane's (novox/hq ADR 0070, 0072). Keeping them apart is what lets the control plane carry on composing declarations while this is down. The builder announces what it built, this places it in the graph and announces what that means, and the control plane hooks the meaning rather than the build output. A rebuild producing the commit already current is registered and is not an upgrade — announcing it would ripple outward forever through modules that did not change. Ordering is not computed. Modules stale and waiting on nothing that is itself stale are announced as buildable; the rest stay stale and appear once whatever they were waiting for is registered, so a chain and a diamond need no special handling and nothing holds a plan. Four tools over the graph: what this mesh holds, one module in full, what a change to a module reaches, and what must be rebuilt and why. The edges are derived from builds rather than declared, so they cannot drift from what the code actually uses. Claude-Session: https://claude.ai/code/session_01D6qtiYU3P9jk3pnAXyAFyx
23 lines
1.2 KiB
TypeScript
23 lines
1.2 KiB
TypeScript
// Ambient types for `pg` (node-postgres), which ships its types only via the separate `@types/pg`
|
|
// package. Rather than pull that in at tsc time, this declares the exact slice model-usage uses —
|
|
// the same precedent anthropic-manager sets for `tweetnacl-sealedbox-js` (a local ambient .d.ts,
|
|
// listed in tsconfig `include`, default-imported). The real `pg` is installed into the module's
|
|
// runtime image (package.json `dependencies`; novox/hq ADR 0052), so this types the code without
|
|
// deciding what runs.
|
|
declare module "pg" {
|
|
/** One checked-out connection. Needed because registering a module-version and its edges is one
|
|
* act: a half-written registration is a graph that lies about what something was built against. */
|
|
export class PoolClient {
|
|
query(text: string, params?: unknown[]): Promise<{ rows: any[]; rowCount: number }>;
|
|
release(): void;
|
|
}
|
|
/** A lazily-connecting connection pool. Only the connection string, one query form, checking out
|
|
* a connection, and end() are used here. */
|
|
export class Pool {
|
|
constructor(config?: { connectionString?: string });
|
|
query(text: string, params?: unknown[]): Promise<{ rows: any[]; rowCount: number }>;
|
|
connect(): Promise<PoolClient>;
|
|
end(): Promise<void>;
|
|
}
|
|
}
|