/** * Semantic projection for contract-pipeline staleness (B3). * * The staleness DAG used to key every dependency on the upstream's RAW payload * content hash, so any byte change to an upstream — a reworded rationale, a * regenerated `created_at` stamp, a reordered list — re-staled the entire * downstream chain and forced a full (often LLM-driven) re-authoring of * artifacts whose load-bearing inputs had not actually changed. That is the * exact friction B3 names: "an edit to finalized_module_contracts re-stales * obligation_ledger → test_validator_plan → contract_assessment even when the * obligation set is unchanged." * * The fix is to make staleness content/semantics-aware: a dependency is recorded * and compared by the hash of its *semantic projection* — only the structure a * downstream actually consumes — not its raw bytes. A cosmetic upstream edit * projects to the same value, so downstreams stay fresh; a real change to the * load-bearing structure (a new module invariant, a changed interface) projects * differently and correctly re-stales. * * This mirrors audit-code's `normalizeForMetadataHash` * (`src/shared/artifactFreshness.ts`): strip non-semantic provenance fields * universally, then apply a per-artifact structural projection. The two * orchestrators stay in conceptual parity (semantic-projection staleness) while * each owns the projection table for its own artifact set. */ import { stableStringifyProjection } from "audit-tools/shared"; import type { ContractPipelineArtifactName } from "./artifactNames.js"; export { stableStringifyProjection }; /** * Project a contract-pipeline artifact payload to only its load-bearing * structure for downstream-staleness purposes. The universal provenance strip * applies to every artifact; both module-contract artifacts * (`module_contracts` and `finalized_module_contracts`) additionally project * their `module_contracts` entries to the derivable fields. Artifacts with no * special case fall back to the provenance-stripped payload (conservative: * behaves like the raw payload minus stamps). * * Non-object payloads pass through unchanged. */ export declare function semanticProjection(name: ContractPipelineArtifactName, payload: unknown): unknown; /** * The order-independent stable serialization used to hash a projection is the * shared `stableStringifyProjection` (re-exported above) — single-sourced in * `audit-tools/shared` so audit-code and remediate-code hash projections * identically. */ //# sourceMappingURL=semanticProjection.d.ts.map