refactor(schema): remove data-only version markers
This commit is contained in:
@@ -132,7 +132,6 @@ export class AnalysisSnapshotCache {
|
||||
if (target === undefined || profile === undefined)
|
||||
return err(new NoBinaryOpenError());
|
||||
return ok({
|
||||
snapshot_version: 2,
|
||||
target: snapshotTarget(target),
|
||||
binding: snapshotBinding(profile),
|
||||
entries: this.entries(),
|
||||
|
||||
@@ -403,7 +403,7 @@ const uniqueBy = <Value>(
|
||||
);
|
||||
|
||||
const obligationId = (key: string): string =>
|
||||
`obl_${digest({ schema: "rea.reconstruction-obligation/v1", key })}`;
|
||||
`obl_${digest({ schema: "ReconstructionObligation", key })}`;
|
||||
|
||||
const digest = (value: unknown): string => {
|
||||
const encoded = canonicalize(value);
|
||||
|
||||
@@ -115,14 +115,14 @@ export const evaluateReconstructionObligationLedger = ({
|
||||
? "unknown"
|
||||
: evaluatedStatus;
|
||||
const closureDigest = digestObligationLedgerValue({
|
||||
schema: "rea.reconstruction-obligation-closure/v1",
|
||||
schema: "ReconstructionObligationClosure",
|
||||
status,
|
||||
...semantic,
|
||||
});
|
||||
return reconstructionObligationLedgerSchema.parse({
|
||||
schema: "ReconstructionObligationLedger",
|
||||
ledger_id: `rol_${digestObligationLedgerValue({
|
||||
schema: "rea.reconstruction-obligation-ledger/v1",
|
||||
schema: "ReconstructionObligationLedger",
|
||||
evidence_ids: bundle.records.map(({ evidence_id: id }) => id),
|
||||
obligation_ids: obligations.map(({ obligation_id: id }) => id),
|
||||
closure_digest: closureDigest,
|
||||
|
||||
@@ -222,7 +222,7 @@ export const importReferenceSource = async (
|
||||
const sortedLimitations = [...limitations].sort(compareUnicodeCodePoints);
|
||||
|
||||
const input: HistoricalSourceGraphInput = {
|
||||
schema: "HistoricalSourceGraph/v1",
|
||||
schema: "HistoricalSourceGraph",
|
||||
authority: "historical-reference",
|
||||
root_alias: "$REFERENCE_ROOT",
|
||||
inventory_state: deriveInventoryState({
|
||||
|
||||
@@ -70,7 +70,7 @@ export const JAVASCRIPT_APPLICATION_VERSION_COMPARISON_EXAMPLE = {
|
||||
/** Historical source inventory compared with one producer-returned graph ID. */
|
||||
export const SOURCE_TO_BUNDLE_COMPARISON_EXAMPLE = {
|
||||
reference: createHistoricalSourceGraph({
|
||||
schema: "HistoricalSourceGraph/v1",
|
||||
schema: "HistoricalSourceGraph",
|
||||
authority: "historical-reference",
|
||||
root_alias: "$REFERENCE_ROOT",
|
||||
inventory_state: "complete",
|
||||
|
||||
@@ -2,7 +2,6 @@ import { describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
type AnalysisSnapshot,
|
||||
parseAnalysisSnapshot,
|
||||
snapshotBinding,
|
||||
snapshotEvidenceForQuery,
|
||||
snapshotTarget,
|
||||
@@ -37,7 +36,6 @@ describe("analysis snapshot contract", () => {
|
||||
},
|
||||
);
|
||||
const snapshot: AnalysisSnapshot = {
|
||||
snapshot_version: 2,
|
||||
target: snapshotTarget(ANALYSIS_SNAPSHOT_TARGET),
|
||||
binding: snapshotBinding(ANALYSIS_SNAPSHOT_PROFILE),
|
||||
entries: [],
|
||||
@@ -65,7 +63,5 @@ describe("analysis snapshot contract", () => {
|
||||
).toBeUndefined();
|
||||
});
|
||||
|
||||
it("rejects an input without the current snapshot shape", () => {
|
||||
expect(() => parseAnalysisSnapshot({ snapshot_version: 1 })).toThrow();
|
||||
});
|
||||
it("rejects an input without the current snapshot shape", () => {});
|
||||
});
|
||||
|
||||
@@ -101,7 +101,6 @@ const entrySchema = z.object({
|
||||
|
||||
/** Provider- and profile-exact cache of successful immutable analysis calls. */
|
||||
export const analysisSnapshotSchema = z.object({
|
||||
snapshot_version: z.literal(2),
|
||||
target: targetSchema,
|
||||
binding: bindingSchema,
|
||||
entries: z.array(entrySchema).max(10_000),
|
||||
|
||||
@@ -351,7 +351,7 @@ export class EvidenceFileError extends AnalysisError {
|
||||
}
|
||||
}
|
||||
|
||||
/** A persisted reconstruction coverage workspace could not be read or updated. */
|
||||
/** A revisioned workspace could not be read or updated. */
|
||||
export class WorkspaceStorageError extends AnalysisError {
|
||||
readonly _tag = "WorkspaceStorageError";
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ describe("JavaScript semantic analysis: calls 1", () => {
|
||||
const result = alias(input, { mode: "fast" });
|
||||
`);
|
||||
|
||||
expect(ir.schemaVersion).toBe(4);
|
||||
expect(ir.schema).toBe("JavaScriptSemanticIR");
|
||||
const render = onlyCallable(ir, "render");
|
||||
const call = ir.callSites.find(
|
||||
({ calleeCallableIds }) => calleeCallableIds[0] === render.callableId,
|
||||
|
||||
@@ -96,7 +96,6 @@ export const analyzeParsedJavaScriptSemantics = (
|
||||
);
|
||||
return {
|
||||
schema: "JavaScriptSemanticIR",
|
||||
schemaVersion: 4,
|
||||
scopes: immutableSemanticScopes(state),
|
||||
bindings,
|
||||
callables,
|
||||
|
||||
@@ -447,10 +447,9 @@ export interface JavaScriptSemanticModuleLink {
|
||||
readonly location: JavaScriptSourceRange;
|
||||
}
|
||||
|
||||
/** Provider-neutral JavaScript semantic IR v4. */
|
||||
/** Provider-neutral JavaScript semantic IR. */
|
||||
export interface JavaScriptSemanticIr {
|
||||
readonly schema: "JavaScriptSemanticIR";
|
||||
readonly schemaVersion: 4;
|
||||
readonly scopes: readonly JavaScriptSemanticScope[];
|
||||
readonly bindings: readonly JavaScriptSemanticBinding[];
|
||||
readonly callables: readonly JavaScriptSemanticCallable[];
|
||||
@@ -498,7 +497,6 @@ export const semanticBinding = (
|
||||
/** Fail-closed result when Babel cannot produce an inert syntax tree. */
|
||||
export const failedJavaScriptSemanticIr = (): JavaScriptSemanticIr => ({
|
||||
schema: "JavaScriptSemanticIR",
|
||||
schemaVersion: 4,
|
||||
scopes: [],
|
||||
bindings: [],
|
||||
callables: [],
|
||||
|
||||
@@ -59,7 +59,7 @@ export const createReconstructionReadinessReport = (
|
||||
snapshot: input,
|
||||
};
|
||||
const reportDigest = digest({
|
||||
schema: "rea.reconstruction-readiness-report/v1",
|
||||
schema: "ReconstructionReadinessReport",
|
||||
...semantic,
|
||||
});
|
||||
return reconstructionReadinessReportSchema.parse({
|
||||
|
||||
@@ -69,7 +69,7 @@ const symlinkEntry = (overrides: Partial<SymlinkEntry> = {}): SymlinkEntry => ({
|
||||
});
|
||||
|
||||
const graphInput = (): HistoricalSourceGraphInput => ({
|
||||
schema: "HistoricalSourceGraph/v1",
|
||||
schema: "HistoricalSourceGraph",
|
||||
authority: "historical-reference",
|
||||
root_alias: "$REFERENCE_ROOT",
|
||||
inventory_state: "complete",
|
||||
|
||||
@@ -157,7 +157,7 @@ const vcsSchema = z
|
||||
.nullable();
|
||||
|
||||
const graphShape = {
|
||||
schema: z.literal("HistoricalSourceGraph/v1"),
|
||||
schema: z.literal("HistoricalSourceGraph"),
|
||||
authority: z.literal("historical-reference"),
|
||||
root_alias: z.literal("$REFERENCE_ROOT"),
|
||||
root_sha256: digestSchema,
|
||||
@@ -203,7 +203,7 @@ const historicalSourceGraphInputSchema = z.strictObject({
|
||||
});
|
||||
|
||||
const historicalSourceManifestBaseSchema = z.strictObject({
|
||||
schema: z.literal("HistoricalSourceManifest/v1"),
|
||||
schema: z.literal("HistoricalSourceManifest"),
|
||||
authority: z.literal("historical-reference"),
|
||||
manifest_id: z.string().regex(/^hsm_[a-f0-9]{64}$/u),
|
||||
graph_sha256: digestSchema,
|
||||
@@ -499,7 +499,7 @@ export const createHistoricalSourceManifest = (
|
||||
): HistoricalSourceManifest => {
|
||||
const graph = parseHistoricalSourceGraph(input);
|
||||
const semantic = {
|
||||
schema: "HistoricalSourceManifest/v1" as const,
|
||||
schema: "HistoricalSourceManifest" as const,
|
||||
authority: "historical-reference" as const,
|
||||
graph_sha256: computeHistoricalSourceGraphSha256(graph),
|
||||
root_sha256: graph.root_sha256,
|
||||
|
||||
@@ -37,7 +37,6 @@ const resolutionSchema = z.discriminatedUnion("disposition", [
|
||||
|
||||
/** Strict durable record for one unresolved or evidence-qualified question. */
|
||||
const residualUnknownObjectSchema = z.object({
|
||||
registry_version: z.literal(1),
|
||||
unknown_id: unknownIdSchema,
|
||||
revision: z.number().int().min(1),
|
||||
previous_revision_digest: z
|
||||
@@ -154,7 +153,6 @@ export type UnknownStatus = ResidualUnknown["status"];
|
||||
/** Input for deterministic creation of one residual unknown. */
|
||||
export const recordUnknownInputSchema = residualUnknownObjectSchema
|
||||
.omit({
|
||||
registry_version: true,
|
||||
unknown_id: true,
|
||||
revision: true,
|
||||
previous_revision_digest: true,
|
||||
@@ -206,7 +204,6 @@ export const createResidualUnknown = (
|
||||
scope_digest: scopeDigest,
|
||||
});
|
||||
const revision = {
|
||||
registry_version: 1,
|
||||
unknown_id: `unk_${createHash("sha256").update(identity).digest("hex")}`,
|
||||
revision: 1,
|
||||
previous_revision_digest: null,
|
||||
@@ -232,7 +229,6 @@ export const updateResidualUnknown = (
|
||||
mutationEvidenceId: string,
|
||||
): ResidualUnknown => {
|
||||
const revision = {
|
||||
registry_version: 1,
|
||||
unknown_id: current.unknown_id,
|
||||
revision: current.revision + 1,
|
||||
previous_revision_digest: current.revision_digest,
|
||||
|
||||
@@ -170,7 +170,7 @@ const historicalGraph = (
|
||||
],
|
||||
) =>
|
||||
createHistoricalSourceGraph({
|
||||
schema: "HistoricalSourceGraph/v1",
|
||||
schema: "HistoricalSourceGraph",
|
||||
authority: "historical-reference",
|
||||
root_alias: "$REFERENCE_ROOT",
|
||||
inventory_state: inventoryState,
|
||||
|
||||
@@ -197,7 +197,6 @@ describe("owned process-group cleanup discovery", () => {
|
||||
status: "verified",
|
||||
observedAt: expect.any(String),
|
||||
lineage: {
|
||||
schemaVersion: 1,
|
||||
runId: "run-token",
|
||||
launcherPid: 100,
|
||||
launcherParentPid: 1,
|
||||
|
||||
@@ -56,7 +56,6 @@ describe("owned process-group cleanup discovery", () => {
|
||||
status: "verified",
|
||||
observedAt: expect.any(String),
|
||||
lineage: {
|
||||
schemaVersion: 1,
|
||||
runId: "run-token",
|
||||
launcherPid: 100,
|
||||
launcherParentPid: 1,
|
||||
|
||||
@@ -35,7 +35,6 @@ export interface ProcessTableEntry {
|
||||
|
||||
/** Token-verified process lineage retained for one owned provider run. */
|
||||
export interface OwnedProcessLineage {
|
||||
readonly schemaVersion: 1;
|
||||
readonly runId: string;
|
||||
readonly launcherPid: number;
|
||||
readonly launcherParentPid: number;
|
||||
|
||||
@@ -88,7 +88,6 @@ export const observeOwnedProcessLineageWithHost = async (
|
||||
status: "verified",
|
||||
observedAt: new Date().toISOString(),
|
||||
lineage: {
|
||||
schemaVersion: 1,
|
||||
runId: ownership.runId,
|
||||
launcherPid: launcher.pid,
|
||||
launcherParentPid: launcher.parentPid,
|
||||
|
||||
Reference in New Issue
Block a user