diff --git a/clients/swift/FractalClient/Sources/FractalClient/Client.swift b/clients/swift/FractalClient/Sources/FractalClient/Client.swift index 893a518c303..3012678d3ca 100644 --- a/clients/swift/FractalClient/Sources/FractalClient/Client.swift +++ b/clients/swift/FractalClient/Sources/FractalClient/Client.swift @@ -440,7 +440,7 @@ public actor FractalClient { public func beginPairing(deviceName: String, personID: String) async throws -> Envelope { try await post("v1/client/pairings", PersonPairingBegin(apiVersion: fractalClientAPIVersion, deviceName: deviceName, personID: personID)) } public func beginPairing(_ request: PairingBegin) async throws -> Envelope { try await post("v1/client/pairings", request) } public func completePairing(pairingID: String, code: String, devicePublicKey: String) async throws -> Envelope { try await post("v1/client/pairings/\(pairingID.replacingOccurrences(of: "pairing/", with: ""))/complete", PairingComplete(apiVersion: fractalClientAPIVersion, code: code, devicePublicKey: devicePublicKey)) } - public func assistantGrant(_ id: String) async throws -> Envelope { try await get("v1/client/assistant/grants/\(id.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed.subtracting(CharacterSet(charactersIn: "/"))) ?? id)") } + public func assistantGrant(_ id: String, witness: Bool = false) async throws -> Envelope { try await get("v1/client/assistant/grants/\(id.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed.subtracting(CharacterSet(charactersIn: "/"))) ?? id)", query: witness ? [.init(name: "witness", value: "1")] : []) } public func assistantGrantRevoke(_ id: String) async throws -> Envelope { try await post("v1/client/assistant/grants/\(id.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed.subtracting(CharacterSet(charactersIn: "/"))) ?? id)/revoke", [String: String]()) } public func assistantGrantPolicy(_ id: String, _ policy: AssistantGrantPolicy) async throws -> Envelope { try await post("v1/client/assistant/grants/\(id.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed.subtracting(CharacterSet(charactersIn: "/"))) ?? id)/policy", policy) } public func assistantGrantReadTrust(_ id: String, _ trust: AssistantReadTrustRequest) async throws -> Envelope { try await post("v1/client/assistant/grants/\(id.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed.subtracting(CharacterSet(charactersIn: "/"))) ?? id)/read-trust", trust) } diff --git a/clients/swift/FractalClient/Sources/FractalClient/Models.swift b/clients/swift/FractalClient/Sources/FractalClient/Models.swift index 4b82447846e..cdb76c605f7 100644 --- a/clients/swift/FractalClient/Sources/FractalClient/Models.swift +++ b/clients/swift/FractalClient/Sources/FractalClient/Models.swift @@ -153,6 +153,8 @@ public enum ErrorCode: Codable, Sendable, Equatable { case peerTooOld case validationFailed case idempotencyConflict + case grantProfileConflict + case assistantGrantAuthorityNotReady case agentsPublicationRowTooLarge case attentionMigrated case invalidAnswer, notAnswerable @@ -245,6 +247,8 @@ public enum ErrorCode: Codable, Sendable, Equatable { case "peer-too-old": .peerTooOld case "validation-failed": .validationFailed case "idempotency-conflict": .idempotencyConflict + case "grant-profile-conflict": .grantProfileConflict + case "assistant-grant-authority-not-ready": .assistantGrantAuthorityNotReady case "stale-fence": .staleFence case "issuer-required": .issuerRequired case "pairing-origin-required": .pairingOriginRequired @@ -337,6 +341,8 @@ public enum ErrorCode: Codable, Sendable, Equatable { case .peerTooOld: "peer-too-old" case .validationFailed: "validation-failed" case .idempotencyConflict: "idempotency-conflict" + case .grantProfileConflict: "grant-profile-conflict" + case .assistantGrantAuthorityNotReady: "assistant-grant-authority-not-ready" case .staleFence: "stale-fence" case .issuerRequired: "issuer-required" case .pairingOriginRequired: "pairing-origin-required" @@ -1569,7 +1575,21 @@ public struct AssistantGrant: Codable, Sendable { public let kind, id, sessionActor, deviceID, keyID, issuer, expiresAt, consentEvidence: String; public let principal: AssistantPrincipal; public let senderClass: AssistantSenderClass; public let scopes: [AssistantScope]; public let policyRevision: UInt64; public let minimalReadMode: AssistantMinimalReadMode; public let recipientAllowlist: [String]; public let disclosureConsent, revoked: Bool /// Owner-provisioned SCG read pins; absent means every assistant read is denied. public let readTrust: AssistantReadTrust? - enum CodingKeys: String, CodingKey { case kind, id, sessionActor = "session_actor", deviceID = "device_id", keyID = "key_id", issuer, expiresAt = "expires_at", consentEvidence = "consent_evidence", principal, senderClass = "sender_class", scopes, policyRevision = "policy_revision", minimalReadMode = "minimal_read_mode", recipientAllowlist = "recipient_allowlist", disclosureConsent = "disclosure_consent", revoked, readTrust = "read_trust" } + public let conflict: GrantProfileConflictWitness? + public let clearedConflicts: [ClearedGrantProfileConflictWitness]? + enum CodingKeys: String, CodingKey { case kind, id, sessionActor = "session_actor", deviceID = "device_id", keyID = "key_id", issuer, expiresAt = "expires_at", consentEvidence = "consent_evidence", principal, senderClass = "sender_class", scopes, policyRevision = "policy_revision", minimalReadMode = "minimal_read_mode", recipientAllowlist = "recipient_allowlist", disclosureConsent = "disclosure_consent", revoked, readTrust = "read_trust", conflict, clearedConflicts = "cleared_conflicts" } +} +public enum ExternalGrantProfile: String, Codable, Sendable { case assistant, service } +public enum GrantProfileConflictCause: String, Codable, Sendable { case revoked, expired } +public struct GrantProfileWitness: Codable, Sendable { + public let grantID: String?; public let origin: String; public let profile: ExternalGrantProfile + enum CodingKeys: String, CodingKey { case grantID = "grant_id", origin, profile } +} +public struct GrantProfileConflictWitness: Codable, Sendable { + public let grants: [GrantProfileWitness] +} +public struct ClearedGrantProfileConflictWitness: Codable, Sendable { + public let grants: [GrantProfileWitness]; public let cause: GrantProfileConflictCause } public struct AssistantGrantPolicy: Codable, Sendable { public let apiVersion, consentEvidence: String; public let scopes: [AssistantScope]; public let expiresInSeconds: UInt64?; public let disclosureConsent: Bool; public let minimalReadMode: AssistantMinimalReadMode; public let recipientAllowlist: [String]? diff --git a/clients/typescript/fractal-client/Client.generated.ts b/clients/typescript/fractal-client/Client.generated.ts index c6d8d44ebd4..be0a7db4c75 100644 --- a/clients/typescript/fractal-client/Client.generated.ts +++ b/clients/typescript/fractal-client/Client.generated.ts @@ -494,8 +494,8 @@ export class FractalClient { return this.request('POST', `/v1/client/pairings/${encodeURIComponent(routedId(id))}/complete`, request, undefined, undefined, requestOptions); } - async assistantGrant(id: string): Promise> { - return this.request('GET', `/v1/client/assistant/grants/${encodeURIComponent(id)}`); + async assistantGrant(id: string, options: { witness?: boolean } = {}): Promise> { + return this.request('GET', `/v1/client/assistant/grants/${encodeURIComponent(id)}${query({ witness: options.witness ? 1 : undefined })}`); } async assistantGrantRevoke(id: string): Promise> { return this.request('POST', `/v1/client/assistant/grants/${encodeURIComponent(id)}/revoke`, {}); diff --git a/clients/typescript/fractal-client/Models.generated.ts b/clients/typescript/fractal-client/Models.generated.ts index 19a491ae870..e5a75b1aea1 100644 --- a/clients/typescript/fractal-client/Models.generated.ts +++ b/clients/typescript/fractal-client/Models.generated.ts @@ -793,6 +793,8 @@ export type AssistantConversationTimelineRequest = { }; export type AssistantGrant = { + cleared_conflicts?: Array; + conflict?: (GrantProfileConflictWitness | null); consent_evidence: string; device_id: Id; disclosure_consent: boolean; @@ -1265,6 +1267,11 @@ export type Capability = { version: number; }; +export type ClearedGrantProfileConflictWitness = { + cause: GrantProfileConflictCause; + grants: Array; +}; + export type ClientConnection = { actor: string; client?: string | null; @@ -1886,6 +1893,8 @@ export type ErrorCode = ( | "peer-too-old" | "validation-failed" | "idempotency-conflict" + | "grant-profile-conflict" + | "assistant-grant-authority-not-ready" | "legacy-action-receipt-untrusted" | "issuer-required" | "pairing-origin-required" @@ -1962,6 +1971,8 @@ export type ExchangeTransport = { fabric_route?: string; }; +export type ExternalGrantProfile = "assistant" | "service"; + export type FabricGrant = { detail?: string; peer?: string; @@ -2022,6 +2033,18 @@ export type GlassTab = { export type GoldenResourceSet = Array; +export type GrantProfileConflictCause = "revoked" | "expired"; + +export type GrantProfileConflictWitness = { + grants: Array; +}; + +export type GrantProfileWitness = { + grant_id: string | null; + origin: string; + profile: ExternalGrantProfile; +}; + export type HarnessAnswerInput = { positions: Array; }; diff --git a/clients/typescript/fractal-client/ReadSchema.generated.ts b/clients/typescript/fractal-client/ReadSchema.generated.ts index b6b6a73dc95..e92a1588456 100644 --- a/clients/typescript/fractal-client/ReadSchema.generated.ts +++ b/clients/typescript/fractal-client/ReadSchema.generated.ts @@ -1747,6 +1747,8 @@ export const ErrorCode = /*#__PURE__*/ (() => openEnum([ "peer-too-old", "validation-failed", "idempotency-conflict", + "grant-profile-conflict", + "assistant-grant-authority-not-ready", "legacy-action-receipt-untrusted", "issuer-required", "pairing-origin-required", diff --git a/clients/typescript/fractal-client/Schema.generated.ts b/clients/typescript/fractal-client/Schema.generated.ts index bcae26143dc..b31f63ce0a8 100644 --- a/clients/typescript/fractal-client/Schema.generated.ts +++ b/clients/typescript/fractal-client/Schema.generated.ts @@ -496,7 +496,41 @@ export const AssistantScope = /*#__PURE__*/ (() => Schema.Literals([ export type AssistantScope = typeof AssistantScope.Type export type AssistantScopeEncoded = typeof AssistantScope.Encoded +export const GrantProfileConflictCause = /*#__PURE__*/ (() => Schema.Literals(["revoked","expired"]).annotate({ identifier: "GrantProfileConflictCause" }))() +export type GrantProfileConflictCause = typeof GrantProfileConflictCause.Type +export type GrantProfileConflictCauseEncoded = typeof GrantProfileConflictCause.Encoded + +export const ExternalGrantProfile = /*#__PURE__*/ (() => Schema.Literals(["assistant","service"]).annotate({ identifier: "ExternalGrantProfile" }))() +export type ExternalGrantProfile = typeof ExternalGrantProfile.Type +export type ExternalGrantProfileEncoded = typeof ExternalGrantProfile.Encoded + +export const GrantProfileWitness = /*#__PURE__*/ (() => Schema.Struct({ + /** Grant ID; null only for legacy local fixtures without an ID. */ + "grant_id": Schema.OptionFromNullOr(Schema.String).annotate({ description: "Grant ID; null only for legacy local fixtures without an ID." }), + "origin": Schema.String, + "profile": ExternalGrantProfile +}).annotate({ identifier: "GrantProfileWitness" }))() +export type GrantProfileWitness = typeof GrantProfileWitness.Type +export type GrantProfileWitnessEncoded = typeof GrantProfileWitness.Encoded + +export const ClearedGrantProfileConflictWitness = /*#__PURE__*/ (() => Schema.Struct({ + "cause": GrantProfileConflictCause, + "grants": Schema.Array(GrantProfileWitness) +}).annotate({ identifier: "ClearedGrantProfileConflictWitness" }))() +export type ClearedGrantProfileConflictWitness = typeof ClearedGrantProfileConflictWitness.Type +export type ClearedGrantProfileConflictWitnessEncoded = typeof ClearedGrantProfileConflictWitness.Encoded + +export const GrantProfileConflictWitness = /*#__PURE__*/ (() => Schema.Struct({ + "grants": Schema.Array(GrantProfileWitness) +}).annotate({ identifier: "GrantProfileConflictWitness" }))() +export type GrantProfileConflictWitness = typeof GrantProfileConflictWitness.Type +export type GrantProfileConflictWitnessEncoded = typeof GrantProfileConflictWitness.Encoded + export const AssistantGrant = /*#__PURE__*/ (() => Schema.Struct({ + /** Revoked or expired opposite-profile witnesses; emitted only on daemon-configured-owner grant inspection with witness=1 when conflict is null. Never disclosed by bearer authentication errors or pairing. */ + "cleared_conflicts": optionalKey(Schema.Array(ClearedGrantProfileConflictWitness)).annotate({ description: "Revoked or expired opposite-profile witnesses; emitted only on daemon-configured-owner grant inspection with witness=1 when conflict is null. Never disclosed by bearer authentication errors or pairing." }), + /** Current opposite-profile conflict, or null when no active conflict exists. Present only on daemon-configured-owner grant inspection with witness=1; omitted from default inspection, bearer authentication errors, pairing and mutation responses. */ + "conflict": Schema.OptionFromOptionalNullOr(GrantProfileConflictWitness, NULL_NONE).annotate({ description: "Current opposite-profile conflict, or null when no active conflict exists. Present only on daemon-configured-owner grant inspection with witness=1; omitted from default inspection, bearer authentication errors, pairing and mutation responses." }), "consent_evidence": Schema.String.check(Schema.isMinCodePoints(1)).check(Schema.isMaxCodePoints(512)), "device_id": Id, "disclosure_consent": Schema.Boolean, @@ -904,23 +938,25 @@ export const Envelope = /*#__PURE__*/ (() => Schema.Struct({ "api_version": Schema.Literals(["st3.client.v0","fractal.client.v0"]), "request_id": RequestId, "snapshot": Snapshot, - "value": Schema.Union([Schema.Struct({ "notes": Schema.Array(DirectiveNote), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "capabilities": Schema.Array(Capability), "event_cursor": Cursor, "grant_expires_at": optionalKey(Timestamp), "grant_id": optionalKey(Id), "grant_kind": optionalKey(Schema.Literals(["person","assistant"])), "kind": Schema.Literal("capabilities"), "limits": Schema.Struct({ "default_assistant_response_bytes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).check(Schema.isLessThanOrEqualTo(4096))), "max_arrangement_body_bytes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_arrangement_folders": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_arrangement_key_bytes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_arrangement_name_bytes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_arrangement_operations": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_arrangement_placements": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_arrangement_resource_bytes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_arrangements": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_assistant_response_bytes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).check(Schema.isLessThanOrEqualTo(16384))), "max_event_items": Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)), "max_glass_body_bytes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_glass_depth": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_glass_nodes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_glasses": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), /** The longest message body in UTF-8 bytes this daemon takes; absent on older daemons, which take 4096. */ + "value": Schema.Union([Schema.Struct({ "notes": Schema.Array(DirectiveNote), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "capabilities": Schema.Array(Capability), "event_cursor": Cursor, "grant_expires_at": optionalKey(Timestamp), "grant_id": optionalKey(Id), "grant_kind": optionalKey(Schema.Literals(["person","assistant"])), "kind": Schema.Literal("capabilities"), "limits": Schema.Struct({ "default_assistant_response_bytes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).check(Schema.isLessThanOrEqualTo(4096))), "max_arrangement_body_bytes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_arrangement_folders": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_arrangement_key_bytes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_arrangement_name_bytes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_arrangement_operations": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_arrangement_placements": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_arrangement_resource_bytes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_arrangements": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_assistant_response_bytes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).check(Schema.isLessThanOrEqualTo(16384))), "max_event_items": Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)), "max_glass_body_bytes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_glass_depth": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_glass_nodes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "max_glasses": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), /** The longest message body in UTF-8 bytes this daemon takes; absent on older daemons, which take 4096. */ "max_message_bytes": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))).annotate({ description: "The longest message body in UTF-8 bytes this daemon takes; absent on older daemons, which take 4096." }), "max_page_items": Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)), "max_response_bytes": Schema.Int.check(Schema.isGreaterThanOrEqualTo(1024)), "max_wait_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)) }), /** Compile-time build identity of the responding daemon; absent on older servers. */ -"machine_version": optionalKey(Schema.String).annotate({ description: "Compile-time build identity of the responding daemon; absent on older servers." }), "minimal_read_mode": optionalKey(AssistantMinimalReadMode), "oldest_event_cursor": Cursor, "policy_revision": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "principal": optionalKey(AssistantPrincipal), "schemas": Schema.Array(Schema.String.check(Schema.isPattern(URI_REFERENCE, { expected: "an RFC 3986 URI reference" }))).check(Schema.isMinLength(1)), "sender_class": optionalKey(AssistantSenderClass), "session_actor": Id, "transport": Schema.Literals(["unix","fabric-loopback"]), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "actions": Schema.Array(PrivateNotesAction).check(Schema.isMaxLength(1)), "data": PrivateNotesData, "family": Schema.Literal("private-notes"), "live": Schema.Null, "ref": PrivateNotesUri, "schema": Schema.Literal("fractal.private-notes@1"), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "bytes": Schema.Array(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).check(Schema.isLessThanOrEqualTo(255))), "changed_at_unix_ms": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))), "latest": optionalKey(Schema.Boolean), "name": optionalKey(Schema.String), "owner": optionalKey(Schema.String), "reference": Schema.String, "size": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))), "version": optionalKey(Schema.String), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "has_more": Schema.Boolean, "history": Schema.Boolean, "items": Schema.Array(DocumentItem), "limit": Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)), "next_cursor": Schema.OptionFromOptionalNullOr(Schema.String, NULL_NONE), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), SchedulesPage, Schema.Struct({ "complete": Schema.Boolean, "references": Schema.Array(DocumentReference), "subject": Schema.String, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "conflicts": Schema.Array(Schema.String), "desired": Schema.suspend(() => CanonicalNode), "desired_revision": Revision, "desired_token": Schema.String.check(Schema.isMinCodePoints(1)), "kdl": Schema.String, "kind": Schema.Literal("subject-definition"), "subject": Schema.String.check(Schema.isPattern(new RegExp("^agent/[^\\s]+$", "u"))), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "declaration": Schema.Record(Schema.String, Schema.Unknown), "kind": Schema.Literal("publication-definition"), "revision": Revision, "subject": Schema.String.check(Schema.isPattern(new RegExp("^(agent|mission|schedule)/[^\\s]+$", "u"))), "token": Schema.String.check(Schema.isMinCodePoints(1)), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "charged": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "declared": AttentionBudgetDeclared, "fleet_complete": Schema.Literal(false), "inclusive": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "local_claim_index": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "mission": Schema.String, "not_charged": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "person": Schema.String, "request_refs": Schema.Array(AttentionBudgetRequestRef).check(Schema.isMaxLength(128)), "request_refs_complete": Schema.Boolean, "unattributed_for_person": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "window_end_inclusive_unix_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "window_start_exclusive_unix_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ /** Contains removed loop shapes that the current parser rejects. */ -"legacy": Schema.Boolean.annotate({ description: "Contains removed loop shapes that the current parser rejects." }), "mission": Schema.String.check(Schema.isPattern(new RegExp("^mission/[^\\s]+$", "u"))), "provenance": optionalKey(MissionDeclarationProvenance), "published_at": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "revision": Revision, "text": Schema.String, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "agent_id": AgentId, /** Agent declaration supplying the workspace; reached through unambiguous stop predecessors. */ +"machine_version": optionalKey(Schema.String).annotate({ description: "Compile-time build identity of the responding daemon; absent on older servers." }), "minimal_read_mode": optionalKey(AssistantMinimalReadMode), "oldest_event_cursor": Cursor, "policy_revision": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))), "principal": optionalKey(AssistantPrincipal), "schemas": Schema.Array(Schema.String.check(Schema.isPattern(URI_REFERENCE, { expected: "an RFC 3986 URI reference" }))).check(Schema.isMinLength(1)), "sender_class": optionalKey(AssistantSenderClass), "session_actor": Id, "transport": Schema.Literals(["unix","fabric-loopback"]), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "actions": Schema.Array(PrivateNotesAction).check(Schema.isMaxLength(1)), "data": PrivateNotesData, "family": Schema.Literal("private-notes"), "live": Schema.Null, "ref": PrivateNotesUri, "schema": Schema.Literal("fractal.private-notes@1"), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "bytes": Schema.Array(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).check(Schema.isLessThanOrEqualTo(255))), "changed_at_unix_ms": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))), "latest": optionalKey(Schema.Boolean), "name": optionalKey(Schema.String), "owner": optionalKey(Schema.String), "reference": Schema.String, "size": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))), "version": optionalKey(Schema.String), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "has_more": Schema.Boolean, "history": Schema.Boolean, "items": Schema.Array(DocumentItem), "limit": Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)), "next_cursor": Schema.OptionFromOptionalNullOr(Schema.String, NULL_NONE), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), SchedulesPage, Schema.Struct({ "complete": Schema.Boolean, "references": Schema.Array(DocumentReference), "subject": Schema.String, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "conflicts": Schema.Array(Schema.String), "desired": Schema.suspend(() => CanonicalNode), "desired_revision": Revision, "desired_token": Schema.String.check(Schema.isMinCodePoints(1)), "kdl": Schema.String, "kind": Schema.Literal("subject-definition"), "subject": Schema.String.check(Schema.isPattern(new RegExp("^agent/[^\\s]+$", "u"))), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "declaration": Schema.Record(Schema.String, Schema.Unknown), "kind": Schema.Literal("publication-definition"), "revision": Revision, "subject": Schema.String.check(Schema.isPattern(new RegExp("^(agent|mission|schedule)/[^\\s]+$", "u"))), "token": Schema.String.check(Schema.isMinCodePoints(1)), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "charged": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "declared": AttentionBudgetDeclared, "fleet_complete": Schema.Literal(false), "inclusive": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "local_claim_index": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "mission": Schema.String, "not_charged": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "person": Schema.String, "request_refs": Schema.Array(AttentionBudgetRequestRef).check(Schema.isMaxLength(128)), "request_refs_complete": Schema.Boolean, "unattributed_for_person": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "window_end_inclusive_unix_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "window_start_exclusive_unix_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ /** Contains removed loop shapes that the current parser rejects. */ +"legacy": Schema.Boolean.annotate({ description: "Contains removed loop shapes that the current parser rejects." }), "mission": Schema.String.check(Schema.isPattern(new RegExp("^mission/[^\\s]+$", "u"))), "provenance": optionalKey(MissionDeclarationProvenance), "published_at": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "revision": Revision, "text": Schema.String, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "agent_id": AgentId, /** Agent declaration supplying the workspace; reached through unambiguous stop predecessors. */ "declaration_token": Schema.String.annotate({ description: "Agent declaration supplying the workspace; reached through unambiguous stop predecessors." }), /** Selected desired claim, including a stop when the seat is retired. */ "desired_token": Schema.String.annotate({ description: "Selected desired claim, including a stop when the seat is retired." }), "host_id": HostId, "kind": Schema.Literal("agent-workspace"), /** Declared workspace directory on host_id, not the API gateway's filesystem or the harness's internal state directory. */ -"workspace": Schema.String.annotate({ description: "Declared workspace directory on host_id, not the API gateway's filesystem or the harness's internal state directory." }), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "collection": Schema.String.check(Schema.makeFilter((value: string) => !new RegExp("^(?:resources|ordered-memberships|assistant\\.(?:attention|missions|agents))$", "u").test(value), { expected: "a string not matching ^(?:resources|ordered-memberships|assistant\\.(?:attention|missions|agents))$" })), "filters": Schema.Record(Schema.String, Schema.String), "items": Schema.Array(Resource), "kind": Schema.Literal("page"), "page": PageInfo, "replicated": optionalKey(ReplicatedNotice), "sync": optionalKey(SyncNotice), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "collection": Schema.Literal("ordered-memberships"), "filters": Schema.Record(Schema.String, Schema.String), "items": Schema.Array(OrderedMembership), "kind": Schema.Literal("page"), "page": PageInfo, "replicated": optionalKey(ReplicatedNotice), "sync": optionalKey(SyncNotice), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "collection": Schema.Literal("resources"), "filters": Schema.Record(Schema.String, Schema.String), "items": Schema.Array(ResourceObservation), "kind": Schema.Literal("page"), "page": PageInfo, "sync": optionalKey(SyncNotice), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Resource, Schema.Struct({ /** Present when conversation-blocks.v1 is negotiated; each field names its value, source and as_of */ -"header": optionalKey(ConversationHeader), "items": Schema.Array(TimelineEntry), "kind": Schema.Literal("timeline-page"), "page": PageInfo, "session_id": Id, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ /** Present when conversation-blocks.v1 is negotiated; each field names its value, source and as_of */ -"header": optionalKey(ConversationHeader), "items": Schema.Array(TimelineEntry).check(Schema.isMaxLength(200)), "kind": Schema.Literal("conversation-changes"), "next_cursor": Cursor, "session_id": Id, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "host_id": Id, "incomplete_sources": Schema.Array(Schema.String), "indexed_at": Timestamp, "items": Schema.Array(ConversationSearchHit).check(Schema.isMaxLength(200)), "kind": Schema.Literal("conversation-search"), "page": PageInfo, "refreshing": Schema.Boolean, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "has_more": Schema.Boolean, "items": Schema.Array(ProjectionEvent).check(Schema.isMaxLength(500)), "kind": Schema.Literal("event-page"), "oldest_cursor": Cursor, "resume_cursor": Cursor, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "action_id": Id, "affected_ids": Schema.Array(Id).check(Schema.isUnique()), "arrangement_revision": optionalKey(Revision), "harness_answer": optionalKey(HarnessAnswerResult), "kind": Schema.Literal("action-result"), "membership_revision": optionalKey(Revision), "operation_id": Id, "private_notes": optionalKey(PrivateNotesFence), "snapshot_id": Id, "status": Schema.Literals(["accepted","completed","rejected"]), "terminal_attachment": Schema.OptionFromOptionalNullOr(TerminalAttachment, NULL_NONE), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "acknowledged_event_ids": Schema.Array(ClientDiagnosticUuid).check(Schema.isMaxLength(32)), "accounts": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), PairingChallenge, PairedSession, Schema.Struct({ "consent_evidence": Schema.String.check(Schema.isMinCodePoints(1)).check(Schema.isMaxCodePoints(512)), "device_id": Id, "disclosure_consent": Schema.Boolean, "expires_at": Timestamp, "id": Id, /** Daemon-configured owning person, sealed by the authoritative grant-issuer member at trusted-local begin. */ +"workspace": Schema.String.annotate({ description: "Declared workspace directory on host_id, not the API gateway's filesystem or the harness's internal state directory." }), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "collection": Schema.String.check(Schema.makeFilter((value: string) => !new RegExp("^(?:resources|ordered-memberships|assistant\\.(?:attention|missions|agents))$", "u").test(value), { expected: "a string not matching ^(?:resources|ordered-memberships|assistant\\.(?:attention|missions|agents))$" })), "filters": Schema.Record(Schema.String, Schema.String), "items": Schema.Array(Resource), "kind": Schema.Literal("page"), "page": PageInfo, "replicated": optionalKey(ReplicatedNotice), "sync": optionalKey(SyncNotice), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "collection": Schema.Literal("ordered-memberships"), "filters": Schema.Record(Schema.String, Schema.String), "items": Schema.Array(OrderedMembership), "kind": Schema.Literal("page"), "page": PageInfo, "replicated": optionalKey(ReplicatedNotice), "sync": optionalKey(SyncNotice), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "collection": Schema.Literal("resources"), "filters": Schema.Record(Schema.String, Schema.String), "items": Schema.Array(ResourceObservation), "kind": Schema.Literal("page"), "page": PageInfo, "sync": optionalKey(SyncNotice), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Resource, Schema.Struct({ /** Present when conversation-blocks.v1 is negotiated; each field names its value, source and as_of */ +"header": optionalKey(ConversationHeader), "items": Schema.Array(TimelineEntry), "kind": Schema.Literal("timeline-page"), "page": PageInfo, "session_id": Id, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ /** Present when conversation-blocks.v1 is negotiated; each field names its value, source and as_of */ +"header": optionalKey(ConversationHeader), "items": Schema.Array(TimelineEntry).check(Schema.isMaxLength(200)), "kind": Schema.Literal("conversation-changes"), "next_cursor": Cursor, "session_id": Id, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "host_id": Id, "incomplete_sources": Schema.Array(Schema.String), "indexed_at": Timestamp, "items": Schema.Array(ConversationSearchHit).check(Schema.isMaxLength(200)), "kind": Schema.Literal("conversation-search"), "page": PageInfo, "refreshing": Schema.Boolean, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "has_more": Schema.Boolean, "items": Schema.Array(ProjectionEvent).check(Schema.isMaxLength(500)), "kind": Schema.Literal("event-page"), "oldest_cursor": Cursor, "resume_cursor": Cursor, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "action_id": Id, "affected_ids": Schema.Array(Id).check(Schema.isUnique()), "arrangement_revision": optionalKey(Revision), "harness_answer": optionalKey(HarnessAnswerResult), "kind": Schema.Literal("action-result"), "membership_revision": optionalKey(Revision), "operation_id": Id, "private_notes": optionalKey(PrivateNotesFence), "snapshot_id": Id, "status": Schema.Literals(["accepted","completed","rejected"]), "terminal_attachment": Schema.OptionFromOptionalNullOr(TerminalAttachment, NULL_NONE), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "acknowledged_event_ids": Schema.Array(ClientDiagnosticUuid).check(Schema.isMaxLength(32)), "accounts": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), PairingChallenge, PairedSession, Schema.Struct({ /** Revoked or expired opposite-profile witnesses; emitted only on daemon-configured-owner grant inspection with witness=1 when conflict is null. Never disclosed by bearer authentication errors or pairing. */ +"cleared_conflicts": optionalKey(Schema.Array(ClearedGrantProfileConflictWitness)).annotate({ description: "Revoked or expired opposite-profile witnesses; emitted only on daemon-configured-owner grant inspection with witness=1 when conflict is null. Never disclosed by bearer authentication errors or pairing." }), /** Current opposite-profile conflict, or null when no active conflict exists. Present only on daemon-configured-owner grant inspection with witness=1; omitted from default inspection, bearer authentication errors, pairing and mutation responses. */ +"conflict": Schema.OptionFromOptionalNullOr(GrantProfileConflictWitness, NULL_NONE).annotate({ description: "Current opposite-profile conflict, or null when no active conflict exists. Present only on daemon-configured-owner grant inspection with witness=1; omitted from default inspection, bearer authentication errors, pairing and mutation responses." }), "consent_evidence": Schema.String.check(Schema.isMinCodePoints(1)).check(Schema.isMaxCodePoints(512)), "device_id": Id, "disclosure_consent": Schema.Boolean, "expires_at": Timestamp, "id": Id, /** Daemon-configured owning person, sealed by the authoritative grant-issuer member at trusted-local begin. */ "issuer": PersonId, /** SHA-256 of the canonical device public-key string; never a credential digest. */ "key_id": Schema.String.check(Schema.isPattern(new RegExp("^[0-9a-f]{64}$", "u"))).annotate({ description: "SHA-256 of the canonical device public-key string; never a credential digest." }), "kind": Schema.Literal("assistant-grant"), "minimal_read_mode": AssistantMinimalReadMode, "policy_revision": Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)), "principal": AssistantPrincipal, /** Owner-provisioned public pins for SCG read proofs. Absent means every assistant read is denied. */ "read_trust": optionalKey(AssistantReadTrust), /** Stored policy metadata; does not restrict message.send. write.assistant.messages permits any existing agent recipient, never a person. */ -"recipient_allowlist": Schema.Array(Schema.String.check(Schema.isPattern(new RegExp("^agent/.+$", "u")))).annotate({ description: "Stored policy metadata; does not restrict message.send. write.assistant.messages permits any existing agent recipient, never a person." }), "revoked": Schema.Boolean, "scopes": Schema.Array(AssistantScope).check(Schema.isMinLength(1)).check(Schema.isUnique()), "sender_class": AssistantSenderClass, "session_actor": Schema.String.check(Schema.isPattern(new RegExp("^assistant/(?:chatgpt|mcp)/session/.+$", "u"))), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "as_of": Timestamp, "counts": Schema.Struct({ "agent_states": Schema.Record(Schema.String, Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))), "attention": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "mission_states": Schema.Record(Schema.String, Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))) }), "kind": Schema.Literal("assistant-summary"), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "collection": Schema.Literal("assistant.attention"), "filters": Schema.Record(Schema.String, Schema.Never), "items": Schema.Array(AssistantAttentionItem), "kind": Schema.Literal("page"), "page": PageInfo, "sync": optionalKey(SyncNotice), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "collection": Schema.Literal("assistant.missions"), "filters": Schema.Record(Schema.String, Schema.Never), "items": Schema.Array(AssistantMissionItem), "kind": Schema.Literal("page"), "page": PageInfo, "sync": optionalKey(SyncNotice), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "collection": Schema.Literal("assistant.agents"), "filters": Schema.Record(Schema.String, Schema.Never), "items": Schema.Array(AssistantAgentItem), "kind": Schema.Literal("page"), "page": PageInfo, "sync": optionalKey(SyncNotice), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), AssistantContentPage, Schema.Struct({ "columns": Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)), "cursor": Schema.Struct({ "blinking": Schema.Boolean, "column": Schema.Int, "row": Schema.Int, "style": Schema.Literals(["block","underline","bar"]), "visible": Schema.Boolean }), "facts": optionalKey(TerminalFacts), "kind": Schema.Literal("terminal-screen"), "lines": Schema.Array(TerminalLine), "modes": TerminalModes, /** Fence for the next input or resize. */ +"recipient_allowlist": Schema.Array(Schema.String.check(Schema.isPattern(new RegExp("^agent/.+$", "u")))).annotate({ description: "Stored policy metadata; does not restrict message.send. write.assistant.messages permits any existing agent recipient, never a person." }), "revoked": Schema.Boolean, "scopes": Schema.Array(AssistantScope).check(Schema.isMinLength(1)).check(Schema.isUnique()), "sender_class": AssistantSenderClass, "session_actor": Schema.String.check(Schema.isPattern(new RegExp("^assistant/(?:chatgpt|mcp)/session/.+$", "u"))), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "as_of": Timestamp, "counts": Schema.Struct({ "agent_states": Schema.Record(Schema.String, Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))), "attention": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "mission_states": Schema.Record(Schema.String, Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))) }), "kind": Schema.Literal("assistant-summary"), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "collection": Schema.Literal("assistant.attention"), "filters": Schema.Record(Schema.String, Schema.Never), "items": Schema.Array(AssistantAttentionItem), "kind": Schema.Literal("page"), "page": PageInfo, "sync": optionalKey(SyncNotice), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "collection": Schema.Literal("assistant.missions"), "filters": Schema.Record(Schema.String, Schema.Never), "items": Schema.Array(AssistantMissionItem), "kind": Schema.Literal("page"), "page": PageInfo, "sync": optionalKey(SyncNotice), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "collection": Schema.Literal("assistant.agents"), "filters": Schema.Record(Schema.String, Schema.Never), "items": Schema.Array(AssistantAgentItem), "kind": Schema.Literal("page"), "page": PageInfo, "sync": optionalKey(SyncNotice), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), AssistantContentPage, Schema.Struct({ "columns": Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)), "cursor": Schema.Struct({ "blinking": Schema.Boolean, "column": Schema.Int, "row": Schema.Int, "style": Schema.Literals(["block","underline","bar"]), "visible": Schema.Boolean }), "facts": optionalKey(TerminalFacts), "kind": Schema.Literal("terminal-screen"), "lines": Schema.Array(TerminalLine), "modes": TerminalModes, /** Fence for the next input or resize. */ "next_sequence": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).annotate({ description: "Fence for the next input or resize." }), "relay": optionalKey(TerminalRelay), /** Digest of the rest of the screen: equal revisions mean equal screens. */ -"revision": Schema.String.check(Schema.isMinCodePoints(1)).pipe(Schema.brand("st3/ScreenRevision")).annotate({ description: "Digest of the rest of the screen: equal revisions mean equal screens." }), "rows": Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)), "runtime_incarnation": Schema.String, "terminal_id": TerminalId, "title": Schema.String, "truncated": Schema.Boolean, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "complete": Schema.Boolean, "items": Schema.Array(StatusTransition).check(Schema.isMaxLength(200)), "kind": Schema.Literal("status-history"), "retained_from": Timestamp, "seat": AgentId, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "agent_id": Id, "current_work_ids": Schema.Array(Id), "kind": Schema.Literal("agent-queue"), "move_count": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "moves": Schema.Array(AgentQueueMove), "next_work_id": Schema.OptionFromNullOr(Id), "runs": Schema.Array(AgentQueueRun), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), AgentRelatedRuns, Schema.Struct({ /** Every declared account in name order, so each panel lists the same accounts. Absent on older servers. */ -"accounts": optionalKey(Schema.Array(UsageAccount)).annotate({ description: "Every declared account in name order, so each panel lists the same accounts. Absent on older servers." }), "agent_messages": optionalKey(AgentMessageEstimate), "limits": optionalKey(Schema.Array(UsageLimit)), "rows": Schema.Array(UsageRow), "since_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "until_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "cleanup_command": Schema.String, "count": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "threshold_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "as_of_unix_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), /** Where a person reads the exported observation history, from the daemon's [observations.otlp] ui_url. Absent when none is configured. */ -"otel_ui_url": optionalKey(Schema.String).annotate({ description: "Where a person reads the exported observation history, from the daemon's [observations.otlp] ui_url. Absent when none is configured." }), "rows": Schema.Array(SloRow), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "id": Schema.String, "samples": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "since_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "steps": Schema.Array(Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)).check(Schema.isLessThanOrEqualTo(100)))), "until_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) })], { mode: "oneOf" }) +"revision": Schema.String.check(Schema.isMinCodePoints(1)).pipe(Schema.brand("st3/ScreenRevision")).annotate({ description: "Digest of the rest of the screen: equal revisions mean equal screens." }), "rows": Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)), "runtime_incarnation": Schema.String, "terminal_id": TerminalId, "title": Schema.String, "truncated": Schema.Boolean, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "complete": Schema.Boolean, "items": Schema.Array(StatusTransition).check(Schema.isMaxLength(200)), "kind": Schema.Literal("status-history"), "retained_from": Timestamp, "seat": AgentId, "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "agent_id": Id, "current_work_ids": Schema.Array(Id), "kind": Schema.Literal("agent-queue"), "move_count": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "moves": Schema.Array(AgentQueueMove), "next_work_id": Schema.OptionFromNullOr(Id), "runs": Schema.Array(AgentQueueRun), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), AgentRelatedRuns, Schema.Struct({ /** Every declared account in name order, so each panel lists the same accounts. Absent on older servers. */ +"accounts": optionalKey(Schema.Array(UsageAccount)).annotate({ description: "Every declared account in name order, so each panel lists the same accounts. Absent on older servers." }), "agent_messages": optionalKey(AgentMessageEstimate), "limits": optionalKey(Schema.Array(UsageLimit)), "rows": Schema.Array(UsageRow), "since_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "until_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "cleanup_command": Schema.String, "count": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "threshold_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "as_of_unix_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), /** Where a person reads the exported observation history, from the daemon's [observations.otlp] ui_url. Absent when none is configured. */ +"otel_ui_url": optionalKey(Schema.String).annotate({ description: "Where a person reads the exported observation history, from the daemon's [observations.otlp] ui_url. Absent when none is configured." }), "rows": Schema.Array(SloRow), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "samples": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "since_ms": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "steps": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "until_ms": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) }), Schema.Struct({ "id": Schema.String, "samples": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "since_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "steps": Schema.Array(Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0)).check(Schema.isLessThanOrEqualTo(100)))), "until_ms": Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)), "accounts": Schema.optionalKey(Schema.Never), "acknowledged_event_ids": Schema.optionalKey(Schema.Never), "action_id": Schema.optionalKey(Schema.Never), "actions": Schema.optionalKey(Schema.Never), "affected_ids": Schema.optionalKey(Schema.Never), "agent_id": Schema.optionalKey(Schema.Never), "agent_messages": Schema.optionalKey(Schema.Never), "arrangement_revision": Schema.optionalKey(Schema.Never), "as_of": Schema.optionalKey(Schema.Never), "as_of_unix_ms": Schema.optionalKey(Schema.Never), "bytes": Schema.optionalKey(Schema.Never), "capabilities": Schema.optionalKey(Schema.Never), "changed_at_unix_ms": Schema.optionalKey(Schema.Never), "charged": Schema.optionalKey(Schema.Never), "cleanup_command": Schema.optionalKey(Schema.Never), "cleared_conflicts": Schema.optionalKey(Schema.Never), "collection": Schema.optionalKey(Schema.Never), "columns": Schema.optionalKey(Schema.Never), "complete": Schema.optionalKey(Schema.Never), "conflict": Schema.optionalKey(Schema.Never), "conflicts": Schema.optionalKey(Schema.Never), "consent_evidence": Schema.optionalKey(Schema.Never), "count": Schema.optionalKey(Schema.Never), "counts": Schema.optionalKey(Schema.Never), "current_work_ids": Schema.optionalKey(Schema.Never), "cursor": Schema.optionalKey(Schema.Never), "data": Schema.optionalKey(Schema.Never), "declaration": Schema.optionalKey(Schema.Never), "declaration_token": Schema.optionalKey(Schema.Never), "declared": Schema.optionalKey(Schema.Never), "desired": Schema.optionalKey(Schema.Never), "desired_revision": Schema.optionalKey(Schema.Never), "desired_token": Schema.optionalKey(Schema.Never), "device_id": Schema.optionalKey(Schema.Never), "disclosure_consent": Schema.optionalKey(Schema.Never), "event_cursor": Schema.optionalKey(Schema.Never), "expires_at": Schema.optionalKey(Schema.Never), "facts": Schema.optionalKey(Schema.Never), "family": Schema.optionalKey(Schema.Never), "filters": Schema.optionalKey(Schema.Never), "fleet_complete": Schema.optionalKey(Schema.Never), "grant_expires_at": Schema.optionalKey(Schema.Never), "grant_id": Schema.optionalKey(Schema.Never), "grant_kind": Schema.optionalKey(Schema.Never), "harness_answer": Schema.optionalKey(Schema.Never), "has_more": Schema.optionalKey(Schema.Never), "header": Schema.optionalKey(Schema.Never), "history": Schema.optionalKey(Schema.Never), "host_id": Schema.optionalKey(Schema.Never), "inclusive": Schema.optionalKey(Schema.Never), "incomplete_sources": Schema.optionalKey(Schema.Never), "indexed_at": Schema.optionalKey(Schema.Never), "issuer": Schema.optionalKey(Schema.Never), "items": Schema.optionalKey(Schema.Never), "kdl": Schema.optionalKey(Schema.Never), "key_id": Schema.optionalKey(Schema.Never), "kind": Schema.optionalKey(Schema.Never), "latest": Schema.optionalKey(Schema.Never), "legacy": Schema.optionalKey(Schema.Never), "limit": Schema.optionalKey(Schema.Never), "limits": Schema.optionalKey(Schema.Never), "lines": Schema.optionalKey(Schema.Never), "live": Schema.optionalKey(Schema.Never), "local_claim_index": Schema.optionalKey(Schema.Never), "machine_version": Schema.optionalKey(Schema.Never), "membership_revision": Schema.optionalKey(Schema.Never), "minimal_read_mode": Schema.optionalKey(Schema.Never), "mission": Schema.optionalKey(Schema.Never), "modes": Schema.optionalKey(Schema.Never), "move_count": Schema.optionalKey(Schema.Never), "moves": Schema.optionalKey(Schema.Never), "name": Schema.optionalKey(Schema.Never), "next_cursor": Schema.optionalKey(Schema.Never), "next_sequence": Schema.optionalKey(Schema.Never), "next_work_id": Schema.optionalKey(Schema.Never), "not_charged": Schema.optionalKey(Schema.Never), "notes": Schema.optionalKey(Schema.Never), "oldest_cursor": Schema.optionalKey(Schema.Never), "oldest_event_cursor": Schema.optionalKey(Schema.Never), "operation_id": Schema.optionalKey(Schema.Never), "otel_ui_url": Schema.optionalKey(Schema.Never), "owner": Schema.optionalKey(Schema.Never), "page": Schema.optionalKey(Schema.Never), "person": Schema.optionalKey(Schema.Never), "policy_revision": Schema.optionalKey(Schema.Never), "principal": Schema.optionalKey(Schema.Never), "private_notes": Schema.optionalKey(Schema.Never), "provenance": Schema.optionalKey(Schema.Never), "published_at": Schema.optionalKey(Schema.Never), "read_trust": Schema.optionalKey(Schema.Never), "recipient_allowlist": Schema.optionalKey(Schema.Never), "ref": Schema.optionalKey(Schema.Never), "reference": Schema.optionalKey(Schema.Never), "references": Schema.optionalKey(Schema.Never), "refreshing": Schema.optionalKey(Schema.Never), "relay": Schema.optionalKey(Schema.Never), "replicated": Schema.optionalKey(Schema.Never), "request_refs": Schema.optionalKey(Schema.Never), "request_refs_complete": Schema.optionalKey(Schema.Never), "resume_cursor": Schema.optionalKey(Schema.Never), "retained_from": Schema.optionalKey(Schema.Never), "revision": Schema.optionalKey(Schema.Never), "revoked": Schema.optionalKey(Schema.Never), "rows": Schema.optionalKey(Schema.Never), "runs": Schema.optionalKey(Schema.Never), "runtime_incarnation": Schema.optionalKey(Schema.Never), "schema": Schema.optionalKey(Schema.Never), "schemas": Schema.optionalKey(Schema.Never), "scopes": Schema.optionalKey(Schema.Never), "seat": Schema.optionalKey(Schema.Never), "sender_class": Schema.optionalKey(Schema.Never), "session_actor": Schema.optionalKey(Schema.Never), "session_id": Schema.optionalKey(Schema.Never), "size": Schema.optionalKey(Schema.Never), "snapshot_id": Schema.optionalKey(Schema.Never), "status": Schema.optionalKey(Schema.Never), "subject": Schema.optionalKey(Schema.Never), "sync": Schema.optionalKey(Schema.Never), "terminal_attachment": Schema.optionalKey(Schema.Never), "terminal_id": Schema.optionalKey(Schema.Never), "text": Schema.optionalKey(Schema.Never), "threshold_ms": Schema.optionalKey(Schema.Never), "title": Schema.optionalKey(Schema.Never), "token": Schema.optionalKey(Schema.Never), "transport": Schema.optionalKey(Schema.Never), "truncated": Schema.optionalKey(Schema.Never), "unattributed_for_person": Schema.optionalKey(Schema.Never), "version": Schema.optionalKey(Schema.Never), "window_end_inclusive_unix_ms": Schema.optionalKey(Schema.Never), "window_start_exclusive_unix_ms": Schema.optionalKey(Schema.Never), "workspace": Schema.optionalKey(Schema.Never) })], { mode: "oneOf" }) }).annotate({ identifier: "Envelope" }))() export type Envelope = typeof Envelope.Type export type EnvelopeEncoded = typeof Envelope.Encoded @@ -1002,6 +1038,8 @@ export const ErrorEnvelope = /*#__PURE__*/ (() => Schema.Union([ Schema.Struct({ "api_version": Schema.Literals(["st3.client.v0","fractal.client.v0"]), "applied": optionalKey(Schema.Literals(["none","unknown"])), "code": Schema.Literal("peer-too-old"), "details": Schema.StructWithRest(Schema.Struct({ "applied": optionalKey(Schema.Literals(["none","unknown"])), "refusal": optionalKey(MessageSendRefusal) }), [Schema.Record(Schema.String, Schema.Unknown)]), "error_version": Schema.Literals(["st3.client.error.v0","fractal.client.error.v0"]), "message": Schema.String, "request_id": Id, "retry_after_ms": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.decodeTo(Schema.Duration.check(durationMillisRange), wholeUnits(1)))), "retryable": Schema.Boolean }), Schema.Struct({ "api_version": Schema.Literals(["st3.client.v0","fractal.client.v0"]), "applied": optionalKey(Schema.Literals(["none","unknown"])), "code": Schema.Literal("validation-failed"), "details": Schema.StructWithRest(Schema.Struct({ "applied": optionalKey(Schema.Literals(["none","unknown"])), "refusal": optionalKey(MessageSendRefusal) }), [Schema.Record(Schema.String, Schema.Unknown)]), "error_version": Schema.Literals(["st3.client.error.v0","fractal.client.error.v0"]), "message": Schema.String, "request_id": Id, "retry_after_ms": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.decodeTo(Schema.Duration.check(durationMillisRange), wholeUnits(1)))), "retryable": Schema.Boolean }), Schema.Struct({ "api_version": Schema.Literals(["st3.client.v0","fractal.client.v0"]), "applied": optionalKey(Schema.Literals(["none","unknown"])), "code": Schema.Literal("idempotency-conflict"), "details": Schema.StructWithRest(Schema.Struct({ "applied": optionalKey(Schema.Literals(["none","unknown"])), "refusal": optionalKey(MessageSendRefusal) }), [Schema.Record(Schema.String, Schema.Unknown)]), "error_version": Schema.Literals(["st3.client.error.v0","fractal.client.error.v0"]), "message": Schema.String, "request_id": Id, "retry_after_ms": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.decodeTo(Schema.Duration.check(durationMillisRange), wholeUnits(1)))), "retryable": Schema.Boolean }), + Schema.Struct({ "api_version": Schema.Literals(["st3.client.v0","fractal.client.v0"]), "applied": optionalKey(Schema.Literals(["none","unknown"])), "code": Schema.Literal("grant-profile-conflict"), "details": Schema.StructWithRest(Schema.Struct({ "applied": optionalKey(Schema.Literals(["none","unknown"])), "refusal": optionalKey(MessageSendRefusal) }), [Schema.Record(Schema.String, Schema.Unknown)]), "error_version": Schema.Literals(["st3.client.error.v0","fractal.client.error.v0"]), "message": Schema.String, "request_id": Id, "retry_after_ms": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.decodeTo(Schema.Duration.check(durationMillisRange), wholeUnits(1)))), "retryable": Schema.Boolean }), + Schema.Struct({ "api_version": Schema.Literals(["st3.client.v0","fractal.client.v0"]), "applied": optionalKey(Schema.Literals(["none","unknown"])), "code": Schema.Literal("assistant-grant-authority-not-ready"), "details": Schema.StructWithRest(Schema.Struct({ "applied": optionalKey(Schema.Literals(["none","unknown"])), "refusal": optionalKey(MessageSendRefusal) }), [Schema.Record(Schema.String, Schema.Unknown)]), "error_version": Schema.Literals(["st3.client.error.v0","fractal.client.error.v0"]), "message": Schema.String, "request_id": Id, "retry_after_ms": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.decodeTo(Schema.Duration.check(durationMillisRange), wholeUnits(1)))), "retryable": Schema.Boolean }), Schema.Struct({ "api_version": Schema.Literals(["st3.client.v0","fractal.client.v0"]), "applied": optionalKey(Schema.Literals(["none","unknown"])), "code": Schema.Literal("legacy-action-receipt-untrusted"), "details": Schema.StructWithRest(Schema.Struct({ "applied": optionalKey(Schema.Literals(["none","unknown"])), "refusal": optionalKey(MessageSendRefusal) }), [Schema.Record(Schema.String, Schema.Unknown)]), "error_version": Schema.Literals(["st3.client.error.v0","fractal.client.error.v0"]), "message": Schema.String, "request_id": Id, "retry_after_ms": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.decodeTo(Schema.Duration.check(durationMillisRange), wholeUnits(1)))), "retryable": Schema.Boolean }), Schema.Struct({ "api_version": Schema.Literals(["st3.client.v0","fractal.client.v0"]), "applied": optionalKey(Schema.Literals(["none","unknown"])), "code": Schema.Literal("issuer-required"), "details": Schema.StructWithRest(Schema.Struct({ "applied": optionalKey(Schema.Literals(["none","unknown"])), "refusal": optionalKey(MessageSendRefusal) }), [Schema.Record(Schema.String, Schema.Unknown)]), "error_version": Schema.Literals(["st3.client.error.v0","fractal.client.error.v0"]), "message": Schema.String, "request_id": Id, "retry_after_ms": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.decodeTo(Schema.Duration.check(durationMillisRange), wholeUnits(1)))), "retryable": Schema.Boolean }), Schema.Struct({ "api_version": Schema.Literals(["st3.client.v0","fractal.client.v0"]), "applied": optionalKey(Schema.Literals(["none","unknown"])), "code": Schema.Literal("pairing-origin-required"), "details": Schema.StructWithRest(Schema.Struct({ "applied": optionalKey(Schema.Literals(["none","unknown"])), "refusal": optionalKey(MessageSendRefusal) }), [Schema.Record(Schema.String, Schema.Unknown)]), "error_version": Schema.Literals(["st3.client.error.v0","fractal.client.error.v0"]), "message": Schema.String, "request_id": Id, "retry_after_ms": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.decodeTo(Schema.Duration.check(durationMillisRange), wholeUnits(1)))), "retryable": Schema.Boolean }), @@ -1046,7 +1084,7 @@ export const ErrorEnvelope = /*#__PURE__*/ (() => Schema.Union([ Schema.Struct({ "api_version": Schema.Literals(["st3.client.v0","fractal.client.v0"]), "applied": optionalKey(Schema.Literals(["none","unknown"])), "code": Schema.Literal("invalid-answer"), "details": HarnessInvalidAnswerDetails, "error_version": Schema.Literals(["st3.client.error.v0","fractal.client.error.v0"]), "message": Schema.String, "request_id": Id, "retry_after_ms": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.decodeTo(Schema.Duration.check(durationMillisRange), wholeUnits(1)))), "retryable": Schema.Boolean }), Schema.Struct({ "api_version": Schema.Literals(["st3.client.v0","fractal.client.v0"]), "applied": optionalKey(Schema.Literals(["none","unknown"])), "code": Schema.Literal("not-answerable"), "details": HarnessNotAnswerableDetails, "error_version": Schema.Literals(["st3.client.error.v0","fractal.client.error.v0"]), "message": Schema.String, "request_id": Id, "retry_after_ms": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.decodeTo(Schema.Duration.check(durationMillisRange), wholeUnits(1)))), "retryable": Schema.Boolean }), Schema.Struct({ "api_version": Schema.Literals(["st3.client.v0","fractal.client.v0"]), "applied": optionalKey(Schema.Literals(["none","unknown"])), "code": Schema.Literal("internal"), "details": Schema.StructWithRest(Schema.Struct({ "applied": optionalKey(Schema.Literals(["none","unknown"])), "refusal": optionalKey(MessageSendRefusal) }), [Schema.Record(Schema.String, Schema.Unknown)]), "error_version": Schema.Literals(["st3.client.error.v0","fractal.client.error.v0"]), "message": Schema.String, "request_id": Id, "retry_after_ms": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.decodeTo(Schema.Duration.check(durationMillisRange), wholeUnits(1)))), "retryable": Schema.Boolean }), - Schema.Struct({ "api_version": Schema.Literals(["st3.client.v0","fractal.client.v0"]), "applied": optionalKey(Schema.Literals(["none","unknown"])), "code": unknownCase(["recipient-retired","agents-publication-row-too-large","identity-cycle","identity-occupied","identity-retired-source","identity-cross-kind","identity-unknown","lifecycle-unavailable","retirement-upgrade-required","retire-revision-mismatch","retire-incarnation-mismatch","invalid-custody-successor","custody-pending","attention-migrated","arrangement-exists","arrangement-folder-exists","arrangement-retired","arrangement-limit","arrangement-folder-deleted","arrangement-cycle","arrangement-body-too-large","arrangement-owner-forbidden","invalid-arrangement-subject","invalid-arrangement-action","invalid-arrangement-operations","invalid-arrangement-folder","invalid-arrangement-name","invalid-arrangement-key","invalid-arrangement-version","invalid-arrangement-body","unsupported-membership-container","membership-owner-forbidden","invalid-membership-member","invalid-membership-bucket","invalid-membership-key","invalid-membership-operations","membership-edit-too-large","invalid-subject-reference","not-found","forbidden","unsupported-capability","peer-too-old","validation-failed","idempotency-conflict","legacy-action-receipt-untrusted","issuer-required","pairing-origin-required","pairing-restart-required","suspend-authored-session-selection","stale-fence","cursor-gap","page-cursor-expired","agent-roster-not-ready","agent-roster-cut-not-ready","message-selectors-not-ready","rate-limited","runtime-not-local","runtime-authority-indeterminate","runtime-list-not-ready","runtime-list-ended","remote-unavailable","terminal-unavailable","inventory-unavailable","terminal-ended","timeline-history-incomplete","projection-detail-too-large","projection-detail-invalid-source","conversation-content-invalidated","transcript-unavailable","blob-too-large","unsupported-media-type","blob-content-mismatch","blob-quota-exceeded","blob-not-found","blob-expired","message-too-large","message-store-full","long-message-signature-unsupported","response-budget-exceeded","content-not-text","invalid-document-reference","document-not-synced","private-notes-unreachable","private-notes-carrier-conflict","private-notes-indeterminate","invalid-answer","not-answerable","internal"]), "details": Schema.StructWithRest(Schema.Struct({ "applied": optionalKey(Schema.Literals(["none","unknown"])), "refusal": optionalKey(MessageSendRefusal) }), [Schema.Record(Schema.String, Schema.Unknown)]), "error_version": Schema.Literals(["st3.client.error.v0","fractal.client.error.v0"]), "message": Schema.String, "request_id": Id, "retry_after_ms": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.decodeTo(Schema.Duration.check(durationMillisRange), wholeUnits(1)))), "retryable": Schema.Boolean }) + Schema.Struct({ "api_version": Schema.Literals(["st3.client.v0","fractal.client.v0"]), "applied": optionalKey(Schema.Literals(["none","unknown"])), "code": unknownCase(["recipient-retired","agents-publication-row-too-large","identity-cycle","identity-occupied","identity-retired-source","identity-cross-kind","identity-unknown","lifecycle-unavailable","retirement-upgrade-required","retire-revision-mismatch","retire-incarnation-mismatch","invalid-custody-successor","custody-pending","attention-migrated","arrangement-exists","arrangement-folder-exists","arrangement-retired","arrangement-limit","arrangement-folder-deleted","arrangement-cycle","arrangement-body-too-large","arrangement-owner-forbidden","invalid-arrangement-subject","invalid-arrangement-action","invalid-arrangement-operations","invalid-arrangement-folder","invalid-arrangement-name","invalid-arrangement-key","invalid-arrangement-version","invalid-arrangement-body","unsupported-membership-container","membership-owner-forbidden","invalid-membership-member","invalid-membership-bucket","invalid-membership-key","invalid-membership-operations","membership-edit-too-large","invalid-subject-reference","not-found","forbidden","unsupported-capability","peer-too-old","validation-failed","idempotency-conflict","grant-profile-conflict","assistant-grant-authority-not-ready","legacy-action-receipt-untrusted","issuer-required","pairing-origin-required","pairing-restart-required","suspend-authored-session-selection","stale-fence","cursor-gap","page-cursor-expired","agent-roster-not-ready","agent-roster-cut-not-ready","message-selectors-not-ready","rate-limited","runtime-not-local","runtime-authority-indeterminate","runtime-list-not-ready","runtime-list-ended","remote-unavailable","terminal-unavailable","inventory-unavailable","terminal-ended","timeline-history-incomplete","projection-detail-too-large","projection-detail-invalid-source","conversation-content-invalidated","transcript-unavailable","blob-too-large","unsupported-media-type","blob-content-mismatch","blob-quota-exceeded","blob-not-found","blob-expired","message-too-large","message-store-full","long-message-signature-unsupported","response-budget-exceeded","content-not-text","invalid-document-reference","document-not-synced","private-notes-unreachable","private-notes-carrier-conflict","private-notes-indeterminate","invalid-answer","not-answerable","internal"]), "details": Schema.StructWithRest(Schema.Struct({ "applied": optionalKey(Schema.Literals(["none","unknown"])), "refusal": optionalKey(MessageSendRefusal) }), [Schema.Record(Schema.String, Schema.Unknown)]), "error_version": Schema.Literals(["st3.client.error.v0","fractal.client.error.v0"]), "message": Schema.String, "request_id": Id, "retry_after_ms": optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.decodeTo(Schema.Duration.check(durationMillisRange), wholeUnits(1)))), "retryable": Schema.Boolean }) ], { mode: "oneOf" }).annotate({ identifier: "ErrorEnvelope" }))() export type ErrorEnvelope = typeof ErrorEnvelope.Type export type ErrorEnvelopeEncoded = typeof ErrorEnvelope.Encoded diff --git a/crates/fractal-api-client-v0/src/api/client_v0.rs b/crates/fractal-api-client-v0/src/api/client_v0.rs index 881813bb75f..b526ce5e69c 100644 --- a/crates/fractal-api-client-v0/src/api/client_v0.rs +++ b/crates/fractal-api-client-v0/src/api/client_v0.rs @@ -3985,6 +3985,9 @@ fn operation_resources(state: &AppState, at: &str) -> Result, ApiErro }; let mut values = checks .iter() + // Grant IDs and issuing identities are trusted-local doctor diagnostics, not + // projection data for paired clients. Both collection and detail use this list. + .filter(|check| check.name != "assistant-grant-provenance") .map(|check| { let digest = hex::encode(Sha256::digest(check.name.as_bytes())); json!({ @@ -13871,6 +13874,69 @@ mission "differential" state="ready" { } } + #[tokio::test] + async fn paired_operations_do_not_disclose_local_doctor_grant_provenance() { + let root = tempfile::tempdir().unwrap(); + let state = test_state(root.path()); + let credential = "operations-provenance-reader"; + state.store.append_client_operation_claim(&ClaimInput { + subject: "custom/client/operations-provenance-reader".into(), + kind: "custom.client.pairing-completed".into(), + actor: Some("person/ada".into()), + fields: BTreeMap::from([ + ("credential_hash".into(), json!(credential_digest(credential))), + ("session_actor".into(), json!("client/operations-provenance-reader")), + ("person_id".into(), json!("person/ada")), + ("scopes".into(), json!(["read.projections"])), + ("expires_at_unix_ms".into(), json!(client_now_ms() as u64 + 60_000)), + ]), + evidence: Vec::new(), expected_subject: None, idempotency_key: None, + }).unwrap(); + let grant_id = "claim/private-doctor-grant"; + let origin = "private-doctor-origin"; + let issuer = "person/private-doctor-issuer"; + state.store.connection.write().execute( + "INSERT INTO assistant_grant_pending + (claim_id,grant_subject,kind,origin,actor,sequence,authenticated,record) + VALUES(?1,?1,'custom.client.assistant.v1.granted',?2,?3,1,0,'{}')", + rusqlite::params![grant_id, origin, issuer], + ).unwrap(); + let checks = doctor_report(&state).unwrap().0.checks; + let provenance = checks.iter() + .find(|check| check.name == "assistant-grant-provenance").unwrap(); + for private in [grant_id, origin, issuer] { + assert!(provenance.message.contains(private), "{provenance:?}"); + } + // Serve exactly the detailed local report through the remote projection paths. + operation_reports().insert( + Arc::as_ptr(&state.store) as usize, + OperationReport { + store: Arc::downgrade(&state.store), checks: Some(Arc::new(checks)), + at: Instant::now(), refreshing: false, + }, + ); + let digest = hex::encode(Sha256::digest(b"assistant-grant-provenance")); + let app = super::super::fabric_router(state.clone()); + for (uri, expected) in [ + ("/v1/client/operations".to_owned(), StatusCode::OK), + (format!("/v1/client/operations/diagnostic-{}", &digest[..16]), StatusCode::NOT_FOUND), + ] { + let request = Request::builder().uri(uri) + .header(AUTHORIZATION, format!("Bearer {credential}")) + .body(Body::empty()).unwrap(); + let session = authenticate(&state, &request, "fabric-loopback").unwrap(); + assert!(session.allows("read.projections")); + assert!(!session.local_peer); + let response = app.clone().oneshot(request).await.unwrap(); + assert_eq!(response.status(), expected); + let bytes = to_bytes(response.into_body(), CLIENT_MAX_RESPONSE_BYTES).await.unwrap(); + let body = std::str::from_utf8(&bytes).unwrap(); + for private in [grant_id, origin, issuer, "assistant-grant-provenance"] { + assert!(!body.contains(private), "{body}"); + } + } + } + #[tokio::test] async fn fleet_operational_commands_are_bounded_and_report_slow_queries() { use crate::OperationsFixtureStore; diff --git a/crates/fractal-api-client-v0/src/api/client_v0/assistant.rs b/crates/fractal-api-client-v0/src/api/client_v0/assistant.rs index 43f06a2dc19..2ca09d7b17a 100644 --- a/crates/fractal-api-client-v0/src/api/client_v0/assistant.rs +++ b/crates/fractal-api-client-v0/src/api/client_v0/assistant.rs @@ -6,6 +6,7 @@ pub use native::propose; pub use authorization::{ReadReceipt, finish as finish_read, pin as pin_read_trust, read as read_projection}; pub use fractal_api_core::api::client_v0::assistant::*; pub use fractal_api_core::api::client_v0::assistant::{PRINCIPAL, append, authenticate, authorize_route, device_resources, trusted_issuer}; +use fractal_api_core::api::client_v0::external_grants::{projection_principal, projection_with_witness, revoked}; pub mod authorization; pub mod native; pub mod reads; @@ -208,12 +209,22 @@ async fn complete_inner(state: &AppState, id: &str, request: &PairingComplete, "grant":projection})))) } +#[derive(Default, Deserialize)] +#[serde(deny_unknown_fields)] +pub struct AssistantGrantQuery { + witness: Option, +} + pub async fn inspect(State(state): State, Extension(session): Extension, - AxumPath(id): AxumPath) -> Result, ApiError> { + AxumPath(id): AxumPath, Query(query): Query) -> Result, ApiError> { trusted_issuer(&state, &session)?; let granted = latest(&state, &subject(&id)?, GRANTED)? .ok_or_else(|| ApiError::not_found("assistant grant does not exist"))?; - Ok(Json(projection(&state, &granted)?)) + Ok(Json(if query.witness.as_deref() == Some("1") { + projection_with_witness(&state, &granted)? + } else { + projection(&state, &granted)? + })) } async fn revoke_inner(State(state): State, Extension(session): Extension, @@ -226,11 +237,18 @@ async fn revoke_inner(State(state): State, Extension(session): Extensi if granted.origin != state.store.origin() { return Err(forbidden("assistant revocation must run on its authoritative issuer")); } - if latest(&state, &subject, REVOKED)?.is_none() { + if !revoked(&state, &granted)? { let previous = effective(&state, &granted)?; - append(&state, subject, REVOKED, issuer, json!({"version":1,"grant_id":fields(&granted)?["grant_id"], - "principal":principal(fields(&granted)?)?,"issuer":issuer,"transport":session.transport, - "timestamp":client_timestamp(client_now_ms()),"outcome":"revoked"}), Some(&previous))?; + let source = fields(&granted)?; + let mut value = json!({"version":1,"grant_id":source["grant_id"], + "principal":projection_principal(source)?,"issuer":issuer,"transport":session.transport, + "timestamp":client_timestamp(client_now_ms()),"outcome":"revoked"}); + // Revocation is not issuance: retain the immutable profile, including + // the absence of a profile on legacy assistant grants. + if let Some(profile) = source.get("profile") { + value["profile"] = profile.clone(); + } + append(&state, subject, REVOKED, issuer, value, Some(&previous))?; signal_changed(&state); } Ok(Json(projection(&state, &granted)?)) @@ -252,7 +270,7 @@ async fn update_policy_inner(State(state): State, Extension(session): if granted.origin != state.store.origin() { return Err(forbidden("assistant policy must change on its authoritative issuer")); } - if latest(&state, &subject, REVOKED)?.is_some() { return Err(forbidden("assistant grant was revoked")); } + if revoked(&state, &granted)? { return Err(forbidden("assistant grant was revoked")); } let previous = effective(&state, &granted)?; // Policy changes must not revive an expired grant: fail closed instead of extending it. if fields(&previous)?["expires_at_unix_ms"].as_u64().map(u128::from).unwrap_or(0) <= client_now_ms() { @@ -306,6 +324,115 @@ mod tests { &request, "fabric-loopback").await.unwrap().unwrap().0 } + fn seeded_grant(state: &AppState, profile: Option<&str>) -> ClaimRecord { + let id = "111111111111111111111111"; + let mut source = json!({"version":1,"grant_id":format!("assistant-grant/{id}"), + "principal":PRINCIPAL,"sender_class":"external-assistant","issuer":ISSUER, + "session_actor":format!("{PRINCIPAL}/session/assistant-grant/{id}"), + "credential_hash":credential_digest("reserved-service-credential"), + "device_id":"device/service-history","key_id":"service-history", + "scopes":SCOPES[..4],"expires_at_unix_ms":client_now_ms()+3_600_000, + "policy_revision":1,"minimal_read_mode":"approval-once","recipient_allowlist":[], + "disclosure_consent":true,"consent_evidence":"recorded owner consent"}); + if let Some(profile) = profile { + source["profile"] = json!(profile); + } + // Retain pre-existing evidence without opening the production issuance gate. + state.store.append_claim(&ClaimInput { + subject: subject(id).unwrap(), kind: GRANTED.into(), actor: Some(ISSUER.into()), + fields: serde_json::from_value(source).unwrap(), evidence: Vec::new(), + expected_subject: None, idempotency_key: None, + }).unwrap() + } + + #[tokio::test] + async fn owner_revoke_endpoint_preserves_profiles_and_is_idempotent() { + use axum::{body::{Body, to_bytes}, http::Request}; + use tower::ServiceExt; + + for profile in [None, Some("assistant"), Some("service")] { + let root = tempfile::tempdir().unwrap(); + let state = state(root.path()); + let granted = seeded_grant(&state, profile); + let app = super::super::super::router_for_transport(state.clone(), + ClientTransportBoundary::Unix, &[crate::api::client_v0::routes]); + let path = "/v1/client/assistant/grants/111111111111111111111111/revoke"; + // An arbitrary local person must not gain the owner's revocation right. + let mut denied = Request::builder().method("POST").uri(path) + .header(LOCAL_PERSON_HEADER, "person/other").body(Body::empty()).unwrap(); + denied.extensions_mut().insert(super::super::super::LocalPeer { pid: 8, peer_process: None, ancestor: None }); + assert_eq!(app.clone().oneshot(denied).await.unwrap().status(), StatusCode::FORBIDDEN); + assert!(latest(&state, &granted.subject, REVOKED).unwrap().is_none()); + + let mut revocation_id = None; + for _ in 0..2 { + let mut request = Request::builder().method("POST").uri(path) + .header(LOCAL_PERSON_HEADER, ISSUER).body(Body::empty()).unwrap(); + request.extensions_mut().insert(super::super::super::LocalPeer { pid: 8, peer_process: None, ancestor: None }); + let response = app.clone().oneshot(request).await.unwrap(); + assert_eq!(response.status(), StatusCode::OK, "{profile:?}"); + let body: Value = serde_json::from_slice(&to_bytes(response.into_body(), usize::MAX).await.unwrap()).unwrap(); + assert_eq!(body["value"]["revoked"], true); + let revoked = latest(&state, &granted.subject, REVOKED).unwrap().unwrap(); + assert_eq!(fields(&revoked).unwrap().get("profile"), fields(&granted).unwrap().get("profile")); + assert_eq!(revoked.actor.as_deref(), Some(ISSUER)); + assert_eq!(revoked.origin, granted.origin); + if let Some(id) = &revocation_id { + assert_eq!(&revoked.id, id, "repeat revocation must not append another transition"); + } else { + revocation_id = Some(revoked.id); + } + } + } + } + + #[tokio::test] + async fn owner_revoke_route_retires_legacy_service_conflict_and_restores_assistant_admission() { + use axum::{body::{Body, to_bytes}, http::Request}; + use tower::ServiceExt; + + let root = tempfile::tempdir().unwrap(); + let state = state(root.path()); + let legacy = seeded_grant(&state, Some("service")); + let Json(challenge) = begin(state.clone(), ClientSession::local(Some(ISSUER)).unwrap(), + request()).await.unwrap(); + let pairing_id = challenge["pairing_id"].as_str().unwrap() + .strip_prefix("pairing/").unwrap(); + let completion: PairingComplete = serde_json::from_value(json!({ + "api_version":CLIENT_API_VERSION,"code":challenge["code"], + "device_public_key":base64::engine::general_purpose::URL_SAFE_NO_PAD.encode([7_u8;32]), + })).unwrap(); + let error = complete(&state, pairing_id, &completion, "fabric-loopback") + .await.unwrap_err(); + assert_eq!(error.code, "grant-profile-conflict"); + assert!(authenticate(&state, &credential_digest("reserved-service-credential"), + "http").is_err(), "legacy conflict evidence must never authenticate as Service"); + + let app = super::super::super::router_for_transport(state.clone(), + ClientTransportBoundary::Unix, &[crate::api::client_v0::routes]); + let mut request = Request::builder().method("POST") + .uri("/v1/client/assistant/grants/111111111111111111111111/revoke") + .header(LOCAL_PERSON_HEADER, ISSUER).body(Body::empty()).unwrap(); + request.extensions_mut().insert(super::super::super::LocalPeer { + pid: 8, peer_process: None, ancestor: None, + }); + let response = app.oneshot(request).await.unwrap(); + assert_eq!(response.status(), StatusCode::OK); + let body: Value = serde_json::from_slice( + &to_bytes(response.into_body(), usize::MAX).await.unwrap()).unwrap(); + assert_eq!(body["value"]["principal"], PRINCIPAL); + assert_eq!(body["value"]["revoked"], true); + let revoked = latest(&state, &legacy.subject, REVOKED).unwrap().unwrap(); + assert_eq!(fields(&revoked).unwrap()["profile"], "service"); + assert_eq!(fields(&revoked).unwrap()["principal"], PRINCIPAL); + let Json(paired) = complete(&state, pairing_id, &completion, "fabric-loopback") + .await.unwrap().expect("owner revocation must restore actual assistant admission"); + assert_eq!(paired["principal"], PRINCIPAL); + assert!(authenticate(&state, + &credential_digest(paired["credential"].as_str().unwrap()), + "fabric-loopback").unwrap().is_some()); + } + async fn begin_assistant(state: &AppState) -> Value { begin(state.clone(), ClientSession::local(Some(ISSUER)).unwrap(), request()).await.unwrap().0 } @@ -364,6 +491,112 @@ mod tests { } } + #[tokio::test] + async fn service_history_does_not_enable_issuance_policy_or_requests() { + use axum::{body::Body, http::Request}; + use tower::ServiceExt; + + let root = tempfile::tempdir().unwrap(); + let state = state(root.path()); + let granted = seeded_grant(&state, Some("service")); + let app = super::super::super::router_for_transport(state.clone(), + ClientTransportBoundary::Unix, &[crate::api::client_v0::routes]); + for path in ["/v1/client/assistant/summary", "/v1/client/capabilities"] { + let request = Request::builder().uri(path) + .header(AUTHORIZATION, "Bearer reserved-service-credential") + .body(Body::empty()).unwrap(); + assert_eq!(app.clone().oneshot(request).await.unwrap().status(), StatusCode::FORBIDDEN); + } + let policy = json!({"api_version":CLIENT_API_VERSION,"scopes":SCOPES[..4], + "expires_in_seconds":3600,"disclosure_consent":true, + "consent_evidence":"recorded owner consent","minimal_read_mode":"approval-once"}); + let mut request = Request::builder().method("POST") + .uri("/v1/client/assistant/grants/111111111111111111111111/policy") + .header(LOCAL_PERSON_HEADER, ISSUER).header("content-type", "application/json") + .body(Body::from(policy.to_string())).unwrap(); + request.extensions_mut().insert(super::super::super::LocalPeer { pid: 8, peer_process: None, ancestor: None }); + assert_eq!(app.clone().oneshot(request).await.unwrap().status(), StatusCode::FORBIDDEN); + assert!(latest(&state, &granted.subject, POLICY).unwrap().is_none()); + + let issuance = json!({"api_version":CLIENT_API_VERSION,"device_name":"service", + "assistant_id":PRINCIPAL,"profile":"service","scopes":SCOPES[..4], + "expires_in_seconds":3600,"disclosure_consent":true, + "consent_evidence":"recorded owner consent"}); + let mut request = Request::builder().method("POST").uri("/v1/client/pairings") + .header(LOCAL_PERSON_HEADER, ISSUER).header("content-type", "application/json") + .body(Body::from(issuance.to_string())).unwrap(); + request.extensions_mut().insert(super::super::super::LocalPeer { pid: 8, peer_process: None, ancestor: None }); + assert_eq!(app.oneshot(request).await.unwrap().status(), StatusCode::UNPROCESSABLE_ENTITY); + assert!(state.store.claims_for_kind_at(BEGUN, None, true, 10).unwrap().claims.is_empty()); + } + + // Frozen pre-witness shape, independent of today's generated grant model. + #[derive(Deserialize)] + #[serde(deny_unknown_fields)] + #[allow(dead_code)] + struct LegacyAssistantGrant { + kind: String, + id: String, + principal: String, + sender_class: String, + session_actor: String, + device_id: String, + key_id: String, + issuer: String, + scopes: Vec, + expires_at: String, + policy_revision: u64, + minimal_read_mode: String, + recipient_allowlist: Vec, + disclosure_consent: bool, + consent_evidence: String, + revoked: bool, + read_trust: Option, + } + + #[tokio::test] + async fn grant_responses_preserve_strict_legacy_shape_unless_inspect_opts_in() { + use axum::{body::{Body, to_bytes}, http::Request}; + use tower::ServiceExt; + + let root = tempfile::tempdir().unwrap(); + let state = state(root.path()); + let paired = paired(&state).await; + serde_json::from_value::(paired["grant"].clone()).unwrap(); + let id = paired["grant"]["id"].as_str().unwrap(); + let app = super::super::super::router_for_transport(state.clone(), ClientTransportBoundary::Unix, &[crate::api::client_v0::routes]); + for query in ["", "?witness=0", "?witness=true", "?witness=1"] { + let mut request = Request::builder() + .uri(format!("/v1/client/assistant/grants/{}{query}", urlencoding::encode(id))) + .header(LOCAL_PERSON_HEADER, ISSUER).body(Body::empty()).unwrap(); + request.extensions_mut().insert(super::super::super::LocalPeer { pid: 8, peer_process: None, ancestor: None }); + let response = app.clone().oneshot(request).await.unwrap(); + assert_eq!(response.status(), StatusCode::OK); + let body: Value = serde_json::from_slice(&to_bytes(response.into_body(), usize::MAX).await.unwrap()).unwrap(); + let grant = body["value"].clone(); + if query == "?witness=1" { + assert_eq!(grant["conflict"], Value::Null); + assert!(grant["cleared_conflicts"].is_array()); + assert!(serde_json::from_value::(grant).is_err()); + } else { + serde_json::from_value::(grant).unwrap(); + } + } + let policy = serde_json::from_value(json!({ + "api_version": CLIENT_API_VERSION, "scopes": SCOPES[..4], + "disclosure_consent": true, "consent_evidence": "owner approved renewal", + "minimal_read_mode": "approval-once" + })).unwrap(); + let Json(changed) = update_policy(State(state.clone()), + Extension(ClientSession::local(Some(ISSUER)).unwrap()), + AxumPath(id.into()), Json(policy)).await.unwrap(); + serde_json::from_value::(changed).unwrap(); + let Json(revoked) = revoke(State(state), + Extension(ClientSession::local(Some(ISSUER)).unwrap()), + AxumPath(id.into())).await.unwrap(); + serde_json::from_value::(revoked).unwrap(); + } + #[tokio::test] async fn legacy_assistant_pairing_requires_an_unexpired_bounded_lifetime() { for (lifetime, accepted) in [(299_000_i64,true),(300_000,true),(300_001,false),(600_000,false),(-1,false)] { @@ -549,7 +782,8 @@ mod tests { value["principal"] = json!(replacement); value["session_actor"] = json!(format!("{replacement}/session/{}", paired["grant"]["id"].as_str().unwrap())); append(&state, granted.subject.clone(), POLICY, ISSUER, value, Some(&granted)).unwrap(); - assert!(authenticate(&state, &credential_digest(paired["credential"].as_str().unwrap()), "fabric-loopback").is_err()); + let session = authenticate(&state, &credential_digest(paired["credential"].as_str().unwrap()), "fabric-loopback").unwrap().unwrap(); + assert_eq!(session.authority_actor, principal); } } } @@ -702,6 +936,39 @@ mod tests { assert!(!String::from_utf8(body.to_vec()).unwrap().contains("max_message_bytes")); } + #[tokio::test] + async fn authority_backfill_refusal_is_typed_retryable_and_recovers() { + let root = tempfile::tempdir().unwrap(); + let state = state(root.path()); + let paired = paired(&state).await; + state.store.connection.write().execute( + "DELETE FROM meta WHERE key='assistant_grant_authority_version'", [], + ).unwrap(); + let app = super::super::super::router_for_transport( + state.clone(), ClientTransportBoundary::Unix, &[crate::api::client_v0::routes], + ); + let inspect = format!("/v1/client/assistant/grants/{}", + urlencoding::encode(paired["grant"]["id"].as_str().unwrap())); + for (path, bearer) in [("/v1/client/assistant/summary", true), (inspect.as_str(), false)] { + let mut request = Request::builder().uri(path); + if bearer { + request = request.header(AUTHORIZATION, + format!("Bearer {}", paired["credential"].as_str().unwrap())); + } else { + request = request.header(LOCAL_PERSON_HEADER, ISSUER); + } + let response = app.clone().oneshot(request.body(Body::empty()).unwrap()).await.unwrap(); + assert_eq!(response.status(), StatusCode::SERVICE_UNAVAILABLE); + let body = axum::body::to_bytes(response.into_body(), usize::MAX).await.unwrap(); + let value: Value = serde_json::from_slice(&body).unwrap(); + assert_eq!(value["code"], "assistant-grant-authority-not-ready"); + assert_eq!(value["retryable"], true); + } + while !state.store.advance_assistant_grant_authority_backfill().unwrap() {} + assert!(authenticate(&state, + &credential_digest(paired["credential"].as_str().unwrap()), "unix").unwrap().is_some()); + } + #[tokio::test] async fn assistant_revocation_and_expiry_survive_restart() { let root=tempfile::tempdir().unwrap(); let state1=state(root.path()); let paired1=paired(&state1).await; @@ -822,7 +1089,7 @@ mod tests { assert_eq!(fs::metadata(&profile).unwrap().permissions().mode() & 0o777,0o600); assert!(!root.path().join("devices.json").exists()); let Json(grant)=inspect(State(state),Extension(ClientSession::local(Some(ISSUER)).unwrap()), - AxumPath(device.session.grant.id)).await.unwrap(); + AxumPath(device.session.grant.id), Query(AssistantGrantQuery::default())).await.unwrap(); assert_eq!(grant["principal"],PRINCIPAL); server.abort(); } diff --git a/crates/fractal-api-client-v0/src/api/client_v0/assistant/authorization_tests.rs b/crates/fractal-api-client-v0/src/api/client_v0/assistant/authorization_tests.rs index e75938f58f2..00299ebb8ac 100644 --- a/crates/fractal-api-client-v0/src/api/client_v0/assistant/authorization_tests.rs +++ b/crates/fractal-api-client-v0/src/api/client_v0/assistant/authorization_tests.rs @@ -101,6 +101,108 @@ async fn request(app: Router, credential: &str, method: &str, path: &str, header (status,serde_json::from_slice(&bytes).unwrap(),bytes.len()) } +#[tokio::test] +async fn p1_owner_transitions_ignore_wrong_origin_overlays_but_fence_the_subject_head() { + for kind in [POLICY, REVOKED] { + let fixture = fixture(SCOPES, false).await; + let subject = subject(&fixture.grant).unwrap(); + let granted = latest(&fixture.state, &subject, GRANTED).unwrap().unwrap(); + let peer = Store::open_memory("wrong-origin").unwrap(); + // These overlays must be authenticated data from the wrong issuer. + // An unsigned import instead fences the subject until it authenticates. + const FLEET: &str = "86700000-0000-4000-8000-000000000001"; + let anchor = Arc::new(smallclaims::fleet::MemberKey::generate().unwrap().0); + let peer_key = Arc::new(smallclaims::fleet::MemberKey::generate().unwrap().0); + for store in [&*fixture.state.store, &peer] { + store.bind_fleet(FLEET).unwrap(); + store.pin_fleet_anchor(anchor.public()).unwrap(); + } + fixture.state.store.set_member_key(Some(anchor.clone())).unwrap(); + peer.set_member_key(Some(peer_key.clone())).unwrap(); + fixture.state.store.admit_fleet_anchor(FLEET, anchor.public(), "listening").unwrap(); + fixture.state.store.append_claim(&ClaimInput { + subject: "host/wrong-origin".into(), kind: "fleet.member-admitted".into(), + actor: Some(OWNER.into()), + fields: serde_json::from_value(json!({ + "fleet_id": FLEET, "member_key": peer_key.public(), + "via": "invite", "mode": "listening", "writer_floor": 0, + })).unwrap(), + evidence: Vec::new(), expected_subject: None, idempotency_key: None, + }).unwrap(); + let replicate = |from: &Store, to: &Store| { + let exchange = from.export_replication_exchange_answering( + FLEET, &to.replication_inventory().unwrap(), + &to.replication_signature_requests().unwrap(), + ).unwrap(); + to.receive_replication_exchange(from.origin(), FLEET, &exchange).unwrap(); + to.validate_replication_backlog().unwrap(); + to.project_replication_backlog().unwrap(); + }; + replicate(&fixture.state.store, &peer); + while !peer.advance_assistant_grant_authority_backfill().unwrap() {} + while !fixture.state.store.advance_assistant_grant_authority_backfill().unwrap() {} + let overlay = || { + let mut value = fields(&granted).unwrap().clone(); + if kind == POLICY { + value["policy_revision"] = json!(999); + value["expires_at_unix_ms"] = json!(1); + value["scopes"] = json!([]); + } + let claim = peer.append_claim(&ClaimInput { + subject: subject.clone(), kind: kind.into(), actor: Some(OWNER.into()), + fields: serde_json::from_value(value).unwrap(), evidence: Vec::new(), + expected_subject: None, idempotency_key: None, + }).unwrap(); + replicate(&peer, &fixture.state.store); + assert!(fixture.state.store.claim_by_id(&claim.id).unwrap().is_some(), + "wrong-origin evidence must remain in raw history without becoming authority"); + assert!(authenticate(&fixture.state, &credential_digest(&fixture.credential), "fabric-loopback").unwrap().is_none(), + "receipt must fence the subject before background authentication"); + while !fixture.state.store.advance_assistant_grant_authority_backfill().unwrap() {} + assert!(fixture.state.store.claim_has_authenticated_member_writer(&claim.id).unwrap(), + "wrong-origin filtering must be exercised after writer authentication"); + assert!(authenticate(&fixture.state, &credential_digest(&fixture.credential), "fabric-loopback").unwrap().is_some()); + }; + + overlay(); + let policy = serde_json::from_value::(json!({ + "api_version": CLIENT_API_VERSION, "scopes": SCOPES, "expires_in_seconds": 86400, + "disclosure_consent": true, "consent_evidence": "recorded owner consent", + "minimal_read_mode": "approval-once", + })).unwrap(); + let Json(renewed) = update_policy(State(fixture.state.clone()), + Extension(ClientSession::local(Some(OWNER)).unwrap()), AxumPath(fixture.grant.clone()), + Json(policy)).await.unwrap(); + assert_eq!(renewed["policy_revision"], 2); + assert_eq!(renewed["revoked"], false); + let renewed_claim = effective(&fixture.state, &granted).unwrap(); + assert_eq!(renewed_claim.body["evidence"], json!([granted.id])); + + overlay(); + let Json(pinned) = pin(State(fixture.state.clone()), + Extension(ClientSession::local(Some(OWNER)).unwrap()), AxumPath(fixture.grant.clone()), + Json(fixture.trust_request())).await.unwrap(); + assert_eq!(pinned["policy_revision"], 3); + assert_eq!(pinned["read_trust"]["key_id"], "approval-key/test"); + let pinned_claim = effective(&fixture.state, &granted).unwrap(); + assert_eq!(pinned_claim.body["evidence"], json!([renewed_claim.id])); + + overlay(); + let Json(revoked) = revoke(State(fixture.state.clone()), + Extension(ClientSession::local(Some(OWNER)).unwrap()), + AxumPath(fixture.grant.clone())).await.unwrap(); + assert_eq!(revoked["revoked"], true); + let revocation = latest(&fixture.state, &subject, REVOKED).unwrap().unwrap(); + assert_eq!(revocation.origin, granted.origin); + assert_eq!(revocation.body["evidence"], json!([pinned_claim.id])); + assert!(authenticate(&fixture.state, &credential_digest(&fixture.credential), "fabric-loopback").is_err()); + assert_eq!(fixture.request("/v1/client/assistant/summary", None).await.0, StatusCode::FORBIDDEN); + assert_eq!(pin(State(fixture.state.clone()), Extension(ClientSession::local(Some(OWNER)).unwrap()), + AxumPath(fixture.grant.clone()), Json(fixture.trust_request())).await.unwrap_err().status, + StatusCode::FORBIDDEN); + } +} + #[tokio::test] async fn scg_read_accepts_header_aliases_and_binds_presented_domain() { let fixture = fixture(SCOPES, true).await; diff --git a/crates/fractal-api-core/src/api.rs b/crates/fractal-api-core/src/api.rs index 3168e636c4d..ff2e1052336 100644 --- a/crates/fractal-api-core/src/api.rs +++ b/crates/fractal-api-core/src/api.rs @@ -482,6 +482,7 @@ impl ApiError { | "stale-subject" | "stale-fence" | "idempotency-conflict" + | "grant-profile-conflict" | "private-notes-carrier-conflict" | "owned-set-refused" | "set-managed-subject" @@ -503,6 +504,7 @@ impl ApiError { "identity-unknown" | "lane-not-found" | "not-found" => StatusCode::NOT_FOUND, "private-notes-unreachable" | "private-notes-indeterminate" => StatusCode::SERVICE_UNAVAILABLE, "database-busy" | "database-locked" | "message-selectors-not-ready" + | "assistant-grant-authority-not-ready" | "checkpoint-proof-in-progress" | "backup-busy" => StatusCode::SERVICE_UNAVAILABLE, "client-diagnostics-rate-limit" => StatusCode::TOO_MANY_REQUESTS, "read-deadline" => StatusCode::GATEWAY_TIMEOUT, @@ -2031,6 +2033,7 @@ pub fn client_error_code(code: Option<&str>) -> String { | "peer-too-old" | "validation-failed" | "idempotency-conflict" + | "grant-profile-conflict" | "invalid-answer" | "not-answerable" | "idempotency-key-expired" @@ -2079,6 +2082,7 @@ pub fn client_error_code(code: Option<&str>) -> String { | "mission-list-not-ready" | "mission-list-ended" | "message-selectors-not-ready" + | "assistant-grant-authority-not-ready" | "response-too-large" | "runtime-not-local" | "runtime-authority-indeterminate" @@ -9626,6 +9630,98 @@ pub(crate) fn fleet_admission_check( } } +fn pending_assistant_grant_checks( + connection: &rusqlite::Connection, + local_origin: &str, +) -> anyhow::Result> { + let mut statement = connection.prepare_cached( + "SELECT pending.claim_id,pending.kind,pending.origin,pending.actor + FROM assistant_grant_pending pending + WHERE pending.authenticated=0 + AND pending.kind='custom.client.assistant.v1.granted' + AND NOT EXISTS(SELECT 1 FROM assistant_grant_local_appends local + WHERE local.claim_id=pending.claim_id) + ORDER BY pending.claim_id", + )?; + let rows = statement.query_map([], |row| { + Ok((row.get::<_, String>(0)?, row.get::<_, String>(1)?, + row.get::<_, String>(2)?, row.get::<_, String>(3)?)) + })?; + rows.map(|row| { + let (id, kind, origin, actor) = row?; + let reason = if origin == local_origin { + "grant predates local-append provenance; re-issue" + } else { + "grant lacks local-append provenance and verified member signature/membership; issuance age unknown" + }; + Ok(DoctorCheck { + name: "assistant-grant-provenance".into(), + status: "warn".into(), + message: format!("{id}: {reason}; kind={kind}; origin={origin}; actor={actor}"), + }) + }).collect() +} + +fn assistant_grant_subject_maintenance_checks( + connection: &rusqlite::Connection, +) -> anyhow::Result> { + let mut statement = connection.prepare_cached( + "SELECT claims.subject, 'dirty claim awaiting projection' AS cause + FROM assistant_grant_dirty dirty JOIN claims ON claims.id=dirty.claim_id + UNION + SELECT pending.grant_subject, 'retired raw claim awaiting projection' + FROM assistant_grant_dirty dirty + JOIN assistant_grant_pending pending ON pending.claim_id=dirty.claim_id + WHERE NOT EXISTS(SELECT 1 FROM claims WHERE id=dirty.claim_id) + UNION + SELECT claims.subject, 'signature authentication cursor in progress' + FROM assistant_grant_auth_cursor cursor JOIN claims ON claims.id=cursor.claim_id + UNION + SELECT grant_subject, 'unauthenticated grant, policy or revocation evidence' + FROM assistant_grant_pending WHERE authenticated=0 + UNION + SELECT pending.grant_subject, 'writer membership revalidation queued: ' || dirty.writer + FROM assistant_grant_retractions dirty + JOIN assistant_grant_pending pending + ON pending.origin=dirty.writer AND pending.auth_member_key=dirty.member_key + WHERE pending.auth_sequence BETWEEN dirty.lower_sequence AND dirty.upper_sequence + AND (pending.auth_sequence,pending.claim_id)>(dirty.sequence,dirty.claim_id) + AND NOT EXISTS(SELECT 1 FROM assistant_grant_membership_windows windows + WHERE windows.writer=pending.origin AND windows.member_key=pending.auth_member_key + AND pending.auth_sequence>=windows.start + AND (windows.end IS NULL OR pending.auth_sequence<=windows.end)) + UNION + SELECT pending.grant_subject, 'authentication proof evidence changed' + FROM assistant_grant_proof_invalidations work + JOIN assistant_grant_pending pending ON pending.origin=work.writer + AND pending.auth_sequence=work.sequence AND pending.auth_envelope_hash=work.envelope_hash + WHERE pending.claim_id>work.claim_id + AND (work.member_key='' OR pending.auth_member_key=work.member_key) + UNION + SELECT pending.grant_subject, 'authentication proof evidence changed' + FROM assistant_grant_proof_rechecks work + JOIN assistant_grant_pending pending ON pending.claim_id=work.claim_id + UNION + SELECT pending.grant_subject, 'retracted authority effective-state recomputation' + FROM assistant_grant_recompute work + JOIN assistant_grant_pending pending ON pending.claim_id=work.claim_id + ORDER BY 1,2", + )?; + let rows = statement.query_map([], |row| { + Ok((row.get::<_, String>(0)?, row.get::<_, String>(1)?)) + })?; + rows.map(|row| { + let (subject, cause) = row?; + Ok(DoctorCheck { + // Keep subject causes in the existing trusted-local-only check, which + // paired operations exclude from both collection and detail reads. + name: "assistant-grant-provenance".into(), + status: "warn".into(), + message: format!("subject={subject}: external-grant subject maintenance; cause={cause}; bearer clients receive generic credential rejection"), + }) + }).collect() +} + fn doctor_report_within( state: &AppState, clock: &DoctorClock, @@ -9669,6 +9765,12 @@ fn doctor_report_within( message: error.to_string(), }), } + checks.extend(pending_assistant_grant_checks( + &state.store.readers.get(), state.store.origin(), + ).map_err(ApiError::internal)?); + checks.extend(assistant_grant_subject_maintenance_checks( + &state.store.readers.get(), + ).map_err(ApiError::internal)?); Ok(checks) }); checks.check("claim-signatures", || { diff --git a/crates/fractal-api-core/src/api/client_v0/assistant/authorization.rs b/crates/fractal-api-core/src/api/client_v0/assistant/authorization.rs index 805097b453f..5bedafdc672 100644 --- a/crates/fractal-api-core/src/api/client_v0/assistant/authorization.rs +++ b/crates/fractal-api-core/src/api/client_v0/assistant/authorization.rs @@ -122,7 +122,7 @@ pub async fn pin(State(state): State, Extension(session): Extension ApiError { + if error.code == "assistant-grant-subject-not-ready" { + credential_rejected("the client credential is unknown or expired") + } else { + ApiError::bad(error) + } +} + /// Closed authority profiles: callers cannot register a profile or mix its rights. /// Service authentication is supported, but production issuance remains disabled. #[derive(Clone, Copy, Debug, Eq, PartialEq)] @@ -68,22 +76,6 @@ fn digest_only(source: &Value) -> Result<(), ApiError> { Ok(()) } -// Issuance-only scan: authentication retains its existing indexed lookup and reads. -// append owns the admission lock; several grants of the same profile are allowed. -// Filter revoked/expired history before loading claim bodies into Rust. Expiry -// uses the latest policy, not the original grant. Keep malformed missing fields -// in the result so the existing validation below still reports them. -const ADMISSION_QUERY: &str = - "SELECT id FROM claims WHERE kind=?1 AND COALESCE(json_extract(body,'$.fields.principal'),'assistant/chatgpt')=?2 - AND (?5 IS NULL OR NOT EXISTS (SELECT 1 FROM claims AS revoked WHERE revoked.subject=claims.subject AND revoked.kind=?3)) - AND (?5 IS NULL OR COALESCE( - (SELECT CASE WHEN json_type(policy.body,'$.fields') IS NULL THEN 1 ELSE - COALESCE(json_type(policy.body,'$.fields.expires_at_unix_ms')='integer' - AND json_extract(policy.body,'$.fields.expires_at_unix_ms')>?5,0) END - FROM claims AS policy WHERE policy.subject=claims.subject AND policy.kind=?4 ORDER BY policy.store_index DESC LIMIT 1), - CASE WHEN json_type(body,'$.fields') IS NULL THEN 1 ELSE - COALESCE(json_type(body,'$.fields.expires_at_unix_ms')='integer' - AND json_extract(body,'$.fields.expires_at_unix_ms')>?5,0) END))"; fn admission_now_ms() -> u128 { #[cfg(test)] if let Some(now) = tests::ADMISSION_NOW.get() { @@ -91,36 +83,74 @@ fn admission_now_ms() -> u128 { } client_now_ms() } +fn candidate_grants(state: &AppState, principal: &str, expiry_cut: Option) -> Result, ApiError> { + candidate_grants_except(state, principal, expiry_cut, None, None) +} + +fn candidate_grants_except(state: &AppState, principal: &str, expiry_cut: Option, + excluded: Option<&str>, ignored_profile: Option) -> Result, ApiError> { + let ignored_profile = ignored_profile.map(|profile| match profile { + Profile::Assistant => "assistant", Profile::Service => "service", + }); + authority::candidates(&state.store.readers.get(), principal, owning_person(state)?, + expiry_cut, excluded, ignored_profile).map_err(authority_error)? + .into_iter().map(|grant| { + let profile = Profile::stored(fields(&grant)?)?; + Ok((grant, profile)) + }).collect() +} + +fn unexpired(source: &Value, now: u64) -> bool { + source["expires_at_unix_ms"].as_u64().is_some_and(|expires| expires > now) +} + + +fn witness(grant: &ClaimRecord, profile: Profile) -> Value { + json!({"grant_id":fields(grant).ok().and_then(|source| source.get("grant_id")), + "origin":grant.origin,"profile":match profile { Profile::Assistant => "assistant", Profile::Service => "service" }}) +} + +fn conflict_error() -> ApiError { + ApiError { + status: StatusCode::CONFLICT, + code: "grant-profile-conflict".into(), + message: "principal has active grants of opposite profiles; revoke one to clear the conflict".into(), + details: Box::default(), + } +} + +#[cfg(test)] +pub fn profile_conflict(state: &AppState, granted: &ClaimRecord) -> Result, ApiError> { + profile_conflict_at(state, granted, client_now_ms() as u64) +} + +fn profile_conflict_at(state: &AppState, granted: &ClaimRecord, now: u64) -> Result, ApiError> { + let active = candidate_grants(state, projection_principal(fields(granted)?)?, Some(now))?; + let Some((grant, profile)) = active.iter().find(|(grant, _)| grant.id == granted.id) else { + return Ok(None); + }; + Ok(active.iter().find(|(_, other)| other != profile).map(|(other, other_profile)| + json!({"grants":[witness(grant, *profile),witness(other, *other_profile)]}))) +} fn admit_profile(state: &AppState, source: &Value) -> Result<(), ApiError> { let profile = Profile::stored(source)?; - let principal = principal(source)?; - // Without a valid owner the old scan must still surface its configuration - // error before examining expiry; do not prefilter those rows. - let expiry_cut = owning_person(state).ok().map(|_| admission_now_ms() as u64); - let ids = { - let connection = state.store.readers.get(); - let mut query = connection.prepare(/* sqlite-large-value: allow-for-now lv-h99f1a302c7b1 owner=fractal_api_core::api::client_v0::external_grants TODO=trace-statement-and-value-representation */ ADMISSION_QUERY).map_err(ApiError::internal)?; - query.query_map(rusqlite::params![GRANTED, principal, REVOKED, POLICY, expiry_cut], |row| row.get::<_, String>(0)) - .map_err(ApiError::internal)?.collect::, _>>().map_err(ApiError::internal)? - }; - for id in ids { - let grant = state.store.claim_by_id(&id).map_err(ApiError::internal)? - .ok_or_else(|| forbidden("external grant is absent"))?; - if grant.origin != state.store.origin() || grant.actor.as_deref() != Some(owning_person(state)?) - || latest(state, &grant.subject, REVOKED)?.is_some() { - continue; - } - let policy = effective(state, &grant)?; - let active = fields(&policy)?; - if active["expires_at_unix_ms"].as_u64().map(u128::from).unwrap_or(0) > admission_now_ms() { - profile.compatible(Profile::stored(fields(&grant)?)?)?; - profile.compatible(Profile::stored(active)?)?; + for (_, other) in candidate_grants(state, principal(source)?, Some(admission_now_ms() as u64))? { + if profile != other { + return Err(conflict_error()); } } Ok(()) } +// Owner management and retained evidence must recognize the projection identity, +// including legacy Service grants on assistant principals. Never use this parser +// for issuance or bearer authentication: those require `principal` below. +pub fn projection_principal(source: &Value) -> Result<&str, ApiError> { + Profile::stored(source)?; + authority::principal(source).ok_or_else(|| forbidden("invalid external grant projection principal")) +} + pub fn principal(source: &Value) -> Result<&str, ApiError> { if Profile::stored(source)? == Profile::Service { return source["principal"].as_str().filter(|principal| { @@ -135,9 +165,7 @@ pub fn principal(source: &Value) -> Result<&str, ApiError> { .ok_or_else(|| forbidden("invalid assistant principal")) } pub const BEGUN: &str = "custom.client.assistant.v1.begun"; -pub const GRANTED: &str = "custom.client.assistant.v1.granted"; -pub const POLICY: &str = "custom.client.assistant.v1.policy"; -pub const REVOKED: &str = "custom.client.assistant.v1.revoked"; +pub use authority::{GRANTED, POLICY, REVOKED}; pub const SCOPES: &[&str] = &[ "read.assistant.summary", "read.assistant.attention", "read.assistant.missions", "read.assistant.agents", "read.assistant.conversation", "read.assistant.terminal", @@ -175,6 +203,9 @@ pub fn fields(claim: &ClaimRecord) -> Result<&Value, ApiError> { claim.body.get("fields").ok_or_else(|| forbidden("invalid assistant grant claim")) } pub fn latest(state: &AppState, subject: &str, kind: &str) -> Result, ApiError> { + if matches!(kind, GRANTED | POLICY | REVOKED) { + return authority::latest(&state.store.readers.get(), subject, kind).map_err(authority_error); + } Ok(state.store.claims_for_subject_kind_at(subject, kind, None, true, 1) .map_err(ApiError::internal)?.claims.into_iter().next()) } @@ -188,7 +219,25 @@ pub fn append(state: &AppState, subject: String, kind: &str, actor: &str, None }; if matches!(kind, BEGUN | GRANTED | POLICY | REVOKED) { - assistant_profile(&value)?; + if kind == REVOKED { + Profile::stored(&value)?; + // A legacy conflicting profile may no longer be issuable, but its + // authoritative owner must still be able to retire that evidence. + let revoke_principal = authority::principal(&value) + .ok_or_else(|| forbidden("invalid external grant revocation principal"))?; + let granted = authority::latest(&state.store.readers.get(), &subject, GRANTED) + .map_err(authority_error)?.ok_or_else(|| forbidden("assistant grant is absent"))?; + if actor != owning_person(state)? || granted.actor.as_deref() != Some(actor) + || granted.origin != state.store.origin() + || previous.is_none() + || Some(revoke_principal) != authority::principal(fields(&granted)?) + || ["grant_id", "issuer", "profile"].iter() + .any(|key| value.get(*key) != granted.body["fields"].get(*key)) { + return Err(forbidden("assistant revocation requires the authoritative grant owner and immutable identity")); + } + } else { + assistant_profile(&value)?; + } digest_only(&value)?; if let Some(previous) = previous { let previous = fields(previous)?; @@ -198,11 +247,17 @@ pub fn append(state: &AppState, subject: String, kind: &str, actor: &str, admit_profile(state, &value)?; } } + // Authority/evidence uses the validated policy; fencing uses the real head. + let expected_subject = if matches!(kind, POLICY | REVOKED) { + state.store.latest_claim(&subject, None).map_err(ApiError::internal)?.map(|claim| claim.id) + } else { + previous.map(|claim| claim.id.clone()) + }; state.store.append_claim(&ClaimInput { subject, kind: kind.into(), actor: Some(actor.into()), fields: serde_json::from_value(value).map_err(ApiError::internal)?, evidence: previous.map(|claim| vec![claim.id.clone()]).unwrap_or_default(), - expected_subject: Some(previous.map(|claim| claim.id.clone())), + expected_subject: Some(expected_subject), idempotency_key: None, }).map_err(ApiError::bad) } @@ -215,8 +270,10 @@ pub fn audit(state: &AppState, operation: &str, actor: &str, transport: &str, let mut audit_principal = actor.split_once("/session/").map(|(principal, _)| principal.to_owned()); if let Some(subject) = grant_id.and_then(|id| subject(id).ok()) { for kind in [BEGUN, GRANTED, POLICY, REVOKED] { - if let Some(claim) = latest(state, &subject, kind)? { - audit_principal = Some(principal(fields(&claim)?)?.to_owned()); + // Audit references retained evidence, including unauthoritative overlays. + if let Some(claim) = state.store.claims_for_subject_kind_at(&subject, kind, None, true, 1) + .map_err(ApiError::internal)?.claims.into_iter().next() { + audit_principal = Some(projection_principal(fields(&claim)?)?.to_owned()); referenced.push(claim.id); } } @@ -235,16 +292,24 @@ pub fn audit(state: &AppState, operation: &str, actor: &str, transport: &str, Ok(()) } +fn transition(state: &AppState, granted: &ClaimRecord, kind: &str) -> Result, ApiError> { + authority::transition(&state.store.readers.get(), granted, kind).map_err(authority_error) +} + +pub fn revoked(state: &AppState, granted: &ClaimRecord) -> Result { + Ok(transition(state, granted, REVOKED)?.is_some()) +} + pub fn effective(state: &AppState, granted: &ClaimRecord) -> Result { - Ok(latest(state, &granted.subject, POLICY)?.unwrap_or_else(|| granted.clone())) + Ok(transition(state, granted, POLICY)?.unwrap_or_else(|| granted.clone())) } pub fn projection(state: &AppState, granted: &ClaimRecord) -> Result { let policy = effective(state, granted)?; let source = fields(&policy)?; let mut value = json!({"kind":"assistant-grant","id":source["grant_id"], - "principal":principal(source)?,"sender_class":"external-assistant","issuer":source["issuer"], + "principal":projection_principal(source)?,"sender_class":"external-assistant","issuer":source["issuer"], "expires_at":client_timestamp(source["expires_at_unix_ms"].as_u64().map(u128::from).unwrap_or(0)), - "revoked":latest(state, &granted.subject, REVOKED)?.is_some()}); + "revoked":revoked(state, granted)?}); for name in ["session_actor","device_id","key_id","scopes","policy_revision", "minimal_read_mode","recipient_allowlist","disclosure_consent","consent_evidence"] { value[name] = source[name].clone(); @@ -255,20 +320,63 @@ pub fn projection(state: &AppState, granted: &ClaimRecord) -> Result Result { + let mut value = projection(state, granted)?; + let policy = effective(state, granted)?; + let source = fields(&policy)?; + let now = client_now_ms() as u64; + value["conflict"] = profile_conflict_at(state, granted, now)?.unwrap_or(Value::Null); + if value["conflict"].is_null() { + let profile = Profile::stored(fields(granted)?)?; + let mut cleared = Vec::new(); + for (other, other_profile) in candidate_grants(state, projection_principal(source)?, None)? { + if profile == other_profile { continue; } + // Historical explanations are optional: another subject's pending proof + // must not turn inspection of this clean grant into a bearer denial. + let explanation = (|| { + let connection = state.store.readers.get(); + let policy = authority::transition(&connection, &other, POLICY)? + .unwrap_or_else(|| other.clone()); + let revoked = authority::transition(&connection, &other, REVOKED)?.is_some(); + Ok::<_, FractalError>((policy, revoked)) + })(); + let (policy, other_revoked) = match explanation { + Err(error) if error.code == "assistant-grant-subject-not-ready" => continue, + result => result.map_err(authority_error)?, + }; + let cause = if other_revoked || value["revoked"] == true { Some("revoked") } + else if !unexpired(fields(&policy)?, now) || !unexpired(source, now) { Some("expired") } else { None }; + if let Some(cause) = cause { + cleared.push(json!({"grants":[witness(granted, profile),witness(&other, other_profile)],"cause":cause})); + } + } + value["cleared_conflicts"] = json!(cleared); + } + Ok(value) +} + pub fn authenticate(state: &AppState, digest: &str, transport: &'static str) -> Result, ApiError> { - let id: Option = state.store.readers.get().query_row( - "SELECT id FROM claims WHERE kind=?1 AND json_extract(body,'$.fields.credential_hash')=?2 ORDER BY store_index DESC LIMIT 1", - rusqlite::params![GRANTED, digest], |row| row.get(0)) - .optional().map_err(ApiError::internal)?; - let Some(id) = id else { return Ok(None) }; - let granted = state.store.claim_by_id(&id).map_err(ApiError::internal)? - .ok_or_else(|| forbidden("assistant grant is absent"))?; + let Some(granted) = authority::by_credential(&state.store.readers.get(), digest) + .map_err(authority_error)? else { return Ok(None); }; session(state, &granted, transport).map(Some) } pub fn session(state: &AppState, granted: &ClaimRecord, transport: &'static str) -> Result { + if !authority::contains(&state.store.readers.get(), &granted.id).map_err(authority_error)? { + return Err(credential_rejected("the client credential is unknown or expired")); + } + let now = client_now_ms() as u64; let policy = effective(state, granted)?; + let is_revoked = revoked(state, granted)?; + if !is_revoked && unexpired(fields(&policy)?, now) + && authority::structurally_valid(granted, &policy) { + let profile = Profile::stored(fields(granted)?)?; + if candidate_grants_except(state, principal(fields(granted)?)?, Some(now), Some(&granted.id), Some(profile))? + .iter().any(|(_, other)| *other != profile) { + return Err(conflict_error()); + } + } let source = fields(&policy)?; let principal = principal(source)?; let granted_fields = fields(granted)?; @@ -278,18 +386,15 @@ pub fn session(state: &AppState, granted: &ClaimRecord, transport: &'static str) digest_only(granted_fields)?; digest_only(source)?; } - if self::principal(granted_fields)? != principal - || ["grant_id", "session_actor", "issuer"].iter().any(|key| source[*key] != granted_fields[*key]) - || source["session_actor"].as_str().and_then(|actor| actor.strip_prefix(principal)) - .and_then(|suffix| suffix.strip_prefix("/session/")) != source["grant_id"].as_str() { + if !authority::structurally_valid(granted, &policy) { return Err(forbidden("assistant grant principal and session are inconsistent")); } if granted.origin != state.store.origin() || policy.origin != granted.origin || granted.actor.as_deref() != Some(owning_person(state)?) || policy.actor.as_deref() != Some(owning_person(state)?) { return Err(forbidden("assistant requests require the authoritative grant issuer")); } - if latest(state, &granted.subject, REVOKED)?.is_some() - || source["expires_at_unix_ms"].as_u64().map(u128::from).unwrap_or(0) <= client_now_ms() + if is_revoked + || !unexpired(source, now) || source["issuer"] != owning_person(state)? || (profile == Profile::Assistant && (!matches!(source["minimal_read_mode"].as_str(), Some("approval-once" | "caller-bound-allow")) @@ -394,6 +499,9 @@ pub fn audit_service_read(state: &AppState, session: &ClientSession) -> Result<( Ok(()) } +#[cfg(test)] +mod conflict_tests; + #[cfg(test)] mod tests { use super::*; @@ -419,6 +527,9 @@ mod tests { fields: serde_json::from_value(json!({ "profile":"service","principal":PRINCIPAL,"issuer":"person/owner", "expires_at_unix_ms":u64::MAX, + "grant_id":"333333333333333333333333", + "session_actor":format!("{PRINCIPAL}/session/333333333333333333333333"), + "minimal_read_mode":"approval-once","disclosure_consent":true,"scopes":[], "credential_hash":credential_digest("persisted service conflict") })).unwrap(), evidence: Vec::new(), expected_subject: Some(None), idempotency_key: None, @@ -458,11 +569,96 @@ mod tests { (admitted, refused, usable) } - // 98e550cb's Rust-only admission, retained independently as the differential - // oracle. Only its wall clock is substituted so expiry == now is exact. - fn rust_only_admission(state: &AppState, source: &Value) -> Result<(), ApiError> { + fn reference_principal(source: &Value) -> Option<&str> { + match source.get("principal") { + None => Some(PRINCIPAL), + Some(Value::String(value)) if value == PRINCIPAL => Some(PRINCIPAL), + Some(Value::String(value)) if value == MCP_PRINCIPAL => Some(MCP_PRINCIPAL), + Some(Value::String(value)) if source["profile"] == "service" => { + let mut parts = value.split('/'); + let component = |part: Option<&str>| part.is_some_and(|part| + !part.is_empty() && part.bytes().all(|byte| + byte.is_ascii_alphanumeric() || b"-_.".contains(&byte))); + (parts.next()==Some("plugin") && component(parts.next()) + && component(parts.next()) && parts.next().is_none()).then_some(value.as_str()) + } + _ => None, + } + } + + // Independent raw-history oracle. Intentionally does not call the projection's + // validator: original identity/digests and effective policy rights have distinct roles. + fn reference_structure(state: &AppState, grant: &ClaimRecord, policy: &ClaimRecord) -> bool { + let Some(original) = grant.body.get("fields").filter(|value| value.is_object()) else { return false }; + let Some(effective) = policy.body.get("fields").filter(|value| value.is_object()) else { return false }; + let parse_principal = reference_principal; + let valid = |claim: &ClaimRecord, source: &Value| { + let Some(principal) = parse_principal(source) else { return false }; + let Some(id) = source["grant_id"].as_str() else { return false }; + subject(id).is_ok_and(|subject| subject == claim.subject) + && claim.actor.as_deref() == state.owning_person.as_deref() + && source["issuer"].as_str() == state.owning_person.as_deref() + && source["session_actor"].as_str() == Some(format!("{principal}/session/{id}").as_str()) + && matches!(source.get("profile"), None | Some(Value::String(_))) + && source.get("profile").is_none_or(|value| value == "assistant" || value == "service") + && !["credential", "code"].iter().any(|key| source.get(*key).is_some()) + && ["credential_hash", "code_hash"].iter().all(|key| source.get(*key).is_none_or(|value| + value.as_str().is_some_and(|digest| digest.len() == 64 + && digest.bytes().all(|byte| byte.is_ascii_hexdigit())))) + }; + let service = original["profile"]=="service" + && parse_principal(original).is_some_and(|principal| principal.starts_with("plugin/")); + grant.origin == policy.origin && grant.subject == policy.subject + && valid(grant, original) && valid(policy, effective) + && (service || (matches!(effective["minimal_read_mode"].as_str(), Some("approval-once" | "caller-bound-allow")) + && effective["disclosure_consent"] == true)) + && effective["expires_at_unix_ms"].as_u64().is_some() + && effective["scopes"].as_array().is_some_and(|scopes| + scopes.iter().all(|scope| scope.as_str().is_some_and(|scope| + if service { SERVICE_SCOPES.contains(&scope) } else { SCOPES.contains(&scope) }))) + && original["credential_hash"].as_str().is_some() + && parse_principal(original) == parse_principal(effective) + && ["grant_id", "session_actor", "issuer", "profile"].iter() + .all(|key| original.get(*key) == effective.get(*key)) + } + + // Deliberately walk subject history rather than reuse the production SQL + // transition selector, effective-policy fold, or revocation helper. + pub(super) fn reference_transition(state: &AppState, grant: &ClaimRecord, kind: &str) + -> Result, ApiError> { + let original = fields(grant)?; + let mut history = state.store.claims_for(&grant.subject, Some(kind)).map_err(ApiError::internal)?; + history.sort_by_key(|claim| std::cmp::Reverse(claim.store_index)); + for claim in history { + let Ok(source) = fields(&claim) else { continue }; + if claim.origin != grant.origin || claim.actor.as_deref() != Some(owning_person(state)?) + || source["issuer"] != owning_person(state)? + || source["grant_id"] != original["grant_id"] + || source["issuer"] != original["issuer"] + || reference_principal(source) != reference_principal(original) + || reference_principal(source).is_none() + || Profile::stored(source).ok() != Profile::stored(original).ok() + || Profile::stored(source).is_err() { + continue; + } + if kind == POLICY && !reference_structure(state, grant, &claim) { + continue; + } + if grant.origin != state.store.origin() + && !state.store.claim_has_authenticated_member_writer(&claim.id).map_err(ApiError::internal)? { + continue; + } + return Ok(Some(claim)); + } + Ok(None) + } + + // Independent Rust-only candidate scan: C's authenticated transition and + // typed-conflict semantics, without the production SQL active prefilter. + pub(super) fn rust_only_admission(state: &AppState, source: &Value) -> Result<(), ApiError> { let profile = Profile::stored(source)?; let principal = principal(source)?; + owning_person(state)?; let ids = { let connection = state.store.readers.get(); let mut query = connection.prepare( @@ -474,15 +670,20 @@ mod tests { for id in ids { let grant = state.store.claim_by_id(&id).map_err(ApiError::internal)? .ok_or_else(|| forbidden("external grant is absent"))?; - if grant.origin != state.store.origin() || grant.actor.as_deref() != Some(owning_person(state)?) - || latest(state, &grant.subject, REVOKED)?.is_some() { + if grant.actor.as_deref() != Some(owning_person(state)?) + || (grant.origin != state.store.origin() + && !state.store.claim_has_authenticated_member_writer(&grant.id).map_err(ApiError::internal)?) + || reference_transition(state, &grant, REVOKED)?.is_some() { continue; } - let policy = effective(state, &grant)?; + let policy = reference_transition(state, &grant, POLICY)?.unwrap_or_else(|| grant.clone()); + if !reference_structure(state, &grant, &policy) { continue; } let active = fields(&policy)?; if active["expires_at_unix_ms"].as_u64().map(u128::from).unwrap_or(0) > admission_now_ms() { - profile.compatible(Profile::stored(fields(&grant)?)?)?; - profile.compatible(Profile::stored(active)?)?; + Profile::stored(fields(&grant)?)?.compatible(Profile::stored(active)?)?; + if profile != Profile::stored(active)? { + return Err(conflict_error()); + } } } Ok(()) @@ -502,15 +703,18 @@ mod tests { ("equal-boundary", json!({"expires_at_unix_ms":100}), vec![], 0, false, false), ("null-expiry", json!({"expires_at_unix_ms":null}), vec![], 0, false, false), ("missing-expiry", json!({}), vec![], 0, false, false), - ("replicated-revoke", json!({"expires_at_unix_ms":101}), vec![], 1, true, false), + ("replicated-revoke", json!({"expires_at_unix_ms":101}), vec![], 1, true, true), ("revoke-of-revoke", json!({"expires_at_unix_ms":101}), vec![], 2, false, false), ("several-policies-live", json!({"expires_at_unix_ms":99}), vec![102, 98, 101], 0, false, true), ("several-policies-expired", json!({"expires_at_unix_ms":101}), vec![99, 102, 100], 0, false, false), + ("renewed-expired-base", json!({"expires_at_unix_ms":99}), vec![98, 100, 102], 0, false, true), + ("shortened-long-policy", json!({"expires_at_unix_ms":99}), vec![1000, 99], 0, false, false), + ("wrong-origin-future-policy", json!({"expires_at_unix_ms":99}), vec![98, 99], 0, false, false), ("unrelated-principal", json!({"expires_at_unix_ms":101}), vec![], 0, false, false), ("legacy-default-principal", json!({"expires_at_unix_ms":101}), vec![], 0, false, true), - ("null-principal", json!({"expires_at_unix_ms":101}), vec![], 0, false, true), + ("null-principal", json!({"expires_at_unix_ms":101}), vec![], 0, false, false), ("mcp-principal", json!({"expires_at_unix_ms":101}), vec![], 0, false, true), - ("service-principal-live", json!({"expires_at_unix_ms":101}), vec![], 0, false, true), + ("service-principal-live", json!({"expires_at_unix_ms":101}), vec![], 0, false, false), ("service-principal-expired", json!({"expires_at_unix_ms":99}), vec![], 0, false, false), ]; for (name, mut source, policies, revokes, replicated, denied) in cases { @@ -518,17 +722,24 @@ mod tests { let mut state = crate::api::tests_shared::state(root.path()); state.owning_person = Some("person/owner".into()); let service_namespace = name.starts_with("service-principal-"); - source["profile"] = json!(if service_namespace { "assistant" } else { "service" }); + source["profile"] = json!("service"); if service_namespace { - // Legacy persisted opposite-profile evidence must still fence - // a valid plugin principal, without relaxing issuance parsing. source["principal"] = json!("plugin/test/reader"); } else if name == "null-principal" { source["principal"] = Value::Null; } else if name != "legacy-default-principal" { source["principal"] = json!(if matches!(name, "unrelated-principal" | "mcp-principal") { MCP_PRINCIPAL } else { PRINCIPAL }); } - let subject = format!("custom/client/differential-{name}"); + let id = "0123456789abcdef01234567"; + let subject = subject(id).unwrap(); + source["grant_id"] = json!(id); + source["issuer"] = json!("person/owner"); + let stored_principal = source["principal"].as_str().unwrap_or(PRINCIPAL); + source["session_actor"] = json!(format!("{stored_principal}/session/{id}")); + source["minimal_read_mode"] = json!("approval-once"); + source["disclosure_consent"] = json!(true); + source["credential_hash"] = json!("a".repeat(64)); + source["scopes"] = json!([]); let append_fixture = |store: &Store, kind: &str, value: Value, previous: Option<&ClaimRecord>| { store.append_claim(&ClaimInput { subject:subject.clone(), kind:kind.into(), actor:Some("person/owner".into()), @@ -543,11 +754,18 @@ mod tests { policy["expires_at_unix_ms"] = json!(expiry); previous = append_fixture(&state.store, POLICY, policy, Some(&previous)); } + if name == "wrong-origin-future-policy" { + let peer = Store::open_memory("overlay").unwrap(); + let mut forged = source.clone(); + forged["expires_at_unix_ms"] = json!(u64::MAX); + append_fixture(&peer, POLICY, forged, None); + state.store.import_replication("overlay", &peer.export_replication(0).unwrap()).unwrap(); + } if replicated { let peer = Store::open_memory("peer").unwrap(); let revoke = append_fixture(&peer, REVOKED, source.clone(), None); state.store.import_replication("peer", &peer.export_replication(0).unwrap()).unwrap(); - let imported = latest(&state, &subject, REVOKED).unwrap().unwrap(); + let imported = state.store.claim_by_id(&revoke.id).map_err(ApiError::internal).unwrap().unwrap(); assert_eq!(imported.id, revoke.id); assert_eq!(imported.origin, "peer"); } else { @@ -576,51 +794,37 @@ mod tests { } #[test] - fn admission_sql_filters_only_inactive_effective_policies() { - let connection = rusqlite::Connection::open_in_memory().unwrap(); - connection.execute_batch( - "CREATE TABLE claims(id TEXT,subject TEXT,kind TEXT,body TEXT,store_index INTEGER PRIMARY KEY); - CREATE INDEX principal_scan ON claims(kind,COALESCE(json_extract(body,'$.fields.principal'),'assistant/chatgpt')); - CREATE INDEX subject_kind ON claims(subject,kind,store_index);" - ).unwrap(); - let fixtures = [ - ("expired", json!({"fields":{"expires_at_unix_ms":99}}), None, false), - ("live", json!({"fields":{"expires_at_unix_ms":101}}), None, true), - ("boundary", json!({"fields":{"expires_at_unix_ms":100}}), None, false), - ("max", json!({"fields":{"expires_at_unix_ms":u64::MAX}}), None, true), - ("negative", json!({"fields":{"expires_at_unix_ms":-1}}), None, false), - ("string", json!({"fields":{"expires_at_unix_ms":"101"}}), None, false), - ("float", json!({"fields":{"expires_at_unix_ms":101.0}}), None, false), - ("absent-expiry", json!({"fields":{}}), None, false), - // Missing fields must still reach fields() and its existing error. - ("absent-fields", json!({}), None, true), - ("renewed", json!({"fields":{"expires_at_unix_ms":99}}), - Some(json!({"fields":{"expires_at_unix_ms":101}})), true), - ("shortened", json!({"fields":{"expires_at_unix_ms":101}}), - Some(json!({"fields":{"expires_at_unix_ms":99}})), false), - ("invalid-policy", json!({"fields":{"expires_at_unix_ms":99}}), - Some(json!({})), true), - ]; - let mut expected = Vec::new(); - for (id, grant, policy, included) in fixtures { - connection.execute("INSERT INTO claims(id,subject,kind,body) VALUES(?1,?1,?2,?3)", - rusqlite::params![id, GRANTED, grant.to_string()]).unwrap(); - if let Some(policy) = policy { - connection.execute("INSERT INTO claims(id,subject,kind,body) VALUES(?1,?2,?3,?4)", - rusqlite::params![format!("{id}-policy"), id, POLICY, policy.to_string()]).unwrap(); + fn projection_candidates_apply_effective_expiry_including_repaired_original_expiry() { + for (expiry, policy_expiry, included) in [ + (json!(99), None, false), (json!(101), None, true), + (json!(100), None, false), (json!(u64::MAX), None, true), + (json!(-1), None, false), (json!("101"), None, false), + (json!(101.0), None, false), (Value::Null, None, false), + (json!(99), Some(101), true), (json!(101), Some(99), false), + (Value::Null, Some(101), true), + ] { + let root = tempfile::tempdir().unwrap(); + let mut state = crate::api::tests_shared::state(root.path()); + state.owning_person = Some("person/owner".into()); + let id = "0123456789abcdef01234567"; + let subject = subject(id).unwrap(); + let mut source = json!({"grant_id":id,"issuer":"person/owner", + "session_actor":format!("{PRINCIPAL}/session/{id}"), + "credential_hash":"a".repeat(64),"minimal_read_mode":"approval-once", + "disclosure_consent":true,"scopes":[],"expires_at_unix_ms":expiry}); + let append = |kind: &str, source: Value| state.store.append_claim(&ClaimInput { + subject:subject.clone(),kind:kind.into(),actor:Some("person/owner".into()), + fields:serde_json::from_value(source).unwrap(),evidence:Vec::new(), + expected_subject:None,idempotency_key:None, + }).unwrap(); + let granted = append(GRANTED, source.clone()); + if let Some(expiry) = policy_expiry { + source["expires_at_unix_ms"] = json!(expiry); + append(POLICY, source); } - if included { expected.push(id.to_owned()); } + let candidates = candidate_grants(&state, PRINCIPAL, Some(100)).unwrap(); + assert_eq!(candidates.iter().any(|(claim, _)| claim.id == granted.id), included); } - let mut found = connection.prepare(ADMISSION_QUERY).unwrap() - .query_map(rusqlite::params![GRANTED, PRINCIPAL, REVOKED, POLICY, 100_u64], - |row| row.get::<_, String>(0)).unwrap().collect::, _>>().unwrap(); - found.sort(); - expected.sort(); - assert_eq!(found, expected); - let unfiltered = connection.prepare(ADMISSION_QUERY).unwrap() - .query_map(rusqlite::params![GRANTED, PRINCIPAL, REVOKED, POLICY, Option::::None], - |row| row.get::<_, String>(0)).unwrap().collect::, _>>().unwrap(); - assert_eq!(unfiltered.len(), 12, "invalid owner configuration must not hide validation errors"); } #[test] @@ -639,14 +843,22 @@ mod tests { let root = tempfile::tempdir().unwrap(); let mut state = crate::api::tests_shared::state(root.path()); state.owning_person = Some("person/owner".into()); - let source = json!({"principal":PRINCIPAL,"issuer":"person/owner", - "expires_at_unix_ms":u64::MAX,"credential_hash":credential_digest("private bearer")}); + let mut source = json!({"principal":PRINCIPAL,"issuer":"person/owner", + "expires_at_unix_ms":u64::MAX,"credential_hash":credential_digest("private bearer"), + "minimal_read_mode":"approval-once","disclosure_consent":true,"scopes":[]}); for id in ["111111111111111111111111", "222222222222222222222222"] { + source["grant_id"] = json!(id); + source["session_actor"] = json!(format!("{PRINCIPAL}/session/{id}")); append(&state, subject(id).unwrap(), GRANTED, "person/owner", source.clone(), None).unwrap(); } let service_subject = subject("333333333333333333333333").unwrap(); let mut service = source.clone(); service["profile"] = json!("service"); + service["grant_id"] = json!("333333333333333333333333"); + service["session_actor"] = json!(format!("{PRINCIPAL}/session/333333333333333333333333")); + service["minimal_read_mode"] = json!("approval-once"); + service["disclosure_consent"] = json!(true); + service["scopes"] = json!([]); // Simulate an existing profile record without enabling service issuance. let grant = state.store.append_claim(&ClaimInput { subject: service_subject.clone(), kind: GRANTED.into(), actor: Some("person/owner".into()), @@ -654,19 +866,20 @@ mod tests { expected_subject: Some(None), idempotency_key: None, }).unwrap(); let next = subject("444444444444444444444444").unwrap(); + source["grant_id"] = json!("444444444444444444444444"); + source["session_actor"] = json!(format!("{PRINCIPAL}/session/444444444444444444444444")); assert!(append(&state, next.clone(), GRANTED, "person/owner", source.clone(), None).is_err()); assert!(latest(&state, &next, GRANTED).unwrap().is_none()); - state.store.append_claim(&ClaimInput { - subject: service_subject, kind: REVOKED.into(), actor: Some("person/owner".into()), - fields: BTreeMap::new(), evidence: vec![grant.id.clone()], - expected_subject: Some(Some(grant.id.clone())), idempotency_key: None, - }).unwrap(); - let candidates = { - let connection = state.store.readers.get(); - connection.prepare(ADMISSION_QUERY).unwrap() - .query_map(rusqlite::params![GRANTED, PRINCIPAL, REVOKED, POLICY, client_now_ms() as u64], |row| row.get::<_, String>(0)) - .unwrap().collect::, _>>().unwrap() - }; + let mut forged = fields(&grant).unwrap().clone(); + forged["profile"] = json!("assistant"); + assert!(append(&state, service_subject.clone(), REVOKED, "person/owner", + forged, Some(&grant)).is_err()); + assert!(append(&state, service_subject.clone(), REVOKED, "person/other", + fields(&grant).unwrap().clone(), Some(&grant)).is_err()); + append(&state, service_subject, REVOKED, "person/owner", + fields(&grant).unwrap().clone(), Some(&grant)).unwrap(); + let candidates = candidate_grants(&state, PRINCIPAL, Some(client_now_ms() as u64)).unwrap() + .into_iter().map(|(grant, _)| grant.id).collect::>(); assert_eq!(candidates.len(), 2); assert!(!candidates.contains(&grant.id), "revoked history must not reach the admission loop"); assert!(append(&state, next, GRANTED, "person/owner", source, None).is_ok()); @@ -728,7 +941,7 @@ mod tests { fields:serde_json::from_value(source).unwrap(), evidence:vec![granted.id.clone()], expected_subject:Some(Some(granted.id)), idempotency_key:None, }).unwrap(); - assert!(authenticate(&state, &credential_digest(&id), "unix").is_err()); + assert!(!matches!(authenticate(&state, &credential_digest(&id), "unix"), Ok(Some(_)))); } } diff --git a/crates/fractal-api-core/src/api/client_v0/external_grants/conflict_tests.rs b/crates/fractal-api-core/src/api/client_v0/external_grants/conflict_tests.rs new file mode 100644 index 00000000000..29333b9ef5e --- /dev/null +++ b/crates/fractal-api-core/src/api/client_v0/external_grants/conflict_tests.rs @@ -0,0 +1,711 @@ +use super::*; +use fractal_client::ErrorCode; +use smallclaims::fleet::MemberKey; +use std::collections::BTreeSet; +use std::sync::Arc; + +const FLEET: &str = "86700000-0000-4000-8000-000000000001"; +const OWNER: &str = "person/owner"; +const ASSISTANT_ID: &str = "111111111111111111111111"; +const SERVICE_ID: &str = "222222222222222222222222"; + +fn member(root: &std::path::Path, name: &str) -> AppState { + let mut state = crate::api::tests_shared::state(root); + state.store = Arc::new(Store::open_memory(name).unwrap()); + state.node = name.into(); + state.owning_person = Some(OWNER.into()); + state.fleet_id = Some(FLEET.into()); + state.store.bind_fleet(FLEET).unwrap(); + state +} + +fn replicate(from: &AppState, to: &AppState) { + let exchange = from.store.export_replication_exchange_answering( + FLEET, &to.store.replication_inventory().unwrap(), + &to.store.replication_signature_requests().unwrap(), + ).unwrap(); + to.store.receive_replication_exchange(from.store.origin(), FLEET, &exchange).unwrap(); + to.store.validate_replication_backlog().unwrap(); + to.store.project_replication_backlog().unwrap(); + while !to.store.advance_assistant_grant_authority_backfill().unwrap() {} +} + +fn admitted_pair(root: &std::path::Path) -> (AppState, AppState) { + admitted_pair_with_floor(root, 0) +} + +fn admitted_pair_with_floor(root: &std::path::Path, floor: u64) -> (AppState, AppState) { + let a = member(root, "alder"); + let b = member(root, "birch"); + b.store.set_writer_floor(floor).unwrap(); + let anchor = Arc::new(MemberKey::generate().unwrap().0); + let peer = Arc::new(MemberKey::generate().unwrap().0); + for (state, key) in [(&a, &anchor), (&b, &peer)] { + state.store.pin_fleet_anchor(anchor.public()).unwrap(); + state.store.set_member_key(Some(key.clone())).unwrap(); + } + a.store.admit_fleet_anchor(FLEET, anchor.public(), "listening").unwrap(); + raw_claim(&a, "host/birch", "fleet.member-admitted", OWNER, json!({ + "fleet_id":FLEET,"member_key":peer.public(),"via":"invite","mode":"listening", + "writer_floor":floor + })); + replicate(&a, &b); + assert!(matches!(b.store.fleet_membership().unwrap().state("birch"), + smallclaims::fleet::MemberState::Current(_))); + (a, b) +} + +// Service rows with this assistant principal are legacy persisted conflict +// evidence, never a service credential accepted by the strict bearer parser. +fn grant_fields(id: &str, profile: &str) -> Value { + json!({"profile":profile,"grant_id":id,"principal":PRINCIPAL, + "issuer":OWNER,"session_actor":format!("{PRINCIPAL}/session/{id}"), + "expires_at_unix_ms":u64::MAX,"minimal_read_mode":"approval-once", + "disclosure_consent":true,"scopes":["read.assistant.summary"], + "credential_hash":credential_digest(id)}) +} + +fn issue(state: &AppState, id: &str, profile: &str) -> Result { + let source = grant_fields(id, profile); + let subject = subject(id).unwrap(); + let begun = append(state, subject.clone(), BEGUN, OWNER, source.clone(), None)?; + append(state, subject, GRANTED, OWNER, source, Some(&begun)) +} + +fn legacy_service(state: &AppState, id: &str) -> ClaimRecord { + raw_claim(state, &subject(id).unwrap(), GRANTED, OWNER, grant_fields(id, "service")) +} + +fn raw_claim(state: &AppState, subject: &str, kind: &str, actor: &str, source: Value) -> ClaimRecord { + state.store.append_claim(&ClaimInput { + subject:subject.into(),kind:kind.into(),actor:Some(actor.into()), + fields:serde_json::from_value(source).unwrap(),evidence:Vec::new(), + expected_subject:None,idempotency_key:None, + }).unwrap() +} + +fn authenticate_id(state: &AppState, id: &str) -> Result, ApiError> { + authenticate(state, &credential_digest(id), "http") +} + +fn assert_legacy_bearer_forbidden(state: &AppState, id: &str) { + let error = authenticate_id(state, id).expect_err("legacy service evidence is not a bearer"); + assert_eq!(error.code, "forbidden"); + assert_eq!(error.status, StatusCode::FORBIDDEN); + assert!(error.details.is_empty(), "legacy rejection must not expose owner witnesses"); +} + +fn assert_conflict(error: &ApiError) { + let typed: ErrorCode = serde_json::from_value(json!(error.code)).unwrap(); + assert_eq!(typed, ErrorCode::GrantProfileConflict); + assert_eq!(error.status, StatusCode::CONFLICT); + assert!(error.details.is_empty(), "bearer errors must not expose owner witnesses"); +} + +fn assert_witness(value: &Value) { + let rows = value["grants"].as_array().unwrap(); + assert_eq!(rows.len(), 2); + for (id, origin, profile) in [(ASSISTANT_ID, "alder", "assistant"), + (SERVICE_ID, "birch", "service")] { + assert!(rows.contains(&json!({"grant_id":id,"origin":origin,"profile":profile})), + "missing grant witness: {value}"); + } +} + +#[test] +fn disconnected_opposite_profiles_conflict_on_both_members_and_revocation_recovers() { + let root = tempfile::tempdir().unwrap(); + let (a, b) = admitted_pair(root.path()); + let assistant = issue(&a, ASSISTANT_ID, "assistant").unwrap(); + let service = legacy_service(&b, SERVICE_ID); + assert!(authenticate_id(&a, ASSISTANT_ID).unwrap().is_some()); + assert_legacy_bearer_forbidden(&b, SERVICE_ID); + replicate(&a, &b); + replicate(&b, &a); + for state in [&a, &b] { + for grant in [&assistant, &service] { + assert!(state.store.claim_has_authenticated_member_writer(&grant.id).unwrap()); + if fields(grant).unwrap()["profile"] == "assistant" { + assert_conflict(&authenticate_id(state, ASSISTANT_ID) + .expect_err("the assistant credential must be suspended on either member")); + } else { + assert_legacy_bearer_forbidden(state, SERVICE_ID); + } + assert_witness(&profile_conflict(state, grant).unwrap().unwrap()); + assert_witness(&projection_with_witness(state, grant).unwrap()["conflict"]); + } + } + append(&b, service.subject.clone(), REVOKED, OWNER, + fields(&service).unwrap().clone(), Some(&service)).unwrap(); + replicate(&b, &a); + for state in [&a, &b] { + for grant in [&assistant, &service] { + assert!(profile_conflict(state, grant).unwrap().is_none()); + assert!(projection_with_witness(state, grant).unwrap()["conflict"].is_null()); + } + assert!(authenticate_id(state, SERVICE_ID).is_err()); + let inspected = projection_with_witness(state, &assistant).unwrap(); + let cleared = inspected["cleared_conflicts"].as_array().unwrap(); + assert_eq!(cleared.len(), 1); + assert_eq!(cleared[0]["cause"], "revoked"); + assert_witness(&cleared[0]); + } + assert!(authenticate_id(&a, ASSISTANT_ID).unwrap().is_some()); + let foreign = authenticate_id(&b, ASSISTANT_ID).err().unwrap(); + assert_eq!(foreign.code, "forbidden"); + assert!(foreign.message.contains("authoritative grant issuer")); +} + +#[test] +fn expiry_boundary_clears_conflict_and_disconnected_reissue_recomputes_it() { + let root = tempfile::tempdir().unwrap(); + let (a, b) = admitted_pair(root.path()); + let assistant = issue(&a, ASSISTANT_ID, "assistant").unwrap(); + let service = legacy_service(&b, SERVICE_ID); + // Birch never receives Alder's assistant grant: it remains a disconnected + // issuer even as Alder receives its grants and policy transitions. + replicate(&b, &a); + assert_witness(&profile_conflict(&a, &assistant).unwrap().unwrap()); + + let mut policy = fields(&service).unwrap().clone(); + policy["expires_at_unix_ms"] = json!(100_u64); + raw_claim(&b, &service.subject, POLICY, OWNER, policy); + replicate(&b, &a); + for (now, expected_count, conflicted) in [(99_u64, 2, true), (100, 1, false), (101, 1, false)] { + let candidates = candidate_grants(&a, PRINCIPAL, Some(now)).unwrap(); + assert_eq!(candidates.len(), expected_count, "SQL/Rust expiry boundary at {now}"); + assert_eq!(candidates.iter().any(|(grant, _)| grant.id == service.id), conflicted); + assert_eq!(profile_conflict_at(&a, &assistant, now).unwrap().is_some(), conflicted); + assert_eq!(profile_conflict_at(&a, &service, now).unwrap().is_some(), conflicted); + assert_eq!(unexpired(fields(&effective(&a, &service).unwrap()).unwrap(), now), conflicted); + } + assert!(authenticate_id(&a, ASSISTANT_ID).unwrap().is_some()); + let inspected = projection_with_witness(&a, &assistant).unwrap(); + assert!(inspected["conflict"].is_null()); + let cleared = inspected["cleared_conflicts"].as_array().unwrap(); + assert_eq!(cleared.len(), 1); + assert_eq!(cleared[0]["cause"], "expired"); + assert_witness(&cleared[0]); + + let replacement_id = "333333333333333333333333"; + let replacement = legacy_service(&b, replacement_id); + replicate(&b, &a); + let witness = profile_conflict(&a, &assistant).unwrap().unwrap(); + let rows = witness["grants"].as_array().unwrap(); + assert_eq!(rows.len(), 2); + assert!(rows.contains(&json!({"grant_id":ASSISTANT_ID,"origin":"alder","profile":"assistant"}))); + assert!(rows.contains(&json!({"grant_id":replacement_id,"origin":"birch","profile":"service"}))); + assert!(!rows.iter().any(|row| row["grant_id"] == SERVICE_ID)); + assert!(profile_conflict(&a, &service).unwrap().is_none()); + assert!(profile_conflict(&a, &replacement).unwrap().is_some()); + assert_conflict(&authenticate_id(&a, ASSISTANT_ID).err().unwrap()); + assert_legacy_bearer_forbidden(&a, replacement_id); + let inspected = projection_with_witness(&a, &assistant).unwrap(); + assert_eq!(inspected["conflict"], witness); + assert!(inspected["cleared_conflicts"].is_null()); +} + +#[test] +fn same_profile_foreign_grants_do_not_conflict_or_authenticate_on_the_wrong_member() { + let root = tempfile::tempdir().unwrap(); + let (a, b) = admitted_pair(root.path()); + let first = issue(&a, ASSISTANT_ID, "assistant").unwrap(); + let second = issue(&b, SERVICE_ID, "assistant").unwrap(); + replicate(&a, &b); + replicate(&b, &a); + for state in [&a, &b] { + for grant in [&first, &second] { + assert!(profile_conflict(state, grant).unwrap().is_none()); + } + } + assert!(authenticate_id(&a, ASSISTANT_ID).unwrap().is_some()); + assert!(authenticate_id(&b, SERVICE_ID).unwrap().is_some()); + assert_eq!(authenticate_id(&a, SERVICE_ID).err().unwrap().code, "forbidden"); + assert_eq!(authenticate_id(&b, ASSISTANT_ID).err().unwrap().code, "forbidden"); +} + +#[test] +fn plugin_service_bearer_is_independent_of_assistant_profiles_and_bound_to_its_issuer() { + let root = tempfile::tempdir().unwrap(); + let (a, b) = admitted_pair(root.path()); + let assistant = issue(&a, ASSISTANT_ID, "assistant").unwrap(); + let mut source = grant_fields(SERVICE_ID, "service"); + source["principal"] = json!("plugin/test/reader"); + source["session_actor"] = json!(format!("plugin/test/reader/session/{SERVICE_ID}")); + source["scopes"] = json!(["read.claims", "read.work", "read.documents"]); + let service = raw_claim(&b, &subject(SERVICE_ID).unwrap(), GRANTED, OWNER, source); + let bearer = authenticate_id(&b, SERVICE_ID).unwrap().unwrap(); + assert_eq!(bearer.authority_actor, "plugin/test/reader"); + assert_eq!(bearer.actor, format!("plugin/test/reader/session/{SERVICE_ID}")); + assert_eq!(bearer.scopes, BTreeSet::from([ + "read.claims".to_owned(), "read.work".to_owned(), "read.documents".to_owned()])); + replicate(&a, &b); + replicate(&b, &a); + for state in [&a, &b] { + for grant in [&assistant, &service] { + assert!(state.store.claim_has_authenticated_member_writer(&grant.id).unwrap()); + assert!(profile_conflict(state, grant).unwrap().is_none()); + assert!(projection_with_witness(state, grant).unwrap()["conflict"].is_null()); + } + assert_eq!(candidate_grants(state, PRINCIPAL, Some(0)).unwrap().len(), 1); + assert_eq!(candidate_grants(state, "plugin/test/reader", Some(0)).unwrap().len(), 1); + } + assert!(authenticate_id(&a, ASSISTANT_ID).unwrap().is_some()); + assert!(authenticate_id(&b, SERVICE_ID).unwrap().is_some()); + for (state, id) in [(&a, SERVICE_ID), (&b, ASSISTANT_ID)] { + let error = authenticate_id(state, id).unwrap_err(); + assert_eq!(error.code, "forbidden"); + assert!(error.message.contains("authoritative grant issuer")); + } +} + +#[test] +fn admission_refuses_a_known_authenticated_foreign_opposite_profile() { + let root = tempfile::tempdir().unwrap(); + let (a, b) = admitted_pair(root.path()); + legacy_service(&b, SERVICE_ID); + replicate(&b, &a); + let error = issue(&a, ASSISTANT_ID, "assistant").err().unwrap(); + assert_conflict(&error); + assert!(latest(&a, &subject(ASSISTANT_ID).unwrap(), GRANTED).unwrap().is_none()); +} + +#[test] +fn malformed_local_owner_actor_grants_cannot_suspend_a_local_credential() { + let root = tempfile::tempdir().unwrap(); + for invalid in ["profile", "grant_id", "principal", "issuer", "session_actor", + "minimal_read_mode", "disclosure_consent", "scopes", "credential_hash"] { + let state = member(root.path(), "alder"); + let local = issue(&state, ASSISTANT_ID, "assistant").unwrap(); + let mut source = grant_fields(SERVICE_ID, "service"); + source[invalid] = Value::Null; + let malformed = raw_claim(&state, &subject(SERVICE_ID).unwrap(), GRANTED, OWNER, source); + assert_eq!(malformed.origin, local.origin); + assert_eq!(malformed.actor.as_deref(), Some(OWNER)); + assert!(profile_conflict(&state, &local).unwrap().is_none(), "{invalid}"); + assert!(authenticate_id(&state, ASSISTANT_ID).unwrap().is_some(), "{invalid}"); + assert!(projection_with_witness(&state, &local).unwrap()["conflict"].is_null(), "{invalid}"); + } +} + +// Same shape as fleet::service_grants' rollback counterexample: a service grant +// with a non-assistant scope (3), an assistant grant (4) and legacy service +// conflict evidence (7), all active for assistant/chatgpt on one member. +#[test] +fn compat_counterexample_suspends_the_valid_pair_and_refuses_the_malformed_service() { + let root = tempfile::tempdir().unwrap(); + let state = member(root.path(), "issuer"); + let [malformed, assistant, service] = ["000000000000000000000003", + "000000000000000000000004", "000000000000000000000007"]; + let mut source = grant_fields(malformed, "service"); + source["scopes"] = json!(["read.service.status"]); + raw_claim(&state, &subject(malformed).unwrap(), GRANTED, OWNER, source); + issue(&state, assistant, "assistant").unwrap(); + raw_claim(&state, &subject(service).unwrap(), GRANTED, OWNER, grant_fields(service, "service")); + assert_conflict(&authenticate_id(&state, assistant) + .expect_err("valid legacy opposite-profile evidence suspends the assistant")); + assert_legacy_bearer_forbidden(&state, service); + assert!(authenticate_id(&state, malformed).unwrap().is_none(), + "malformed service evidence must not enter bearer authority"); +} + +#[test] +fn malformed_authenticated_foreign_grants_cannot_suspend_a_local_credential() { + let root = tempfile::tempdir().unwrap(); + // Each case is independently a signed admitted writer's claim, rather than + // an unsigned claim rejected before it can exercise the conflict scanner. + for invalid in ["profile", "grant_id", "principal", "issuer", "session_actor", + "minimal_read_mode", "disclosure_consent", "scopes", "credential_hash", "actor"] { + let (a, b) = admitted_pair(root.path()); + let local = issue(&a, ASSISTANT_ID, "assistant").unwrap(); + let mut source = grant_fields(SERVICE_ID, "service"); + if invalid != "actor" { + source[invalid] = Value::Null; + } + let foreign = raw_claim(&b, &subject(SERVICE_ID).unwrap(), GRANTED, + if invalid == "actor" { "person/intruder" } else { OWNER }, source); + replicate(&b, &a); + assert!(a.store.claim_by_id(&foreign.id).unwrap().is_some(), "{invalid}"); + assert!(a.store.claim_has_authenticated_member_writer(&foreign.id).unwrap(), "{invalid}"); + assert!(profile_conflict(&a, &local).unwrap().is_none(), "{invalid}"); + assert!(authenticate_id(&a, ASSISTANT_ID).unwrap().is_some(), "{invalid}"); + } +} + +#[test] +fn foreign_policy_with_mismatched_identity_cannot_clear_a_conflict() { + let root = tempfile::tempdir().unwrap(); + let (a, b) = admitted_pair(root.path()); + let local = issue(&a, ASSISTANT_ID, "assistant").unwrap(); + let foreign = legacy_service(&b, SERVICE_ID); + let mut policy = fields(&foreign).unwrap().clone(); + policy["session_actor"] = json!("assistant/chatgpt/session/333333333333333333333333"); + raw_claim(&b, &foreign.subject, POLICY, OWNER, policy); + replicate(&b, &a); + assert!(profile_conflict(&a, &local).unwrap().is_some()); + assert_conflict(&authenticate_id(&a, ASSISTANT_ID).err().unwrap()); +} + +#[test] +fn wrong_origin_revocation_and_expired_policy_cannot_clear_conflict() { + let root = tempfile::tempdir().unwrap(); + for kind in [REVOKED, POLICY] { + let (a, b) = admitted_pair(root.path()); + let local = issue(&a, ASSISTANT_ID, "assistant").unwrap(); + let foreign = legacy_service(&b, SERVICE_ID); + replicate(&a, &b); + replicate(&b, &a); + let mut overlay = fields(&foreign).unwrap().clone(); + if kind == POLICY { + overlay["expires_at_unix_ms"] = json!(1_u64); + } + // An admitted, signed writer with an owner-shaped actor still cannot + // mutate another member's grant lifecycle. + let malicious = raw_claim(&a, &foreign.subject, kind, OWNER, overlay); + replicate(&a, &b); + for state in [&a, &b] { + assert!(state.store.claim_has_authenticated_member_writer(&malicious.id).unwrap()); + assert_eq!(effective(state, &foreign).unwrap().id, foreign.id); + assert_witness(&profile_conflict(state, &local).unwrap().unwrap()); + assert_conflict(&authenticate_id(state, ASSISTANT_ID).err().unwrap()); + assert_legacy_bearer_forbidden(state, SERVICE_ID); + let inspected = projection_with_witness(state, &local).unwrap(); + assert!(inspected["conflict"].is_object()); + assert!(inspected["cleared_conflicts"].is_null()); + } + } +} + +#[test] +fn malformed_same_origin_expired_policy_keeps_the_last_valid_live_policy() { + let root = tempfile::tempdir().unwrap(); + let (a, b) = admitted_pair(root.path()); + let local = issue(&a, ASSISTANT_ID, "assistant").unwrap(); + let foreign = legacy_service(&b, SERVICE_ID); + let mut live = fields(&foreign).unwrap().clone(); + live["policy_revision"] = json!(2); + let live = raw_claim(&b, &foreign.subject, POLICY, OWNER, live); + let mut malformed = fields(&live).unwrap().clone(); + malformed["expires_at_unix_ms"] = json!(1_u64); + malformed["session_actor"] = json!("assistant/chatgpt/session/not-this-grant"); + raw_claim(&b, &foreign.subject, POLICY, OWNER, malformed); + replicate(&a, &b); + replicate(&b, &a); + for state in [&a, &b] { + assert_eq!(effective(state, &foreign).unwrap().id, live.id); + assert_witness(&profile_conflict(state, &local).unwrap().unwrap()); + assert_conflict(&authenticate_id(state, ASSISTANT_ID).err().unwrap()); + } +} + +#[test] +fn unauthenticated_legacy_transitions_preserve_authenticated_lifecycle_history() { + let root = tempfile::tempdir().unwrap(); + for (scenario, kind) in [("renewal", POLICY), ("renewal", REVOKED), + ("narrowing", POLICY), ("revocation", REVOKED)] { + let (a, b) = admitted_pair_with_floor(root.path(), 10); + let local = issue(&a, ASSISTANT_ID, "assistant").unwrap(); + let mut expired = grant_fields(SERVICE_ID, "service"); + expired["expires_at_unix_ms"] = json!(if scenario == "renewal" { 1_u64 } else { u64::MAX }); + let foreign = raw_claim(&b, &subject(SERVICE_ID).unwrap(), GRANTED, OWNER, expired); + let mut live = fields(&foreign).unwrap().clone(); + live["expires_at_unix_ms"] = json!(if scenario == "narrowing" { 1_u64 } else { u64::MAX }); + let live = raw_claim(&b, &foreign.subject, POLICY, OWNER, live); + let authentic_revoke = (scenario == "revocation").then(|| + raw_claim(&b, &foreign.subject, REVOKED, OWNER, fields(&foreign).unwrap().clone())); + replicate(&b, &a); + assert!(a.store.claim_has_authenticated_member_writer(&foreign.id).unwrap()); + assert!(a.store.claim_has_authenticated_member_writer(&live.id).unwrap()); + if let Some(revoke) = &authentic_revoke { + assert!(a.store.claim_has_authenticated_member_writer(&revoke.id).unwrap()); + } + assert_eq!(effective(&a, &foreign).unwrap().id, live.id); + assert_eq!(revoked(&a, &foreign).unwrap(), scenario == "revocation"); + + // A different incarnation of the same writer sends a signed envelope + // below the admission floor. It is visible Legacy data, not authority, + // even though origin, owner actor and immutable grant identity match. + let legacy = member(root.path(), "birch"); + legacy.store.set_member_key(Some(Arc::new(MemberKey::generate().unwrap().0))).unwrap(); + let mut source = fields(&foreign).unwrap().clone(); + source["expires_at_unix_ms"] = json!(if scenario == "narrowing" { u64::MAX } else { 1_u64 }); + let overlay = raw_claim(&legacy, &foreign.subject, kind, OWNER, source); + replicate(&legacy, &a); + let overlay = a.store.claim_by_id(&overlay.id).unwrap().unwrap(); + let retained = a.store.claim_by_id(&live.id).unwrap().unwrap(); + assert!(overlay.store_index > retained.store_index); + assert_eq!(overlay.origin, foreign.origin); + assert_eq!(overlay.actor, foreign.actor); + let connection = a.store.readers.get(); + let (signatures, sequence): (u64, u64) = connection.query_row( + "SELECT count(*),max(sequence) FROM replica_records JOIN replica_envelope_signatures + USING(writer,sequence,envelope_hash) WHERE claim_id=?1", + [&overlay.id], |row| Ok((row.get(0)?, row.get(1)?))).unwrap(); + assert!(signatures > 0, "this regression must pass the signature-row prefilter"); + drop(connection); + assert!(matches!(a.store.fleet_membership().unwrap().window("birch", sequence), + smallclaims::fleet::Window::Legacy)); + assert!(!a.store.claim_has_authenticated_member_writer(&overlay.id).unwrap()); + assert_eq!(tests::reference_transition(&a, &foreign, POLICY).unwrap().unwrap().id, live.id); + assert_eq!(tests::reference_transition(&a, &foreign, REVOKED).unwrap().map(|claim| claim.id), + authentic_revoke.as_ref().map(|claim| claim.id.clone())); + // Maintenance has finished, but this below-floor incarnation cannot + // authenticate. Its retained transition still fences its own subject; + // it must neither grant bearer access nor replace the last authenticated + // snapshot used for cross-subject conflict admission. + assert!(authenticate_id(&a, SERVICE_ID).unwrap().is_none()); + for error in [ + effective(&a, &foreign).unwrap_err(), + revoked(&a, &foreign).unwrap_err(), + ] { + assert_eq!(error.code, "forbidden"); + assert_eq!(error.details["reason"], "credential-rejected"); + } + let candidate = json!({"profile":"assistant","principal":PRINCIPAL}); + let reference = tests::rust_only_admission(&a, &candidate).map_err(|error| error.code); + let production = admit_profile(&a, &candidate).map_err(|error| error.code); + assert_eq!(production, reference, "{scenario}/{kind}: independent provenance-aware oracle"); + assert_eq!(production.is_err(), scenario == "renewal"); + if scenario == "renewal" { + assert_witness(&profile_conflict(&a, &local).unwrap().unwrap()); + assert_conflict(&authenticate_id(&a, ASSISTANT_ID).expect_err("the old renewal remains active")); + } else { + assert!(profile_conflict(&a, &local).unwrap().is_none()); + assert!(authenticate_id(&a, ASSISTANT_ID).unwrap().is_some()); + } + } +} + +#[test] +fn signed_revocation_arriving_before_its_grant_converges_without_conflict() { + let root = tempfile::tempdir().unwrap(); + let (a, b) = admitted_pair(root.path()); + let local = issue(&a, ASSISTANT_ID, "assistant").unwrap(); + replicate(&a, &b); + let source = grant_fields(SERVICE_ID, "service"); + let subject = subject(SERVICE_ID).unwrap(); + // Replicated custom lifecycle claims are open data. Import the authentic + // revocation first, while its grant is absent, then import that grant. + let revoked = raw_claim(&b, &subject, REVOKED, OWNER, source.clone()); + replicate(&b, &a); + assert!(latest(&a, &subject, GRANTED).unwrap().is_none()); + assert!(a.store.claim_by_id(&revoked.id).unwrap().is_some()); + assert!(authenticate_id(&a, ASSISTANT_ID).unwrap().is_some()); + let granted = raw_claim(&b, &subject, GRANTED, OWNER, source); + replicate(&b, &a); + for state in [&a, &b] { + let revoked = state.store.claim_by_id(&revoked.id).unwrap().unwrap(); + let granted = state.store.claim_by_id(&granted.id).unwrap().unwrap(); + assert!(revoked.store_index < granted.store_index); + assert!(state.store.claim_has_authenticated_member_writer(&revoked.id).unwrap()); + assert!(state.store.claim_has_authenticated_member_writer(&granted.id).unwrap()); + assert!(profile_conflict(state, &local).unwrap().is_none()); + assert!(profile_conflict(state, &granted).unwrap().is_none()); + let inspected = projection_with_witness(state, &local).unwrap(); + let cleared = inspected["cleared_conflicts"].as_array().unwrap(); + assert_eq!(cleared.len(), 1); + assert_eq!(cleared[0]["cause"], "revoked"); + assert_witness(&cleared[0]); + } + assert!(authenticate_id(&a, ASSISTANT_ID).unwrap().is_some()); +} + +#[test] +fn unverifiable_foreign_grant_cannot_suspend_a_local_credential() { + let root = tempfile::tempdir().unwrap(); + // Legacy replication projects unsigned envelopes. Mere visibility and an + // owner-shaped actor are not sufficient provenance for a conflict witness. + let a = member(root.path(), "alder"); + let b = member(root.path(), "birch"); + let local = issue(&a, ASSISTANT_ID, "assistant").unwrap(); + let foreign = raw_claim(&b, &subject(SERVICE_ID).unwrap(), GRANTED, OWNER, + grant_fields(SERVICE_ID, "service")); + replicate(&b, &a); + assert!(a.store.claim_by_id(&foreign.id).unwrap().is_some()); + assert!(!a.store.claim_has_authenticated_member_writer(&foreign.id).unwrap()); + assert!(profile_conflict(&a, &local).unwrap().is_none()); + assert!(authenticate_id(&a, ASSISTANT_ID).unwrap().is_some()); +} + +#[test] +fn admission_reads_the_authority_projection_index() { + let root = tempfile::tempdir().unwrap(); + let state = member(root.path(), "alder"); + let grant = issue(&state, ASSISTANT_ID, "assistant").unwrap(); + let candidates = candidate_grants(&state, PRINCIPAL, Some(client_now_ms() as u64)).unwrap(); + assert_eq!(candidates.len(), 1); + assert_eq!(candidates[0].0.id, grant.id); + let connection = state.store.readers.get(); + let mut query = connection.prepare(/* sqlite-large-value: allow-for-now lv-ha14d9df71ca8 owner=fractal_api_core::api::client_v0::external_grants::conflict_tests TODO=trace-statement-and-value-representation */ &format!("EXPLAIN QUERY PLAN {}", authority::CANDIDATES_QUERY)).unwrap(); + let expiry = authority::expiry_key(client_now_ms() as u64); + let plan = query.query_map(rusqlite::params![PRINCIPAL, OWNER, expiry, + Option::<&str>::None, Option::<&str>::None], |row| row.get::<_, String>(3)).unwrap() + .collect::, _>>().unwrap(); + assert!(plan.iter().any(|step| step.contains("assistant_grant_effective_active_index")), + "admission must use the effective authority projection: {plan:?}"); + assert!(plan.iter().all(|step| !step.contains("claims")), + "admission must never scan raw claim history: {plan:?}"); +} + +#[test] +fn p1_policy_candidates_keep_read_acquisitions_bounded_with_expired_history() { + // Profiling is process-global, so isolate it using the profiler's own + // subprocess convention instead of mutating parallel tests' environment. + const CHILD: &str = "FRACTAL_POLICY_CANDIDATE_PROFILE_CHILD"; + if std::env::var_os(CHILD).is_none() { + let directory = tempfile::tempdir().unwrap(); + let status = std::process::Command::new(std::env::current_exe().unwrap()) + .args(["--exact", + "api::client_v0::external_grants::conflict_tests::p1_policy_candidates_keep_read_acquisitions_bounded_with_expired_history", + "--nocapture"]) + .env(CHILD, "1") + .env("ST3_PROFILE_DIR", directory.path()) + .env("ST3_PROFILE_SLOW_MS", "0") + .status().unwrap(); + assert!(status.success(), "isolated policy candidate regression failed"); + let log = std::fs::read_to_string(directory.path().join("slow.jsonl")).unwrap(); + let rows = log.lines().map(|line| serde_json::from_str::(line).unwrap()) + .collect::>(); + let acquisitions = |label: &str| rows.iter().find(|row| row["label"] == label) + .unwrap()["read_acquisitions"].as_u64().unwrap(); + let before = acquisitions("p1-policy-candidates-before"); + let after = acquisitions("p1-policy-candidates-after"); + assert!(before > 0, "the measured scan must acquire real read connections"); + assert_eq!(after, before, "expired policy history and wrong-origin renewals must be pruned before per-grant reads"); + let two = acquisitions("p1-authentication-n2"); + let six = acquisitions("p1-authentication-n6"); + assert!(two > 0, "authentication must acquire real read connections"); + assert_eq!(six, two, "authenticated foreign candidates must use constant-N batched reads"); + return; + } + smallclaims::profile::init_from_env(); + let root = tempfile::tempdir().unwrap(); + let a = member(root.path(), "alder"); + let b = member(root.path(), "birch"); + let local = issue(&a, ASSISTANT_ID, "assistant").unwrap(); + let measure = |label: &'static str| { + let operation = smallclaims::profile::Op::start(label, None).unwrap(); + { + let _entered = operation.enter(); + let candidates = candidate_grants(&a, PRINCIPAL, Some(100)).unwrap(); + assert_eq!(candidates.len(), 1); + assert_eq!(candidates[0].0.id, local.id); + } + operation.finish(); + }; + measure("p1-policy-candidates-before"); + for index in 0..128 { + let id = format!("{:024x}", index + 1000); + let subject = subject(&id).unwrap(); + let mut expired = grant_fields(&id, "service"); + expired["expires_at_unix_ms"] = json!(1); + raw_claim(&a, &subject, GRANTED, OWNER, expired.clone()); + raw_claim(&a, &subject, POLICY, OWNER, expired.clone()); + // A future policy from another origin must not pull this expired + // issuer grant back into the per-candidate Rust authority fold. + expired["expires_at_unix_ms"] = json!(u64::MAX); + raw_claim(&b, &subject, POLICY, OWNER, expired); + } + replicate(&b, &a); + measure("p1-policy-candidates-after"); + + let (a, b) = admitted_pair(root.path()); + issue(&a, ASSISTANT_ID, "assistant").unwrap(); + for (count, label) in [(1, "p1-authentication-n2"), (5, "p1-authentication-n6")] { + let start = if count == 1 { 0 } else { 1 }; + for index in start..count { + let id = format!("{:024x}", index + 2000); + let source = grant_fields(&id, "service"); + let grant = raw_claim(&b, &subject(&id).unwrap(), GRANTED, OWNER, source.clone()); + raw_claim(&b, &grant.subject, POLICY, OWNER, source); + } + replicate(&b, &a); + let operation = smallclaims::profile::Op::start(label, None).unwrap(); + { + let _entered = operation.enter(); + assert_conflict(&authenticate_id(&a, ASSISTANT_ID) + .expect_err("all measured opposite-profile grants remain active")); + } + operation.finish(); + } +} + +#[test] +fn dirty_grant_reads_and_bearers_fail_closed_without_blocking_an_unrelated_credential() { + let root = tempfile::tempdir().unwrap(); + let state = member(root.path(), "issuer"); + let grant = issue(&state, ASSISTANT_ID, "assistant").unwrap(); + let independent = issue(&state, SERVICE_ID, "assistant").unwrap(); + while !state.store.advance_assistant_grant_authority_backfill().unwrap() {} + authenticate_id(&state, ASSISTANT_ID).unwrap().unwrap(); + authenticate_id(&state, SERVICE_ID).unwrap().unwrap(); + state.store.connection.write().execute( + /* sqlite-large-value: allow-for-now lv-hda4b15518ef0 owner=fractal_api_core::api::client_v0::external_grants::conflict_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_dirty(claim_id) VALUES(?1)", [&grant.id], + ).unwrap(); + assert!(authenticate_id(&state, ASSISTANT_ID).unwrap().is_none()); + authenticate_id(&state, SERVICE_ID).unwrap().unwrap(); + let denied = credential_rejected("the client credential is unknown or expired"); + for error in [ + session(&state, &grant, "http").unwrap_err(), + effective(&state, &grant).unwrap_err(), + revoked(&state, &grant).unwrap_err(), + projection(&state, &grant).unwrap_err(), + latest(&state, &grant.subject, GRANTED).unwrap_err(), + ] { + assert_eq!(error.status, denied.status); + assert_eq!(error.code, denied.code); + assert_eq!(error.message, denied.message); + assert_eq!(error.details, denied.details); + } + assert_eq!(candidate_grants(&state, PRINCIPAL, Some(0)).unwrap() + .iter().map(|(claim, _)| claim.id.as_str()).collect::>(), + BTreeSet::from([grant.id.as_str(), independent.id.as_str()])); +} + +#[test] +fn dirty_opposite_profile_witness_does_not_clear_an_established_conflict() { + let root = tempfile::tempdir().unwrap(); + let (a, b) = admitted_pair(root.path()); + issue(&a, ASSISTANT_ID, "assistant").unwrap(); + let service = legacy_service(&b, SERVICE_ID); + replicate(&a, &b); + replicate(&b, &a); + assert_conflict(&authenticate_id(&a, ASSISTANT_ID).unwrap_err()); + a.store.connection.write().execute( + /* sqlite-large-value: allow-for-now lv-h830bfc82281f owner=fractal_api_core::api::client_v0::external_grants::conflict_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_dirty(claim_id) VALUES(?1)", [&service.id], + ).unwrap(); + assert!(authenticate_id(&a, SERVICE_ID).unwrap().is_none(), + "the dirty subject's own credential is fenced"); + assert_conflict(&authenticate_id(&a, ASSISTANT_ID).unwrap_err()); + assert_eq!(candidate_grants(&a, PRINCIPAL, Some(0)).unwrap().len(), 2, + "pending work cannot erase the last authenticated opposite-profile snapshot"); +} + +#[test] +fn clean_grant_inspection_omits_pending_expired_or_revoked_opposite_history() { + for cause in ["expired", "revoked"] { + let root = tempfile::tempdir().unwrap(); + let (a, b) = admitted_pair(root.path()); + let assistant = issue(&a, ASSISTANT_ID, "assistant").unwrap(); + let service = legacy_service(&b, SERVICE_ID); + let mut source = fields(&service).unwrap().clone(); + let kind = if cause == "expired" { + source["expires_at_unix_ms"] = json!(1_u64); + POLICY + } else { REVOKED }; + raw_claim(&b, &service.subject, kind, OWNER, source); + replicate(&b, &a); + let inspected = projection_with_witness(&a, &assistant).unwrap(); + assert_eq!(inspected["cleared_conflicts"][0]["cause"], cause); + a.store.connection.write().execute( + /* sqlite-large-value: allow-for-now lv-hb8b3d12c32f5 owner=fractal_api_core::api::client_v0::external_grants::conflict_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_dirty(claim_id) VALUES(?1)", [&service.id], + ).unwrap(); + assert!(authenticate_id(&a, SERVICE_ID).unwrap().is_none()); + assert!(authenticate_id(&a, ASSISTANT_ID).unwrap().is_some()); + let inspected = projection_with_witness(&a, &assistant).unwrap(); + assert!(inspected["conflict"].is_null()); + assert_eq!(inspected["cleared_conflicts"], json!([])); + assert_eq!(inspected["revoked"], false); + assert_eq!(inspected["id"], ASSISTANT_ID); + } +} diff --git a/crates/fractal-api-core/src/api/tests.rs b/crates/fractal-api-core/src/api/tests.rs index 769b22d4ef4..d7a2422ab7f 100644 --- a/crates/fractal-api-core/src/api/tests.rs +++ b/crates/fractal-api-core/src/api/tests.rs @@ -1199,6 +1199,84 @@ async fn native_session_reports_cannot_replace_a_successor_binding() { assert_eq!(state.store.claims_for(subject, Some("harness.session-file")).unwrap().len(), 2); } +#[test] +fn doctor_lists_unmarked_pending_grants_without_dating_remote_history() { + let store = Store::open_memory("amber").unwrap(); + let connection = store.connection.lock().expect("fixture writer"); + for (id, kind, origin, authenticated) in [ + ("claim/local-a", "custom.client.assistant.v1.granted", "amber", 0), + ("claim/local-b", "custom.client.assistant.v1.granted", "amber", 0), + ("claim/remote", "custom.client.assistant.v1.granted", "birch", 0), + ("claim/verified", "custom.client.assistant.v1.granted", "amber", 1), + ("claim/marked", "custom.client.assistant.v1.granted", "amber", 0), + ("claim/policy", "custom.client.assistant.v1.policy", "amber", 0), + ("claim/revoked", "custom.client.assistant.v1.revoked", "amber", 0), + ] { + connection.execute( + /* sqlite-large-value: allow-for-now lv-h568eec89a376 owner=fractal_api_core::api::tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_pending + (claim_id,grant_subject,kind,origin,actor,sequence,authenticated,record) + VALUES(?1,?1,?2,?3,'person/operator',1,?4,'{}')", + rusqlite::params![id, kind, origin, authenticated], + ).unwrap(); + } + connection.execute( + /* sqlite-large-value: allow-for-now lv-hac4604f86ba0 owner=fractal_api_core::api::tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_local_appends(claim_id) VALUES('claim/marked')", [], + ).unwrap(); + let checks = pending_assistant_grant_checks(&connection, "amber").unwrap(); + assert_eq!(checks.len(), 3); + for (check, id) in checks[..2].iter().zip(["claim/local-a", "claim/local-b"]) { + assert_eq!(check.name, "assistant-grant-provenance"); + assert_eq!(check.status, "warn"); + assert_eq!(check.message, format!( + "{id}: grant predates local-append provenance; re-issue; kind=custom.client.assistant.v1.granted; origin=amber; actor=person/operator" + )); + } + assert!(checks[2].message.starts_with("claim/remote: grant lacks local-append provenance")); + assert!(checks[2].message.contains("issuance age unknown")); + assert!(!checks[2].message.contains("predates")); + connection.execute(/* sqlite-large-value: allow-for-now lv-he965ae9e187f owner=fractal_api_core::api::tests TODO=bound-or-reference-values-and-reclamation */ "UPDATE assistant_grant_pending SET authenticated=1", []).unwrap(); + assert!(pending_assistant_grant_checks(&connection, "amber").unwrap().is_empty()); +} + +#[test] +fn doctor_lists_subject_maintenance_for_authenticated_membership_retries() { + let store = Store::open_memory("amber").unwrap(); + let connection = store.connection.lock().expect("fixture writer"); + for (id, subject, origin, sequence, authenticated, kind) in [ + ("claim/a", "grant/consumed", "birch", 7, 1, "custom.client.assistant.v1.granted"), + ("claim/b", "grant/queued", "birch", 7, 1, "custom.client.assistant.v1.granted"), + ("claim/c", "grant/unrelated", "cedar", 8, 1, "custom.client.assistant.v1.granted"), + ("claim/revoke", "grant/pending-revoke", "cedar", 9, 0, "custom.client.assistant.v1.revoked"), + ] { + connection.execute( + /* sqlite-large-value: allow-for-now lv-he1ce05c0581f owner=fractal_api_core::api::tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_pending + (claim_id,grant_subject,kind,origin,actor,sequence,authenticated,record,auth_member_key,auth_sequence) + VALUES(?1,?2,?3,?4,'person/operator',?5,?6,'{}','key/birch',?5)", + rusqlite::params![id, subject, kind, origin, sequence, authenticated], + ).unwrap(); + } + connection.execute( + /* sqlite-large-value: allow-for-now lv-h20114a3e8154 owner=fractal_api_core::api::tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_retractions(writer,member_key,lower_sequence,upper_sequence,sequence,claim_id) + VALUES('birch','key/birch',7,7,7,'claim/a')", [], + ).unwrap(); + let checks = assistant_grant_subject_maintenance_checks(&connection).unwrap(); + assert_eq!(checks.len(), 2); + assert!(checks.iter().all(|check| check.name == "assistant-grant-provenance" && check.status == "warn")); + assert!(checks.iter().any(|check| check.message.contains("subject=grant/queued") + && check.message.contains("writer membership revalidation queued: birch"))); + assert!(checks.iter().any(|check| check.message.contains("subject=grant/pending-revoke") + && check.message.contains("unauthenticated grant, policy or revocation evidence"))); + assert!(checks.iter().all(|check| check.message.contains("generic credential rejection"))); + connection.execute( + /* sqlite-large-value: allow-for-now lv-h25f52ee4e4eb owner=fractal_api_core::api::tests TODO=bound-or-reference-values-and-reclamation */ "UPDATE assistant_grant_retractions SET claim_id='claim/b' WHERE writer='birch'", [], + ).unwrap(); + let checks = assistant_grant_subject_maintenance_checks(&connection).unwrap(); + assert_eq!(checks.len(), 1); + assert!(checks[0].message.contains("subject=grant/pending-revoke")); + connection.execute(/* sqlite-large-value: allow-for-now lv-h28b4c5d9b4eb owner=fractal_api_core::api::tests TODO=bound-or-reference-values-and-reclamation */ "UPDATE assistant_grant_pending SET authenticated=1", []).unwrap(); + assert!(assistant_grant_subject_maintenance_checks(&connection).unwrap().is_empty()); +} + #[test] fn doctor_flags_low_descriptor_limits_and_high_usage() { let low = descriptor_usage_check(256, 8192, Some(92)); diff --git a/crates/fractal-client-codegen/templates/Client.swift.in b/crates/fractal-client-codegen/templates/Client.swift.in index cf0251cacd9..dd2f94a1bf3 100644 --- a/crates/fractal-client-codegen/templates/Client.swift.in +++ b/crates/fractal-client-codegen/templates/Client.swift.in @@ -299,7 +299,7 @@ public actor FractalClient { public func beginPairing(deviceName: String, personID: String) async throws -> Envelope { try await post("v1/client/pairings", PersonPairingBegin(apiVersion: fractalClientAPIVersion, deviceName: deviceName, personID: personID)) } public func beginPairing(_ request: PairingBegin) async throws -> Envelope { try await post("v1/client/pairings", request) } public func completePairing(pairingID: String, code: String, devicePublicKey: String) async throws -> Envelope { try await post("v1/client/pairings/\(pairingID.replacingOccurrences(of: "pairing/", with: ""))/complete", PairingComplete(apiVersion: fractalClientAPIVersion, code: code, devicePublicKey: devicePublicKey)) } - public func assistantGrant(_ id: String) async throws -> Envelope { try await get("v1/client/assistant/grants/\(id.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed.subtracting(CharacterSet(charactersIn: "/"))) ?? id)") } + public func assistantGrant(_ id: String, witness: Bool = false) async throws -> Envelope { try await get("v1/client/assistant/grants/\(id.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed.subtracting(CharacterSet(charactersIn: "/"))) ?? id)", query: witness ? [.init(name: "witness", value: "1")] : []) } public func assistantGrantRevoke(_ id: String) async throws -> Envelope { try await post("v1/client/assistant/grants/\(id.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed.subtracting(CharacterSet(charactersIn: "/"))) ?? id)/revoke", [String: String]()) } public func assistantGrantPolicy(_ id: String, _ policy: AssistantGrantPolicy) async throws -> Envelope { try await post("v1/client/assistant/grants/\(id.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed.subtracting(CharacterSet(charactersIn: "/"))) ?? id)/policy", policy) } public func assistantGrantReadTrust(_ id: String, _ trust: AssistantReadTrustRequest) async throws -> Envelope { try await post("v1/client/assistant/grants/\(id.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed.subtracting(CharacterSet(charactersIn: "/"))) ?? id)/read-trust", trust) } diff --git a/crates/fractal-client-codegen/templates/Client.ts.in b/crates/fractal-client-codegen/templates/Client.ts.in index ab5e2df734b..5e0c69fb19b 100644 --- a/crates/fractal-client-codegen/templates/Client.ts.in +++ b/crates/fractal-client-codegen/templates/Client.ts.in @@ -494,8 +494,8 @@ export class FractalClient { return this.request('POST', `/v1/client/pairings/${encodeURIComponent(routedId(id))}/complete`, request, undefined, undefined, requestOptions); } - async assistantGrant(id: string): Promise> { - return this.request('GET', `/v1/client/assistant/grants/${encodeURIComponent(id)}`); + async assistantGrant(id: string, options: { witness?: boolean } = {}): Promise> { + return this.request('GET', `/v1/client/assistant/grants/${encodeURIComponent(id)}${query({ witness: options.witness ? 1 : undefined })}`); } async assistantGrantRevoke(id: string): Promise> { return this.request('POST', `/v1/client/assistant/grants/${encodeURIComponent(id)}/revoke`, {}); diff --git a/crates/fractal-client-codegen/templates/Models.swift.in b/crates/fractal-client-codegen/templates/Models.swift.in index f67d5ffb1f3..d739b04f577 100644 --- a/crates/fractal-client-codegen/templates/Models.swift.in +++ b/crates/fractal-client-codegen/templates/Models.swift.in @@ -153,6 +153,8 @@ public enum ErrorCode: Codable, Sendable, Equatable { case peerTooOld case validationFailed case idempotencyConflict + case grantProfileConflict + case assistantGrantAuthorityNotReady case agentsPublicationRowTooLarge case attentionMigrated case invalidAnswer, notAnswerable @@ -245,6 +247,8 @@ public enum ErrorCode: Codable, Sendable, Equatable { case "peer-too-old": .peerTooOld case "validation-failed": .validationFailed case "idempotency-conflict": .idempotencyConflict + case "grant-profile-conflict": .grantProfileConflict + case "assistant-grant-authority-not-ready": .assistantGrantAuthorityNotReady case "stale-fence": .staleFence case "issuer-required": .issuerRequired case "pairing-origin-required": .pairingOriginRequired @@ -337,6 +341,8 @@ public enum ErrorCode: Codable, Sendable, Equatable { case .peerTooOld: "peer-too-old" case .validationFailed: "validation-failed" case .idempotencyConflict: "idempotency-conflict" + case .grantProfileConflict: "grant-profile-conflict" + case .assistantGrantAuthorityNotReady: "assistant-grant-authority-not-ready" case .staleFence: "stale-fence" case .issuerRequired: "issuer-required" case .pairingOriginRequired: "pairing-origin-required" @@ -1511,7 +1517,21 @@ public struct AssistantGrant: Codable, Sendable { public let kind, id, sessionActor, deviceID, keyID, issuer, expiresAt, consentEvidence: String; public let principal: AssistantPrincipal; public let senderClass: AssistantSenderClass; public let scopes: [AssistantScope]; public let policyRevision: UInt64; public let minimalReadMode: AssistantMinimalReadMode; public let recipientAllowlist: [String]; public let disclosureConsent, revoked: Bool /// Owner-provisioned SCG read pins; absent means every assistant read is denied. public let readTrust: AssistantReadTrust? - enum CodingKeys: String, CodingKey { case kind, id, sessionActor = "session_actor", deviceID = "device_id", keyID = "key_id", issuer, expiresAt = "expires_at", consentEvidence = "consent_evidence", principal, senderClass = "sender_class", scopes, policyRevision = "policy_revision", minimalReadMode = "minimal_read_mode", recipientAllowlist = "recipient_allowlist", disclosureConsent = "disclosure_consent", revoked, readTrust = "read_trust" } + public let conflict: GrantProfileConflictWitness? + public let clearedConflicts: [ClearedGrantProfileConflictWitness]? + enum CodingKeys: String, CodingKey { case kind, id, sessionActor = "session_actor", deviceID = "device_id", keyID = "key_id", issuer, expiresAt = "expires_at", consentEvidence = "consent_evidence", principal, senderClass = "sender_class", scopes, policyRevision = "policy_revision", minimalReadMode = "minimal_read_mode", recipientAllowlist = "recipient_allowlist", disclosureConsent = "disclosure_consent", revoked, readTrust = "read_trust", conflict, clearedConflicts = "cleared_conflicts" } +} +public enum ExternalGrantProfile: String, Codable, Sendable { case assistant, service } +public enum GrantProfileConflictCause: String, Codable, Sendable { case revoked, expired } +public struct GrantProfileWitness: Codable, Sendable { + public let grantID: String?; public let origin: String; public let profile: ExternalGrantProfile + enum CodingKeys: String, CodingKey { case grantID = "grant_id", origin, profile } +} +public struct GrantProfileConflictWitness: Codable, Sendable { + public let grants: [GrantProfileWitness] +} +public struct ClearedGrantProfileConflictWitness: Codable, Sendable { + public let grants: [GrantProfileWitness]; public let cause: GrantProfileConflictCause } public struct AssistantGrantPolicy: Codable, Sendable { public let apiVersion, consentEvidence: String; public let scopes: [AssistantScope]; public let expiresInSeconds: UInt64?; public let disclosureConsent: Bool; public let minimalReadMode: AssistantMinimalReadMode; public let recipientAllowlist: [String]? diff --git a/crates/fractal-client-codegen/templates/generated.rs.in b/crates/fractal-client-codegen/templates/generated.rs.in index a2a87f21f7d..4c271acb0ea 100644 --- a/crates/fractal-client-codegen/templates/generated.rs.in +++ b/crates/fractal-client-codegen/templates/generated.rs.in @@ -134,6 +134,8 @@ pub enum ErrorCode { PeerTooOld, ValidationFailed, IdempotencyConflict, + GrantProfileConflict, + AssistantGrantAuthorityNotReady, LegacyActionReceiptUntrusted, IssuerRequired, PairingOriginRequired, @@ -4450,6 +4452,40 @@ pub struct AssistantGrant { pub revoked: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub read_trust: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conflict: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cleared_conflicts: Option>, +} +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[serde(rename_all = "kebab-case")] +pub enum ExternalGrantProfile { + Assistant, + Service, +} +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[serde(rename_all = "kebab-case")] +pub enum GrantProfileConflictCause { + Revoked, + Expired, +} +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] +#[serde(deny_unknown_fields)] +pub struct GrantProfileWitness { + pub grant_id: Option, + pub origin: String, + pub profile: ExternalGrantProfile, +} +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] +#[serde(deny_unknown_fields)] +pub struct GrantProfileConflictWitness { + pub grants: Vec, +} +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] +#[serde(deny_unknown_fields)] +pub struct ClearedGrantProfileConflictWitness { + pub grants: Vec, + pub cause: GrantProfileConflictCause, } #[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] #[serde(deny_unknown_fields)] diff --git a/crates/fractal-client-codegen/templates/lib.rs.in b/crates/fractal-client-codegen/templates/lib.rs.in index cb69c4c2fae..fa9d34c9c63 100644 --- a/crates/fractal-client-codegen/templates/lib.rs.in +++ b/crates/fractal-client-codegen/templates/lib.rs.in @@ -1194,6 +1194,8 @@ fn render_message(code: Option<&ErrorCode>, message: &str, human: bool) -> Strin | ErrorCode::LegacyActionReceiptUntrusted | ErrorCode::RuntimeNotLocal | ErrorCode::PrivateNotesCarrierConflict + | ErrorCode::GrantProfileConflict + | ErrorCode::AssistantGrantAuthorityNotReady | ErrorCode::PrivateNotesUnreachable | ErrorCode::PrivateNotesIndeterminate | ErrorCode::ArrangementExists @@ -2064,6 +2066,11 @@ impl Client { pub async fn assistant_grant(&self, id: &str) -> Result, ClientError> { self.get(&format!("/v1/client/assistant/grants/{}", percent_encode_segment(id.strip_prefix("assistant-grant/").unwrap_or(id)))).await } + /// Inspect with optional conflict witnesses; the default method retains the legacy wire shape. + pub async fn assistant_grant_with_witness(&self, id: &str, witness: bool) -> Result, ClientError> { + let query = if witness { "?witness=1" } else { "" }; + self.get(&format!("/v1/client/assistant/grants/{}{query}", percent_encode_segment(id.strip_prefix("assistant-grant/").unwrap_or(id)))).await + } pub async fn assistant_grant_revoke(&self, id: &str) -> Result, ClientError> { self.post(&format!("/v1/client/assistant/grants/{}/revoke", percent_encode_segment(id.strip_prefix("assistant-grant/").unwrap_or(id))), &serde_json::json!({})).await } diff --git a/crates/fractal-client/src/generated.rs b/crates/fractal-client/src/generated.rs index c26061f4283..a9df8dc7778 100644 --- a/crates/fractal-client/src/generated.rs +++ b/crates/fractal-client/src/generated.rs @@ -134,6 +134,8 @@ pub enum ErrorCode { PeerTooOld, ValidationFailed, IdempotencyConflict, + GrantProfileConflict, + AssistantGrantAuthorityNotReady, LegacyActionReceiptUntrusted, IssuerRequired, PairingOriginRequired, @@ -5281,6 +5283,40 @@ pub struct AssistantGrant { pub revoked: bool, #[serde(default, skip_serializing_if = "Option::is_none")] pub read_trust: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conflict: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cleared_conflicts: Option>, +} +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[serde(rename_all = "kebab-case")] +pub enum ExternalGrantProfile { + Assistant, + Service, +} +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[serde(rename_all = "kebab-case")] +pub enum GrantProfileConflictCause { + Revoked, + Expired, +} +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] +#[serde(deny_unknown_fields)] +pub struct GrantProfileWitness { + pub grant_id: Option, + pub origin: String, + pub profile: ExternalGrantProfile, +} +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] +#[serde(deny_unknown_fields)] +pub struct GrantProfileConflictWitness { + pub grants: Vec, +} +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] +#[serde(deny_unknown_fields)] +pub struct ClearedGrantProfileConflictWitness { + pub grants: Vec, + pub cause: GrantProfileConflictCause, } #[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] #[serde(deny_unknown_fields)] diff --git a/crates/fractal-client/src/lib.rs b/crates/fractal-client/src/lib.rs index acacfab4677..67839138395 100644 --- a/crates/fractal-client/src/lib.rs +++ b/crates/fractal-client/src/lib.rs @@ -1280,6 +1280,8 @@ fn render_message(code: Option<&ErrorCode>, message: &str, human: bool) -> Strin | ErrorCode::LegacyActionReceiptUntrusted | ErrorCode::RuntimeNotLocal | ErrorCode::PrivateNotesCarrierConflict + | ErrorCode::GrantProfileConflict + | ErrorCode::AssistantGrantAuthorityNotReady | ErrorCode::PrivateNotesUnreachable | ErrorCode::PrivateNotesIndeterminate | ErrorCode::ArrangementExists @@ -3738,6 +3740,19 @@ impl Client { )) .await } + /// Inspect with optional conflict witnesses; the default method retains the legacy wire shape. + pub async fn assistant_grant_with_witness( + &self, + id: &str, + witness: bool, + ) -> Result, ClientError> { + let query = if witness { "?witness=1" } else { "" }; + self.get(&format!( + "/v1/client/assistant/grants/{}{query}", + percent_encode_segment(id.strip_prefix("assistant-grant/").unwrap_or(id)) + )) + .await + } pub async fn assistant_grant_revoke( &self, id: &str, diff --git a/crates/fractal-daemon/src/tiles/seccomp.rs b/crates/fractal-daemon/src/tiles/seccomp.rs index 68083e6852b..4d7b6ebeba8 100644 --- a/crates/fractal-daemon/src/tiles/seccomp.rs +++ b/crates/fractal-daemon/src/tiles/seccomp.rs @@ -92,6 +92,7 @@ fn jump(code: u32, k: u32, jt: u8, jf: u8) -> libc::sock_filter { const LOAD: u32 = libc::BPF_LD | libc::BPF_W | libc::BPF_ABS; const EQUAL: u32 = libc::BPF_JMP | libc::BPF_JEQ | libc::BPF_K; +#[cfg(any(target_arch = "x86_64", test))] const AT_LEAST: u32 = libc::BPF_JMP | libc::BPF_JGE | libc::BPF_K; const ANY_BIT: u32 = libc::BPF_JMP | libc::BPF_JSET | libc::BPF_K; const RETURN: u32 = libc::BPF_RET | libc::BPF_K; diff --git a/crates/fractal-delivery/src/store/message_send_tests.rs b/crates/fractal-delivery/src/store/message_send_tests.rs index 3ea559bf7e1..57a0b37bd23 100644 --- a/crates/fractal-delivery/src/store/message_send_tests.rs +++ b/crates/fractal-delivery/src/store/message_send_tests.rs @@ -445,8 +445,8 @@ fn assistant_provenance_stamps_authenticated_grant_and_preserves_replica_admissi store.apply(&crate::graph::parse_test_intent( "version 2\nagent \"example-recipient.local\" { workspace \"/tmp/st-test\"; command \"true\"; restart always; }", "node").unwrap(), &BTreeMap::from([("agent/example-recipient.local".to_string(), Vec::new())]), "assistant-recipient").unwrap(); - let grant_subject = "custom/client/assistant-v1-native-fixture"; - let grant_id = "assistant-grant/native-fixture"; + let grant_subject = "custom/client/assistant-v1-0123456789abcdef01234567"; + let grant_id = "assistant-grant/0123456789abcdef01234567"; let session_actor = format!("{principal}/session/{grant_id}"); store.append_claim(&ClaimInput { subject: grant_subject.into(), kind: "custom.client.assistant.v1.granted".into(), @@ -454,12 +454,15 @@ fn assistant_provenance_stamps_authenticated_grant_and_preserves_replica_admissi fields: serde_json::from_value(json!({ "principal":principal, "session_actor":session_actor, "issuer":"person/robin", "disclosure_consent":true, "policy_revision":1, + "credential_hash":"a".repeat(64), "minimal_read_mode":"approval-once", "expires_at_unix_ms":now_ms() as u64 + 60_000, "scopes":["write.assistant.messages"], "recipient_allowlist":["agent/example-recipient.local"], "grant_id":grant_id })).unwrap(), evidence: vec![], expected_subject: None, idempotency_key: None, }).unwrap(); + // Complete fixture authority maintenance before exercising the writer recheck. + while !store.advance_assistant_grant_authority_backfill().unwrap() {} let authorization = assistant_write::AssistantWriteAuthorization { grant_subject: grant_subject.into(), actor: session_actor.clone(), owner: "person/robin".into(), policy_revision: 1, scope: "write.assistant.messages".into(), @@ -491,3 +494,52 @@ fn assistant_provenance_stamps_authenticated_grant_and_preserves_replica_admissi assert_eq!(store.append_assistant_claim_outcome(&wrong_actor, &authorization).unwrap_err().code, "forbidden"); } } + +#[test] +fn writer_recheck_fences_dirty_subject_without_exposing_projection_state() { + let store = Store::open_memory("node").unwrap(); + store.apply(&crate::graph::parse_test_intent( + "version 2\nagent \"example-recipient.local\" { workspace \"/tmp/st-test\"; command \"true\"; restart always; }", "node").unwrap(), + &BTreeMap::from([("agent/example-recipient.local".to_string(), Vec::new())]), "assistant-recipient").unwrap(); + let grant_subject = "custom/client/assistant-v1-0123456789abcdef01234567"; + let grant_id = "assistant-grant/0123456789abcdef01234567"; + let session_actor = format!("assistant/chatgpt/session/{grant_id}"); + let granted = store.append_claim(&ClaimInput { + subject: grant_subject.into(), kind: "custom.client.assistant.v1.granted".into(), + actor: Some("person/robin".into()), + fields: serde_json::from_value(json!({ + "principal":"assistant/chatgpt", "session_actor":session_actor, + "issuer":"person/robin", "disclosure_consent":true, "policy_revision":1, + "credential_hash":"a".repeat(64), "minimal_read_mode":"approval-once", + "expires_at_unix_ms":u64::MAX, "scopes":["write.assistant.messages"], + "grant_id":grant_id + })).unwrap(), + evidence: vec![], expected_subject: None, idempotency_key: None, + }).unwrap(); + // Settle the valid fixture before injecting dirty state; the writer must not repair it. + while !store.advance_assistant_grant_authority_backfill().unwrap() {} + let authorization = assistant_write::AssistantWriteAuthorization { + grant_subject: grant_subject.into(), actor: session_actor, + owner: "person/robin".into(), policy_revision: 1, + scope: "write.assistant.messages".into(), + recipient: Some("agent/example-recipient.local".into()), + }; + let mut input = request(); + input.actor = Some("assistant/chatgpt".into()); + input.fields.insert("from".into(), json!("assistant/chatgpt")); + input.fields.insert("to".into(), json!("agent/example-recipient.local")); + // An unrelated pending claim must not prevent the actual mutation transaction. + store.connection.lock().unwrap().execute( + /* sqlite-large-value: allow-for-now lv-hb8891f8aff3c owner=fractal_delivery::store::message_send_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_dirty(claim_id) VALUES('unrelated-claim')", [], + ).unwrap(); + assert!(store.append_assistant_claim_outcome(&input, &authorization).unwrap().1); + input.subject = "message/assistant-dirty-subject-denied".into(); + input.idempotency_key = Some("assistant-dirty-subject-denied".into()); + store.connection.lock().unwrap().execute( + /* sqlite-large-value: allow-for-now lv-he8ff1a0f8ec1 owner=fractal_delivery::store::message_send_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_dirty(claim_id) VALUES(?1)", [&granted.id], + ).unwrap(); + let error = store.append_assistant_claim_outcome(&input, &authorization).unwrap_err(); + assert_eq!(error.code, "forbidden"); + assert_eq!(error.message, "assistant write authorization changed or expired before commit"); + assert!(store.latest_claim(&input.subject, None).unwrap().is_none()); +} diff --git a/crates/fractal-store/src/store.rs b/crates/fractal-store/src/store.rs index 0d59fbf9673..56cd1b49d23 100644 --- a/crates/fractal-store/src/store.rs +++ b/crates/fractal-store/src/store.rs @@ -809,7 +809,7 @@ pub struct AgentWorkQueue { /// Fractal's projection tables, and the indexes its folds read the claim log through. The /// graph creates its own tables first; see `smallclaims::store::SCHEMA`. -const SCHEMA: &str = /* sqlite-large-value: allow-for-now lv-h6088551c41aa owner=fractal_store::store TODO=chunk-or-reference-variable-columns */ r#" +const SCHEMA: &str = /* sqlite-large-value: allow-for-now lv-h6e39e16546c7 owner=fractal_store::store TODO=chunk-or-reference-variable-columns */ r#" -- An unmanaged member's staging check needs tagged claims, not its runtime history. CREATE INDEX IF NOT EXISTS claims_owned_set_subject_index ON claims(subject) WHERE json_extract(body,'$.owned_set') IS NOT NULL; @@ -959,9 +959,6 @@ WHERE kind='custom.client.pairing-completed'; CREATE INDEX IF NOT EXISTS claims_assistant_v1_credential_index ON claims(json_extract(body, '$.fields.credential_hash'), store_index) WHERE kind='custom.client.assistant.v1.granted'; --- Match parameterized admission by kind and effective principal, including legacy ChatGPT grants. -CREATE INDEX IF NOT EXISTS claims_assistant_v1_principal_index -ON claims(kind, COALESCE(json_extract(body,'$.fields.principal'),'assistant/chatgpt')); -- A runtime incarnation's claims about a subject by acceptance time, so when a session began -- and last changed are two seeks instead of a read of every claim the subject has. The -- expression is INCARNATION_OF_CLAIM, which queries repeat so the planner uses this index. diff --git a/crates/fractal-store/src/store/assistant_write.rs b/crates/fractal-store/src/store/assistant_write.rs index 7c5691e3a06..c0ab6fc4894 100644 --- a/crates/fractal-store/src/store/assistant_write.rs +++ b/crates/fractal-store/src/store/assistant_write.rs @@ -1,5 +1,6 @@ -//! Server-established assistant provenance, checked in the mutation's writer transaction. +//! Server-established assistant provenance, rechecked against projected authority in the mutation's writer transaction. use super::*; +use smallclaims::store::assistant_grant_authority as authority; #[derive(Clone, Debug)] pub struct AssistantWriteAuthorization { @@ -17,12 +18,6 @@ impl AssistantWriteAuthorization { } } -pub fn principal(fields: &Value) -> Option<&str> { - match fields.get("principal") { - None => Some("assistant/chatgpt"), - Some(value) => value.as_str().filter(|principal| matches!(*principal, "assistant/chatgpt" | "assistant/mcp")), - } -} pub fn authorize_grant(connection: &Connection, origin: &str, authorization: &AssistantWriteAuthorization) -> Result { let granted = authorized_grant(connection, origin, authorization)?; @@ -32,27 +27,28 @@ pub fn authorize_grant(connection: &Connection, origin: &str, authorization: &As pub fn authorized_grant(connection: &Connection, origin: &str, authorization: &AssistantWriteAuthorization) -> Result { let denied = || FractalError::new("forbidden", "assistant write authorization changed or expired before commit"); - let claim = |kind: &str| -> Result, FractalError> { - connection.query_row(/* sqlite-large-value: allow-for-now lv-hd82c937baff5 owner=fractal_store::store::assistant_write TODO=trace-statement-and-value-representation */ &latest_claim_of_kind_query(), - params![authorization.grant_subject,kind],claim_from_row).optional().map_err(internal) + let authority_error = |error: FractalError| { + if matches!(error.code, "assistant-grant-authority-not-ready" | "assistant-grant-subject-not-ready") { + denied() + } else { error } }; - let granted = claim("custom.client.assistant.v1.granted")?.ok_or_else(denied)?; - let policy_claim = claim("custom.client.assistant.v1.policy")?; + let granted = authority::latest(connection, &authorization.grant_subject, authority::GRANTED).map_err(authority_error)? + .ok_or_else(denied)?; + let policy_claim = authority::transition(connection, &granted, authority::POLICY).map_err(authority_error)?; let policy = policy_claim.as_ref().unwrap_or(&granted); - if granted.origin != origin || policy.origin != origin || claim("custom.client.assistant.v1.revoked")?.is_some() { + if granted.origin != origin || policy.origin != origin + || !authority::structurally_valid(&granted, policy) + || authority::transition(connection, &granted, authority::REVOKED).map_err(authority_error)?.is_some() { return Err(denied()); } let fields = &policy.body["fields"]; - let principal = principal(fields).ok_or_else(denied)?; - if self::principal(&granted.body["fields"]) != Some(principal) - || ["grant_id", "session_actor", "issuer"].iter().any(|key| fields[*key] != granted.body["fields"][*key]) + let principal = authority::principal(fields).ok_or_else(denied)?; + if fields.get("profile").is_some_and(|profile| profile != "assistant") || authorization.principal() != principal || fields["session_actor"] != authorization.actor - || fields["session_actor"].as_str().and_then(|actor| actor.strip_prefix(principal)) - .and_then(|suffix| suffix.strip_prefix("/session/")) != fields["grant_id"].as_str() || granted.actor.as_deref() != Some(authorization.owner.as_str()) || policy.actor.as_deref() != Some(authorization.owner.as_str()) - || fields["issuer"] != authorization.owner || fields["disclosure_consent"] != true + || fields["issuer"] != authorization.owner || fields["policy_revision"].as_u64() != Some(authorization.policy_revision) || fields["expires_at_unix_ms"].as_u64().map(u128::from).is_none_or(|expiry| expiry <= now_ms()) || !fields["scopes"].as_array().is_some_and(|scopes| scopes.iter().any(|scope| scope.as_str() == Some(&authorization.scope))) @@ -103,14 +99,113 @@ pub fn validate_replicated(kind: &str, actor: Option<&str>, fields: &Value) -> R mod tests { use super::*; + fn transition_fixture() -> (Store, String, Value) { + let store = Store::open_memory("local").unwrap(); + let suffix = "0123456789abcdef01234567"; + let subject = format!("custom/client/assistant-v1-{suffix}"); + let body = json!({"fields":{ + "grant_id":format!("assistant-grant/{suffix}"), "issuer":"person/owner", + "session_actor":format!("assistant/chatgpt/session/assistant-grant/{suffix}"), + "credential_hash":"a".repeat(64), "minimal_read_mode":"approval-once", + "disclosure_consent":true, "scopes":["write.assistant.messages"], + "expires_at_unix_ms":u64::MAX + }}); + insert_transition(&store, &subject, authority::GRANTED, "person/owner", &body); + (store, subject, body) + } + + fn insert_transition(store: &Store, subject: &str, kind: &str, actor: &str, body: &Value) -> ClaimRecord { + store.append_claim(&ClaimInput { + subject: subject.into(), kind: kind.into(), actor: Some(actor.into()), + fields: serde_json::from_value(body["fields"].clone()).unwrap(), + evidence: Vec::new(), expected_subject: None, idempotency_key: None, + }).unwrap() + } + + #[test] + fn projected_transition_ignores_actor_overlay_flood() { + let (store, subject, body) = transition_fixture(); + let granted = authority::latest(&store.readers.get(), &subject, authority::GRANTED).unwrap().unwrap(); + let valid = insert_transition(&store, &subject, authority::POLICY, "person/owner", &body); + let mut prior = None; + for count in [32, 512, 7900] { + for index in 0..count { + let mut overlay = body.clone(); + overlay["fields"]["nonce"] = json!(format!("{count}-{index}")); + insert_transition(&store, &subject, authority::POLICY, "person/other", &overlay); + } + let selected = authority::transition(&store.readers.get(), &granted, authority::POLICY).unwrap().unwrap(); + assert_eq!(selected.id, valid.id); + let connection = store.readers.get(); + let args = params![subject, authority::POLICY, granted.origin, "person/owner", granted.id]; + let mut statement = connection.prepare(authority::TRANSITION_QUERY).unwrap(); + let _: String = statement.query_row(args, |row| row.get(0)).unwrap(); + let cost = statement.get_status(rusqlite::StatementStatus::VmStep); + if let Some(prior) = prior { assert!(cost <= prior + 20, "{prior} -> {cost}"); } + prior = Some(cost); + let plan = connection.prepare(&format!("EXPLAIN QUERY PLAN {}", authority::TRANSITION_QUERY)).unwrap() + .query_map(args, |row| row.get::<_, String>(3)).unwrap() + .collect::>>().unwrap().join("; "); + assert!(plan.contains("assistant_grant_authority_transition_index"), "{plan}"); + assert!(!plan.contains("USE TEMP B-TREE FOR ORDER BY"), "{plan}"); + } + } + + #[test] + fn projected_transition_ignores_malformed_newer_policies_and_revocations() { + let (store, subject, body) = transition_fixture(); + let granted = authority::latest(&store.readers.get(), &subject, authority::GRANTED).unwrap().unwrap(); + for kind in [authority::POLICY, authority::REVOKED] { + let valid = insert_transition(&store, &subject, kind, "person/owner", &body); + let mut patches = vec![ + json!({"principal":null}), json!({"principal":"assistant/mcp"}), + json!({"profile":null}), json!({"profile":"service"}), + json!({"issuer":"person/other"}), json!({"grant_id":"assistant-grant/other"}), + ]; + if kind.ends_with(".policy") { + patches.extend([ + json!({"session_actor":"assistant/chatgpt/session/other"}), + json!({"minimal_read_mode":"unknown"}), json!({"disclosure_consent":false}), + json!({"expires_at_unix_ms":null}), json!({"expires_at_unix_ms":-1}), + json!({"expires_at_unix_ms":1.5}), json!({"scopes":["unknown"]}), + json!({"expires_at_unix_ms":1e19}), + json!({"scopes":[null]}), json!({"credential":"secret"}), + json!({"credential_hash":"invalid"}), json!({"code_hash":null}), + ]); + } + for patch in patches { + let mut malformed = body.clone(); + malformed["fields"].as_object_mut().unwrap().extend(patch.as_object().unwrap().clone()); + insert_transition(&store, &subject, kind, "person/owner", &malformed); + } + let selected = authority::transition(&store.readers.get(), &granted, kind).unwrap().unwrap(); + assert_eq!(selected.id, valid.id); + } + } + + #[test] + fn projected_transition_accepts_raw_hex_grant_identity() { + let store = Store::open_memory("local").unwrap(); + let suffix = "0123456789abcdef01234567"; + let subject = format!("custom/client/assistant-v1-{suffix}"); + let body = json!({"fields":{"grant_id":suffix,"issuer":"person/owner", + "session_actor":format!("assistant/chatgpt/session/{suffix}"), + "credential_hash":"a".repeat(64),"minimal_read_mode":"approval-once", + "disclosure_consent":true,"scopes":[],"expires_at_unix_ms":u64::MAX}}); + let granted = insert_transition(&store, &subject, authority::GRANTED, "person/owner", &body); + let valid = insert_transition(&store, &subject, authority::POLICY, "person/owner", &body); + let selected = authority::transition(&store.readers.get(), &granted, authority::POLICY).unwrap().unwrap(); + assert_eq!(selected.id, valid.id); + } + #[test] fn grant_principal_defaults_only_absent_legacy_fields_to_chatgpt() { - assert_eq!(principal(&json!({})), Some("assistant/chatgpt")); + assert_eq!(authority::principal(&json!({})), Some("assistant/chatgpt")); for expected in ["assistant/chatgpt", "assistant/mcp"] { - assert_eq!(principal(&json!({"principal":expected})), Some(expected)); + assert_eq!(authority::principal(&json!({"principal":expected})), Some(expected)); } for forged in [Value::Null, json!("assistant/other"), json!("person/other"), json!(7)] { - assert_eq!(principal(&json!({"principal":forged})), None); + assert_eq!(authority::principal(&json!({"principal":forged})), None); } } @@ -139,4 +234,5 @@ mod tests { assert!(refuse_unverified("message.sent", Some(principal), Some(principal), false).is_err()); } } + } diff --git a/crates/fractal-store/src/store/messages_shard.rs b/crates/fractal-store/src/store/messages_shard.rs index 24810d58233..f58544e9817 100644 --- a/crates/fractal-store/src/store/messages_shard.rs +++ b/crates/fractal-store/src/store/messages_shard.rs @@ -475,6 +475,7 @@ impl FleetAuthority for GraphAuthority { FleetAuthority::fleet_generation(&self.graph()?.graph) } + fn fleet_membership(&self) -> anyhow::Result { FleetAuthority::fleet_membership(&self.graph()?.graph) } diff --git a/crates/fractal-store/src/store/runtime.rs b/crates/fractal-store/src/store/runtime.rs index e5e70ca980c..1fb4556378b 100644 --- a/crates/fractal-store/src/store/runtime.rs +++ b/crates/fractal-store/src/store/runtime.rs @@ -866,23 +866,15 @@ mod schema_install_tests { use super::*; #[test] - fn assistant_principal_index_installs_on_existing_claims_and_reopens_without_ddl() { - const GRANTED: &str = "custom.client.assistant.v1.granted"; - const REVOKED: &str = "custom.client.assistant.v1.revoked"; - const POLICY: &str = "custom.client.assistant.v1.policy"; - const INDEX: &str = "claims_assistant_v1_principal_index"; - const SELECT: &str = "SELECT id FROM claims WHERE kind=?1 AND COALESCE(json_extract(body,'$.fields.principal'),'assistant/chatgpt')=?2"; - const ACTIVE: &str = - "SELECT id FROM claims WHERE kind=?1 AND COALESCE(json_extract(body,'$.fields.principal'),'assistant/chatgpt')=?2 - AND (?5 IS NULL OR NOT EXISTS (SELECT 1 FROM claims AS revoked WHERE revoked.subject=claims.subject AND revoked.kind=?3)) - AND (?5 IS NULL OR COALESCE( - (SELECT CASE WHEN json_type(policy.body,'$.fields') IS NULL THEN 1 ELSE - COALESCE(json_type(policy.body,'$.fields.expires_at_unix_ms')='integer' - AND json_extract(policy.body,'$.fields.expires_at_unix_ms')>?5,0) END - FROM claims AS policy WHERE policy.subject=claims.subject AND policy.kind=?4 ORDER BY policy.store_index DESC LIMIT 1), - CASE WHEN json_type(body,'$.fields') IS NULL THEN 1 ELSE - COALESCE(json_type(body,'$.fields.expires_at_unix_ms')='integer' - AND json_extract(body,'$.fields.expires_at_unix_ms')>?5,0) END))"; + fn assistant_projection_backfills_existing_claims_without_changing_baseline_schema() { + use smallclaims::store::assistant_grant_authority as authority; + use std::time::Duration; + + const OBSOLETE_INDEXES: [&str; 3] = [ + "claims_assistant_v1_principal_index", + "claims_assistant_v1_principal_expiry_index", + "claims_assistant_v1_transition_index", + ]; fn snapshot(connection: &Connection) -> Vec> { connection @@ -896,100 +888,152 @@ mod schema_install_tests { .unwrap() } - fn plan(connection: &Connection, sql: &str, active: bool) -> Vec { - let parameters: Vec<&dyn rusqlite::ToSql> = if active { - vec![&GRANTED, &"assistant/chatgpt", &REVOKED, &POLICY, &100_u64] - } else { - vec![&GRANTED, &"assistant/chatgpt"] - }; + fn claims_indexes(connection: &Connection) -> Vec<(String, Option)> { connection - .prepare(&format!("EXPLAIN QUERY PLAN {sql}")) + .prepare("SELECT name,sql FROM sqlite_schema WHERE type='index' AND tbl_name='claims' ORDER BY name") .unwrap() - .query_map(parameters.as_slice(), |row| row.get(3)) + .query_map([], |row| Ok((row.get(0)?, row.get(1)?))) .unwrap() .collect::>() .unwrap() } - // These supported stores need additive DDL, not a data or version conversion. - for version in [18, 19, fractal_schema::STORAGE_VERSION] { - let directory = tempfile::tempdir().unwrap(); - let path = directory.path().join("claims.sqlite"); - let connection = Connection::open(&path).unwrap(); - connection.execute_batch(smallclaims::store::SCHEMA).unwrap(); - install_initial_schema(&connection, true).unwrap(); - connection.execute_batch("DROP INDEX claims_assistant_v1_principal_index;").unwrap(); - connection.pragma_update(None, "user_version", version).unwrap(); + fn append(connection: &Connection, id: &str, slot: u8, kind: &str, principal: &str, expiry: u64) { + let suffix = format!("{slot:024x}"); + let grant_id = format!("assistant-grant/{suffix}"); + let body = json!({"fields": { + "grant_id": grant_id, + "issuer": "person/owner", + "principal": principal, + "profile": "assistant", + "session_actor": format!("{principal}/session/{grant_id}"), + "credential_hash": "a".repeat(64), + "minimal_read_mode": "approval-once", + "disclosure_consent": true, + "expires_at_unix_ms": expiry, + "scopes": ["read.assistant.summary"] + }}); connection.execute( - "INSERT INTO batches(id,origin,replica_sequence,hash,accepted_at_unix_ms) VALUES('batch','node',1,'hash','1')", - [], + "INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) + VALUES(?1,'batch',?2,?3,'node','person/owner',?4,'[]','1')", + params![id, format!("custom/client/assistant-v1-{suffix}"), kind, body.to_string()], ).unwrap(); - for (id, subject, kind, body) in [ - ("legacy", "custom/client/legacy", GRANTED, r#"{"fields":{"expires_at_unix_ms":200}}"#), - ("chatgpt", "custom/client/chatgpt", GRANTED, r#"{"fields":{"principal":"assistant/chatgpt","expires_at_unix_ms":50}}"#), - ("mcp", "custom/client/mcp", GRANTED, r#"{"fields":{"principal":"assistant/mcp","expires_at_unix_ms":200}}"#), - ("policy", "custom/client/chatgpt", POLICY, r#"{"fields":{"expires_at_unix_ms":200}}"#), - ("revoked", "custom/client/legacy", REVOKED, r#"{"fields":{}}"#), - ("unrelated", "custom/test/unrelated", "custom.test.recorded", r#"{"fields":{}}"#), - ] { + } + + // Supported older stores retain their version and raw evidence. An intermediate + // build's indexes must also survive: rollback is additive, never DROP INDEX. + for version in [18, 19, fractal_schema::STORAGE_VERSION] { + for had_obsolete_indexes in [false, true] { + let directory = tempfile::tempdir().unwrap(); + let path = directory.path().join("claims.sqlite"); + // Use the public constructor so fleet-generation state and all other + // smallclaims initialization exist before exercising historical raw writes. + drop(Store::open(&path, "node").unwrap()); + let connection = Connection::open(&path).unwrap(); + let baseline_indexes = claims_indexes(&connection); + assert!(baseline_indexes.iter().any(|(name, _)| name == "claims_assistant_v1_credential_index")); + assert!(baseline_indexes.iter().all(|(name, _)| !OBSOLETE_INDEXES.contains(&name.as_str()))); + if had_obsolete_indexes { + // Historical DDL is a rollback fixture, not a production installation. + connection.execute_batch( + "CREATE INDEX claims_assistant_v1_principal_index + ON claims(kind, COALESCE(json_extract(body,'$.fields.principal'),'assistant/chatgpt')); + CREATE INDEX claims_assistant_v1_principal_expiry_index + ON claims(kind, COALESCE(json_extract(body,'$.fields.principal'),'assistant/chatgpt'), + json_extract(body,'$.fields.expires_at_unix_ms')); + CREATE INDEX claims_assistant_v1_transition_index + ON claims(subject, kind, origin, actor, store_index);" + ).unwrap(); + } + connection.pragma_update(None, "user_version", version).unwrap(); connection.execute( - "INSERT INTO claims(id,batch_id,subject,kind,origin,body,predecessors,accepted_at_unix_ms) VALUES(?1,'batch',?2,?3,'node',?4,'[]','1')", - params![id, subject, kind, body], + "INSERT INTO batches(id,origin,replica_sequence,hash,accepted_at_unix_ms) + VALUES('batch','node',1,'hash','1')", [], ).unwrap(); - } - let before = snapshot(&connection); - let plans_before = [plan(&connection, SELECT, false), plan(&connection, ACTIVE, true)]; - assert!(plans_before.iter().flatten().all(|detail| !detail.contains(INDEX))); - drop(connection); - - let connection = Connection::open(&path).unwrap(); - migrate_schema(&connection).unwrap(); - install_initial_schema(&connection, false).unwrap(); - assert_eq!(snapshot(&connection), before, "version {version}: claim bytes"); - assert_eq!( - connection.pragma_query_value(None, "user_version", |row| row.get::<_, u32>(0)).unwrap(), - version, - ); - for (sql, active, previous) in [(SELECT, false, &plans_before[0]), (ACTIVE, true, &plans_before[1])] { - let current = plan(&connection, sql, active); - eprintln!("assistant admission version={version} active={active} before={previous:?} after={current:?}"); - assert!( - current.iter().any(|detail| detail.contains("SEARCH") && detail.contains(INDEX) - && detail.contains("kind=?") && detail.contains("=?")), - "version {version}: before={previous:?}; after={current:?}", + append(&connection, "active", 1, authority::GRANTED, "assistant/chatgpt", 50); + append(&connection, "extended", 1, authority::POLICY, "assistant/chatgpt", 200); + append(&connection, "expired", 2, authority::GRANTED, "assistant/chatgpt", 50); + append(&connection, "revoked", 3, authority::GRANTED, "assistant/chatgpt", 200); + append(&connection, "revoke", 3, authority::REVOKED, "assistant/chatgpt", 200); + append(&connection, "mcp", 4, authority::GRANTED, "assistant/mcp", 200); + append(&connection, "unrelated", 5, "custom.test.recorded", "assistant/chatgpt", 200); + // These fixture rows model durable local appends. Truly old, + // unmarked raw evidence is ambiguous and must remain pending. + for id in ["active", "extended", "expired", "revoked", "revoke", "mcp"] { + connection.execute( + "INSERT INTO assistant_grant_local_appends(claim_id) VALUES(?1)", [id], + ).unwrap(); + } + let before = snapshot(&connection); + let indexes_before = claims_indexes(&connection); + drop(connection); + + let connection = Connection::open(&path).unwrap(); + migrate_schema(&connection).unwrap(); + install_initial_schema(&connection, false).unwrap(); + authority::install(&connection, "node").unwrap(); + assert!(authority::candidates(&connection, "assistant/chatgpt", "person/owner", Some(100), None, None).is_err()); + // A zero-budget slice makes partial progress without marking it ready. + assert!(!authority::backfill_slice(&connection, Duration::ZERO).unwrap()); + assert!(authority::ready(&connection).is_err()); + while !authority::backfill_slice(&connection, Duration::from_secs(1)).unwrap() {} + authority::ready(&connection).unwrap(); + assert_eq!(snapshot(&connection), before, "version {version}: raw evidence"); + assert_eq!(claims_indexes(&connection), indexes_before, "projection must not build or drop raw claims indexes"); + assert_eq!( + connection.pragma_query_value(None, "user_version", |row| row.get::<_, u32>(0)).unwrap(), + version, ); - } - for (principal, mut expected) in [ - ("assistant/chatgpt", vec!["chatgpt".to_owned(), "legacy".to_owned()]), - ("assistant/mcp", vec!["mcp".to_owned()]), - ] { - let mut found = connection.prepare(SELECT).unwrap() - .query_map(params![GRANTED, principal], |row| row.get::<_, String>(0)) + let active = authority::candidates(&connection, "assistant/chatgpt", "person/owner", Some(100), None, None).unwrap(); + assert_eq!(active.iter().map(|claim| claim.id.as_str()).collect::>(), vec!["active"]); + assert_eq!( + authority::candidates(&connection, "assistant/mcp", "person/owner", Some(100), None, None).unwrap() + .iter().map(|claim| claim.id.as_str()).collect::>(), + vec!["mcp"], + ); + assert_eq!( + authority::candidates(&connection, "assistant/chatgpt", "person/owner", None, None, None).unwrap().len(), + 3, + "no cutoff retains expired and revoked validation candidates", + ); + let plan = connection.prepare(&format!("EXPLAIN QUERY PLAN {}", authority::CANDIDATES_QUERY)).unwrap() + .query_map(params!["assistant/chatgpt", "person/owner", authority::expiry_key(100), Option::::None, Option::::None], |row| row.get::<_, String>(3)) .unwrap().collect::>>().unwrap(); - found.sort(); - expected.sort(); - assert_eq!(found, expected); + assert!(plan.iter().any(|step| step.contains("SEARCH") + && step.contains("assistant_grant_effective_active_index") + && step.contains("principal=? AND owner=? AND revoked=? AND expires_at>?")), "{plan:?}"); + assert!(plan.iter().all(|step| !step.contains("SCAN claims") && !step.contains("SEARCH claims")), "{plan:?}"); + + // An older build's raw revoke fences its subject before and + // after reconciliation: origin text cannot authenticate it, + // but pending revocation must not authorize a stale grant. + append(&connection, "late-revoke", 1, authority::REVOKED, "assistant/chatgpt", 200); + authority::ready(&connection).unwrap(); + assert_eq!(authority::candidates(&connection, "assistant/chatgpt", "person/owner", Some(100), None, None) + .unwrap().iter().map(|claim| claim.id.as_str()).collect::>(), vec!["active"]); + assert!(!authority::contains(&connection, "active").unwrap()); + while !authority::backfill_slice(&connection, Duration::from_secs(1)).unwrap() {} + assert_eq!(authority::candidates(&connection, "assistant/chatgpt", "person/owner", Some(100), None, None) + .unwrap().iter().map(|claim| claim.id.as_str()).collect::>(), vec!["active"]); + assert!(!authority::contains(&connection, "active").unwrap()); + assert!(!authority::contains(&connection, "late-revoke").unwrap()); + let after = snapshot(&connection); + let cookie: u32 = connection.pragma_query_value(None, "schema_version", |row| row.get(0)).unwrap(); + drop(connection); + + let connection = Connection::open(&path).unwrap(); + migrate_schema(&connection).unwrap(); + install_initial_schema(&connection, false).unwrap(); + authority::install(&connection, "node").unwrap(); + authority::ready(&connection).unwrap(); + assert_eq!(snapshot(&connection), after); + assert_eq!(claims_indexes(&connection), indexes_before); + assert_eq!( + connection.pragma_query_value(None, "schema_version", |row| row.get::<_, u32>(0)).unwrap(), + cookie, + "an unchanged reopen must not rebuild projection or baseline indexes", + ); } - let active = connection.prepare(ACTIVE).unwrap() - .query_map(params![GRANTED, "assistant/chatgpt", REVOKED, POLICY, 100_u64], |row| row.get::<_, String>(0)) - .unwrap().collect::>>().unwrap(); - assert_eq!(active, vec!["chatgpt"]); - let unfiltered = connection.prepare(ACTIVE).unwrap() - .query_map(params![GRANTED, "assistant/chatgpt", REVOKED, POLICY, Option::::None], |row| row.get::<_, String>(0)) - .unwrap().collect::>>().unwrap(); - assert_eq!(unfiltered.len(), 2, "no cutoff preserves unfiltered validation candidates"); - let cookie: u32 = connection.pragma_query_value(None, "schema_version", |row| row.get(0)).unwrap(); - drop(connection); - - let connection = Connection::open(&path).unwrap(); - migrate_schema(&connection).unwrap(); - install_initial_schema(&connection, false).unwrap(); - assert_eq!(snapshot(&connection), before); - assert_eq!( - connection.pragma_query_value(None, "schema_version", |row| row.get::<_, u32>(0)).unwrap(), - cookie, - "an unchanged reopen must not rebuild the index", - ); } } diff --git a/crates/fractal-store/src/store/shared.rs b/crates/fractal-store/src/store/shared.rs index d796a6ecc65..5cd56982aec 100644 --- a/crates/fractal-store/src/store/shared.rs +++ b/crates/fractal-store/src/store/shared.rs @@ -259,6 +259,15 @@ impl Store { .map_err(internal)?; if inserted != 0 { let index = transaction.last_insert_rowid() as u64; + if matches!(claim.kind.as_str(), + smallclaims::store::assistant_grant_authority::GRANTED + | smallclaims::store::assistant_grant_authority::POLICY + | smallclaims::store::assistant_grant_authority::REVOKED) + { + smallclaims::store::assistant_grant_authority::refresh_claim( + &transaction, &claim.id, + ).map_err(internal)?; + } let effective = register_operation_tx(&transaction, claim).map_err(internal)?; if effective { insert_event( diff --git a/crates/fractal/src/assistant_grant_authority_wake_tests.rs b/crates/fractal/src/assistant_grant_authority_wake_tests.rs new file mode 100644 index 00000000000..b1f28ac598c --- /dev/null +++ b/crates/fractal/src/assistant_grant_authority_wake_tests.rs @@ -0,0 +1,85 @@ +use super::*; +use smallclaims::store::assistant_grant_authority as authority; + +#[tokio::test] +async fn completed_authority_reconciles_older_build_appends_without_reopen() { + let store = Arc::new(Store::open_memory("node").unwrap()); + while !store.advance_assistant_grant_authority_backfill().unwrap() {} + assert!(authority::ready(&store.readers.get()).is_ok()); + let task = tokio::spawn(build_assistant_grant_authority(store.clone())); + // The old writer bypasses projection hooks. Only the persistent insert + // trigger and the store's commit notification connect it to maintenance. + // An invalid grant is still durable dirty work and must be reconciled. + store.connection.write().execute_batch( + /* sqlite-large-value: allow-for-now lv-h212901f6fe4a owner=fractal::assistant_grant_authority_wake_tests TODO=chunk-or-reference-exact-wire-values */ "INSERT INTO batches(id,origin,replica_sequence,hash,accepted_at_unix_ms) + VALUES('batch/old-writer','node',1,'old-writer','1');" + ).unwrap(); + // Two independently committed appends ensure this exercises an already + // completed worker, even if its first poll races the initial raw append. + for id in ["claim/old-writer/first", "claim/old-writer/second"] { + store.connection.write().execute( + /* sqlite-large-value: allow-for-now lv-h89976b37066a owner=fractal::assistant_grant_authority_wake_tests TODO=prepare-body-and-predecessor-values */ "INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) + VALUES(?1,'batch/old-writer','custom/client/assistant-v1-invalid', + 'custom.client.assistant.v1.granted','node','person/owner','{}','[]','1')", + [id], + ).unwrap(); + authority::ready(&store.readers.get()).unwrap(); + tokio::time::timeout(Duration::from_secs(5), async { + loop { + if !authority::maintenance_pending(&store.readers.get()).unwrap() { break; } + tokio::task::yield_now().await; + } + }).await.expect("a completed projection wakes and drains compatibility work"); + assert!(!authority::contains(&store.readers.get(), id).unwrap()); + } + task.abort(); +} + +#[tokio::test] +async fn authority_commit_between_completed_drain_and_wait_is_not_lost() { + let store = Arc::new(Store::open_memory("node").unwrap()); + while !store.advance_assistant_grant_authority_backfill().unwrap() {} + let mut maintenance = AssistantGrantAuthorityMaintenance::new(store.clone()); + assert!(maintenance.advance().await.unwrap(), "the drain completed"); + // Deterministically place this commit after the completed drain and before + // waiting. No scheduler timing or sleep is needed to hit the race boundary. + store.connection.write().execute_batch( + /* sqlite-large-value: allow-for-now lv-h0c36a77fc900 owner=fractal::assistant_grant_authority_wake_tests TODO=chunk-or-reference-exact-wire-values */ "BEGIN; + INSERT INTO batches(id,origin,replica_sequence,hash,accepted_at_unix_ms) + VALUES('batch/race','node',1,'race','1'); + INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) + VALUES('claim/race','batch/race','custom/client/assistant-v1-invalid', + 'custom.client.assistant.v1.granted','node','person/owner','{}','[]','1'); + COMMIT;" + ).unwrap(); + authority::ready(&store.readers.get()).unwrap(); + assert!(authority::maintenance_pending(&store.readers.get()).unwrap()); + tokio::time::timeout(Duration::from_secs(5), maintenance.changes.changed()) + .await.expect("the intervening commit stays visible") + .expect("the observer remains registered"); + assert!(maintenance.advance().await.unwrap()); + assert!(authority::ready(&store.readers.get()).is_ok()); + assert!(!authority::maintenance_pending(&store.readers.get()).unwrap()); +} + +#[tokio::test] +async fn authority_maintenance_shutdown_exits_and_unregisters_its_observer() { + let store = Arc::new(Store::open_memory("node").unwrap()); + while !store.advance_assistant_grant_authority_backfill().unwrap() {} + let mut maintenance = AssistantGrantAuthorityMaintenance::new(store.clone()); + assert!(maintenance.advance().await.unwrap()); + let mut changes = maintenance.changes.clone(); + let task = tokio::spawn(maintenance.run()); + tokio::task::yield_now().await; + task.abort(); + assert!(task.await.unwrap_err().is_cancelled(), "shutdown exits the loop"); + // Only the registered observer owns the sender. A closed receiver proves + // cancellation dropped the observer callback, not just the task's receiver. + tokio::time::timeout(Duration::from_secs(5), changes.changed()).await + .expect("shutdown drops the observer without waiting for another commit") + .expect_err("no observer sender remains registered"); + store.connection.write().execute( + /* sqlite-large-value: allow-for-now lv-hb8c82682a9d0 owner=fractal::assistant_grant_authority_wake_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO meta(key,value) VALUES('authority-after-shutdown','1')", [], + ).unwrap(); + assert!(changes.has_changed().is_err(), "later commits cannot invoke the removed observer"); +} diff --git a/crates/fractal/src/main.rs b/crates/fractal/src/main.rs index 99008097da7..709e128d3c8 100644 --- a/crates/fractal/src/main.rs +++ b/crates/fractal/src/main.rs @@ -7833,6 +7833,7 @@ async fn run_up(args: UpArgs) -> Result<()> { spawn_publication_evidence(store.clone()); tokio::spawn(build_transport_observation_index(store.clone())); tokio::spawn(build_operation_claim_digests(store.clone())); + tokio::spawn(build_assistant_grant_authority(store.clone())); startup_telemetry.serving(); let ready_at = Instant::now(); startup_phases.log_ready( @@ -20993,6 +20994,71 @@ async fn build_transport_observation_index(store: Arc) { } } +/// Continue the persisted authority cursor after serving begins, then reconcile +/// compatibility-trigger work on commits. Subscribe before checking readiness so +/// an older-build append between the check and the wait cannot be lost. +async fn build_assistant_grant_authority(store: Arc) { + AssistantGrantAuthorityMaintenance::new(store).run().await; +} + +/// Own the subscription for exactly the maintenance task's lifetime. Splitting +/// one page from the wait also makes the drain-to-wait boundary explicit. +struct AssistantGrantAuthorityMaintenance { + store: Arc, + changes: tokio::sync::watch::Receiver<()>, + _observer: smallclaims::sqlite::CommitObserver, +} + +impl AssistantGrantAuthorityMaintenance { + fn new(store: Arc) -> Self { + let (changed, changes) = tokio::sync::watch::channel(()); + let observer = store.observe_commits(move |connection| { + if connection.is_autocommit() { + changed.send_replace(()); + } + }); + Self { store, changes, _observer: observer } + } + + async fn advance(&mut self) -> Result { + // Consume before the read, not after draining: a commit between the + // read/drain and changed().await must remain an unseen generation. + self.changes.borrow_and_update(); + let worker = self.store.clone(); + tokio::task::spawn_blocking(move || { + if !worker.assistant_grant_authority_maintenance_pending()? { + return Ok(true); + } + worker.advance_assistant_grant_authority_backfill() + }).await? + } + + async fn run(mut self) { + loop { + match self.advance().await { + Ok(true) => { + if self.changes.changed().await.is_err() { + return; + } + continue; + } + Ok(false) => {} + Err(error) if maintenance_contention(&error) => {} + error => { + stderr_message("st", format_args!("assistant grant authority backfill stopped: {error:?}; restart resumes its committed cursor")); + return; + } + } + // Each page releases the writer. Yield scheduling, never time-based + // pacing: persisted work resumes immediately in another transaction. + tokio::task::yield_now().await; + } + } +} + +#[cfg(test)] +mod assistant_grant_authority_wake_tests; + /// This starts only after both APIs serve. Each page reads up to 32 operation claims on a /// reader, then joins the managed background writer queue only to insert their keys, and /// yields for 100 ms. The operation audit reads bodies until the last page marks it ready. diff --git a/crates/fractal/tests/assistant_native.rs b/crates/fractal/tests/assistant_native.rs index 2dd1aa0f9c5..31397bdc739 100644 --- a/crates/fractal/tests/assistant_native.rs +++ b/crates/fractal/tests/assistant_native.rs @@ -605,7 +605,7 @@ async fn writer_transaction_rechecks_policy_revision_actor_scope_and_revocation( } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] -async fn synchronous_send_rechecks_revocation_and_scope_removal_before_commit() { +async fn synchronous_send_rechecks_pending_subject_revocation_and_scope_removal_before_commit() { let h = Arc::new(Harness::new()); let paired = h.pair().await; let gate = h.root.path().join("mutation-gate"); @@ -614,10 +614,10 @@ async fn synchronous_send_rechecks_revocation_and_scope_removal_before_commit() let count_messages = || connection.query_row( "SELECT count(*) FROM claims WHERE kind='message.sent'", [], |row| row.get::<_, u64>(0), ).unwrap(); - for revoke in [false, true] { + for change in ["pending-subject", "scope", "revocation"] { h.policy(&paired, scopes()).await; let before = count_messages(); - let request = h.message(AGENT, if revoke { "held-revoke" } else { "held-scope" }).await; + let request = h.message(AGENT, &format!("held-{change}")).await; for name in ["hold", "entered", "release", "done"] { let path = gate.join(name); if path.exists() { std::fs::remove_file(path).unwrap(); } @@ -634,7 +634,14 @@ async fn synchronous_send_rechecks_revocation_and_scope_removal_before_commit() tokio::time::sleep(std::time::Duration::from_millis(5)).await; } assert!(!send.is_finished(), "synchronous send must still await its mutation"); - if revoke { + if change == "pending-subject" { + let granted = h.state.store.latest_claim( + &grant_subject(&paired), Some("custom.client.assistant.v1.granted"), + ).unwrap().unwrap(); + connection.execute( + "INSERT INTO assistant_grant_dirty(claim_id) VALUES(?1)", [&granted.id], + ).unwrap(); + } else if change == "revocation" { h.owner("POST", &grant_path(&paired, "/revoke"), &json!({})).await; } else { h.owner("POST", &grant_path(&paired, "/policy"), &AssistantGrantPolicy { @@ -651,7 +658,16 @@ async fn synchronous_send_rechecks_revocation_and_scope_removal_before_commit() let (status, denial) = send.await.unwrap(); assert!(!status.is_success(), "{denial}"); assert_eq!(denial["code"], "forbidden", "{denial}"); + assert_eq!(denial["message"], "assistant write authorization changed or expired before commit"); + assert!(!denial.to_string().contains("not-ready"), "{denial}"); assert_eq!(count_messages(), before, "denied send must append no message claim"); + if change == "pending-subject" { + connection.execute( + "DELETE FROM assistant_grant_dirty WHERE claim_id IN + (SELECT id FROM claims WHERE subject=?1)", + [grant_subject(&paired)], + ).unwrap(); + } } } diff --git a/crates/fractal/tests/daemon_cost/assistant_admission.rs b/crates/fractal/tests/daemon_cost/assistant_admission.rs index 6ec1c66e755..ddbeeda2340 100644 --- a/crates/fractal/tests/daemon_cost/assistant_admission.rs +++ b/crates/fractal/tests/daemon_cost/assistant_admission.rs @@ -1,21 +1,82 @@ //! Opt-in, real HTTP/Unix daemon measurement (not a router oneshot or mocked daemon). -//! Run this same test source on 98e550cb and on PR3-B, sequentially on one host: +//! Run this same source sequentially on each revision, from that worktree root. +//! Bind the build to its source revision and select the executable from Cargo JSON, +//! NEVER by searching a shared target directory for `integration-*` (stale head/base +//! binaries can coexist). `baseline` is a scenario label, NOT executable identity. //! ```sh -//! ST_ADMISSION_VARIANT=baseline cargo test --release -p fractal --test integration daemon_cost::assistant_admission::authenticated_get_during_pairing -- --exact --nocapture --test-threads=1 -//! ST_ADMISSION_VARIANT=indexed cargo test --release -p fractal --test integration daemon_cost::assistant_admission::authenticated_get_during_pairing -- --exact --nocapture --test-threads=1 +//! export ST_ADMISSION_SOURCE_ROOT="$PWD" +//! export ST_ADMISSION_EXPECT_REVISION="$(git rev-parse HEAD)" +//! export ST_ADMISSION_BUILD_REVISION="$ST_ADMISSION_EXPECT_REVISION" +//! export ST_ADMISSION_BUILD_PROVENANCE="git worktree; harness backport only; cargo command below" +//! export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-$PWD/tmp/867-admission/target}" +//! mkdir -p "$PWD/tmp/867-admission" +//! cargo test --release -p fractal --test integration --no-run --message-format=json > "$PWD/tmp/867-admission/build.jsonl" +//! export ST_ADMISSION_BINARY="$(jq -rs '[.[] | select(.reason == "compiler-artifact" and .target.name == "integration" and .profile.test and .executable != null) | .executable] | unique | if length == 1 then .[0] else error("expected one integration test executable") end' "$PWD/tmp/867-admission/build.jsonl")" +//! # Like-for-like counts: run N=2 AND N=5 at BOTH revisions; fresh profiles. +//! # Set variant=baseline on base, indexed on head. Do not reuse an old binary. +//! for n in 2 5; do +//! ST3_PROFILE_DIR="$PWD/tmp/867-admission/$ST_ADMISSION_EXPECT_REVISION-n$n-profile" ST3_PROFILE_SLOW_MS=0 ST_ADMISSION_VARIANT=indexed ST_ADMISSION_LOCAL_ACTIVE="$n" ST_ADMISSION_READ_COUNTS_ONLY=1 ST_ADMISSION_WRONG_ORIGIN_OVERLAYS=0 ST_ADMISSION_FOREIGN_ACTIVE=0 ST_ADMISSION_REPORT="$PWD/tmp/867-admission/$ST_ADMISSION_EXPECT_REVISION-n$n.json" "$ST_ADMISSION_BINARY" daemon_cost::assistant_admission::authenticated_get_during_pairing --exact --nocapture --test-threads=1 +//! done +//! # Head only, full extended q39: 2 local + 3 authenticated foreign grants, +//! # 10000 expired grants/principal, 3 renewals each, 1000 overlays/active grant, +//! # 200 concurrent GET/completion pairs/mode; do NOT set READ_COUNTS_ONLY. +//! ST3_PROFILE_DIR="$PWD/tmp/867-admission/$ST_ADMISSION_EXPECT_REVISION-q39-profile" ST3_PROFILE_SLOW_MS=0 ST_ADMISSION_VARIANT=indexed ST_ADMISSION_LOCAL_ACTIVE=2 ST_ADMISSION_HISTORY=10000 ST_ADMISSION_SAMPLES=200 ST_ADMISSION_FOREIGN_ACTIVE=3 ST_ADMISSION_WRONG_ORIGIN_OVERLAYS=1000 ST_ADMISSION_REPORT="$PWD/tmp/867-admission/$ST_ADMISSION_EXPECT_REVISION-q39.json" "$ST_ADMISSION_BINARY" daemon_cost::assistant_admission::authenticated_get_during_pairing --exact --nocapture --test-threads=1 //! ``` -//! Copy only this file and its `mod assistant_admission;` registration to the A worktree. -//! The baseline must actually be built from 98e550cb: dropping an index on PR3-B does not -//! restore A's admission query. Use distinct CARGO_TARGET_DIR paths for the two worktrees: -//! Cargo freshness can otherwise reuse the baseline's artifacts for the indexed checkout. +//! Backport to base d477c67ad1: copy this file, add `mod assistant_admission;` to +//! crates/fractal/tests/daemon_cost.rs, and replace ONLY `revision_api`'s body +//! with the documented base body below. Build there using the commands above; +//! change VARIANT to baseline in the counts loop. Base supports local N=2/5, +//! but requires READ_COUNTS_ONLY=1, FOREIGN_ACTIVE=0, WRONG_ORIGIN_OVERLAYS=0. +//! It has no provenance API and does not ignore foreign overlays or expose an indexed probe. +//! For a git archive (no .git), set ST_ADMISSION_SOURCE_REVISION to the archived +//! full commit ID and ST_ADMISSION_SOURCE_PROVENANCE to the exact archive command +//! and source/build evidence location; retain the build env above and set EXPECT +//! to that ID explicitly instead of git rev-parse. These are declared provenance, +//! not a claim that a reused binary was built from that archive. The executable's +//! embedded revision MUST match EXPECT; its canonical path and SHA256 are reported. +//! A worktree report records actual `git rev-parse HEAD`; archives record null for +//! that observation and separately record the explicit source revision/evidence. +//! Counts are observations, not expectations: rerun true base N=2 to establish or +//! explain the previously cited 4/12/16 (auth/caller-bound/approval-once) counts. +//! Old base 8/8/9 with identical head SQL is not evidence of base behavior without +//! executable identity. Compare direct auth separately from GET: receipt/proof work +//! and the number of live grants differ. Never relabel an existing report as base. +//! Prior run: `git archive d477c67ad1` into a base directory, harness-only +//! backport, then `cargo test --release -p fractal --test integration ...` in a +//! shared target directory previously used by head. The retained report +//! /var/tmp/867c-evidence/fix/base-counts-1.json lacked executable identity. +//! This fixture serves routers IN PROCESS: daemon_bench's standalone binary +//! discovery cannot explain its direct-auth measurement. A reused integration +//! executable/dependency artifact is a hypothesis, not an established cause. +//! Source inspection of d477c67ad1 authenticate/session implies four acquisitions +//! (digest lookup, claim_by_id, POLICY, REVOKED), independent of N. GET 12/16 must +//! be remeasured with the same route, proof, receipt flush and profiling scope; +//! they are not asserted as expected counts by this fixture. Retain reports and +//! build JSON to distinguish executable reuse from instrumentation/scope differences. //! ST_ADMISSION_HISTORY (default 10000) is expired grants PER principal; ST_ADMISSION_SAMPLES //! (default 200) is measured GET/completion pairs PER read mode. Setup and proof creation are //! outside timing. Each pair starts behind a barrier, with no sleeps, polling, retries or timers. -//! ST_ADMISSION_REPORT optionally saves the complete JSON report. Hardware is observed -//! from uname/lscpu in the report, not inferred from an environment label. -//! The index DDL timing is a synthetic startup migration probe on the populated disposable -//! real store, not total daemon startup or cold-disk startup. Latencies use the real daemon's -//! bound sockets, bearer middleware, grant lookup, projection and durable approval consumption. +//! ST_ADMISSION_FOREIGN_ACTIVE optionally adds verified same-profile active foreign grants +//! (default 0; use 3 for the provenance-check scenario). ST_ADMISSION_REPORT optionally +//! saves the complete JSON report. Hardware is observed from uname/lscpu, not inferred. +//! ST_ADMISSION_LOCAL_ACTIVE (default 2, minimum 2) creates that many local active +//! grants, including the two measured modes; total N is local + FOREIGN_ACTIVE. +//! Extra local grants use caller-bound-allow and remain active throughout sampling. +//! Each expired grant has three still-expired POLICY renewals. Each active session has +//! ST_ADMISSION_WRONG_ORIGIN_OVERLAYS (default 1000; 0 allowed) authenticated wrong-origin +//! overlays, alternating POLICY and REVOKED; every measured read must still succeed. +//! ST_ADMISSION_READ_COUNTS_ONLY=1 measures only read counts: it skips the +//! candidate SQL, latency pairs, the q39 gate and the release-build requirement. +//! Read counts require a fresh ST3_PROFILE_DIR and ST3_PROFILE_SLOW_MS=0. The existing +//! profile `read_acquisitions` counts pooled read-connection/snapshot acquisitions per +//! operation (not SQL rows), for direct authentication and one standalone GET per mode. +//! SQL work uses existing smallclaims sqlite::work trace counters (statements/VM steps). +//! Authentication work is thread-scoped; standalone GET work is process-global through the +//! receipt flush and can include background daemon SQL. No production code changes. +//! Current-head candidate diagnostics read the effective authority projection only; +//! the separate historical index DDL probe is not a current admission measurement. +//! Latencies use the real daemon's bound sockets, bearer middleware, grant lookup, +//! projection and durable approval consumption. use std::{collections::BTreeMap, path::PathBuf, sync::Arc, time::{Instant, SystemTime, UNIX_EPOCH}}; @@ -28,22 +89,14 @@ use serde_json::{Value, json}; use tokio::sync::Barrier; const OWNER: &str = "person/bench-operator"; -const NODE: &str = "admission-bench"; +const NODE: &str = "benchmark-member"; const GRANTED: &str = "custom.client.assistant.v1.granted"; -const INDEX: &str = "claims_assistant_v1_principal_index"; -const CREATE_INDEX: &str = "CREATE INDEX claims_assistant_v1_principal_index ON claims(kind,COALESCE(json_extract(body,'$.fields.principal'),'assistant/chatgpt'))"; +const POLICY: &str = "custom.client.assistant.v1.policy"; +const REVOKED: &str = "custom.client.assistant.v1.revoked"; +const INDEX: &str = "claims_assistant_v1_principal_expiry_index"; +const CREATE_INDEX: &str = "CREATE INDEX claims_assistant_v1_principal_expiry_index ON claims(kind,COALESCE(json_extract(body,'$.fields.principal'),'assistant/chatgpt'),json_extract(body,'$.fields.expires_at_unix_ms'))"; const A_QUERY: &str = "SELECT id FROM claims WHERE kind=?1 AND COALESCE(json_extract(body,'$.fields.principal'),'assistant/chatgpt')=?2"; -const INDEXED_QUERY: &str = - "SELECT id FROM claims WHERE kind=?1 AND COALESCE(json_extract(body,'$.fields.principal'),'assistant/chatgpt')=?2 - AND (?5 IS NULL OR NOT EXISTS (SELECT 1 FROM claims AS revoked WHERE revoked.subject=claims.subject AND revoked.kind=?3)) - AND (?5 IS NULL OR COALESCE( - (SELECT CASE WHEN json_type(policy.body,'$.fields') IS NULL THEN 1 ELSE - COALESCE(json_type(policy.body,'$.fields.expires_at_unix_ms')='integer' - AND json_extract(policy.body,'$.fields.expires_at_unix_ms')>?5,0) END - FROM claims AS policy WHERE policy.subject=claims.subject AND policy.kind=?4 ORDER BY policy.store_index DESC LIMIT 1), - CASE WHEN json_type(body,'$.fields') IS NULL THEN 1 ELSE - COALESCE(json_type(body,'$.fields.expires_at_unix_ms')='integer' - AND json_extract(body,'$.fields.expires_at_unix_ms')>?5,0) END))"; +const PROJECTION_INDEX: &str = "assistant_grant_effective_active_index"; const PATH: &str = "/v1/client/assistant/summary"; fn number(name: &str, default: usize) -> usize { @@ -52,6 +105,64 @@ fn number(name: &str, default: usize) -> usize { value } +fn count(name: &str, default: usize) -> usize { + std::env::var(name).map_or(default, |s| s.parse().expect("nonnegative integer setting")) +} + +/// Bind source checkout/archive, build declaration and the actual running executable. +/// Embedded env values are Cargo-tracked inputs, not runtime overrides of old artifacts. +fn execution_identity() -> Value { + let required = |name: &str| std::env::var(name).unwrap_or_else(|_| panic!("set {name}; see harness instructions")); + let expected = required("ST_ADMISSION_EXPECT_REVISION"); + assert_eq!(expected.len(), 40, "use a full commit ID"); + assert!(expected.bytes().all(|byte| byte.is_ascii_hexdigit()), "use a full commit ID"); + let (Some(built_revision), Some(build_provenance)) = ( + option_env!("ST_ADMISSION_BUILD_REVISION"), + option_env!("ST_ADMISSION_BUILD_PROVENANCE"), + ) else { + panic!("opt-in measurement requires build revision and provenance; see harness instructions"); + }; + assert!(!build_provenance.trim().is_empty(), "build provenance must not be empty"); + assert_eq!(built_revision, expected, "the executable was built for a different source revision"); + let binary = std::env::current_exe().unwrap().canonicalize().unwrap(); + assert_eq!(binary, PathBuf::from(required("ST_ADMISSION_BINARY")).canonicalize().unwrap(), + "execute the explicitly selected Cargo artifact"); + let source_root = PathBuf::from(required("ST_ADMISSION_SOURCE_ROOT")).canonicalize().unwrap(); + let (git_head, source_revision, source_provenance) = if source_root.join(".git").exists() { + let git = |args: &[&str]| { + let output = std::process::Command::new("git").arg("-C").arg(&source_root).args(args).output().unwrap(); + assert!(output.status.success(), "git identity command failed"); + String::from_utf8(output.stdout).unwrap().trim().to_owned() + }; + assert_eq!(PathBuf::from(git(&["rev-parse", "--show-toplevel"])).canonicalize().unwrap(), source_root); + let head = git(&["rev-parse", "HEAD"]); + assert_eq!(head, expected, "source checkout and executable revision differ"); + let status = git(&["status", "--porcelain", "--untracked-files=no"]); + (Some(head.clone()), head, format!("git worktree; tracked changes:\n{status}")) + } else { + let revision = required("ST_ADMISSION_SOURCE_REVISION"); + let provenance = required("ST_ADMISSION_SOURCE_PROVENANCE"); + assert_eq!(revision, expected, "archive source and executable revision differ"); + assert!(!provenance.trim().is_empty(), "archive evidence must not be empty"); + (None, revision, provenance) + }; + use std::io::Read as _; + let mut executable = std::fs::File::open(&binary).unwrap(); + let mut hash = ring::digest::Context::new(&ring::digest::SHA256); + let mut buffer = [0_u8; 65_536]; + loop { + let bytes = executable.read(&mut buffer).unwrap(); + if bytes == 0 { break; } + hash.update(&buffer[..bytes]); + } + let sha256 = hex::encode(hash.finish().as_ref()); + json!({"git_rev_parse_head":git_head,"source_revision":source_revision, + "source_root":source_root,"source_provenance":source_provenance, + "binary_path":binary,"binary_sha256":sha256,"build_revision":built_revision, + "build_provenance":build_provenance, + "identity_limit":"build/archive provenance is explicitly supplied; SHA256 identifies executed bytes, not independent source attestation"}) +} + fn value(response: Value) -> Value { response.get("value").cloned().unwrap_or(response) } @@ -98,38 +209,135 @@ fn proof(paired: &Value, signer: &Ed25519KeyPair, sequence: usize) -> String { URL_SAFE_NO_PAD.encode(serde_json::to_vec(&json!({"payload":payload,"signature":signature})).unwrap()) } -fn explain(connection: &rusqlite::Connection, query: &str) -> Vec { +fn explain(connection: &rusqlite::Connection, query: &str, parameters: &[&dyn rusqlite::ToSql]) -> Vec { let mut statement = connection.prepare(&format!("EXPLAIN QUERY PLAN {query}")).unwrap(); - let mut rows = if query == A_QUERY { - statement.query(rusqlite::params![GRANTED, "assistant/chatgpt"]).unwrap() - } else { - statement.query(rusqlite::params![GRANTED, "assistant/chatgpt", "custom.client.assistant.v1.revoked", - "custom.client.assistant.v1.policy", - u64::try_from(SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_millis()).unwrap()]).unwrap() - }; + let mut rows = statement.query(parameters).unwrap(); let mut plan = Vec::new(); while let Some(row) = rows.next().unwrap() { plan.push(row.get::<_, String>(3).unwrap()); } plan } -fn p95(samples: &mut [f64]) -> f64 { +fn p95(samples: &mut [f64]) -> Option { samples.sort_by(f64::total_cmp); - samples[(samples.len() * 95).div_ceil(100) - 1] + (!samples.is_empty()).then(|| samples[(samples.len() * 95).div_ceil(100) - 1]) +} + +fn sql_work(work: smallclaims::sqlite::work::SqliteWork) -> Value { + assert!(work.statements > 0, "SQL work instrumentation must be enabled"); + json!({"statements":work.statements,"vm_steps":work.vm_steps, + "fullscan_steps":work.fullscan_steps,"sorts":work.sorts,"autoindex_rows":work.autoindex_rows}) +} + +fn profile_lines(path: &std::path::Path) -> usize { + std::fs::read_to_string(path).map_or(0, |log| log.lines().count()) +} + +/// The read acquisitions of the single `label` operation recorded after line `from`. +fn profile_reads(path: &std::path::Path, from: usize, label: &str) -> u64 { + let log = std::fs::read_to_string(path).expect("profile slow.jsonl must be readable"); + let rows = log.lines().skip(from).map(|line| serde_json::from_str::(line).unwrap()) + .filter(|row| row["label"] == label).collect::>(); + assert_eq!(rows.len(), 1, "expected exactly one new {label} profile row; set ST3_PROFILE_SLOW_MS=0"); + rows[0]["read_acquisitions"].as_u64().expect("profile rows report read_acquisitions") +} + +// Real signed membership and replication, outside measured requests. Merely +// copying origin text would not exercise the authentication provenance check. +fn foreign_same_profile(store: &Store, anchor: Arc, template: &Value, count: usize, active: &[(String, Value)], overlays: usize) { + let fleet = super::super::daemon_bench::FLEET; + store.pin_fleet_anchor(anchor.public()).unwrap(); + store.set_member_key(Some(anchor.clone())).unwrap(); + store.admit_fleet_anchor(fleet, anchor.public(), "listening").unwrap(); + let peer = Store::open_memory("benchmark-peer").unwrap(); + peer.bind_fleet(fleet).unwrap(); + let key = Arc::new(smallclaims::fleet::MemberKey::generate().unwrap().0); + peer.pin_fleet_anchor(anchor.public()).unwrap(); + peer.set_member_key(Some(key.clone())).unwrap(); + store.append_claim(&ClaimInput { + subject:"host/benchmark-peer".into(), kind:"fleet.member-admitted".into(), + actor:Some(OWNER.into()), fields:serde_json::from_value(json!({ + "fleet_id":fleet,"member_key":key.public(),"via":"invite","mode":"listening" + })).unwrap(), evidence:vec![], expected_subject:None, idempotency_key:None, + }).unwrap(); + let sync = |from: &Store, to: &Store| { + let exchange = from.export_replication_exchange_answering( + fleet, &to.replication_inventory().unwrap(), &to.replication_signature_requests().unwrap(), + ).unwrap(); + to.receive_replication_exchange(from.origin(), fleet, &exchange).unwrap(); + to.validate_replication_backlog().unwrap(); + to.project_replication_backlog().unwrap(); + }; + sync(store, &peer); + let mut ids = Vec::new(); + for row in 0..count { + let id = format!("{:024x}", row + 1); + let mut fields = template.clone(); + fields["grant_id"] = json!(id); + fields["session_actor"] = json!(format!("assistant/chatgpt/session/{id}")); + fields["expires_at_unix_ms"] = json!(u64::MAX); + fields["credential_hash"] = json!(hex::encode(ring::digest::digest(&ring::digest::SHA256, id.as_bytes()).as_ref())); + let grant = peer.append_claim(&ClaimInput { + subject:format!("custom/client/assistant-v1-{id}"), kind:GRANTED.into(), + actor:Some(OWNER.into()), fields:serde_json::from_value(fields).unwrap(), + evidence:vec![], expected_subject:None, idempotency_key:None, + }).unwrap(); + ids.push(grant.id); + } + for (subject, template) in active { + for row in 0..overlays { + let mut fields = template.clone(); + fields["expires_at_unix_ms"] = json!(1); + fields["policy_revision"] = json!(row + 100); + let overlay = peer.append_claim(&ClaimInput { + subject:subject.clone(), kind:if row % 2 == 0 { POLICY } else { REVOKED }.into(), + actor:Some(OWNER.into()), fields:serde_json::from_value(fields).unwrap(), + evidence:vec![], expected_subject:None, idempotency_key:None, + }).unwrap(); + ids.push(overlay.id); + } + } + // Exchanges are cut to a body budget, so overlay histories need several rounds. + peer.seal_local_batches().unwrap(); + for _ in 0..256 { + sync(&peer, store); + if ids.iter().all(|id| revision_api::verified_writer(store, id)) { return; } + } + panic!("the foreign-grant scenario must exercise verified provenance"); } #[tokio::test(flavor = "multi_thread", worker_threads = 8)] async fn authenticated_get_during_pairing() { let Ok(variant) = std::env::var("ST_ADMISSION_VARIANT") else { return }; assert!(matches!(variant.as_str(), "baseline" | "indexed")); - assert!(fractal_daemon::test_support::optimized_build(), "use --release"); + let identity = execution_identity(); + assert_eq!(variant, revision_api::VARIANT, "scenario variant must match the compiled revision API"); + let counts_only = std::env::var_os("ST_ADMISSION_READ_COUNTS_ONLY").is_some(); + assert!(counts_only || fractal_daemon::test_support::optimized_build(), "use --release"); + assert_eq!(std::env::var("ST3_PROFILE_SLOW_MS").as_deref(), Ok("0"), + "set ST3_PROFILE_SLOW_MS=0 to capture every measured operation"); + let profile_log = PathBuf::from(std::env::var_os("ST3_PROFILE_DIR") + .expect("set a fresh ST3_PROFILE_DIR for each revision")).join("slow.jsonl"); + smallclaims::profile::init_from_env(); + assert!(smallclaims::profile::enabled(), "profiling must initialize before Store::open"); let indexed = variant == "indexed"; let history = number("ST_ADMISSION_HISTORY", 10_000); - let samples = number("ST_ADMISSION_SAMPLES", 200); + let policy_renewals = count("ST_ADMISSION_RENEWALS", 3); + let invalid_history_ids = std::env::var_os("ST_ADMISSION_INVALID_HISTORY_IDS").is_some(); + let samples = if counts_only { 0 } else { number("ST_ADMISSION_SAMPLES", 200) }; + let foreign_active = count("ST_ADMISSION_FOREIGN_ACTIVE", 0); + let overlays = count("ST_ADMISSION_WRONG_ORIGIN_OVERLAYS", 1000); + let local_active = number("ST_ADMISSION_LOCAL_ACTIVE", 2); + assert!(local_active >= 2, "the fixture measures two distinct read modes"); + if variant == "baseline" { + assert!(counts_only && foreign_active == 0 && overlays == 0, + "base requires READ_COUNTS_ONLY=1, FOREIGN_ACTIVE=0, WRONG_ORIGIN_OVERLAYS=0"); + } let root = tempfile::tempdir().unwrap(); let database = root.path().join("admission.sqlite"); let store = Arc::new(Store::open(&database, NODE).unwrap()); store.bind_fleet(super::super::daemon_bench::FLEET).unwrap(); - store.set_node_key(Arc::new(smallclaims::fleet::MemberKey::generate().unwrap().0)).unwrap(); + let node_key = Arc::new(smallclaims::fleet::MemberKey::generate().unwrap().0); + store.set_node_key(node_key.clone()).unwrap(); let state = AppState { browser_pairing_login:None, seat_admission:Default::default(), owning_person:Some(OWNER.into()), store:store.clone(), @@ -182,47 +390,128 @@ async fn authenticated_get_during_pairing() { } sessions.push((mode, paired)); } + let mut extra_sessions = Vec::new(); + for _ in 2..local_active { + extra_sessions.push(complete(&http, &base, &begin(&owner, "caller-bound-allow").await).await); + } // Synthetic expired grants retain valid production field shapes, native Store envelopes, // origin/actor and per-subject indexes. They are never service-profile fixtures and never // authorize a request. Grant history is deliberately nonempty for BOTH principals. let template_subject = format!("custom/client/assistant-v1-{}", sessions[0].1["grant"]["id"].as_str().unwrap().trim_start_matches("assistant-grant/")); let template = store.claims_for_subject_kind_at(&template_subject, GRANTED, None, true, 1).unwrap().claims.pop().unwrap(); + let active = sessions.iter().map(|(_, paired)| paired).chain(extra_sessions.iter()).map(|paired| { + let subject = format!("custom/client/assistant-v1-{}", paired["grant"]["id"].as_str().unwrap().trim_start_matches("assistant-grant/")); + let grant = store.claims_for_subject_kind_at(&subject, GRANTED, None, true, 1).unwrap().claims.pop().unwrap(); + (subject, grant.body["fields"].clone()) + }).collect::>(); + if foreign_active > 0 || overlays > 0 { + foreign_same_profile(&store, node_key, &template.body["fields"], foreign_active, &active, overlays); + } let fixture_store = store.clone(); tokio::task::spawn_blocking(move || { for principal in ["assistant/chatgpt", "assistant/mcp"] { for row in 0..history { - let id = format!("history-{}-{row}", principal.trim_start_matches("assistant/")); + let id = if invalid_history_ids { + format!("history-{}-{row}", principal.trim_start_matches("assistant/")) + } else { + format!("{:024x}", row * 2 + usize::from(principal == "assistant/mcp")) + }; let mut fields = template.body["fields"].clone(); fields["principal"] = json!(principal); fields["grant_id"] = json!(format!("assistant-grant/{id}")); fields["session_actor"] = json!(format!("{principal}/session/assistant-grant/{id}")); fields["expires_at_unix_ms"] = json!(1); fields["credential_hash"] = json!(hex::encode(ring::digest::digest(&ring::digest::SHA256, id.as_bytes()).as_ref())); - fixture_store.append_claim(&ClaimInput { subject:format!("custom/client/assistant-v1-{id}"), kind:GRANTED.into(), - actor:Some(OWNER.into()), fields:serde_json::from_value(fields).unwrap(), evidence:vec![], expected_subject:None, idempotency_key:None }).unwrap(); + let subject = format!("custom/client/assistant-v1-{id}"); + fixture_store.append_claim(&ClaimInput { subject:subject.clone(), kind:GRANTED.into(), + actor:Some(OWNER.into()), fields:serde_json::from_value(fields.clone()).unwrap(), evidence:vec![], expected_subject:None, idempotency_key:None }).unwrap(); + for revision in 0..policy_renewals { + fields["policy_revision"] = json!(revision + 2); + fields["expires_at_unix_ms"] = json!(revision + 2); + fixture_store.append_claim(&ClaimInput { subject:subject.clone(), kind:POLICY.into(), + actor:Some(OWNER.into()), fields:serde_json::from_value(fields.clone()).unwrap(), + evidence:vec![], expected_subject:None, idempotency_key:None }).unwrap(); + } } } }).await.unwrap(); let connection = rusqlite::Connection::open(&database).unwrap(); - let query = if indexed { INDEXED_QUERY } else { A_QUERY }; - let index_exists: bool = connection.query_row("SELECT EXISTS(SELECT 1 FROM sqlite_master WHERE type='index' AND name=?1)", [INDEX], |r| r.get(0)).unwrap(); - assert_eq!(index_exists, indexed, "build baseline on 98e550cb; indexed on PR3-B"); - let (before, after, build_ms) = if indexed { - connection.execute_batch("DROP INDEX claims_assistant_v1_principal_index").unwrap(); - let before = explain(&connection, query); - let started = Instant::now(); - connection.execute_batch(CREATE_INDEX).unwrap(); - let elapsed = started.elapsed().as_secs_f64() * 1000.0; - let after = explain(&connection, query); - assert!(after.iter().any(|line| line.contains(INDEX)), "{after:?}"); - (before, after, Some(elapsed)) - } else { (explain(&connection, query), Vec::new(), None) }; + let candidate_query = revision_api::candidate_query(); + let query = candidate_query.as_ref().map_or(A_QUERY, |(query, _)| *query); + let after = if counts_only { + Vec::new() + } else if let Some((query, expiry)) = &candidate_query { + let plan = explain(&connection, query, rusqlite::params![ + "assistant/chatgpt", OWNER, expiry, Option::::None, Option::::None + ]); + assert!(plan.iter().any(|line| line.contains(PROJECTION_INDEX)), "{plan:?}"); + assert!(!plan.iter().any(|line| line.contains("claims")), "{plan:?}"); + plan + } else { + explain(&connection, A_QUERY, rusqlite::params![GRANTED, "assistant/chatgpt"]) + }; let total_rows: u64 = connection.query_row("SELECT count(*) FROM claims", [], |r| r.get(0)).unwrap(); let mut principal_rows = BTreeMap::new(); for principal in ["assistant/chatgpt", "assistant/mcp"] { let count: u64 = connection.query_row("SELECT count(*) FROM claims WHERE kind=?1 AND COALESCE(json_extract(body,'$.fields.principal'),'assistant/chatgpt')=?2", rusqlite::params![GRANTED,principal], |r| r.get(0)).unwrap(); principal_rows.insert(principal, count); } + // Isolate the production effective-authority query from provenance and locks. + // Diagnostic work stays outside HTTP samples; no raw-history admission alias. + let mut diagnostics = Vec::new(); + for _ in 0..8 { + let candidate = candidate_query.as_ref().filter(|_| !counts_only).map(|(query, expiry)| { + let started = Instant::now(); + let mut statement = connection.prepare(query).unwrap(); + let grant_records = statement.query_map(rusqlite::params![ + "assistant/chatgpt", OWNER, expiry, Option::::None, Option::::None + ], |row| row.get::<_, String>(0)).unwrap().collect::, _>>().unwrap(); + // This independent diagnostic connection is not a traced Store connection. + let status = |counter| u64::try_from(statement.get_status(counter)).unwrap(); + let work = smallclaims::sqlite::work::SqliteWork { + statements: 1, + vm_steps: status(rusqlite::StatementStatus::VmStep), + fullscan_steps: status(rusqlite::StatementStatus::FullscanStep), + sorts: status(rusqlite::StatementStatus::Sort), + autoindex_rows: status(rusqlite::StatementStatus::AutoIndex), + }; + assert_eq!(grant_records.len(), local_active + foreign_active, + "expired history and wrong-origin overlays must not change active N"); + assert_eq!(work.fullscan_steps, 0, "candidate reads must not scan history"); + assert!(work.vm_steps <= 512 + 128 * u64::try_from(local_active + foreign_active).unwrap(), + "candidate VM work must scale with active N, not expired history or overlay floods: {work:?}"); + for record in &grant_records { + let _: fractal_daemon::model::ClaimRecord = serde_json::from_str(record).unwrap(); + } + (grant_records.len(), started.elapsed().as_secs_f64() * 1000.0, sql_work(work)) + }); + let credential = sessions[0].1["credential"].as_str().unwrap(); + let digest = hex::encode(ring::digest::digest(&ring::digest::SHA256, credential.as_bytes()).as_ref()); + let profile_from = profile_lines(&profile_log); + let started = Instant::now(); + let authentication_profile = smallclaims::profile::Op::start("admission-bench/authenticate", None).unwrap(); + let entered = authentication_profile.enter(); + let work_scope = smallclaims::sqlite::work::SqliteWorkScope::start(); + assert!(api::client_v0::external_grants::authenticate(&state, &digest, "http").unwrap().is_some()); + let authentication_sql_work = sql_work(work_scope.finish()); + drop(entered); + authentication_profile.finish(); + let direct_auth_ms = started.elapsed().as_secs_f64()*1000.0; + let authentication_read_acquisitions = profile_reads(&profile_log, profile_from, "admission-bench/authenticate"); + diagnostics.push(json!({"candidate_count":candidate.as_ref().map(|(count, _, _)| count), + "candidate_sql_ms":candidate.as_ref().map(|(_, ms, _)| ms), + "candidate_sql_work":candidate.as_ref().map(|(_, _, work)| work), + "direct_auth_ms":direct_auth_ms,"authentication_sql_work":authentication_sql_work, + "authentication_read_acquisitions":authentication_read_acquisitions})); + } + let inspected = store.claims_for_subject_kind_at(&template_subject, GRANTED, None, true, 1).unwrap().claims.pop().unwrap(); + let started = Instant::now(); + api::client_v0::external_grants::projection(&state, &inspected).unwrap(); + let legacy_projection_ms = started.elapsed().as_secs_f64()*1000.0; + let witness_projection_ms = revision_api::witness_projection_ms(&state, &inspected); + let plan = after.clone(); + println!("ADMISSION_DIAGNOSTICS {}", json!({"plan":plan,"samples":diagnostics, + "legacy_projection_ms":legacy_projection_ms,"witness_projection_ms":witness_projection_ms})); drop(connection); api::wait_published_lists_at_least(&store, store.index().unwrap()).await.unwrap(); let mut measurements = Vec::new(); @@ -235,6 +524,23 @@ async fn authenticated_get_during_pairing() { let warm = if mode == "approval-once" { warm.header(HEADER, proof(&paired, &signer, samples + 1)) } else { warm }; let response = warm.send().await.unwrap(); assert!(response.status().is_success(), "warm GET: {}", response.text().await.unwrap()); + // A separate unpaired read work window avoids attributing pairing completion + // SQL to the GET. Global counters can still include background daemon work. + state.assistant_receipts.flush().await.unwrap(); + api::wait_published_lists_at_least(&store, store.index().unwrap()).await.unwrap(); + let measured_read = http.get(format!("{base}{PATH}")).bearer_auth(credential); + let measured_read = if mode == "approval-once" { + measured_read.header(HEADER, proof(&paired, &signer, samples + 2)) + } else { measured_read }; + let before_read = smallclaims::sqlite::work::total(); + let profile_from = profile_lines(&profile_log); + let response = measured_read.send().await.unwrap(); + let status = response.status(); + let body = response.bytes().await.unwrap(); + state.assistant_receipts.flush().await.unwrap(); + let standalone_read_sql_work = sql_work(smallclaims::sqlite::work::total() - before_read); + assert!(status.is_success(), "standalone GET {status}: {}", String::from_utf8_lossy(&body)); + let standalone_read_acquisitions = profile_reads(&profile_log, profile_from, &format!("GET {PATH}")); for sequence in 0..samples { let challenge = begin(&owner, mode).await; let get = http.get(format!("{base}{PATH}")).bearer_auth(credential); @@ -267,7 +573,10 @@ async fn authenticated_get_during_pairing() { let get_p95 = p95(&mut get_ms); let completion_p95 = p95(&mut completion_ms); measurements.push(json!({"mode":mode,"get_samples":get_ms.len(),"completion_samples":completion_ms.len(), - "get_p95_ms":get_p95,"completion_p95_ms":completion_p95,"q39_budget_ms":100,"q39_pass":get_p95 <= 100.0, + "get_p95_ms":get_p95,"completion_p95_ms":completion_p95,"q39_budget_ms":100, + "q39_pass":get_p95.map(|p95| p95 <= 100.0), + "standalone_read_sql_work":standalone_read_sql_work, + "standalone_read_acquisitions":standalone_read_acquisitions, "get_ms":get_ms,"completion_ms":completion_ms})); } let hardware = |program: &str, args: &[&str]| { @@ -277,32 +586,49 @@ async fn authenticated_get_during_pairing() { }; let final_connection = rusqlite::Connection::open(&database).unwrap(); let final_rows: u64 = final_connection.query_row("SELECT count(*) FROM claims", [], |r| r.get(0)).unwrap(); - let report = json!({"variant":variant,"baseline_revision":"98e550cb75", "hardware_uname":hardware("uname", &["-a"]), + let report = json!({"variant":variant,"read_counts_only":counts_only,"revision_api":revision_api::REVISION, + "execution_identity":identity,"local_active_grants":local_active,"active_grants_n":local_active + foreign_active, + "hardware_uname":hardware("uname", &["-a"]), "hardware_lscpu":hardware("lscpu", &["-J"]),"hardware_hostname":hardware("hostname", &[]), - "expected_host":"same otherwise-idle host for both variants (verify observed hardware)", + "host_description":"Observed local benchmark host; no prescribed hardware identity", + "fixture_person_ids":[OWNER],"verified_foreign_same_profile_active_grants":foreign_active, "history_grants_per_principal":history,"initial_total_claim_rows":total_rows,"initial_granted_rows_by_principal":principal_rows, + "policy_renewals_per_expired_grant":policy_renewals, + "invalid_expired_history_ids":invalid_history_ids, + "wrong_origin_overlays_per_active_grant":overlays, + "wrong_origin_overlay_active_grants":active.len(), + "sql_work_scope":{"authentication":"current-thread completed traced SQL statements", + "standalone_read":"process-global, unpaired HTTP GET through receipt flush; may include background daemon SQL", + "read_count_limit":"statement/VM work counters, not logical rows read or storage IO", + "read_acquisitions":"existing profile read_acquisitions: pooled read-connection/snapshot acquisitions per operation"}, "final_total_claim_rows":final_rows,"admission_query":query, - "explain_without_index":before,"explain_with_index":after,"synthetic_startup_index_build_ms":build_ms, + "conflict_fold_diagnostics":diagnostics, + "legacy_projection_ms":legacy_projection_ms,"witness_projection_ms":witness_projection_ms, + "explain_with_index":after, "measurements":measurements}); println!("ADMISSION_MEASUREMENT {}", serde_json::to_string_pretty(&report).unwrap()); if let Some(path) = std::env::var_os("ST_ADMISSION_REPORT") { std::fs::write(path, serde_json::to_vec_pretty(&report).unwrap()).unwrap(); } local.abort(); fabric.abort(); - if indexed { + if indexed && !counts_only { assert!(report["measurements"].as_array().unwrap().iter().all(|row| row["q39_pass"] == true), "q39: authenticated GET p95 must be <=100ms; see report"); } } /// Synthetic large-store index build, independent of the HTTP latency fixture: /// ```sh -/// ST_ADMISSION_INDEX_BUILD=1 cargo test --release -p fractal --test integration daemon_cost::assistant_admission::synthetic_large_store_index_build -- --exact --nocapture --test-threads=1 +/// ST_ADMISSION_INDEX_BUILD=1 "$ST_ADMISSION_BINARY" daemon_cost::assistant_admission::synthetic_large_store_index_build --exact --nocapture --test-threads=1 /// ``` /// ST_ADMISSION_INDEX_ROWS defaults to 1,000,000 total claims. ST_ADMISSION_INDEX_REPORT -/// optionally saves JSON. Run on the indexed branch. This measures the exact startup index -/// CREATE DDL, not full Store::open, cold-disk startup, admission, or signature verification. +/// optionally saves JSON. This explicitly historical claims-index measurement is +/// independent of the current effective-authority query. It measures CREATE DDL, +/// not full Store::open, cold-disk startup, admission, or signature verification. +/// Use the same identity-bound build/export commands above (including SOURCE_ROOT, +/// EXPECT_REVISION and BINARY). Every index report carries the same execution identity. #[test] fn synthetic_large_store_index_build() { if std::env::var_os("ST_ADMISSION_INDEX_BUILD").is_none() { return; } + let identity = execution_identity(); assert!(fractal_daemon::test_support::optimized_build(), "use --release"); let rows = number("ST_ADMISSION_INDEX_ROWS", 1_000_000); let root = tempfile::tempdir().unwrap(); @@ -323,12 +649,7 @@ fn synthetic_large_store_index_build() { // Native claims triggers retain their real digest implementation during the // synthetic population, just as on production/checkpoint writer connections. smallclaims::store::configure_projection_writer(&connection).unwrap(); - let installed: bool = connection.query_row( - "SELECT EXISTS(SELECT 1 FROM sqlite_master WHERE type='index' AND name=?1)", - [INDEX], |row| row.get(0), - ).unwrap(); - assert!(installed, "run the large-store index probe on the indexed branch"); - connection.execute_batch("DROP INDEX claims_assistant_v1_principal_index").unwrap(); + connection.execute_batch("DROP INDEX IF EXISTS claims_assistant_v1_principal_expiry_index").unwrap(); // Copy every native required column rather than depending on a second claims schema. // The native autoincrement store_index, claim ID and subject must remain unique. let columns = { @@ -360,12 +681,13 @@ fn synthetic_large_store_index_build() { let actual_rows: u64 = connection.query_row("SELECT count(*) FROM claims", [], |row| row.get(0)).unwrap(); assert_eq!(actual_rows, u64::try_from(rows).unwrap()); connection.execute_batch("PRAGMA wal_checkpoint(TRUNCATE)").unwrap(); - let before = explain(&connection, INDEXED_QUERY); + // Independent historical A-query evidence, not the current authority query. + let before = explain(&connection, A_QUERY, rusqlite::params![GRANTED, "assistant/chatgpt"]); let main_bytes_before = std::fs::metadata(&database).unwrap().len(); let started = Instant::now(); connection.execute_batch(CREATE_INDEX).unwrap(); let elapsed_ms = started.elapsed().as_secs_f64() * 1000.0; - let after = explain(&connection, INDEXED_QUERY); + let after = explain(&connection, A_QUERY, rusqlite::params![GRANTED, "assistant/chatgpt"]); assert!(after.iter().any(|line| line.contains(INDEX)), "{after:?}"); let pages: u64 = connection.query_row("PRAGMA page_count", [], |row| row.get(0)).unwrap(); let page_size: u64 = connection.query_row("PRAGMA page_size", [], |row| row.get(0)).unwrap(); @@ -377,20 +699,55 @@ fn synthetic_large_store_index_build() { String::from_utf8(output.stdout).unwrap() }; let report = json!({ - "measurement":"synthetic startup index CREATE DDL only; not full startup", + "measurement":"historical claims principal/expiry index CREATE DDL only; not current admission or full startup", + "execution_identity":identity, "claims_rows":actual_rows,"synthetic_copied_rows":rows - 1, "fixture_authority":"one native template; SQL copies are not signature-authoritative", "index_name":INDEX,"index_create_sql":CREATE_INDEX,"index_build_ms":elapsed_ms, + "historical_query":A_QUERY, "main_db_bytes_before":main_bytes_before, "main_db_bytes_after":std::fs::metadata(&database).unwrap().len(), "wal_bytes_after":wal_bytes,"logical_db_bytes_after":pages * page_size, "explain_without_index":before,"explain_with_index":after, "hardware_uname":hardware("uname", &["-a"]), "hardware_hostname":hardware("hostname", &[]),"hardware_lscpu":hardware("lscpu", &["-J"]), - "expected_host":"same otherwise-idle host for both variants (verify observed hardware)", + "host_description":"Observed local benchmark host; no prescribed hardware identity", + "fixture_person_ids":[OWNER], }); println!("ADMISSION_INDEX_BUILD {}", serde_json::to_string_pretty(&report).unwrap()); if let Some(path) = std::env::var_os("ST_ADMISSION_INDEX_REPORT") { std::fs::write(path, serde_json::to_vec_pretty(&report).unwrap()).unwrap(); } } + +/// The only head-specific API surface. To backport the harness to origin/main +/// (d477c67ad1), replace this module's body with exactly: +/// ```ignore +/// use super::*; +/// pub const REVISION: &str = "origin/main"; +/// pub const VARIANT: &str = "baseline"; +/// // origin/main admission is a credential-hash lookup with no candidate query. +/// pub fn candidate_query() -> Option<(&'static str, String)> { None } +/// pub fn verified_writer(_: &Store, _: &str) -> bool { +/// panic!("origin/main has no provenance check; use FOREIGN_ACTIVE=0 and WRONG_ORIGIN_OVERLAYS=0") +/// } +/// pub fn witness_projection_ms(_: &AppState, _: &fractal_daemon::model::ClaimRecord) -> Option { None } +/// ``` +mod revision_api { + use super::*; + pub const REVISION: &str = "fixed-head"; + pub const VARIANT: &str = "indexed"; + pub fn candidate_query() -> Option<(&'static str, String)> { + let now = u64::try_from(SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_millis()).unwrap(); + Some((smallclaims::store::assistant_grant_authority::CANDIDATES_QUERY, + smallclaims::store::assistant_grant_authority::expiry_key(now))) + } + pub fn verified_writer(store: &Store, id: &str) -> bool { + store.claim_has_authenticated_member_writer(id).unwrap() + } + pub fn witness_projection_ms(state: &AppState, inspected: &fractal_daemon::model::ClaimRecord) -> Option { + let started = Instant::now(); + api::client_v0::external_grants::projection_with_witness(state, inspected).unwrap(); + Some(started.elapsed().as_secs_f64() * 1000.0) + } +} diff --git a/crates/fractal/tests/fleet.rs b/crates/fractal/tests/fleet.rs index 5133a5481af..cce533cc148 100644 --- a/crates/fractal/tests/fleet.rs +++ b/crates/fractal/tests/fleet.rs @@ -3634,6 +3634,19 @@ fn fleet_workflows_have_no_path_filter() { "previous_release_replicates_with_new_members_and_preserves_history_on_upgrade" ) ); + assert!( + stages.contains( + "fleet::service_grants::previous_release_authorizes_and_revokes_after_authority_projection_rollback" + ), + "fleet compatibility must exercise baseline rollback after authority projection backfill" + ); + assert!( + stages.contains( + "fleet::service_grants::authority_projection_resumes_after_daemon_is_killed_with_committed_partial_backfill" + ), + "fleet compatibility must exercise abrupt daemon death with an incomplete authority projection" + ); + assert!(stages.contains("test result: ok. 11 passed")); // The optional macOS job lives in macos.yml so label events cannot restart this gate. assert!( !compat.to_ascii_lowercase().contains("macos-"), diff --git a/crates/fractal/tests/fleet/service_grants.rs b/crates/fractal/tests/fleet/service_grants.rs index 56b33485da4..94b4a97a0f9 100644 --- a/crates/fractal/tests/fleet/service_grants.rs +++ b/crates/fractal/tests/fleet/service_grants.rs @@ -58,7 +58,11 @@ fn seed(node: &Node, number: u8, profile: &str, principal: &str, scope: &str, let policy = append(node, &id, POLICY, fields, Some(&granted)); let mut claims = BTreeSet::from([granted, policy.clone()]); if revoked { - claims.insert(append(node, &id, REVOKED, json!({}), Some(&policy))); + // Same shape as the owner revoke route: only an authoritative revocation counts. + claims.insert(append(node, &id, REVOKED, json!({ + "version": 1, "grant_id": id, "principal": principal, "issuer": PERSON, + "transport": "fixture", "timestamp": "2026-01-01T00:00:00Z", "outcome": "revoked" + }), Some(&policy))); } Grant { id, credential, claims } } @@ -79,11 +83,31 @@ async fn auth_response(node: &Node, grant: &Grant) -> (u16, String) { } async fn assert_auth(node: &Node, grant: &Grant, accepted: bool) { + assert_status(node, grant, if accepted { 400 } else { 403 }).await; +} + +async fn assert_status(node: &Node, grant: &Grant, expected: u16) { let (status, body) = auth_response(node, grant).await; - assert_eq!(status, if accepted { 400 } else { 403 }, + assert_eq!(status, expected, "{} grant {}: {body}\n{}", node.name, grant.id, node.logs()); } +// With the counterexample, assistant grant 4 (index 3) and service grant 7 (index 6) +// are active, well-formed opposite-profile grants for assistant/chatgpt. The +// candidate suspends both: it refuses with the conflict (409 grant-profile-conflict) +// before the service-profile refusal (403), so grant 7 answers 409, not 403. +// Grant 3 (index 2) has a non-assistant scope, +// so it is malformed for conflicts and stays a plain 403 service refusal. +fn candidate_counterexample_status(index: usize) -> u16 { + if index == 3 || index == 6 { 409 } else { 403 } +} + +async fn assert_candidate_counterexample(node: &Node, grants: &[Grant]) { + for (index, grant) in grants.iter().enumerate() { + assert_status(node, grant, candidate_counterexample_status(index)).await; + } +} + async fn assert_retained(node: &Node, grants: &[Grant]) { let ids: BTreeSet = node.claims().await.into_iter() .map(|claim| claim["id"].as_str().unwrap().to_owned()).collect(); @@ -171,9 +195,7 @@ async fn previous_release_refuses_plugin_service_grants_on_same_database_rollbac assert_candidate_issuance_grammar(&node).await; // Includes the unissuable profile-blind counterexample; candidate must refuse it. let grants = fixtures(&mut node, true).await; - for (index, grant) in grants.iter().enumerate() { - assert_auth(&node, grant, index == 3).await; - } + assert_candidate_counterexample(&node, &grants).await; let state = node.state_dir(); node.stop(); node.binary = old; @@ -233,12 +255,256 @@ async fn previous_release_refuses_plugin_service_grants_on_same_database_rollbac node.binary = PathBuf::from(st3()); node.start().await; assert_eq!(node.state_dir(), state); - for (index, grant) in grants.iter().enumerate() { - assert_auth(&node, grant, index == 3).await; - } + assert_candidate_counterexample(&node, &grants).await; assert_retained(&node, &grants).await; } +// Use the release's real issuance and policy routes: this history must predate the +// candidate's first Store::open, rather than being seeded by candidate store code. +async fn issue_with_policy(node: &Node, key: u8) -> Grant { + use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD}; + + let owner = Client::unix_as(node.socket(), PERSON).unwrap(); + let policy = json!({ + "api_version":"st3.client.v0", + "scopes":["read.assistant.summary", "read.assistant.attention", + "read.assistant.missions", "read.assistant.agents"], + "expires_in_seconds":3600, "minimal_read_mode":"approval-once", + "disclosure_consent":true, "consent_evidence":"Disposable rollback fixture owner consent" + }); + let mut begin = policy.clone(); + begin["assistant_id"] = json!("assistant/chatgpt"); + begin["device_name"] = json!(format!("rollback fixture {key}")); + let challenge: Value = owner.post("/v1/client/pairings", &begin).await.unwrap(); + let challenge = challenge.get("value").unwrap_or(&challenge); + let pairing = challenge["pairing_id"].as_str().unwrap().trim_start_matches("pairing/"); + let response = reqwest::Client::builder().unix_socket(node.socket()).build().unwrap() + .post(format!("http://localhost/v1/client/pairings/{pairing}/complete")) + .json(&json!({"api_version":"st3.client.v0", "code":challenge["code"], + "device_public_key":URL_SAFE_NO_PAD.encode([key; 32]), "key_storage":"software"})) + .send().await.unwrap(); + let status = response.status(); + let paired: Value = response.json().await.unwrap(); + assert_eq!(status.as_u16(), 200, "baseline assistant issuance: {paired}"); + let paired = paired.get("value").unwrap_or(&paired); + let id = paired["grant"]["id"].as_str().unwrap().trim_start_matches("assistant-grant/").to_owned(); + let changed: Value = owner.post( + &format!("/v1/client/assistant/grants/{id}/policy"), &policy, + ).await.unwrap(); + let changed = changed.get("value").unwrap_or(&changed); + assert_eq!(changed["policy_revision"], 2, "{changed}"); + let subject = format!("custom/client/assistant-v1-{id}"); + let claims = node.claims().await.into_iter() + .filter(|claim| claim["subject"] == subject) + .map(|claim| claim["id"].as_str().unwrap().to_owned()).collect(); + Grant { id, credential: paired["credential"].as_str().unwrap().to_owned(), claims } +} + +fn authority_history(node: &Node) -> Vec<(String, String)> { + let connection = rusqlite::Connection::open_with_flags( + node.state_dir().join("claims.sqlite3"), rusqlite::OpenFlags::SQLITE_OPEN_READ_ONLY, + ).unwrap(); + connection.prepare( + "SELECT id, body FROM claims WHERE kind IN (?1, ?2, ?3) ORDER BY id", + ).unwrap().query_map([GRANTED, POLICY, REVOKED], |row| { + Ok((row.get(0)?, row.get(1)?)) + }).unwrap().collect::>().unwrap() +} + +fn assert_authority_projection_ready(node: &Node) { + let version: String = rusqlite::Connection::open_with_flags( + node.state_dir().join("claims.sqlite3"), rusqlite::OpenFlags::SQLITE_OPEN_READ_ONLY, + ).unwrap().query_row( + "SELECT value FROM meta WHERE key='assistant_grant_authority_version'", + [], |row| row.get(0), + ).unwrap(); + assert_eq!(version, "1", "candidate must complete authority backfill before rollback"); +} + +fn authority_projection_snapshot(connection: &rusqlite::Connection) -> (Vec, Vec) { + let authority = connection.prepare( + "SELECT json_array(claim_id,base_claim_id,grant_subject,kind,origin,actor,principal,profile, + expires_at,store_index,credential_hash,record) + FROM assistant_grant_authority ORDER BY claim_id,base_claim_id", + ).unwrap().query_map([], |row| row.get(0)).unwrap() + .collect::>>().unwrap(); + let effective = connection.prepare( + "SELECT json_array(claim_id,grant_subject,principal,owner,profile,expires_at,revoked,grant_record) + FROM assistant_grant_effective ORDER BY claim_id", + ).unwrap().query_map([], |row| row.get(0)).unwrap() + .collect::>>().unwrap(); + (authority, effective) +} + +fn authority_backfill_progress(connection: &rusqlite::Connection) -> (u64, bool) { + connection.query_row( + "SELECT COALESCE((SELECT CAST(value AS INTEGER) FROM meta WHERE key=?1),0), + EXISTS(SELECT 1 FROM meta WHERE key='assistant_grant_authority_version')", + [format!("assistant_grant_authority_cursor/{GRANTED}")], + |row| Ok((row.get(0)?, row.get(1)?)), + ).unwrap() +} + +#[tokio::test(flavor = "multi_thread")] +#[ignore = "needs ST3_COMPAT_BIN: the pinned previous published release"] +async fn authority_projection_resumes_after_daemon_is_killed_with_committed_partial_backfill() { + use smallclaims::store::assistant_grant_authority as authority; + + if fractal_daemon::test_support::supervise_test() { return; } + let root = tempfile::tempdir().unwrap(); + let mut node = Node::new(root.path(), "issuer"); + node.binary = compat_binary(); + node.start().await; + let active = issue_with_policy(&node, 7).await; + let revoked = issue_with_policy(&node, 8).await; + let owner = Client::unix_as(node.socket(), PERSON).unwrap(); + let _: Value = owner.post( + &format!("/v1/client/assistant/grants/{}/revoke", revoked.id), &json!({}), + ).await.unwrap(); + let history = authority_history(&node); + assert_eq!(history.len(), 5); + node.stop(); + + let database = node.state_dir().join("claims.sqlite3"); + let mut connection = rusqlite::Connection::open(&database).unwrap(); + fractal_daemon::store::configure_projection_writer(&connection).unwrap(); + authority::install(&connection, &node.name).unwrap(); + let reference_path = root.path().join("uninterrupted.sqlite3"); + connection.execute("VACUUM INTO ?1", [reference_path.to_str().unwrap()]).unwrap(); + let mut reference = rusqlite::Connection::open(&reference_path).unwrap(); + fractal_daemon::store::configure_projection_writer(&reference).unwrap(); + loop { + let transaction = reference.transaction().unwrap(); + let done = authority::backfill_slice(&transaction, Duration::from_secs(2)).unwrap(); + transaction.commit().unwrap(); + if done { break; } + } + let expected = authority_projection_snapshot(&reference); + assert!(expected.0.is_empty(), "pre-marker Legacy grants lack authenticated writer provenance"); + assert!(expected.1.is_empty()); + drop(reference); + + // Commit one real backfill step rather than making the fixture's size depend on + // machine speed. The writer fence holds startup at this incomplete migration, + // so an actual process kill cannot race a fast daemon finishing all five rows. + let transaction = connection.transaction().unwrap(); + assert!(!authority::backfill_slice(&transaction, Duration::ZERO).unwrap()); + transaction.commit().unwrap(); + let partial = authority_backfill_progress(&connection); + assert!(partial.0 > 0, "must kill with durable forward progress"); + assert!(!partial.1, "the committed projection must still be incomplete"); + assert!(authority_projection_snapshot(&connection).0.is_empty(), + "a partial cursor must not turn ambiguous Legacy evidence into authority"); + let blocker = connection.transaction_with_behavior(rusqlite::TransactionBehavior::Immediate).unwrap(); + node.binary = PathBuf::from(st3()); + let pty = node.root.join("bin/pty"); + let mut daemon = DaemonProcess::spawn_isolated( + node.command(&["up", "--pty-binary", pty.to_str().unwrap(), "--web-listen", "off"]), + fs::File::create(node.root.join("daemon.log")).unwrap(), + fs::File::create(node.root.join("daemon.stderr.log")).unwrap(), + ).unwrap(); + let deadline = Instant::now() + Duration::from_secs(30); + loop { + assert!(daemon.try_wait().unwrap().is_none(), "candidate exited before interrupted startup:\n{}", node.logs()); + // Startup owns the directory fence before opening/migrating the store. + if fractal_daemon::node_identity::lock_directory(&node.state_dir()).is_err() { + break; + } + assert!(Instant::now() < deadline, "candidate did not acquire its startup state fence:\n{}", node.logs()); + tokio::time::sleep(Duration::from_millis(10)).await; + } + assert_eq!(authority_backfill_progress(&blocker), partial); + daemon.kill().unwrap(); + assert!(!daemon.wait().unwrap().success(), "the interrupted daemon must not exit gracefully"); + assert_eq!(authority_backfill_progress(&blocker), partial, "kill must retain the committed cursor"); + blocker.rollback().unwrap(); + drop(connection); + assert_eq!(authority_history(&node), history, "process kill must not alter raw evidence"); + + node.start().await; + wait_until("authority backfill becomes ready after daemon restart", 30, || async { + let reader = rusqlite::Connection::open_with_flags( + &database, rusqlite::OpenFlags::SQLITE_OPEN_READ_ONLY, + ).unwrap(); + authority_backfill_progress(&reader).1 + }).await; + assert_authority_projection_ready(&node); + let reader = rusqlite::Connection::open_with_flags( + &database, rusqlite::OpenFlags::SQLITE_OPEN_READ_ONLY, + ).unwrap(); + assert_eq!(authority_projection_snapshot(&reader), expected, + "restart must converge exactly to uninterrupted authority and effective rows"); + assert_auth(&node, &active, false).await; + assert_auth(&node, &revoked, false).await; + assert_eq!(authority_history(&node), history, "restart must preserve every raw claim body"); +} + +#[tokio::test(flavor = "multi_thread")] +#[ignore = "needs ST3_COMPAT_BIN: the pinned previous published release"] +async fn previous_release_authorizes_and_revokes_after_authority_projection_rollback() { + if fractal_daemon::test_support::supervise_test() { return; } + let root = tempfile::tempdir().unwrap(); + let mut node = Node::new(root.path(), "issuer"); + node.binary = compat_binary(); + node.start().await; + let active = issue_with_policy(&node, 7).await; + let revoked = issue_with_policy(&node, 8).await; + let owner = Client::unix_as(node.socket(), PERSON).unwrap(); + let _: Value = owner.post( + &format!("/v1/client/assistant/grants/{}/revoke", revoked.id), &json!({}), + ).await.unwrap(); + assert_auth(&node, &active, true).await; + assert_auth(&node, &revoked, false).await; + let history = authority_history(&node); + assert_eq!(history.len(), 5, "two grants, two policy renewals and one revocation"); + let projection_exists: bool = rusqlite::Connection::open_with_flags( + node.state_dir().join("claims.sqlite3"), rusqlite::OpenFlags::SQLITE_OPEN_READ_ONLY, + ).unwrap().query_row( + "SELECT EXISTS(SELECT 1 FROM sqlite_schema WHERE type='table' AND name='assistant_grant_authority')", + [], |row| row.get(0), + ).unwrap(); + assert!(!projection_exists, "baseline history must predate authority projection initialization"); + let state = node.state_dir(); + + node.stop(); + node.binary = PathBuf::from(st3()); + node.start().await; + assert_eq!(node.state_dir(), state); + assert_authority_projection_ready(&node); + // The old standalone issuer had no member signature or local-append marker. + // The upgrade preserves evidence but requires its owner to re-issue. + assert_auth(&node, &active, false).await; + assert_auth(&node, &revoked, false).await; + assert_eq!(authority_history(&node), history, "backfill must not rewrite raw evidence"); + + node.stop(); + node.binary = compat_binary(); + node.start().await; + assert_eq!(node.state_dir(), state); + assert_auth(&node, &active, true).await; + assert_auth(&node, &revoked, false).await; + assert_eq!(authority_history(&node), history, "baseline must retain the backfilled history"); + let owner = Client::unix_as(node.socket(), PERSON).unwrap(); + let _: Value = owner.post( + &format!("/v1/client/assistant/grants/{}/revoke", active.id), &json!({}), + ).await.unwrap(); + assert_auth(&node, &active, false).await; + let after_revoke = authority_history(&node); + assert_eq!(after_revoke.len(), history.len() + 1); + for claim in &history { + assert!(after_revoke.contains(claim), "baseline revoke changed prior evidence"); + } + + node.stop(); + node.binary = PathBuf::from(st3()); + node.start().await; + assert_authority_projection_ready(&node); + assert_auth(&node, &active, false).await; + assert_auth(&node, &revoked, false).await; + assert_retained(&node, &[active, revoked]).await; + assert_eq!(authority_history(&node), after_revoke, "reopen must retain the baseline revoke"); +} + fn compat_binary() -> PathBuf { PathBuf::from(std::env::var("ST3_COMPAT_BIN").expect("ST3_COMPAT_BIN names the pinned baseline")) } @@ -249,6 +515,18 @@ async fn candidate_offline_service_fixtures_replicate_without_authorizing_creden mixed_pair(None, false).await; } +// Candidate-only reproduction of the rollback fixture, without a baseline binary. +#[tokio::test(flavor = "multi_thread")] +async fn candidate_suspends_the_offline_counterexample_profile_conflict() { + if fractal_daemon::test_support::supervise_test() { return; } + let root = tempfile::tempdir().unwrap(); + let mut node = Node::new(root.path(), "issuer"); + node.start().await; + let grants = fixtures(&mut node, true).await; + assert_candidate_counterexample(&node, &grants).await; + assert_retained(&node, &grants).await; +} + async fn assert_candidate_issuance_grammar(node: &Node) { let client = reqwest::Client::builder().unix_socket(node.socket()).build().unwrap(); let request = json!({"api_version":"st3.client.v0", "device_name":"fixture", diff --git a/crates/smallclaims/src/store.rs b/crates/smallclaims/src/store.rs index bf6c6751c00..fb4e2f7243e 100644 --- a/crates/smallclaims/src/store.rs +++ b/crates/smallclaims/src/store.rs @@ -43,6 +43,11 @@ pub use admitted::{AdmittedStore, STORE_DATABASE_FILES}; mod proof; pub mod prepared_envelope; +pub mod assistant_grant_authority; +#[cfg(test)] +mod assistant_grant_authority_tests; +#[cfg(test)] +mod assistant_grant_authority_bench; mod replica_record; use crate::operation_metadata::OperationMetadata; #[cfg(test)] @@ -885,6 +890,12 @@ pub struct Store { admission_schema_digest: std::sync::OnceLock, /// The membership last folded, and the `fleet_generation` it was folded at. pub membership_cache: Mutex>, + /// Request-only sealed folds, which may omit local batches not yet sealed. + /// Never used by the sealing path's `membership_cache` fast path. + sealed_membership_cache: Mutex>, + /// Last inherited generation whose applied window snapshot was checked. + /// Equal snapshots advance only this memory cache, never the writer. + assistant_grant_membership_observed_generation: AtomicI64, /// Where the scan for signatures missing on admitted envelopes stands. signature_backfill: Mutex, /// Read-only sealed view; never populated with the client's local-signer fallback. @@ -1265,6 +1276,26 @@ impl Store { readers.path == path && readers.shared_memory == shared_memory, "st database writer and read pool must use the same opened database path and mode" ); + #[cfg(test)] + assistant_grant_authority_bench::observe_open_authority( + &connection, assistant_grant_authority_bench::OpenAuthorityPhase::BeforeInstall, + ); + assistant_grant_authority::install(&connection, &origin)?; + #[cfg(test)] + assistant_grant_authority_bench::observe_open_authority( + &connection, assistant_grant_authority_bench::OpenAuthorityPhase::Installed, + ); + { + let transaction = connection.unchecked_transaction()?; + assistant_grant_authority::backfill_slice( + &transaction, std::time::Duration::from_secs(2), + )?; + transaction.commit()?; + } + #[cfg(test)] + assistant_grant_authority_bench::observe_open_authority( + &connection, assistant_grant_authority_bench::OpenAuthorityPhase::StartupComplete, + ); // Batch rowids are the sealing frontier. Checkpoint adoption can remove the highest // rows, so SQLite's default rowid allocator cannot be used: it reuses those keys and // leaves new local batches behind the frontier. Persist the allocation high water. @@ -1343,6 +1374,8 @@ impl Store { admission: Mutex::new(()), admission_schema_digest: std::sync::OnceLock::new(), membership_cache: Mutex::new(None), + sealed_membership_cache: Mutex::new(None), + assistant_grant_membership_observed_generation: AtomicI64::new(i64::MIN), fleet_authority: std::sync::OnceLock::new(), admitted_fleet_generation: AtomicI64::new(i64::MIN), signature_backfill: Mutex::default(), @@ -2197,7 +2230,16 @@ pub /* sqlite-large-value-flow: allow-for-now flow-h8ff255a3c271 owner=smallclai serde_json::to_string(predecessors)?, now.to_string(), ])?; - Ok(transaction.last_insert_rowid() as u64) + let store_index = transaction.last_insert_rowid() as u64; + if matches!(kind, assistant_grant_authority::GRANTED | assistant_grant_authority::POLICY | assistant_grant_authority::REVOKED) { + // This function is the local append boundary; replicated admission uses + // its own insert path and must never write this marker. + transaction.execute( + /* sqlite-large-value: allow-for-now lv-h52b61956c36c owner=smallclaims::store TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_local_appends(claim_id) VALUES(?1)", [id], + )?; + assistant_grant_authority::refresh_claim(transaction, id)?; + } + Ok(store_index) } /// The next sequence for a local batch: one past the writer's highest batch, including one a @@ -2668,8 +2710,13 @@ impl Store { { return Ok(membership.clone()); } - // Do not populate the sealing path's cache with a fold that can omit local batches. - fleet_membership_tx(&connection) + // Keep cold request folds separate: they can omit unsealed local batches, + // so publishing them into membership_cache would bypass the sealing path. + sealed_membership_tx( + &connection, + &mut self.sealed_membership_cache.lock() + .unwrap_or_else(PoisonError::into_inner), + ) }) } @@ -2971,6 +3018,96 @@ impl Store { Ok(false) } + /// Whether an accepted copy was signed by a keyed fleet member acting as its origin. + /// Requires a valid record in a validated or degraded envelope, a signature key authorized + /// for that writer's sequence, and a cryptographically valid signature in this store's + /// fleet/shard domain. Invalid sibling records do not disqualify a valid record in a + /// degraded envelope. Legacy and unkeyed writers do not authenticate provenance. Reads only sealed + /// membership; this query never seals local batches or scans the replication log. + pub fn claim_has_authenticated_member_writer(&self, claim_id: &str) -> Result { + Ok(self.authenticated_member_writer_claim_ids(&serde_json::to_string(&[claim_id])?)? + .contains(claim_id)) + } + + /// The requested claims with fully authenticated keyed-member envelope provenance. + /// Uses the same membership windows, record states, origin check and fleet/shard signature + /// domain as [`Self::claim_has_authenticated_member_writer`]. All claims share one read + /// snapshot and one sealed-membership lookup; identical envelope signatures are verified + /// at most once, including signatures shared by several claims or repeated input IDs. + pub fn claim_ids_with_authenticated_member_writers( + &self, + claim_ids: &[String], + ) -> Result> { + if claim_ids.is_empty() { + return Ok(BTreeSet::new()); + } + self.authenticated_member_writer_claim_ids(&serde_json::to_string(claim_ids)?) + } + + fn authenticated_member_writer_claim_ids(&self, claim_ids: &str) -> Result> { + self.read_snapshot(|_| { + let membership = self.fleet_membership_sealed()?; + let connection = self.readers.get(); + let Some(fleet_id) = self.signing_fleet_id(&connection)? else { + return Ok(BTreeSet::new()); + }; + let shard = fleet_meta(&connection, "shard_id")?; + let mut statement = connection.prepare_cached( + "SELECT records.claim_id, records.writer, records.sequence, records.envelope_hash, + signatures.member_key, signatures.signature + FROM replica_records AS records + JOIN claims ON claims.id=records.claim_id AND claims.origin=records.writer + JOIN replica_envelopes AS envelopes + USING (writer, sequence, envelope_hash) + JOIN replica_envelope_signatures AS signatures + USING (writer, sequence, envelope_hash) + WHERE records.claim_id IN (SELECT value FROM json_each(?1)) + AND records.state='valid' + AND envelopes.receipt_state IN ('validated', 'degraded')", + )?; + let rows = statement.query_map([claim_ids], |row| { + Ok(( + row.get::<_, String>(0)?, + ( + row.get::<_, String>(1)?, + row.get::<_, u64>(2)?, + row.get::<_, String>(3)?, + row.get::<_, String>(4)?, + row.get::<_, String>(5)?, + ), + )) + })?; + let mut authenticated = BTreeSet::new(); + let mut verified = BTreeMap::new(); + for row in rows { + let (claim_id, signature_identity) = row?; + if authenticated.contains(&claim_id) { + continue; + } + let valid = *verified.entry(signature_identity).or_insert_with_key(|identity| { + let (writer, sequence, hash, key, signature) = identity; + if !matches!( + membership.window(writer, *sequence), + crate::fleet::Window::Keyed(keys) if keys.contains(key) + ) { + return false; + } + #[cfg(test)] + membership_query_tests::SIGNATURE_VERIFICATIONS.with(|count| { + count.set(count.get() + 1); + }); + VerifiedEnvelopeSignature::verify( + shard.as_deref(), &fleet_id, writer, *sequence, hash, key, signature, + ).is_some() + }); + if valid { + authenticated.insert(claim_id); + } + } + Ok(authenticated) + }) + } + /// Envelopes this node admitted before it knew that their writer is keyed or that their /// incarnation had ended. Admission decisions are not revisited, so these stay admitted; @@ -3314,6 +3451,22 @@ fn fleet_generation(connection: &Connection) -> Result { .query_row(/* sqlite-large-value: allow-for-now lv-h339ecb1b2413 owner=smallclaims::store TODO=trace-statement-and-value-representation */ [], |row| row.get(0))?) } +// The caller holds one snapshot for both the generation read and membership fold. +fn sealed_membership_tx( + connection: &Connection, + cache: &mut Option<(i64, crate::fleet::Membership)>, +) -> Result { + let generation = fleet_generation(connection)?; + if let Some((cached_generation, membership)) = cache.as_ref() + && *cached_generation == generation + { + return Ok(membership.clone()); + } + let membership = fleet_membership_tx(connection)?; + *cache = Some((generation, membership.clone())); + Ok(membership) +} + // The caller holds a read snapshot. Unlike the client view this has no local signer; // Membership::fold and FleetView::from_membership use no clock or expiry state. fn sealed_fleet_view_tx( @@ -3609,7 +3762,7 @@ impl<'a> VerifiedEnvelopeSignature<'a> { } fn store(&self, transaction: &Transaction<'_>, now: &str) -> Result { - Ok(transaction + let inserted = transaction .prepare_cached( /* sqlite-large-value: allow-for-now lv-hece070718e6e owner=smallclaims::store TODO=chunk-or-reference-exact-wire-values */ "INSERT OR IGNORE INTO replica_envelope_signatures( writer, sequence, envelope_hash, member_key, signature, stored_at_unix_ms @@ -3622,7 +3775,8 @@ impl<'a> VerifiedEnvelopeSignature<'a> { self.member_key, self.signature, now - ])?) + ])?; + Ok(inserted) } } @@ -3648,6 +3802,7 @@ impl FleetAuthority for Store { fleet_generation(&self.readers.get()) } + fn fleet_membership(&self) -> Result { Store::fleet_membership(self) } @@ -7066,7 +7221,11 @@ impl Store { ); self.fleet_authority .set(authority) - .map_err(|_| anyhow::anyhow!("this shard already has a fleet authority")) + .map_err(|_| anyhow::anyhow!("this shard already has a fleet authority"))?; + // Generation numbers belong to their authority. Recheck the inherited + // snapshot even if it happens to equal the shard's former local number. + self.assistant_grant_membership_observed_generation.store(i64::MIN, Ordering::Release); + Ok(()) } /// The fleet this store's envelopes sign for: its authority's, for a shard. diff --git a/crates/smallclaims/src/store/assistant_grant_authority.rs b/crates/smallclaims/src/store/assistant_grant_authority.rs new file mode 100644 index 00000000000..21676f349aa --- /dev/null +++ b/crates/smallclaims/src/store/assistant_grant_authority.rs @@ -0,0 +1,1375 @@ +//! Incremental, authenticated external-grant authority. Raw claims remain evidence only. +use super::*; +use std::time::{Duration, Instant}; + +pub const GRANTED: &str = "custom.client.assistant.v1.granted"; +pub const POLICY: &str = "custom.client.assistant.v1.policy"; +pub const REVOKED: &str = "custom.client.assistant.v1.revoked"; +const VERSION: &str = "1"; +const KINDS: [&str; 3] = [GRANTED, POLICY, REVOKED]; +pub const CLAIMS_PER_SLICE: usize = 64; +pub const MEMBERSHIP_KEYS_PER_REFRESH: usize = 16; +const SCOPES: &[&str] = &[ + "read.assistant.summary", "read.assistant.attention", "read.assistant.missions", + "read.assistant.agents", "read.assistant.conversation", "read.assistant.terminal", + "write.assistant.messages", "write.assistant.custom-reply", "write.assistant.answers", +]; +const SERVICE_SCOPES: &[&str] = &["read.claims", "read.work", "read.documents"]; + +fn service_principal(value: &str) -> bool { + let mut parts = value.split('/'); + let component = |part: Option<&str>| part.is_some_and(|part| !part.is_empty() + && part.bytes().all(|byte| byte.is_ascii_alphanumeric() || b"-_.".contains(&byte))); + parts.next() == Some("plugin") && component(parts.next()) + && component(parts.next()) && parts.next().is_none() +} + +/// Projection identity includes legacy Service-on-assistant conflict witnesses. +/// API bearer authentication must separately require a plugin principal for Service. +pub fn principal(fields: &Value) -> Option<&str> { + match fields.get("principal") { + None => Some("assistant/chatgpt"), + Some(value) => value.as_str().filter(|value| + matches!(*value, "assistant/chatgpt" | "assistant/mcp") + || (profile(fields) == Some("service") && service_principal(value))), + } +} +fn profile(fields: &Value) -> Option<&str> { + match fields.get("profile") { + None => Some("assistant"), + Some(value) => value.as_str().filter(|value| matches!(*value, "assistant" | "service")), + } +} +fn digest(value: &Value) -> bool { + value.as_str().is_some_and(|value| value.len() == 64 && value.bytes().all(|byte| byte.is_ascii_hexdigit())) +} +fn digest_only(fields: &Value) -> bool { + fields.get("credential").is_none() && fields.get("code").is_none() + && ["credential_hash", "code_hash"].iter().all(|key| fields.get(*key).is_none_or(digest)) +} +fn identity(claim: &ClaimRecord) -> bool { + let fields = &claim.body["fields"]; + let Some(id) = fields["grant_id"].as_str() else { return false; }; + let suffix = id.strip_prefix("assistant-grant/").unwrap_or(id); + fields.is_object() && principal(fields).is_some() && profile(fields).is_some() + && suffix.len() == 24 && suffix.bytes().all(|byte| byte.is_ascii_hexdigit()) + && claim.subject.strip_prefix("custom/client/assistant-v1-") == Some(suffix) + && claim.actor.as_deref().is_some_and(|actor| fields["issuer"].as_str() == Some(actor)) +} +fn policy_fields(claim: &ClaimRecord) -> bool { + let fields = &claim.body["fields"]; + // Historical Service-on-assistant rows remain conservative conflict evidence + // under their original assistant policy, never Service bearer credentials. + let service = principal(fields).is_some_and(service_principal); + let scopes = if service { SERVICE_SCOPES } else { SCOPES }; + identity(claim) && digest_only(fields) + && fields["session_actor"].as_str().and_then(|actor| + principal(fields).and_then(|principal| actor.strip_prefix(principal))) + .and_then(|suffix| suffix.strip_prefix("/session/")) == fields["grant_id"].as_str() + && (service || (matches!(fields["minimal_read_mode"].as_str(), Some("approval-once" | "caller-bound-allow")) + && fields["disclosure_consent"] == true)) + && fields["expires_at_unix_ms"].as_u64().is_some() + && fields["scopes"].as_array().is_some_and(|values| + values.iter().all(|scope| scope.as_str().is_some_and(|scope| scopes.contains(&scope)))) +} +fn base_valid(claim: &ClaimRecord) -> bool { + identity(claim) && digest_only(&claim.body["fields"]) + && digest(&claim.body["fields"]["credential_hash"]) +} +/// Shared wire validation for admission, consumers and the raw-history oracle. +/// Authentication and projection folding are independently implemented by tests. +pub fn structurally_valid(grant: &ClaimRecord, policy: &ClaimRecord) -> bool { + base_valid(grant) && policy_fields(policy) && grant.subject == policy.subject + && grant.origin == policy.origin && grant.actor == policy.actor + && principal(&grant.body["fields"]) == principal(&policy.body["fields"]) + && ["grant_id", "session_actor", "issuer", "profile"].iter() + .all(|key| grant.body["fields"][*key] == policy.body["fields"][*key]) +} +pub fn transition_valid(grant: &ClaimRecord, transition: &ClaimRecord) -> bool { + if transition.kind == POLICY { return structurally_valid(grant, transition); } + transition.kind == REVOKED && base_valid(grant) && identity(transition) + && transition.origin == grant.origin && transition.actor == grant.actor + && transition.subject == grant.subject + && transition.body["fields"]["grant_id"] == grant.body["fields"]["grant_id"] + && transition.body["fields"]["issuer"] == grant.body["fields"]["issuer"] + && principal(&transition.body["fields"]) == principal(&grant.body["fields"]) + && profile(&transition.body["fields"]) == profile(&grant.body["fields"]) +} + +pub fn expiry_key(value: u64) -> String { format!("{value:020}") } + +pub fn install(connection: &Connection, local_origin: &str) -> Result<()> { + connection.execute_batch( + /* sqlite-large-value: allow-for-now lv-hbfff283c1bdb owner=smallclaims::store::assistant_grant_authority TODO=chunk-or-reference-variable-columns */ + "CREATE TABLE IF NOT EXISTS assistant_grant_authority ( + claim_id TEXT NOT NULL, base_claim_id TEXT NOT NULL, + grant_subject TEXT NOT NULL, kind TEXT NOT NULL, origin TEXT NOT NULL, + actor TEXT NOT NULL, principal TEXT NOT NULL, profile TEXT NOT NULL, + expires_at TEXT NOT NULL, store_index INTEGER NOT NULL, + credential_hash TEXT, record TEXT NOT NULL, + PRIMARY KEY(claim_id,base_claim_id)); + CREATE INDEX IF NOT EXISTS assistant_grant_authority_transition_index + ON assistant_grant_authority(grant_subject,kind,origin,actor,base_claim_id,store_index DESC); + CREATE INDEX IF NOT EXISTS assistant_grant_authority_latest_index + ON assistant_grant_authority(grant_subject,kind,store_index DESC); + CREATE INDEX IF NOT EXISTS assistant_grant_authority_credential_index + ON assistant_grant_authority(credential_hash,store_index DESC) WHERE kind='custom.client.assistant.v1.granted'; + CREATE TABLE IF NOT EXISTS assistant_grant_effective ( + claim_id TEXT PRIMARY KEY, grant_subject TEXT NOT NULL, principal TEXT NOT NULL, + owner TEXT NOT NULL, profile TEXT NOT NULL, expires_at TEXT NOT NULL, + revoked INTEGER NOT NULL, grant_record TEXT NOT NULL); + CREATE INDEX IF NOT EXISTS assistant_grant_effective_active_index + ON assistant_grant_effective(principal,owner,revoked,expires_at,profile); + CREATE INDEX IF NOT EXISTS assistant_grant_effective_subject_index + ON assistant_grant_effective(grant_subject); + CREATE TABLE IF NOT EXISTS assistant_grant_pending ( + claim_id TEXT PRIMARY KEY, grant_subject TEXT NOT NULL, kind TEXT NOT NULL, + origin TEXT NOT NULL, actor TEXT NOT NULL, sequence INTEGER NOT NULL, + authenticated INTEGER NOT NULL, record TEXT NOT NULL, + auth_member_key TEXT, auth_sequence INTEGER, + auth_envelope_hash TEXT, auth_record_position INTEGER); + CREATE INDEX IF NOT EXISTS assistant_grant_pending_subject_index + ON assistant_grant_pending(grant_subject,authenticated,origin,actor,kind); + CREATE INDEX IF NOT EXISTS assistant_grant_pending_writer_index + ON assistant_grant_pending(origin,authenticated,sequence,claim_id); + CREATE INDEX IF NOT EXISTS assistant_grant_pending_evidence_index + ON assistant_grant_pending(origin,auth_member_key,auth_sequence,claim_id); + CREATE INDEX IF NOT EXISTS assistant_grant_pending_signature_index + ON assistant_grant_pending(origin,auth_sequence,auth_envelope_hash,auth_member_key,claim_id); + CREATE INDEX IF NOT EXISTS assistant_grant_pending_envelope_index + ON assistant_grant_pending(origin,auth_sequence,auth_envelope_hash,claim_id); + CREATE TABLE IF NOT EXISTS assistant_grant_proof_invalidations ( + id INTEGER PRIMARY KEY, writer TEXT NOT NULL, sequence INTEGER NOT NULL, + envelope_hash TEXT NOT NULL, member_key TEXT NOT NULL, + claim_id TEXT NOT NULL DEFAULT ''); + CREATE INDEX IF NOT EXISTS assistant_grant_proof_invalidations_identity_index + ON assistant_grant_proof_invalidations(writer,sequence,envelope_hash,member_key); + CREATE TABLE IF NOT EXISTS assistant_grant_proof_rechecks (claim_id TEXT PRIMARY KEY); + CREATE TABLE IF NOT EXISTS assistant_grant_dirty (claim_id TEXT PRIMARY KEY); + CREATE TABLE IF NOT EXISTS assistant_grant_auth_cursor ( + claim_id TEXT PRIMARY KEY, position INTEGER NOT NULL, record_rowid INTEGER NOT NULL, + member_key TEXT NOT NULL, membership_start INTEGER NOT NULL DEFAULT -1); + CREATE TABLE IF NOT EXISTS assistant_grant_additions ( + id INTEGER PRIMARY KEY, writer TEXT NOT NULL, member_key TEXT NOT NULL, + lower_sequence INTEGER NOT NULL, upper_sequence INTEGER NOT NULL, + sequence INTEGER NOT NULL DEFAULT -1, envelope_hash TEXT NOT NULL DEFAULT '', + position INTEGER NOT NULL DEFAULT -1, claim_id TEXT NOT NULL DEFAULT '', + active_claim TEXT NOT NULL DEFAULT ''); + CREATE TABLE IF NOT EXISTS assistant_grant_auth_work ( + writer TEXT NOT NULL, claim_id TEXT NOT NULL, PRIMARY KEY(writer,claim_id)); + CREATE INDEX IF NOT EXISTS assistant_grant_pending_unauthenticated_index + ON assistant_grant_pending(origin,claim_id) WHERE authenticated=0; + CREATE INDEX IF NOT EXISTS assistant_grant_auth_work_claim_index + ON assistant_grant_auth_work(claim_id); + CREATE INDEX IF NOT EXISTS replica_records_grant_proof_index + ON replica_records(claim_id,writer,sequence,envelope_hash,position); + CREATE TABLE IF NOT EXISTS assistant_grant_retractions ( + id INTEGER PRIMARY KEY, writer TEXT NOT NULL, member_key TEXT NOT NULL, + lower_sequence INTEGER NOT NULL, upper_sequence INTEGER NOT NULL, + sequence INTEGER NOT NULL DEFAULT -1, claim_id TEXT NOT NULL DEFAULT ''); + CREATE INDEX IF NOT EXISTS assistant_grant_retractions_writer_key_index + ON assistant_grant_retractions(writer,member_key,lower_sequence,upper_sequence); + CREATE TABLE IF NOT EXISTS assistant_grant_recompute (claim_id TEXT PRIMARY KEY); + CREATE INDEX IF NOT EXISTS assistant_grant_authority_base_index + ON assistant_grant_authority(base_claim_id,kind,store_index DESC); + CREATE TABLE IF NOT EXISTS assistant_grant_membership_state ( + id INTEGER PRIMARY KEY CHECK(id=1), applied_generation INTEGER NOT NULL); + INSERT OR IGNORE INTO assistant_grant_membership_state VALUES(1,-1); + CREATE TABLE IF NOT EXISTS assistant_grant_local_appends (claim_id TEXT PRIMARY KEY); + CREATE TRIGGER IF NOT EXISTS assistant_grant_dirty_insert AFTER INSERT ON claims + WHEN NEW.kind IN ('custom.client.assistant.v1.granted','custom.client.assistant.v1.policy','custom.client.assistant.v1.revoked') + BEGIN INSERT OR IGNORE INTO assistant_grant_dirty VALUES(NEW.id); END; + CREATE TRIGGER IF NOT EXISTS assistant_grant_dirty_delete AFTER DELETE ON claims + WHEN EXISTS(SELECT 1 FROM assistant_grant_pending WHERE claim_id=OLD.id) + BEGIN INSERT OR IGNORE INTO assistant_grant_dirty VALUES(OLD.id); END; + DROP TRIGGER IF EXISTS assistant_grant_dirty_signature_insert; + DROP TRIGGER IF EXISTS assistant_grant_dirty_signature_insert_v2; + CREATE TRIGGER IF NOT EXISTS assistant_grant_dirty_signature_insert_v3 + AFTER INSERT ON replica_envelope_signatures + WHEN EXISTS(SELECT 1 FROM assistant_grant_membership_windows + WHERE writer=NEW.writer AND member_key=NEW.member_key + AND NEW.sequence>=start AND (end IS NULL OR NEW.sequence<=end)) + BEGIN + INSERT OR IGNORE INTO assistant_grant_dirty(claim_id) + SELECT records.claim_id FROM replica_records AS records + JOIN claims ON claims.id=records.claim_id + WHERE records.writer=NEW.writer AND records.sequence=NEW.sequence + AND records.envelope_hash=NEW.envelope_hash + AND claims.kind IN ('custom.client.assistant.v1.granted','custom.client.assistant.v1.policy','custom.client.assistant.v1.revoked'); + DELETE FROM assistant_grant_auth_cursor WHERE claim_id IN ( + SELECT claim_id FROM replica_records + WHERE writer=NEW.writer AND sequence=NEW.sequence AND envelope_hash=NEW.envelope_hash); + END; + CREATE TABLE IF NOT EXISTS assistant_grant_membership_windows ( + writer TEXT NOT NULL, member_key TEXT NOT NULL, start INTEGER NOT NULL, end INTEGER, + PRIMARY KEY(writer,member_key)); + CREATE INDEX IF NOT EXISTS assistant_grant_membership_windows_seek + ON assistant_grant_membership_windows(writer,start,member_key);" + )?; + connection.execute_batch(/* sqlite-large-value: allow-for-now lv-hff2d1c2b03b3 owner=smallclaims::store::assistant_grant_authority TODO=trace-statement-and-value-representation */ "SAVEPOINT assistant_grant_upgrade")?; + install_auth_cursor(connection)?; + install_proof_invalidation_triggers(connection)?; + install_auth_work(connection)?; + connection.execute(/* sqlite-large-value: allow-for-now lv-h3f117dab1bdd owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "INSERT OR REPLACE INTO meta(key,value) VALUES('assistant_grant_authority_local_origin',?1)", [local_origin])?; + connection.execute_batch(/* sqlite-large-value: allow-for-now lv-h57db182d0631 owner=smallclaims::store::assistant_grant_authority TODO=trace-statement-and-value-representation */ "RELEASE assistant_grant_upgrade")?; + Ok(()) +} + +fn install_auth_cursor(connection: &Connection) -> Result<()> { + let has_start: bool = connection.query_row( + "SELECT EXISTS(SELECT 1 FROM pragma_table_info('assistant_grant_auth_cursor') WHERE name='membership_start')", + [], |row| row.get(0), + )?; + if !has_start { + // The unreleased key-only cursor cannot describe the new window order. + // Requeue every interrupted claim rather than trusting its stale position. + connection.execute_batch( + /* sqlite-large-value: allow-for-now lv-h7b614d59afc6 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "INSERT OR IGNORE INTO assistant_grant_dirty SELECT claim_id FROM assistant_grant_auth_cursor; + DELETE FROM assistant_grant_auth_cursor; + ALTER TABLE assistant_grant_auth_cursor ADD COLUMN membership_start INTEGER NOT NULL DEFAULT -1;" + )?; + } + Ok(()) +} + +fn install_auth_work(connection: &Connection) -> Result<()> { + let old_additions: bool = connection.query_row( + "SELECT NOT EXISTS(SELECT 1 FROM pragma_table_info('assistant_grant_additions') WHERE name='claim_id')", + [], |row| row.get(0), + )?; + if old_additions { + // Retain key/range obligations, but replace history-wide progress with + // a fresh grant-work cursor. No committed obligation is discarded. + connection.execute_batch( + /* sqlite-large-value: allow-for-now lv-hed00daccc56e owner=smallclaims::store::assistant_grant_authority TODO=chunk-or-reference-exact-wire-values */ "ALTER TABLE assistant_grant_additions ADD COLUMN claim_id TEXT NOT NULL DEFAULT ''; + ALTER TABLE assistant_grant_additions ADD COLUMN active_claim TEXT NOT NULL DEFAULT ''; + UPDATE assistant_grant_additions SET sequence=-1,envelope_hash='',position=-1;" + )?; + } + // The outer statement's conflict policy can override a trigger's OR IGNORE. + // Work is set membership, so explicitly avoid inserting an existing claim; + // this remains idempotent under cursor/pending UPSERTs as well as plain writes. + for table in ["assistant_grant_pending","assistant_grant_auth_cursor","assistant_grant_proof_rechecks"] { + for event in ["INSERT","UPDATE","DELETE"] { + let row = if event=="DELETE" { "OLD" } else { "NEW" }; + connection.execute_batch(&format!( + /* sqlite-large-value: allow-for-now lv-h8579ec8dafea owner=smallclaims::store::assistant_grant_authority TODO=prepare-body-and-predecessor-values */ "DROP TRIGGER IF EXISTS {table}_auth_work_{event}; + CREATE TRIGGER {table}_auth_work_{event} AFTER {event} ON {table} BEGIN + INSERT INTO assistant_grant_auth_work + SELECT COALESCE((SELECT origin FROM assistant_grant_pending WHERE claim_id={row}.claim_id), + (SELECT origin FROM claims WHERE id={row}.claim_id)),{row}.claim_id + WHERE (EXISTS(SELECT 1 FROM assistant_grant_pending WHERE claim_id={row}.claim_id AND authenticated=0) + OR EXISTS(SELECT 1 FROM assistant_grant_auth_cursor WHERE claim_id={row}.claim_id) + OR EXISTS(SELECT 1 FROM assistant_grant_proof_rechecks WHERE claim_id={row}.claim_id)) + AND NOT EXISTS(SELECT 1 FROM assistant_grant_auth_work WHERE claim_id={row}.claim_id) + AND (EXISTS(SELECT 1 FROM assistant_grant_pending WHERE claim_id={row}.claim_id) + OR EXISTS(SELECT 1 FROM claims WHERE id={row}.claim_id)); + DELETE FROM assistant_grant_auth_work WHERE claim_id={row}.claim_id + AND NOT EXISTS(SELECT 1 FROM assistant_grant_pending WHERE claim_id={row}.claim_id AND authenticated=0) + AND NOT EXISTS(SELECT 1 FROM assistant_grant_auth_cursor WHERE claim_id={row}.claim_id) + AND NOT EXISTS(SELECT 1 FROM assistant_grant_proof_rechecks WHERE claim_id={row}.claim_id); + END;" + ))?; + } + } + let installed: bool = connection.query_row( + "SELECT EXISTS(SELECT 1 FROM meta WHERE key='assistant_grant_auth_work_installed')", + [], |row| row.get(0), + )?; + if !installed { + connection.execute_batch( + /* sqlite-large-value: allow-for-now lv-hda7f8f715d53 owner=smallclaims::store::assistant_grant_authority TODO=prepare-body-and-predecessor-values */ "INSERT OR IGNORE INTO assistant_grant_auth_work + SELECT origin,claim_id FROM assistant_grant_pending + INDEXED BY assistant_grant_pending_unauthenticated_index WHERE authenticated=0; + INSERT OR IGNORE INTO assistant_grant_auth_work + SELECT claims.origin,cursor.claim_id FROM assistant_grant_auth_cursor AS cursor + JOIN claims ON claims.id=cursor.claim_id; + INSERT OR IGNORE INTO assistant_grant_auth_work + SELECT pending.origin,work.claim_id FROM assistant_grant_proof_rechecks AS work + JOIN assistant_grant_pending AS pending ON pending.claim_id=work.claim_id; + INSERT INTO meta(key,value) VALUES('assistant_grant_auth_work_installed','1');" + )?; + } + let legacy: bool = connection.query_row( + "SELECT EXISTS(SELECT 1 FROM sqlite_master WHERE type='table' AND name='assistant_grant_membership_dirty')", + [], |row| row.get(0), + )?; + if legacy { + connection.execute_batch( + /* sqlite-large-value: allow-for-now lv-hda9098901f71 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "INSERT OR IGNORE INTO assistant_grant_proof_rechecks + SELECT pending.claim_id FROM assistant_grant_membership_dirty AS work + JOIN assistant_grant_pending AS pending INDEXED BY assistant_grant_pending_writer_index + ON pending.origin=work.writer AND pending.authenticated=0 + WHERE (pending.sequence,pending.claim_id)>(work.sequence,work.claim_id); + DROP TABLE assistant_grant_membership_dirty;" + )?; + } + Ok(()) +} + +// Destructive evidence changes are independent of membership invalidation. +// Triggers enqueue a proof identity in constant work; indexed maintenance +// visits dependent claims one at a time instead of expanding them in a trigger. +fn install_proof_invalidation_triggers(connection: &Connection) -> Result<()> { + for (table,stem,key,index,changes) in [ + ("replica_envelope_signatures","signature","OLD.member_key", + "assistant_grant_pending_signature_index", + "OLD.writer IS NOT NEW.writer OR OLD.sequence IS NOT NEW.sequence OR OLD.envelope_hash IS NOT NEW.envelope_hash OR OLD.member_key IS NOT NEW.member_key OR OLD.signature IS NOT NEW.signature"), + ("replica_envelopes","envelope","''", + "assistant_grant_pending_envelope_index", + "OLD.writer IS NOT NEW.writer OR OLD.sequence IS NOT NEW.sequence OR OLD.envelope_hash IS NOT NEW.envelope_hash OR (OLD.receipt_state IN ('validated','degraded') AND NEW.receipt_state NOT IN ('validated','degraded'))"), + ] { + let key_filter = if stem=="signature" { "AND auth_member_key=OLD.member_key" } else { "" }; + let dependent = format!( + "SELECT 1 FROM assistant_grant_pending INDEXED BY {index} + WHERE origin=OLD.writer AND auth_sequence=OLD.sequence + AND auth_envelope_hash=OLD.envelope_hash {key_filter}" + ); + for event in ["DELETE","UPDATE"] { + let changed = if event=="UPDATE" { format!("({changes}) AND ") } else { String::new() }; + connection.execute_batch(&format!( + /* sqlite-large-value: allow-for-now lv-ha2046fcea9c3 owner=smallclaims::store::assistant_grant_authority TODO=chunk-or-reference-exact-wire-values */ "CREATE TRIGGER IF NOT EXISTS assistant_grant_proof_{stem}_{event} + AFTER {event} ON {table} WHEN {changed}EXISTS({dependent}) + BEGIN + INSERT INTO assistant_grant_proof_invalidations(writer,sequence,envelope_hash,member_key) + VALUES(OLD.writer,OLD.sequence,OLD.envelope_hash,{key}); + END;" + ))?; + } + } + let dependent = "SELECT claim_id FROM assistant_grant_pending + WHERE claim_id=OLD.claim_id AND origin=OLD.writer + AND auth_sequence=OLD.sequence AND auth_envelope_hash=OLD.envelope_hash + AND auth_record_position=OLD.position"; + for event in ["DELETE","UPDATE"] { + let changed = if event=="UPDATE" { + "(OLD.writer IS NOT NEW.writer OR OLD.sequence IS NOT NEW.sequence + OR OLD.envelope_hash IS NOT NEW.envelope_hash OR OLD.position IS NOT NEW.position + OR OLD.claim_id IS NOT NEW.claim_id + OR (OLD.state='valid' AND NEW.state<>'valid')) AND " + } else { "" }; + connection.execute_batch(&format!( + /* sqlite-large-value: allow-for-now lv-h0d8e722e48bb owner=smallclaims::store::assistant_grant_authority TODO=chunk-or-reference-exact-wire-values */ "DROP TRIGGER IF EXISTS assistant_grant_proof_record_{event}; + CREATE TRIGGER assistant_grant_proof_record_{event} + AFTER {event} ON replica_records WHEN {changed}EXISTS({dependent}) + BEGIN + INSERT OR IGNORE INTO assistant_grant_proof_rechecks {dependent}; + DELETE FROM assistant_grant_auth_cursor WHERE claim_id IN ({dependent}); + END;" + ))?; + } + Ok(()) +} + + +pub fn ready(connection: &Connection) -> Result<(), FractalError> { + let complete: bool = connection.query_row( + "SELECT COALESCE((SELECT value FROM meta WHERE key='assistant_grant_authority_version'),'')=?1", + [VERSION], |row| row.get(0), + ).map_err(internal)?; + if !complete { + return Err(FractalError::new("assistant-grant-authority-not-ready", "external-grant authority backfill is in progress; retry after it completes")); + } + Ok(()) +} +/// Durable maintenance work is independent of initial-backfill readiness. +pub fn maintenance_pending(connection: &Connection) -> Result { + let pending: bool = connection.query_row( + "SELECT COALESCE((SELECT value FROM meta WHERE key='assistant_grant_authority_version'),'')<>?1 + OR EXISTS(SELECT 1 FROM assistant_grant_dirty) + OR EXISTS(SELECT 1 FROM assistant_grant_retractions) + OR EXISTS(SELECT 1 FROM assistant_grant_additions) + OR EXISTS(SELECT 1 FROM assistant_grant_recompute) + OR EXISTS(SELECT 1 FROM assistant_grant_proof_invalidations) + OR EXISTS(SELECT 1 FROM assistant_grant_proof_rechecks)", + [VERSION], |row| row.get(0), + ).map_err(internal)?; + Ok(pending) +} +// Keep the subject lookup outermost even when the global work queues are large. +// Cost still grows with this subject's claims and matching proof obligations. +pub const SUBJECT_PENDING_QUERY: &str = + "SELECT EXISTS(SELECT 1 FROM claims INDEXED BY claims_subject_index + CROSS JOIN assistant_grant_dirty AS dirty + WHERE claims.subject=?1 AND dirty.claim_id=claims.id) + OR EXISTS(SELECT 1 FROM assistant_grant_pending AS pending INDEXED BY assistant_grant_pending_subject_index + CROSS JOIN assistant_grant_dirty AS dirty + WHERE pending.grant_subject=?1 AND dirty.claim_id=pending.claim_id) + OR EXISTS(SELECT 1 FROM claims INDEXED BY claims_subject_index + CROSS JOIN assistant_grant_auth_cursor AS cursor + WHERE claims.subject=?1 AND cursor.claim_id=claims.id) + OR EXISTS(SELECT 1 FROM assistant_grant_pending + WHERE grant_subject=?1 AND authenticated=0) + OR EXISTS(SELECT 1 FROM assistant_grant_pending AS pending INDEXED BY assistant_grant_pending_subject_index + CROSS JOIN assistant_grant_recompute AS work + WHERE pending.grant_subject=?1 AND work.claim_id=pending.claim_id) + OR EXISTS(SELECT 1 FROM assistant_grant_pending AS pending INDEXED BY assistant_grant_pending_subject_index + CROSS JOIN assistant_grant_proof_rechecks AS work + WHERE pending.grant_subject=?1 AND work.claim_id=pending.claim_id) + OR EXISTS(SELECT 1 FROM assistant_grant_pending AS pending INDEXED BY assistant_grant_pending_subject_index + CROSS JOIN assistant_grant_proof_invalidations AS work INDEXED BY assistant_grant_proof_invalidations_identity_index + WHERE work.writer=pending.origin AND work.sequence=pending.auth_sequence + AND work.envelope_hash=pending.auth_envelope_hash + AND pending.grant_subject=?1 AND pending.claim_id>work.claim_id + AND (work.member_key='' OR work.member_key=pending.auth_member_key)) + OR EXISTS(SELECT 1 FROM assistant_grant_pending AS pending INDEXED BY assistant_grant_pending_subject_index + CROSS JOIN assistant_grant_retractions AS dirty INDEXED BY assistant_grant_retractions_writer_key_index + ON dirty.writer=pending.origin AND dirty.member_key=pending.auth_member_key + WHERE pending.grant_subject=?1 + AND pending.auth_sequence BETWEEN dirty.lower_sequence AND dirty.upper_sequence + AND (pending.auth_sequence,pending.claim_id)>(dirty.sequence,dirty.claim_id) + AND NOT EXISTS(SELECT 1 FROM assistant_grant_membership_windows AS windows + WHERE windows.writer=pending.origin AND windows.member_key=pending.auth_member_key + AND pending.auth_sequence>=windows.start + AND (windows.end IS NULL OR pending.auth_sequence<=windows.end)))"; +fn subject_pending(connection: &Connection, subject: &str) -> Result { + connection.query_row(/* sqlite-large-value: allow-for-now lv-h648b9952e737 owner=smallclaims::store::assistant_grant_authority TODO=trace-statement-and-value-representation */ SUBJECT_PENDING_QUERY, [subject], |row| row.get(0)).map_err(internal) +} +/// A pending proof or unauthenticated revoke fences only its grant subject. +pub fn subject_ready(connection: &Connection, subject: &str) -> Result<(), FractalError> { + ready(connection)?; + if subject_pending(connection, subject)? { + return Err(FractalError::new("assistant-grant-subject-not-ready", "external-grant subject authentication is in progress")); + } + Ok(()) +} +fn decode(record: String) -> Result { + serde_json::from_str(&record).map_err(internal) +} +pub const TRANSITION_QUERY: &str = "SELECT record FROM assistant_grant_authority + WHERE grant_subject=?1 AND kind=?2 AND origin=?3 AND actor=?4 AND base_claim_id=?5 + ORDER BY store_index DESC LIMIT 1"; +pub fn transition(connection: &Connection, granted: &ClaimRecord, kind: &str) -> Result, FractalError> { + subject_ready(connection, &granted.subject)?; + transition_unchecked(connection, granted, kind).map_err(internal) +} +fn transition_unchecked(connection: &Connection, granted: &ClaimRecord, kind: &str) -> Result> { + let record: Option = connection.query_row(/* sqlite-large-value: allow-for-now lv-h80fb9d4725e0 owner=smallclaims::store::assistant_grant_authority TODO=trace-statement-and-value-representation */ TRANSITION_QUERY, + params![granted.subject, kind, granted.origin, granted.actor, granted.id], |row| row.get(0)).optional()?; + record.map(|record| serde_json::from_str(&record).map_err(Into::into)).transpose() +} +pub fn latest(connection: &Connection, subject: &str, kind: &str) -> Result, FractalError> { + subject_ready(connection, subject)?; + let record: Option = connection.query_row( + "SELECT record FROM assistant_grant_authority WHERE grant_subject=?1 AND kind=?2 ORDER BY store_index DESC LIMIT 1", + params![subject,kind], |row| row.get(0)).optional().map_err(internal)?; + record.map(decode).transpose() +} +pub const CANDIDATES_QUERY: &str = "SELECT grant_record FROM assistant_grant_effective + WHERE ?3 IS NOT NULL AND principal=?1 AND owner=?2 AND revoked=0 AND expires_at>?3 + AND (?4 IS NULL OR claim_id<>?4) AND (?5 IS NULL OR profile<>?5) + UNION ALL + SELECT grant_record FROM assistant_grant_effective + WHERE ?3 IS NULL AND principal=?1 AND owner=?2 + AND (?4 IS NULL OR claim_id<>?4) AND (?5 IS NULL OR profile<>?5)"; +/// Authenticated effective snapshots for conflict admission, not bearer access. +/// A pending revoke must not erase an opposite-profile conflict witness before +/// it authenticates. Bearer and transition readers independently fence subjects. +pub fn candidates(connection: &Connection, principal: &str, owner: &str, expiry_cut: Option, excluded: Option<&str>, ignored_profile: Option<&str>) -> Result, FractalError> { + ready(connection)?; + let mut statement = connection.prepare_cached(/* sqlite-large-value: allow-for-now lv-h556bdadaf8cd owner=smallclaims::store::assistant_grant_authority TODO=trace-statement-and-value-representation */ CANDIDATES_QUERY).map_err(internal)?; + let records = statement.query_map(params![principal,owner,expiry_cut.map(expiry_key),excluded,ignored_profile], |row| row.get::<_,String>(0)) + .map_err(internal)?; + records.map(|record| decode(record.map_err(internal)?)).collect() +} +pub fn by_credential(connection: &Connection, digest: &str) -> Result, FractalError> { + ready(connection)?; + let record: Option = connection.query_row( + "SELECT record FROM assistant_grant_authority WHERE credential_hash=?1 AND kind='custom.client.assistant.v1.granted' ORDER BY store_index DESC LIMIT 1", + [digest], |row| row.get(0)).optional().map_err(internal)?; + let grant = record.map(decode).transpose()?; + match grant { + Some(grant) if !subject_pending(connection, &grant.subject)? => Ok(Some(grant)), + _ => Ok(None), + } +} +pub fn contains(connection: &Connection, claim_id: &str) -> Result { + ready(connection)?; + let subject: Option = connection.query_row( + "SELECT grant_subject FROM assistant_grant_authority WHERE claim_id=?1 LIMIT 1", + [claim_id], |row| row.get(0), + ).optional().map_err(internal)?; + match subject { + Some(subject) => Ok(!subject_pending(connection, &subject)?), + None => Ok(false), + } +} + +fn insert_authority(connection: &Connection, claim: &ClaimRecord, base: &ClaimRecord) -> Result { + let fields = &claim.body["fields"]; + Ok(connection.execute( + /* sqlite-large-value: allow-for-now lv-h60572e3ac6a5 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ + "INSERT OR IGNORE INTO assistant_grant_authority + (claim_id,base_claim_id,grant_subject,kind,origin,actor,principal,profile,expires_at,store_index,credential_hash,record) + VALUES(?1,?2,?3,?4,?5,?6,?7,?8,?9,?10,?11,?12)", + params![claim.id,base.id,claim.subject,claim.kind,claim.origin,claim.actor,principal(fields),profile(fields), + expiry_key(fields["expires_at_unix_ms"].as_u64().unwrap_or(0)),claim.store_index, + if claim.kind==GRANTED { fields["credential_hash"].as_str() } else { None },serde_json::to_string(claim)?], + )? != 0) +} +// Full reconstruction is a test oracle operation, never maintenance work. +#[cfg(test)] +pub fn rebuild_subject(connection: &Connection, subject: &str) -> Result<()> { + connection.execute("DELETE FROM assistant_grant_effective WHERE grant_subject=?1", [subject])?; + let mut statement = connection.prepare_cached( + "SELECT claim_id FROM assistant_grant_authority WHERE grant_subject=?1 AND kind=?2")?; + let bases = statement.query_map(params![subject,GRANTED], |row| row.get::<_,String>(0))? + .collect::>>()?; + for base in bases { recompute_base(connection,&base)?; } + Ok(()) +} + +// One base PK lookup and at most two indexed latest-transition seeks. Neither +// another base nor an earlier policy/revoke is replayed during recomputation. +fn recompute_base(connection: &Connection, base_id: &str) -> Result<()> { + connection.execute(/* sqlite-large-value: allow-for-now lv-h67e21448c6af owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_effective WHERE claim_id=?1", [base_id])?; + let record: Option = connection.query_row( + "SELECT authority.record FROM assistant_grant_authority AS authority + JOIN assistant_grant_pending AS pending ON pending.claim_id=authority.claim_id + WHERE authority.claim_id=?1 AND authority.base_claim_id=?1 AND pending.authenticated=1", + [base_id], |row| row.get(0)).optional()?; + let Some(record) = record else { return Ok(()); }; + let grant: ClaimRecord = serde_json::from_str(&record)?; + let policy_claim = transition_unchecked(connection,&grant,POLICY)?; + let policy = policy_claim.as_ref().unwrap_or(&grant); + if !structurally_valid(&grant,policy) { + // The final repairing policy disappeared. The raw base remains pending, + // but must no longer mask a valid older credential in authority lookup. + connection.execute( + /* sqlite-large-value: allow-for-now lv-hd5498a2a9ed1 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_authority WHERE claim_id=?1 AND base_claim_id=?1", + [base_id])?; + return Ok(()); + } + let fields = &policy.body["fields"]; + connection.execute( + /* sqlite-large-value: allow-for-now lv-h3f4f98505546 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_effective(claim_id,grant_subject,principal,owner,profile,expires_at,revoked,grant_record) + VALUES(?1,?2,?3,?4,?5,?6,?7,?8)", + params![grant.id,grant.subject,principal(fields),grant.actor,profile(fields), + expiry_key(fields["expires_at_unix_ms"].as_u64().unwrap_or(0)), + transition_unchecked(connection,&grant,REVOKED)?.is_some(),record])?; + Ok(()) +} +fn attach_claim(connection: &Connection, claim: &ClaimRecord) -> Result<()> { + let mut changed = false; + if claim.kind == GRANTED { + // A malformed base stays pending until a valid issuer policy repairs it. + // Otherwise a newer malformed copy could mask a valid bearer lookup. + if structurally_valid(claim,claim) { + changed |= insert_authority(connection,claim,claim)?; + } + // Only this base's issuer prefix can attach to it. In particular, an + // authenticated wrong-actor history cannot enlarge later admission work. + let mut statement = connection.prepare_cached( + "SELECT record FROM assistant_grant_pending WHERE grant_subject=?1 + AND authenticated=1 AND origin=?2 AND actor=?3 AND kind<>?4")?; + let records = statement.query_map(params![claim.subject,claim.origin,claim.actor,GRANTED], |row| row.get::<_,String>(0))?; + for record in records { + let transition: ClaimRecord = serde_json::from_str(&record?)?; + if transition_valid(claim,&transition) { + if transition.kind == POLICY { + changed |= insert_authority(connection,claim,claim)?; + } + changed |= insert_authority(connection,&transition,claim)?; + } + } + if changed { recompute_base(connection,&claim.id)?; } + } else { + let mut statement = connection.prepare_cached( + "SELECT record FROM assistant_grant_pending WHERE grant_subject=?1 + AND authenticated=1 AND kind=?2 AND origin=?3 AND actor=?4")?; + let records = statement.query_map(params![claim.subject,GRANTED,claim.origin,claim.actor], |row| row.get::<_,String>(0))?; + for record in records { + let grant: ClaimRecord = serde_json::from_str(&record?)?; + let mut changed = false; + if transition_valid(&grant,claim) { + if claim.kind == POLICY { + changed |= insert_authority(connection,&grant,&grant)?; + } + changed |= insert_authority(connection,claim,&grant)?; + if changed { recompute_base(connection,&grant.id)?; } + } + } + } + Ok(()) +} +fn local_origin(connection: &Connection) -> Result { + Ok(connection.query_row("SELECT value FROM meta WHERE key='assistant_grant_authority_local_origin'", [], |row| row.get(0))?) +} +/// Admission pays structural/authentication cost once. Invalid rows never enter +/// the authority or the pending-authentication writer/window index. +pub fn refresh_claim(connection: &Connection, id: &str) -> Result<()> { + // Receipt/local append boundary: only durable local admission is immediate. + // Remote first-authentication runs in maintenance after generation validation. + refresh_claim_inner(connection, id, false) +} + +fn refresh_claim_inner(connection: &Connection, id: &str, membership_current: bool) -> Result<()> { + refresh_claim_with_authentication(connection,id,membership_current,None) +} + +fn refresh_claim_with_authentication(connection: &Connection, id: &str, + membership_current: bool, verified: Option) -> Result<()> { + static QUERY: std::sync::LazyLock = std::sync::LazyLock::new(|| + format!("SELECT {CLAIM_COLUMNS} FROM claims WHERE id=?1")); + let claim = connection.prepare_cached(/* sqlite-large-value: allow-for-now lv-h1665a4a8cfdf owner=smallclaims::store::assistant_grant_authority TODO=trace-statement-and-value-representation */ &QUERY)?.query_row(/* sqlite-large-value: allow-for-now lv-h5520ddeb5d20 owner=smallclaims::store::assistant_grant_authority TODO=trace-statement-and-value-representation */ [id], claim_from_row).optional()?; + let Some(claim) = claim else { + // Trim can remove a receipt and its raw claim in one transaction. + // Retire cached state through bounded demotion, not a stuck dirty row. + connection.execute( + /* sqlite-large-value: allow-for-now lv-h28df63bc590a owner=smallclaims::store::assistant_grant_authority TODO=chunk-or-reference-exact-wire-values */ "UPDATE assistant_grant_pending SET authenticated=0,auth_member_key=NULL, + auth_sequence=NULL,auth_envelope_hash=NULL,auth_record_position=NULL WHERE claim_id=?1", [id], + )?; + connection.execute( + /* sqlite-large-value: allow-for-now lv-h7ab907abb853 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "INSERT OR IGNORE INTO assistant_grant_recompute + SELECT claim_id FROM assistant_grant_pending WHERE claim_id=?1", [id], + )?; + connection.execute(/* sqlite-large-value: allow-for-now lv-h1a4864d9f6c8 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1", [id])?; + connection.execute(/* sqlite-large-value: allow-for-now lv-h3221720b83b7 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_dirty WHERE claim_id=?1", [id])?; + return Ok(()); + }; + if !KINDS.contains(&claim.kind.as_str()) { return Ok(()); } + let valid = if claim.kind==GRANTED { base_valid(&claim) } + else if claim.kind==POLICY { policy_fields(&claim) } else { identity(&claim) }; + if valid { + let sequence: u64 = connection.query_row("SELECT replica_sequence FROM batches WHERE id=?1", [&claim.batch_id], |row| row.get(0))?; + // Only the local append transaction can create this durable admission + // fact. Origin text and the absence of a receipt prove nothing: legacy + // imports can also have neither envelopes nor replica records. + let local_append: bool = connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_local_appends WHERE claim_id=?1)", + [&claim.id], |row| row.get(0), + )?; + let previous: Option<(bool,Option,Option,Option,Option)> = connection.query_row( + "SELECT authenticated,auth_member_key,auth_sequence,auth_envelope_hash,auth_record_position + FROM assistant_grant_pending WHERE claim_id=?1", + [&claim.id], |row| Ok((row.get(0)?,row.get(1)?,row.get(2)?,row.get(3)?,row.get(4)?)), + ).optional()?; + let (admitted, previous_key, previous_sequence, previous_hash, previous_position) = + previous.unwrap_or((false,None,None,None,None)); + // Trust depends on precise evidence, never monotonic admission. Retraction + // tasks target that dependency; local append is a separate durable fact. + let authentication = if let Some(verified) = verified { + verified + } else if local_append && claim.origin == local_origin(connection)? { + Authentication::Authenticated(None) + } else if membership_current { + authenticated_claim(connection,&claim.id)? + } else if admitted { + Authentication::Authenticated(previous_key.clone().zip(previous_sequence) + .zip(previous_hash.clone()).zip(previous_position) + .map(|(((key,sequence),hash),position)| (key,sequence,hash,position))) + } else { + Authentication::Pending + }; + let (authenticated, proof_key, proof_sequence, proof_hash, proof_position) = match &authentication { + Authentication::Authenticated(proof) => (true,proof.as_ref().map(|p|p.0.clone()), + proof.as_ref().map(|p|p.1),proof.as_ref().map(|p|p.2.clone()),proof.as_ref().map(|p|p.3)), + Authentication::Unauthenticated => (false,None,None,None,None), + Authentication::Pending => (admitted,previous_key,previous_sequence,previous_hash,previous_position), + }; + let changed = connection.execute(/* sqlite-large-value: allow-for-now lv-h5e92793f2a03 owner=smallclaims::store::assistant_grant_authority TODO=chunk-or-reference-exact-wire-values */ "INSERT INTO assistant_grant_pending(claim_id,grant_subject,kind,origin,actor,sequence,authenticated,record,auth_member_key,auth_sequence,auth_envelope_hash,auth_record_position) + VALUES(?1,?2,?3,?4,?5,?6,?7,?8,?9,?10,?11,?12) ON CONFLICT(claim_id) DO UPDATE SET + authenticated=excluded.authenticated,auth_member_key=excluded.auth_member_key,auth_sequence=excluded.auth_sequence, + auth_envelope_hash=excluded.auth_envelope_hash,auth_record_position=excluded.auth_record_position + WHERE assistant_grant_pending.authenticated<>excluded.authenticated + OR assistant_grant_pending.auth_member_key IS NOT excluded.auth_member_key + OR assistant_grant_pending.auth_sequence IS NOT excluded.auth_sequence + OR assistant_grant_pending.auth_envelope_hash IS NOT excluded.auth_envelope_hash + OR assistant_grant_pending.auth_record_position IS NOT excluded.auth_record_position", + params![claim.id,claim.subject,claim.kind,claim.origin,claim.actor,sequence,authenticated,serde_json::to_string(&claim)?,proof_key,proof_sequence,proof_hash,proof_position])? != 0; + if changed && !admitted && authenticated { attach_claim(connection,&claim)?; } + if admitted && !authenticated { rebuild_authenticated_subject(connection,&claim)?; } + if matches!(authentication, Authentication::Pending) { + connection.execute(/* sqlite-large-value: allow-for-now lv-he3fa452add20 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "INSERT OR IGNORE INTO assistant_grant_dirty VALUES(?1)", [id])?; + return Ok(()); + } + } + connection.execute(/* sqlite-large-value: allow-for-now lv-hd91341d01a91 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_dirty WHERE claim_id=?1", [id])?; + Ok(()) +} + +// Rebuild both bases and transitions: losing a policy may invalidate a repaired +// malformed base, and losing a revoke must produce exactly fresh-backfill state. +// A still-pending unauthenticated transition continues to fence bearer use. +fn rebuild_authenticated_subject(connection: &Connection, claim: &ClaimRecord) -> Result<()> { + // Fanout is durable work, not a subject-history replay in this claim's unit. + connection.execute( + /* sqlite-large-value: allow-for-now lv-h53b6a1e0835c owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "INSERT OR IGNORE INTO assistant_grant_recompute(claim_id) VALUES(?1)", + [&claim.id])?; + Ok(()) +} + +// Consume exactly one authority pair (or one completed task). The queue must +// drain before authenticating another claim, so a later readmission cannot race +// deletion of the previous admission's dependent rows. +fn recompute_one(connection: &Connection) -> Result { + let claim_id: Option = connection.query_row( + "SELECT claim_id FROM assistant_grant_recompute ORDER BY claim_id LIMIT 1", + [], |row| row.get(0)).optional()?; + let Some(claim_id) = claim_id else { return Ok(false); }; + let pair: Option<(String,String)> = connection.query_row( + "SELECT claim_id,base_claim_id FROM + (SELECT claim_id,base_claim_id FROM assistant_grant_authority WHERE claim_id=?1 LIMIT 1) + UNION ALL + SELECT claim_id,base_claim_id FROM + (SELECT claim_id,base_claim_id FROM assistant_grant_authority + INDEXED BY assistant_grant_authority_base_index WHERE base_claim_id=?1 LIMIT 1) + LIMIT 1", + [&claim_id], |row| Ok((row.get(0)?,row.get(1)?))).optional()?; + if let Some((dependent,base)) = pair { + connection.execute( + /* sqlite-large-value: allow-for-now lv-h67b7b4921e3a owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_authority WHERE claim_id=?1 AND base_claim_id=?2", + params![dependent,base])?; + recompute_base(connection,&base)?; + } else { + connection.execute(/* sqlite-large-value: allow-for-now lv-h981cb88354da owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_recompute WHERE claim_id=?1", [&claim_id])?; + connection.execute( + /* sqlite-large-value: allow-for-now lv-h9ab29a0fbe52 owner=smallclaims::store::assistant_grant_authority TODO=prepare-body-and-predecessor-values */ "DELETE FROM assistant_grant_pending WHERE claim_id=?1 + AND NOT EXISTS(SELECT 1 FROM claims WHERE id=?1)", [&claim_id], + )?; + } + Ok(true) +} + +enum Authentication { + Pending, + Unauthenticated, + // None denotes durable local append. Writer is the claim's validated origin. + Authenticated(Option<(String,u64,String,i64)>), +} + +#[cfg(test)] +thread_local! { static AUTHENTICATION_ATTEMPTS: std::cell::Cell = const { std::cell::Cell::new(0) }; } +#[cfg(test)] +pub fn take_authentication_attempts() -> usize { + AUTHENTICATION_ATTEMPTS.with(|count| count.replace(0)) +} +#[cfg(test)] +thread_local! { static AUTHENTICATION_CLAIMS: std::cell::RefCell> = const { std::cell::RefCell::new(Vec::new()) }; } +#[cfg(test)] +pub fn take_authentication_claims() -> Vec { + AUTHENTICATION_CLAIMS.with(|claims| std::mem::take(&mut *claims.borrow_mut())) +} +/// One record and at most sixteen membership keys per refresh. Nonmember +/// signatures are never enumerated: every signature lookup supplies its full PK. +/// Persist progress even through missing/invalid evidence, so a later valid key +/// or record cannot be hidden behind an arbitrary number of earlier candidates. +fn authenticated_claim(connection: &Connection, id: &str) -> Result { + #[cfg(test)] + AUTHENTICATION_ATTEMPTS.with(|count| count.set(count.get()+1)); + #[cfg(test)] + AUTHENTICATION_CLAIMS.with(|claims| claims.borrow_mut().push(id.to_owned())); + let Some(fleet_id) = fleet_meta(connection,"assistant_grant_authority_fleet_id")? else { + return Ok(Authentication::Unauthenticated); + }; + let shard = fleet_meta(connection,"shard_id")?; + let cursor: Option<(i64,i64,String,i64)> = connection.query_row( + "SELECT position,record_rowid,member_key,membership_start FROM assistant_grant_auth_cursor WHERE claim_id=?1", + [id], |row| Ok((row.get(0)?,row.get(1)?,row.get(2)?,row.get(3)?))).optional()?; + let initial = cursor.is_none(); + let (position_cursor,rowid_cursor,key_cursor,start_cursor) = + cursor.unwrap_or((i64::MIN,i64::MIN,String::new(),-1)); + let record: Option<(i64,i64,String,u64,String,bool)> = connection.query_row( + "SELECT records.position,records.rowid,records.writer,records.sequence,records.envelope_hash, + records.state='valid' AND claims.origin=records.writer + AND EXISTS(SELECT 1 FROM replica_envelopes AS envelopes + WHERE envelopes.writer=records.writer AND envelopes.sequence=records.sequence + AND envelopes.envelope_hash=records.envelope_hash + AND envelopes.receipt_state IN ('validated','degraded')) + FROM replica_records AS records INDEXED BY replica_records_claim + JOIN claims ON claims.id=records.claim_id + WHERE records.claim_id=?1 AND (records.position,records.rowid)>=(?2,?3) + AND (?5 OR (records.position,records.rowid)<>(?2,?3) OR ?4<>'') + ORDER BY records.position,records.rowid LIMIT 1", + params![id,position_cursor,rowid_cursor,key_cursor,initial], + |row| Ok((row.get(0)?,row.get(1)?,row.get(2)?,row.get(3)?,row.get(4)?,row.get(5)?))).optional()?; + let Some((position,record_rowid,writer,sequence,hash,eligible)) = record else { + connection.execute(/* sqlite-large-value: allow-for-now lv-hdb10afe3ddca owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1", [id])?; + return Ok(Authentication::Unauthenticated); + }; + // A nonempty key resumes this record; an empty key advances past it. + // The index seek skips at most the one completed record at the cursor. + let mut next_key = String::new(); + let mut next_start = -1; + if eligible { + let mut statement = connection.prepare_cached(/* sqlite-large-value: allow-for-now lv-hf53f8e0e2462 owner=smallclaims::store::assistant_grant_authority TODO=trace-statement-and-value-representation */ AUTHENTICATION_KEYS_QUERY)?; + let keys = statement.query_map( + params![writer,sequence,hash, + if (position,record_rowid)==(position_cursor,rowid_cursor) { start_cursor } else { -1 }, + if (position,record_rowid)==(position_cursor,rowid_cursor) { key_cursor.as_str() } else { "" }, + MEMBERSHIP_KEYS_PER_REFRESH], + |row| Ok((row.get::<_,String>(0)?,row.get::<_,Option>(1)?, + row.get::<_,i64>(2)?,row.get::<_,Option>(3)?)))? + .collect::>>()?; + for (key,signature,_,end) in &keys { + // Expired windows consume a candidate slot too: filtering them in + // SQL would permit unbounded scans before reaching the page limit. + if end.is_none_or(|end| sequence<=end) && signature.as_deref().is_some_and(|signature| + VerifiedEnvelopeSignature::verify(shard.as_deref(),&fleet_id,&writer,sequence,&hash,key,signature).is_some()) { + connection.execute(/* sqlite-large-value: allow-for-now lv-h773f1bab1a89 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1", [id])?; + return Ok(Authentication::Authenticated(Some((key.clone(),sequence,hash,position)))); + } + } + if keys.len()==MEMBERSHIP_KEYS_PER_REFRESH { + let (key,_,start,_) = keys.into_iter().last().expect("full key page"); + next_key = key; + next_start = start; + } + } + if next_key.is_empty() { + let more: bool = connection.query_row( + "SELECT EXISTS(SELECT 1 FROM replica_records INDEXED BY replica_records_claim + WHERE claim_id=?1 AND (position,rowid)>(?2,?3))", + params![id,position,record_rowid], |row| row.get(0))?; + if !more { + connection.execute(/* sqlite-large-value: allow-for-now lv-h0a908802271b owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1", [id])?; + return Ok(Authentication::Unauthenticated); + } + } + connection.execute( + /* sqlite-large-value: allow-for-now lv-h87d2d3e94117 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_auth_cursor(claim_id,position,record_rowid,member_key,membership_start) + VALUES(?1,?2,?3,?4,?5) + ON CONFLICT(claim_id) DO UPDATE SET position=excluded.position, + record_rowid=excluded.record_rowid,member_key=excluded.member_key, + membership_start=excluded.membership_start", + params![id,position,record_rowid,next_key,next_start])?; + Ok(Authentication::Pending) +} +pub const AUTHENTICATION_KEYS_QUERY: &str = + "SELECT windows.member_key,signatures.signature,windows.start,windows.end + FROM assistant_grant_membership_windows AS windows INDEXED BY assistant_grant_membership_windows_seek + LEFT JOIN replica_envelope_signatures AS signatures + ON signatures.writer=windows.writer AND signatures.sequence=?2 + AND signatures.envelope_hash=?3 AND signatures.member_key=windows.member_key + WHERE windows.writer=?1 AND windows.start<=?2 + AND (windows.start,windows.member_key)>(?4,?5) + ORDER BY windows.start,windows.member_key LIMIT ?6"; +/// Refresh only this envelope's grant records, after receipt/signature state has +/// been written, and before its transaction is committed. +pub fn refresh_envelope(connection: &Connection, writer: &str, sequence: u64, hash: &str) -> Result<()> { + let ids = { + let mut statement = connection.prepare_cached("SELECT records.claim_id FROM replica_records AS records JOIN claims ON claims.id=records.claim_id + WHERE records.writer=?1 AND records.sequence=?2 AND records.envelope_hash=?3 + AND claims.kind IN ('custom.client.assistant.v1.granted','custom.client.assistant.v1.policy','custom.client.assistant.v1.revoked')")?; + statement.query_map(params![writer,sequence,hash], |row| row.get::<_,String>(0))?.collect::>>()? + }; + // A replicated same-origin claim does NOT acquire the local-write exception. + for id in ids { + // Signatures may predate their replica record and therefore could not + // invalidate a claim cursor when inserted. New evidence must restart + // its claim even when its indexed position precedes that cursor. + connection.execute(/* sqlite-large-value: allow-for-now lv-h188a54cc0c91 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1", [&id])?; + refresh_claim(connection,&id)?; + } + Ok(()) +} + +// Inclusive membership bounds; an absent end denotes a current incarnation. +type MembershipWindow = (u64, Option); + +struct MembershipUpdate { + generation: i64, + fleet_id: Option, + // Only changed/deleted keys, never a replacement of the complete snapshot. + windows: Vec<(String, String, Option)>, + complete: bool, +} + +impl MembershipUpdate { + fn apply(&self, connection: &Connection) -> Result { + for (writer,key,window) in &self.windows { + let old: Option = connection.query_row( + "SELECT start,end FROM assistant_grant_membership_windows WHERE writer=?1 AND member_key=?2", + params![writer,key], |row| Ok((row.get(0)?,row.get(1)?)), + ).optional()?; + // Additions cannot invalidate a proof. Contractions queue only the + // recorded key's lost ranges; actual verification can use other keys. + // Legitimate removal costs O(rows authenticated by that key), with + // bounded transactions and those subjects fenced until rechecked. + // Only an authenticated fleet member authorized to remove members + // can trigger this membership cost; nonmember relay noise cannot. + if let Some((old_start,old_end)) = old { + let enqueue = |lower: u64, upper: u64| -> Result<()> { + if lower<=upper { + connection.execute( + /* sqlite-large-value: allow-for-now lv-h63ca01e24d8b owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_retractions(writer,member_key,lower_sequence,upper_sequence) + SELECT ?1,?2,?3,?4 WHERE EXISTS( + SELECT 1 FROM assistant_grant_pending INDEXED BY assistant_grant_pending_evidence_index + WHERE origin=?1 AND auth_member_key=?2 AND auth_sequence BETWEEN ?3 AND ?4)", + params![writer,key,lower,upper], + )?; + } + Ok(()) + }; + let old_end = old_end.unwrap_or(i64::MAX as u64); + match window { + None => enqueue(old_start,old_end)?, + Some((start,end)) => { + if *start>old_start { enqueue(old_start,old_end.min(start-1))?; } + if let Some(end) = end { + if *end Result<()> { + // Snapshot the current receipt frontier. Future-only windows + // cannot help existing rows and must not create retry work. + connection.execute( + /* sqlite-large-value: allow-for-now lv-h2fc5feb42670 owner=smallclaims::store::assistant_grant_authority TODO=chunk-or-reference-exact-wire-values */ "INSERT INTO assistant_grant_additions(writer,member_key,lower_sequence,upper_sequence) + SELECT ?1,?2,?3,MIN(?4,sequence) FROM replica_records + WHERE writer=?1 AND sequence>=?3 ORDER BY sequence DESC LIMIT 1", + params![writer,key,lower,upper], + )?; + Ok(()) + }; + let end = end.unwrap_or(i64::MAX as u64); + if let Some((old_start,old_end)) = old { + if *startold_end { enqueue((*start).max(old_end+1),end)?; } + } else { + enqueue(*start,end)?; + } + } + } + if self.complete { + if let Some(fleet_id) = &self.fleet_id { + connection.execute( + /* sqlite-large-value: allow-for-now lv-h0ce05c43b4a2 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "INSERT OR REPLACE INTO meta(key,value) VALUES('assistant_grant_authority_fleet_id',?1)", + [fleet_id], + )?; + } else { + connection.execute(/* sqlite-large-value: allow-for-now lv-ha3bce0201694 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM meta WHERE key='assistant_grant_authority_fleet_id'", [])?; + } + connection.execute( + /* sqlite-large-value: allow-for-now lv-h86c509920fc9 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "UPDATE assistant_grant_membership_state SET applied_generation=?1 WHERE id=1", + [self.generation], + )?; + } + Ok(self.windows.len()) + } +} +/// Resumable, idempotent versioned backfill. Each page uses claims_kind_index; +/// unrelated claims are never visited. Cursor and projection changes commit +/// together in the caller's transaction. Old-build appends and signature-only +/// arrivals are captured by persistent dirty triggers even after completion. +pub fn backfill_slice(connection: &Connection, budget: Duration) -> Result { + let applied: i64 = connection.query_row( + "SELECT applied_generation FROM assistant_grant_membership_state WHERE id=1", [], |row| row.get(0), + )?; + backfill_slice_with_limit(connection, budget, CLAIMS_PER_SLICE, fleet_generation(connection)?==applied) +} + +// A destructive signature/envelope write queues one proof identity, not its +// history-sized dependent set. Indexed dispatch and real authentication consume +// separate shared budget units. Only the verifier may discharge the latter. +fn proof_invalidation_one(connection: &Connection) -> Result { + let task: Option<(i64,String,u64,String,String,String)> = connection.query_row( + "SELECT id,writer,sequence,envelope_hash,member_key,claim_id + FROM assistant_grant_proof_invalidations ORDER BY id LIMIT 1", [], + |row| Ok((row.get(0)?,row.get(1)?,row.get(2)?,row.get(3)?,row.get(4)?,row.get(5)?)), + ).optional()?; + let Some((task,writer,sequence,hash,key,cursor)) = task else { return Ok(false); }; + let query = if key.is_empty() { + "SELECT claim_id FROM assistant_grant_pending INDEXED BY assistant_grant_pending_envelope_index + WHERE origin=?1 AND auth_sequence=?2 AND auth_envelope_hash=?3 AND claim_id>?5 + ORDER BY claim_id LIMIT 1" + } else { + "SELECT claim_id FROM assistant_grant_pending INDEXED BY assistant_grant_pending_signature_index + WHERE origin=?1 AND auth_sequence=?2 AND auth_envelope_hash=?3 + AND auth_member_key=?4 AND claim_id>?5 ORDER BY claim_id LIMIT 1" + }; + let claim: Option = connection.query_row(/* sqlite-large-value: allow-for-now lv-h8247508e87c0 owner=smallclaims::store::assistant_grant_authority TODO=trace-statement-and-value-representation */ query,params![writer,sequence,hash,key,cursor], + |row| row.get(0)).optional()?; + if let Some(claim) = claim { + connection.execute(/* sqlite-large-value: allow-for-now lv-h921f15324dcd owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1", [&claim])?; + connection.execute(/* sqlite-large-value: allow-for-now lv-hfc49ec7f7720 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "INSERT OR IGNORE INTO assistant_grant_proof_rechecks VALUES(?1)", [&claim])?; + connection.execute( + /* sqlite-large-value: allow-for-now lv-hcd8ada722bbd owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "UPDATE assistant_grant_proof_invalidations SET claim_id=?2 WHERE id=?1", + params![task,claim], + )?; + } else { + connection.execute(/* sqlite-large-value: allow-for-now lv-h83f6fdabc1cb owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_proof_invalidations WHERE id=?1", [task])?; + } + Ok(true) +} + +// Coverage restoration immediately exempts covered dependencies from fencing. +// Lazily subtract its intersection from one queued range per budget unit, so +// cancellation itself never expands into an unbounded writer transaction. +fn trim_restored_retraction(connection: &Connection, task: i64, writer: &str, key: &str, + lower: u64, upper: u64, sequence: i64, claim: &str) -> Result { + let window: Option = connection.query_row( + "SELECT start,end FROM assistant_grant_membership_windows WHERE writer=?1 AND member_key=?2", + params![writer,key], |row| Ok((row.get(0)?,row.get(1)?)), + ).optional()?; + let Some((start,end)) = window else { return Ok(false); }; + let covered_lower = lower.max(start); + let covered_upper = upper.min(end.unwrap_or(i64::MAX as u64)); + if covered_lower>covered_upper { return Ok(false); } + connection.execute(/* sqlite-large-value: allow-for-now lv-h4e21f68dabd5 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_retractions WHERE id=?1", [task])?; + for remainder in [ + (lower Result { + let task: Option<(i64,String,String,u64,u64,i64,String,i64,String,String)> = connection.query_row( + "SELECT id,writer,member_key,lower_sequence,upper_sequence,sequence,envelope_hash,position,claim_id,active_claim + FROM assistant_grant_additions ORDER BY id LIMIT 1", [], + |row| Ok((row.get(0)?,row.get(1)?,row.get(2)?,row.get(3)?,row.get(4)?,row.get(5)?,row.get(6)?,row.get(7)?,row.get(8)?,row.get(9)?)), + ).optional()?; + let Some((task,writer,key,lower,upper,sequence,hash,position,after,claim)) = task else { return Ok(false); }; + if claim.is_empty() { + let next: Option = connection.query_row( + "SELECT claim_id FROM assistant_grant_auth_work WHERE writer=?1 AND claim_id>?2 ORDER BY claim_id LIMIT 1", + params![writer,after], |row| row.get(0), + ).optional()?; + if let Some(next) = next { + connection.execute( + /* sqlite-large-value: allow-for-now lv-h73bc9ba2f84a owner=smallclaims::store::assistant_grant_authority TODO=chunk-or-reference-exact-wire-values */ "UPDATE assistant_grant_additions SET active_claim=?2,sequence=-1,envelope_hash='',position=-1 WHERE id=?1", + params![task,next], + )?; + } else { + connection.execute(/* sqlite-large-value: allow-for-now lv-h4bcc00c86e41 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_additions WHERE id=?1", [task])?; + } + return Ok(true); + } + let record: Option<(u64,String,i64,bool)> = connection.query_row( + "SELECT sequence,envelope_hash,position,state='valid' FROM replica_records INDEXED BY replica_records_grant_proof_index + WHERE claim_id=?1 AND writer=?2 AND sequence BETWEEN ?3 AND ?4 + AND (sequence,envelope_hash,position)>(?5,?6,?7) + AND EXISTS(SELECT 1 FROM assistant_grant_auth_work WHERE writer=?2 AND claim_id=?1) + ORDER BY sequence,envelope_hash,position LIMIT 1", + params![claim,writer,lower,upper,sequence,hash,position], + |row| Ok((row.get(0)?,row.get(1)?,row.get(2)?,row.get(3)?)), + ).optional()?; + let Some((sequence,hash,position,valid)) = record else { + connection.execute( + /* sqlite-large-value: allow-for-now lv-hb39485ba125b owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "UPDATE assistant_grant_additions SET claim_id=active_claim,active_claim='' WHERE id=?1", [task], + )?; + return Ok(true); + }; + if valid { + let signature: Option = connection.query_row( + "SELECT signatures.signature FROM replica_envelope_signatures AS signatures + WHERE signatures.writer=?1 AND signatures.sequence=?2 + AND signatures.envelope_hash=?3 AND signatures.member_key=?4 + AND EXISTS(SELECT 1 FROM claims WHERE id=?5 AND origin=?1) + AND EXISTS(SELECT 1 FROM assistant_grant_pending AS pending + WHERE pending.claim_id=?5 AND pending.origin=?1 + AND (pending.authenticated=0 + OR EXISTS(SELECT 1 FROM assistant_grant_auth_cursor WHERE claim_id=?5) + OR EXISTS(SELECT 1 FROM assistant_grant_proof_rechecks WHERE claim_id=?5))) + AND EXISTS(SELECT 1 FROM assistant_grant_membership_windows + WHERE writer=?1 AND member_key=?4 AND ?2>=start AND (end IS NULL OR ?2<=end)) + AND EXISTS(SELECT 1 FROM replica_envelopes WHERE writer=?1 AND sequence=?2 + AND envelope_hash=?3 AND receipt_state IN ('validated','degraded'))", + params![writer,sequence,hash,key,claim], |row| row.get(0), + ).optional()?; + if let Some(signature) = signature { + let fleet_id = fleet_meta(connection,"assistant_grant_authority_fleet_id")?; + let shard = fleet_meta(connection,"shard_id")?; + if fleet_id.as_deref().is_some_and(|fleet_id| + VerifiedEnvelopeSignature::verify(shard.as_deref(),fleet_id,&writer,sequence,&hash,&key,&signature).is_some()) { + refresh_claim_with_authentication(connection,&claim,true, + Some(Authentication::Authenticated(Some((key,sequence,hash.clone(),position)))))?; + connection.execute(/* sqlite-large-value: allow-for-now lv-h4e1ea146a20c owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1", [&claim])?; + connection.execute(/* sqlite-large-value: allow-for-now lv-h1e384e782172 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_proof_rechecks WHERE claim_id=?1", [&claim])?; + } + } + } + connection.execute( + /* sqlite-large-value: allow-for-now lv-h9bbb6621cf95 owner=smallclaims::store::assistant_grant_authority TODO=chunk-or-reference-exact-wire-values */ "UPDATE assistant_grant_additions SET sequence=?2,envelope_hash=?3,position=?4 WHERE id=?1", + params![task,sequence,hash,position], + )?; + Ok(true) +} + +// Both dispatch queues invoke the same owning verifier, including when a +// one-unit slice encounters a dirty claim before reaching the recheck queue. +fn refresh_recheck(connection: &Connection, claim: &str) -> Result { + refresh_claim_inner(connection,claim,true)?; + let unfinished: bool = connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_auth_cursor WHERE claim_id=?1) + OR EXISTS(SELECT 1 FROM assistant_grant_dirty WHERE claim_id=?1)", + [claim], |row| row.get(0), + )?; + if !unfinished { + connection.execute(/* sqlite-large-value: allow-for-now lv-h5a430ec6f457 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_proof_rechecks WHERE claim_id=?1", [claim])?; + } + Ok(!unfinished) +} + +fn backfill_slice_with_limit(connection: &Connection, budget: Duration, mut remaining: usize, membership_current: bool) -> Result { + let started = Instant::now(); + if remaining==0 { return Ok(false); } + // Give ordinary dirty authentication the first half of each transaction. + // Persist its round-robin position so a long key search cannot monopolize + // this share and an addition backlog cannot fence unrelated dirty subjects. + let dirty_limit = remaining.div_ceil(2); + let mut dirty_visits = 0; + let mut dirty_done = false; + let mut dirty_after = fleet_meta(connection,"assistant_grant_dirty_cursor")?.unwrap_or_default(); + // Include membership-driven retries in the same fixed item budget. Each + // empty writer task also consumes a unit, bounding sparse writer queues. + while remaining>0 { + // Finish demotion before a later authentication can restore the row. + // Each authority-pair deletion/effective recompute costs one unit. + if recompute_one(connection)? { + remaining -= 1; + if remaining==0 || started.elapsed()>=budget { return Ok(false); } + continue; + } + if !dirty_done && dirty_visits = connection.query_row( + "SELECT claim_id FROM assistant_grant_dirty WHERE claim_id>?1 ORDER BY claim_id LIMIT 1", + [&dirty_after], |row| row.get(0), + ).optional()?; + if let Some(claim) = dirty { + let recheck_owned: bool = connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_proof_rechecks WHERE claim_id=?1)", + [&claim], |row| row.get(0), + )?; + // Dispatch to the owning verifier here, rather than spending a + // skip unit forever when every slice has only one unit/time. + let unfinished = if recheck_owned { + if !membership_current { return Ok(false); } + !refresh_recheck(connection,&claim)? + } else { + refresh_claim_inner(connection,&claim,membership_current)?; + false + }; + connection.execute( + /* sqlite-large-value: allow-for-now lv-h29b7dbf310f3 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "INSERT OR REPLACE INTO meta(key,value) VALUES('assistant_grant_dirty_cursor',?1)", [&claim], + )?; + dirty_after = claim; + dirty_visits += 1; + remaining -= 1; + if unfinished || remaining==0 || started.elapsed()>=budget { return Ok(false); } + continue; + } + connection.execute(/* sqlite-large-value: allow-for-now lv-hf280419e5a4a owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM meta WHERE key='assistant_grant_dirty_cursor'", [])?; + if dirty_visits==0 && !dirty_after.is_empty() { + // A late insert/evidence arrival may sort before the saved + // cursor. Wrap now, not in a later otherwise empty slice. + dirty_after.clear(); + continue; + } + dirty_done = true; + } + let recheck: Option = connection.query_row( + "SELECT claim_id FROM assistant_grant_proof_rechecks ORDER BY claim_id LIMIT 1", + [], |row| row.get(0), + ).optional()?; + if let Some(claim) = recheck { + if !membership_current { return Ok(false); } + // A single owning verifier advances and discharges this obligation, + // regardless of which dispatch queue selected the claim. + let complete = refresh_recheck(connection,&claim)?; + remaining -= 1; + if !complete { return Ok(false); } + if remaining==0 || started.elapsed()>=budget { return Ok(false); } + continue; + } + if proof_invalidation_one(connection)? { + remaining -= 1; + if remaining==0 || started.elapsed()>=budget { return Ok(false); } + continue; + } + let retraction: Option<(i64,String,String,u64,u64,i64,String)> = connection.query_row( + "SELECT id,writer,member_key,lower_sequence,upper_sequence,sequence,claim_id + FROM assistant_grant_retractions ORDER BY id LIMIT 1", [], + |row| Ok((row.get(0)?,row.get(1)?,row.get(2)?,row.get(3)?,row.get(4)?,row.get(5)?,row.get(6)?)), + ).optional()?; + if let Some((task,writer,key,lower,upper,sequence,id)) = retraction { + if trim_restored_retraction(connection,task,&writer,&key,lower,upper,sequence,&id)? { + remaining -= 1; + if remaining==0 || started.elapsed()>=budget { return Ok(false); } + continue; + } + let pending: Option<(u64,String)> = connection.query_row( + "SELECT auth_sequence,claim_id FROM assistant_grant_pending INDEXED BY assistant_grant_pending_evidence_index + WHERE origin=?1 AND auth_member_key=?2 AND auth_sequence BETWEEN ?3 AND ?4 + AND (auth_sequence,claim_id)>(?5,?6) + ORDER BY auth_sequence,claim_id LIMIT 1", + params![writer,key,lower,upper,sequence,id], |row| Ok((row.get(0)?,row.get(1)?)), + ).optional()?; + if let Some((sequence,id)) = pending { + connection.execute(/* sqlite-large-value: allow-for-now lv-h2daf7a592c21 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1", [&id])?; + connection.execute(/* sqlite-large-value: allow-for-now lv-hbc290dd6ae0d owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "INSERT OR IGNORE INTO assistant_grant_proof_rechecks VALUES(?1)", [&id])?; + connection.execute( + /* sqlite-large-value: allow-for-now lv-h7be65771e125 owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "UPDATE assistant_grant_retractions SET sequence=?2,claim_id=?3 WHERE id=?1", + params![task,sequence,id], + )?; + } else { + connection.execute(/* sqlite-large-value: allow-for-now lv-hc1e17d6d240e owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_retractions WHERE id=?1", [task])?; + } + remaining -= 1; + if remaining==0 || started.elapsed()>=budget { return Ok(false); } + continue; + } + if membership_current && addition_one(connection)? { + remaining -= 1; + if remaining==0 || started.elapsed()>=budget { return Ok(false); } + continue; + } + break; + } + // A completed version only drains the old-build dirty queue. Readiness also + // includes that queue, but must never cause a completed history rescan. + if fleet_meta(connection,"assistant_grant_authority_version")?.as_deref() != Some(VERSION) { + for kind in KINDS { + let key = format!("assistant_grant_authority_cursor/{kind}"); + loop { + let cursor: u64 = connection.query_row("SELECT CAST(value AS INTEGER) FROM meta WHERE key=?1",[&key],|row|row.get(0)).optional()?.unwrap_or(0); + let rows = { + let mut statement = connection.prepare_cached("SELECT id,store_index FROM claims INDEXED BY claims_kind_index WHERE kind=?1 AND store_index>?2 ORDER BY store_index LIMIT 64")?; + statement.query_map(params![kind,cursor],|row|Ok((row.get::<_,String>(0)?,row.get::<_,u64>(1)?)))?.collect::>>()? + }; + if rows.is_empty() { break; } + for (id,index) in rows { + refresh_claim_inner(connection,&id,membership_current)?; + remaining -= 1; + connection.execute(/* sqlite-large-value: allow-for-now lv-h3f49c0e579cd owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "INSERT OR REPLACE INTO meta(key,value) VALUES(?1,?2)",params![key,index.to_string()])?; + if connection.query_row("SELECT EXISTS(SELECT 1 FROM assistant_grant_recompute)", [], |row| row.get::<_,bool>(0))? { + return Ok(false); + } + if remaining==0 || started.elapsed()>=budget { return Ok(false); } + } + } + } + } + let dirty: bool = connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_dirty) + OR EXISTS(SELECT 1 FROM assistant_grant_retractions) + OR EXISTS(SELECT 1 FROM assistant_grant_additions) + OR EXISTS(SELECT 1 FROM assistant_grant_recompute) + OR EXISTS(SELECT 1 FROM assistant_grant_proof_invalidations) + OR EXISTS(SELECT 1 FROM assistant_grant_proof_rechecks)", [], |row| row.get(0))?; + if dirty { return Ok(false); } + connection.execute(/* sqlite-large-value: allow-for-now lv-h9b70e51e754e owner=smallclaims::store::assistant_grant_authority TODO=bound-or-reference-values-and-reclamation */ "INSERT OR REPLACE INTO meta(key,value) VALUES('assistant_grant_authority_version',?1)",[VERSION])?; + Ok(true) +} + +impl Store { + fn assistant_grant_membership_generation(&self) -> Result { + if let Some(authority) = self.fleet_authority.get() { + return authority.fleet_generation(); + } + fleet_generation(&self.readers.get()) + } + + pub fn assistant_grant_authority_maintenance_pending(&self) -> Result { + if maintenance_pending(&self.readers.get()).map_err(anyhow::Error::new)? { + return Ok(true); + } + Ok(self.assistant_grant_membership_generation()? != + self.assistant_grant_membership_observed_generation.load(Ordering::Acquire)) + } + + // Reuse the inherited sealed-view invalidation contract for changes to the + // projected writer/key/start/end windows, including delayed bootstrap proofs. + // Shard bounds do not affect those tuples (their generation triggers cover + // INSERT/DELETE, not UPDATE). Reader-fold amplification remains #6124; do + // not mirror membership invalidation in another trigger/revision. + // Only actual changed windows acquire the writer; equal snapshots update an + // in-memory observation, without SQL writes or authentication cursor resets. + fn prepare_assistant_grant_membership(&self) -> Result> { + let generation = self.assistant_grant_membership_generation()?; + if generation==self.assistant_grant_membership_observed_generation.load(Ordering::Acquire) { + return Ok(None); + } + let connection = self.readers.get(); + let membership = self.fleet_membership_sealed()?; + let fleet_id = if let Some(authority) = self.fleet_authority.get() { + authority.fleet_id()? + } else { + fleet_meta(&connection, "fleet_id")? + }; + let desired: BTreeMap<_,_> = membership.incarnations().map(|incarnation| ( + (incarnation.name.clone(),incarnation.member_key.clone()), + (incarnation.start,incarnation.end), + )).collect(); + let current: BTreeMap<_,_> = connection.prepare( + "SELECT writer,member_key,start,end FROM assistant_grant_membership_windows", + )?.query_map([], |row| Ok(((row.get::<_,String>(0)?,row.get::<_,String>(1)?), + (row.get::<_,u64>(2)?,row.get::<_,Option>(3)?))))? + .collect::>()?; + let mut windows = Vec::with_capacity(CLAIMS_PER_SLICE); + let mut complete = true; + for (identity,window) in &desired { + if current.get(identity)==Some(window) { continue; } + if windows.len()==CLAIMS_PER_SLICE { complete=false; break; } + windows.push((identity.0.clone(),identity.1.clone(),Some(*window))); + } + if complete { + for identity in current.keys() { + if desired.contains_key(identity) { continue; } + if windows.len()==CLAIMS_PER_SLICE { complete=false; break; } + windows.push((identity.0.clone(),identity.1.clone(),None)); + } + } + Ok(Some(MembershipUpdate { generation, fleet_id, windows, complete })) + } + + /// Background work only; receipt transactions never fold fleet history. + pub fn advance_assistant_grant_authority_backfill(&self) -> Result { + let prepared = self.prepare_assistant_grant_membership()?; + let generation = prepared.as_ref().map_or_else( + || self.assistant_grant_membership_observed_generation.load(Ordering::Acquire), + |update| update.generation, + ); + let claim_work = maintenance_pending(&self.readers.get()).map_err(anyhow::Error::new)?; + if !claim_work && prepared.as_ref().is_none_or(|update| update.windows.is_empty()) { + if self.assistant_grant_membership_generation()? != generation { return Ok(false); } + self.assistant_grant_membership_observed_generation.store(generation,Ordering::Release); + return Ok(true); + } + let mut connection = self.connection.write_background(); + let transaction = connection.transaction()?; + let current_generation = if let Some(authority) = self.fleet_authority.get() { + authority.fleet_generation()? + } else { + fleet_generation(&transaction)? + }; + if current_generation != generation { return Ok(false); } + let used = if let Some(update) = &prepared { + update.apply(&transaction)? + } else { 0 }; + let membership_current = prepared.as_ref().is_none_or(|update| update.complete); + let done = backfill_slice_with_limit( + &transaction, Duration::from_millis(100), CLAIMS_PER_SLICE-used, membership_current, + )?; + transaction.commit()?; + if membership_current { + self.assistant_grant_membership_observed_generation.store(generation,Ordering::Release); + } + Ok(done && membership_current) + } +} diff --git a/crates/smallclaims/src/store/assistant_grant_authority_bench.rs b/crates/smallclaims/src/store/assistant_grant_authority_bench.rs new file mode 100644 index 00000000000..07911f1fe84 --- /dev/null +++ b/crates/smallclaims/src/store/assistant_grant_authority_bench.rs @@ -0,0 +1,553 @@ +//! Opt-in, disk-backed authority migration measurement, not an index-build proxy. +//! +//! Run alone in a fresh test process: Linux VmHWM is process-lifetime high water, +//! including fixture preparation. No claim history is retained in Rust memory. +//! Defaults describe a synthetic workload, not measured production proportions: +//! 1% authority-kind rows; five events per grant (grant, three policy revisions, +//! then revoke for 25% of groups or another policy); 10% malformed groups and +//! 20% unsigned remote groups, disjoint. +//! Unrelated JSON bodies are 70% quarter-size, 25% base-size, 5% four-times-size. +//! All ordinary Store indexes and durability settings stay enabled during setup. +//! Only authority projection work is disabled, so timed work is the actual +//! install + resumable backfill, not insert-time maintenance. +//! +//! Real-store cold-cache run (Linux, run alone in a fresh process): +//! `AUTHORITY_REAL_STORE=/restore/claims.sqlite3 AUTHORITY_REAL_ORIGIN=dev3 cargo test -p smallclaims --lib store::assistant_grant_authority_bench::assistant_grant_authority_measure_real_store -- --exact --ignored --nocapture --test-threads=1` +//! Use a freshly restored working copy from the current main build; this is the +//! cold-cache condition. The harness writes to it and does not reset projections, +//! checkpoint, or restore it. Restore again for each measurement. Agents cannot +//! use `echo 3 | sudo tee /proc/sys/vm/drop_caches`; `vmtouch -e` or +//! `dd iflag=nocache` eviction is optional, not performed by this test. +//! The origin defaults to dev3; override it with the source daemon's node name. +//! Store::open includes install and the committed two-second startup slice. +//! Test-only hooks time those exact operations, without repeating them. Background +//! slices call the production Store maintenance entrypoint, including membership +//! preparation. Readiness is the production authentication readiness check, +//! observed after each committed slice (not an HTTP request or credential probe). +//! One JSON measurement line is emitted; libtest may also print its own status. +//! Timings exclude final diagnostic queries; byte/RSS samples are taken before +//! those queries and while the store is still open (WAL bytes are physical size). +//! `total_backfill_ms` sums install and committed slice wall times, including +//! membership preparation; `elapsed_open_through_backfill_ms` also includes all +//! other open work and readiness probes. Slice counts include the startup slice. +//! Pending is a retained authentication evidence table, not necessarily queued +//! work; authenticated rows remain there after completion. +use super::*; +use std::time::{Duration, Instant}; + +const LOCAL: &str = "authority-bench-local"; +const REMOTE: &str = "authority-bench-unsigned"; +const EVENTS: u64 = 5; +const DENOMINATOR: u64 = 10_000; + +struct Config { + rows: u64, + authority_bps: u64, + malformed_bps: u64, + unauthenticated_bps: u64, + revoked_bps: u64, + unrelated_body_bytes: usize, + authority_body_bytes: usize, + transaction_rows: u64, + slice_ms: u64, + startup_ms: u64, + target_bytes: u64, +} + +fn setting(name: &str, default: u64) -> u64 { + match std::env::var(name) { + Ok(value) => value.parse().unwrap_or_else(|_| panic!("{name} must be an unsigned integer")), + Err(std::env::VarError::NotPresent) => default, + Err(error) => panic!("{name}: {error}"), + } +} + +impl Config { + fn from_env() -> Self { + let config = Self { + rows: setting("AUTHORITY_BENCH_ROWS", 1_000_000), + authority_bps: setting("AUTHORITY_BENCH_AUTHORITY_BPS", 100), + malformed_bps: setting("AUTHORITY_BENCH_MALFORMED_BPS", 1_000), + unauthenticated_bps: setting("AUTHORITY_BENCH_UNAUTHENTICATED_BPS", 2_000), + revoked_bps: setting("AUTHORITY_BENCH_REVOKED_BPS", 2_500), + unrelated_body_bytes: usize::try_from(setting("AUTHORITY_BENCH_BODY_BYTES", 4_096)).unwrap(), + authority_body_bytes: usize::try_from(setting("AUTHORITY_BENCH_AUTHORITY_BODY_BYTES", 1_024)).unwrap(), + transaction_rows: setting("AUTHORITY_BENCH_TRANSACTION_ROWS", 1_000), + slice_ms: setting("AUTHORITY_BENCH_SLICE_MS", 100), + startup_ms: setting("AUTHORITY_BENCH_STARTUP_MS", 2_000), + target_bytes: setting("AUTHORITY_BENCH_TARGET_BYTES", 50_000_000_000), + }; + assert!(config.rows >= DENOMINATOR && config.rows.is_multiple_of(DENOMINATOR)); + assert!(config.authority_bps > 0 && config.authority_bps < DENOMINATOR); + assert!(config.authority_bps.is_multiple_of(EVENTS)); + assert!(config.malformed_bps + config.unauthenticated_bps < DENOMINATOR); + assert!(config.revoked_bps <= DENOMINATOR); + assert!(config.unrelated_body_bytes >= 256 && config.authority_body_bytes >= 1_024); + assert!(config.transaction_rows > 0 && config.slice_ms > 0 && config.target_bytes > 0); + config + } +} + +fn padded_body(mut body: Value, bytes: usize) -> String { + body["fields"]["measurement_padding"] = json!(""); + let empty = serde_json::to_string(&body).unwrap(); + assert!(empty.len() <= bytes, "configured body size smaller than fixture fields"); + body["fields"]["measurement_padding"] = json!("x".repeat(bytes - empty.len())); + let serialized = serde_json::to_string(&body).unwrap(); + assert_eq!(serialized.len(), bytes); + serialized +} + +fn authority_body(group: u64, event: u64, malformed: bool, bytes: usize) -> String { + let grant_id = format!("assistant-grant/{group:024x}"); + let mut body = json!({"fields": { + "grant_id": grant_id, + "issuer": "person/perf-operator", + "principal": "assistant/chatgpt", + "profile": if group.is_multiple_of(4) { "service" } else { "assistant" }, + "session_actor": format!("assistant/chatgpt/session/{grant_id}"), + "credential_hash": format!("{group:064x}"), + "minimal_read_mode": "approval-once", + "disclosure_consent": true, + "expires_at_unix_ms": 4_102_444_800_000_u64 + event, + "scopes": ["read.assistant.summary", "read.assistant.attention", "write.assistant.messages"] + }}); + // Every event of a malformed group fails identity validation; valid remote + // groups are structurally sound but have no signed envelope/membership proof. + if malformed { + body["fields"]["issuer"] = json!(17); + } + padded_body(body, bytes) +} + +fn open_connection(path: &Path) -> Connection { + let connection = Connection::open(path).unwrap(); + projection_digest::register(&connection).unwrap(); + connection.execute_batch( + "PRAGMA journal_mode=WAL; PRAGMA synchronous=FULL; + PRAGMA foreign_keys=ON; PRAGMA busy_timeout=5000;", + ).unwrap(); + connection.pragma_update(None, "cache_size", -(crate::sqlite::WRITE_CACHE_KIB as i64)).unwrap(); + connection +} + +fn physical_bytes(path: &Path) -> (u64, u64) { + let db = fs::metadata(path).unwrap().len(); + let wal = fs::metadata(path.with_file_name("claims.sqlite3-wal")) + .map_or_else(|error| { + assert_eq!(error.kind(), std::io::ErrorKind::NotFound); + 0 + }, |metadata| metadata.len()); + (db, wal) +} + +fn memory_kib() -> (u64, u64) { + let status = fs::read_to_string("/proc/self/status") + .expect("authority backfill memory measurement requires Linux /proc/self/status"); + let field = |name: &str| -> u64 { + status.lines().find_map(|line| { + line.strip_prefix(name).map(|value| value.split_whitespace().next().unwrap().parse().unwrap()) + }).unwrap_or_else(|| panic!("missing {name} in /proc/self/status")) + }; + (field("VmRSS:"), field("VmHWM:")) +} + +fn cursors(connection: &Connection) -> Vec<(String, String)> { + let mut statement = connection.prepare( + "SELECT key,value FROM meta WHERE key LIKE 'assistant_grant_authority_cursor/%' ORDER BY key", + ).unwrap(); + statement.query_map([], |row| Ok((row.get(0)?, row.get(1)?))) + .unwrap().collect::>().unwrap() +} + +fn slice(connection: &mut Connection, budget: Duration) -> (bool, Duration) { + assert!(assistant_grant_authority::ready(connection).is_err()); + let started = Instant::now(); + let transaction = connection.transaction().unwrap(); + let done = assistant_grant_authority::backfill_slice(&transaction, budget).unwrap(); + assert_eq!(assistant_grant_authority::ready(&transaction).is_ok(), done); + transaction.commit().unwrap(); + assert_eq!(assistant_grant_authority::ready(connection).is_ok(), done); + (done, started.elapsed()) +} + +pub(super) enum OpenAuthorityPhase { + BeforeInstall, + Installed, + StartupComplete, +} + +struct OpenAuthorityTimings { + open_started: Instant, + phase_started: Instant, + install: Duration, + startup_slice: Duration, + first_ready: Option, + ready_after_install: bool, + ready_after_startup: bool, +} + +thread_local! { + static REAL_STORE_OPEN: std::cell::RefCell> = + const { std::cell::RefCell::new(None) }; +} + +// Inert for all other tests; no instrumentation exists in non-test builds. +pub(super) fn observe_open_authority(connection: &Connection, phase: OpenAuthorityPhase) { + REAL_STORE_OPEN.with_borrow_mut(|measurement| { + let Some(measurement) = measurement else { return; }; + let now = Instant::now(); + match phase { + OpenAuthorityPhase::BeforeInstall => measurement.phase_started = now, + OpenAuthorityPhase::Installed => { + measurement.install = now.duration_since(measurement.phase_started); + measurement.ready_after_install = assistant_grant_authority::ready(connection).is_ok(); + if measurement.ready_after_install { + measurement.first_ready = Some(measurement.open_started.elapsed()); + } + measurement.phase_started = Instant::now(); + } + OpenAuthorityPhase::StartupComplete => { + measurement.startup_slice = now.duration_since(measurement.phase_started); + measurement.ready_after_startup = assistant_grant_authority::ready(connection).is_ok(); + if measurement.ready_after_startup && measurement.first_ready.is_none() { + measurement.first_ready = Some(measurement.open_started.elapsed()); + } + } + } + }); +} + +#[test] +#[ignore = "writes a freshly restored real store; opt-in Linux cold-cache/RSS measurement"] +fn assistant_grant_authority_measure_real_store() { + let path = PathBuf::from(std::env::var_os("AUTHORITY_REAL_STORE") + .expect("set AUTHORITY_REAL_STORE to the restored claims.sqlite3 working copy")); + assert!(path.is_file(), "AUTHORITY_REAL_STORE must be an existing store, not a new fixture"); + assert_eq!(path.file_name().and_then(|name| name.to_str()), Some("claims.sqlite3")); + let origin = std::env::var("AUTHORITY_REAL_ORIGIN").unwrap_or_else(|_| "dev3".into()); + let (db_bytes_before, wal_bytes_before) = physical_bytes(&path); + let (baseline_rss_kib, baseline_peak_kib) = memory_kib(); + let started = Instant::now(); + REAL_STORE_OPEN.with_borrow_mut(|measurement| { + *measurement = Some(OpenAuthorityTimings { + open_started: started, + phase_started: started, + install: Duration::ZERO, + startup_slice: Duration::ZERO, + first_ready: None, + ready_after_install: false, + ready_after_startup: false, + }); + }); + let store = Store::open(&path, &origin, Arc::new(runtime::Plain)).unwrap(); + let open_elapsed = started.elapsed(); + let timing = REAL_STORE_OPEN.with_borrow_mut(Option::take).unwrap(); + let mut first_ready = timing.first_ready; + let mut slices = 1_u64; + let mut background_slices = 0_u64; + let mut max_slice = timing.startup_slice; + let mut slice_sum = timing.startup_slice; + // Always enter maintenance at least once: startup has not prepared the sealed + // membership snapshot, even if its version/readiness marker already exists. + loop { + let slice_started = Instant::now(); + let done = store.advance_assistant_grant_authority_backfill().unwrap(); + let elapsed = slice_started.elapsed(); + slices += 1; + background_slices += 1; + max_slice = max_slice.max(elapsed); + slice_sum += elapsed; + let ready = assistant_grant_authority::ready(&store.readers.get()).is_ok(); + if ready && first_ready.is_none() { + first_ready = Some(started.elapsed()); + } + if done { + assert!(ready, "maintenance completed without authentication readiness"); + break; + } + } + let total_elapsed = started.elapsed(); + let (db_bytes_after, wal_bytes_after) = physical_bytes(&path); + let (final_rss_kib, peak_rss_kib) = memory_kib(); + let connection = store.readers.get(); + let count = |sql: &str| -> u64 { + connection.query_row(/* sqlite-large-value: allow-for-now lv-hd9109fd4002d owner=smallclaims::store::assistant_grant_authority_bench TODO=trace-statement-and-value-representation */ sql, [], |row| row.get(0)).unwrap() + }; + let grant_kind_claims: u64 = connection.query_row( + "SELECT COUNT(*) FROM claims WHERE kind IN (?1,?2,?3)", + params![assistant_grant_authority::GRANTED, assistant_grant_authority::POLICY, + assistant_grant_authority::REVOKED], |row| row.get(0), + ).unwrap(); + let mut statement = connection.prepare( + "SELECT pending.claim_id,pending.kind,pending.origin, + CASE + WHEN NOT EXISTS(SELECT 1 FROM meta WHERE key='assistant_grant_authority_fleet_id') + THEN 'no fleet identity for member-writer authentication' + WHEN NOT EXISTS(SELECT 1 FROM replica_records WHERE claim_id=pending.claim_id) + THEN 'no replica record and no durable local-append admission' + ELSE 'no authenticated member-writer evidence and no durable local-append admission' + END + FROM assistant_grant_pending AS pending + WHERE pending.authenticated=0 AND pending.kind=?1 ORDER BY pending.claim_id", + ).unwrap(); + let pending_grants: Vec = statement.query_map([assistant_grant_authority::GRANTED], |row| { + Ok(json!({ + "id": row.get::<_, String>(0)?, + "kind": row.get::<_, String>(1)?, + "origin": row.get::<_, String>(2)?, + "reason": row.get::<_, String>(3)?, + })) + }).unwrap().collect::>().unwrap(); + let ms = |elapsed: Duration| elapsed.as_secs_f64() * 1_000.0; + println!("{}", json!({ + "measurement": "assistant_grant_authority_real_store", + "store": path, + "origin": origin, + "store_open_ms": ms(open_elapsed), + "install_ms": ms(timing.install), + "startup_slice_ms": ms(timing.startup_slice), + "total_backfill_ms": ms(timing.install + slice_sum), + "elapsed_open_through_backfill_ms": ms(total_elapsed), + "slices": slices, + "background_slices": background_slices, + "max_slice_ms": ms(max_slice), + "slice_sum_ms": ms(slice_sum), + "authentication_ready_from_open_ms": first_ready.map(ms), + "ready_after_install": timing.ready_after_install, + "ready_after_startup": timing.ready_after_startup, + "readiness_checked_each_slice": true, + "baseline_rss_kib": baseline_rss_kib, + "baseline_peak_rss_kib": baseline_peak_kib, + "final_rss_kib": final_rss_kib, + "peak_rss_kib": peak_rss_kib, + "peak_rss_increase_kib": peak_rss_kib.saturating_sub(baseline_peak_kib), + "db_bytes_before": db_bytes_before, + "wal_bytes_before": wal_bytes_before, + "db_bytes_after": db_bytes_after, + "wal_bytes_after": wal_bytes_after, + "grant_kind_claims": grant_kind_claims, + "authority_rows": count("SELECT COUNT(*) FROM assistant_grant_authority"), + "effective_grants": count("SELECT COUNT(*) FROM assistant_grant_effective"), + "pending_unauthenticated_grant_claims": pending_grants.len(), + "pending_unauthenticated_grants": pending_grants, + "dirty_queue_size": count("SELECT COUNT(*) FROM assistant_grant_dirty"), + "pending_queue_size": count("SELECT COUNT(*) FROM assistant_grant_pending"), + "pending_unauthenticated_queue_size": count("SELECT COUNT(*) FROM assistant_grant_pending WHERE authenticated=0"), + "membership_addition_queue_size": count("SELECT COUNT(*) FROM assistant_grant_additions"), + "authentication_cursor_queue_size": count("SELECT COUNT(*) FROM assistant_grant_auth_cursor"), + })); +} + +#[test] +#[ignore = "opt-in disk/RSS authority backfill measurement; run alone with --ignored --nocapture"] +fn assistant_grant_authority_measure_realistic_backfill() { + measure_backfill(Config::from_env()); +} + +#[test] +fn assistant_grant_authority_bench_unsigned_rows_reach_readiness() { + measure_backfill(Config { + rows: 10_000, + authority_bps: 5_000, + malformed_bps: 1_000, + unauthenticated_bps: 4_000, + revoked_bps: 2_500, + unrelated_body_bytes: 1_024, + authority_body_bytes: 1_024, + transaction_rows: 1_000, + slice_ms: 100, + startup_ms: 2_000, + target_bytes: 50_000_000_000, + }); +} + +fn measure_backfill(config: Config) { + let fixture_started = Instant::now(); + let directory = tempfile::tempdir().unwrap(); + let path = directory.path().join("claims.sqlite3"); + let store = Store::open(&path, LOCAL, Arc::new(runtime::Plain)).unwrap(); + let mut expected_effective = 0_u64; + let mut expected_revoked = 0_u64; + let mut raw_revocations = 0_u64; + let mut expected_malformed_rows = 0_u64; + let mut expected_unauthenticated_rows = 0_u64; + let mut authority_body_bytes = 0_u64; + let mut unrelated_body_bytes = 0_u64; + { + let connection = store.connection.write(); + connection.execute_batch( + /* sqlite-large-value: allow-for-now lv-h54566dabc8dc owner=smallclaims::store::assistant_grant_authority_bench TODO=bound-or-reference-values-and-reclamation */ + "DROP TRIGGER IF EXISTS assistant_grant_dirty_insert; + DELETE FROM assistant_grant_authority; + DELETE FROM assistant_grant_effective; + DELETE FROM assistant_grant_pending; + DELETE FROM assistant_grant_dirty; + DELETE FROM assistant_grant_auth_cursor; + DELETE FROM assistant_grant_additions; + DELETE FROM meta WHERE key='assistant_grant_authority_version' + OR key LIKE 'assistant_grant_authority_cursor/%';", + ).unwrap(); + } + // Invalidating readiness above makes the production worker persist its + // sealed snapshot, rather than taking the already-idle in-memory fast path. + assert!(store.advance_assistant_grant_authority_backfill().unwrap()); + { + let mut connection = store.connection.write(); + connection.execute(/* sqlite-large-value: allow-for-now lv-hb93a7253f42d owner=smallclaims::store::assistant_grant_authority_bench TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM meta WHERE key='assistant_grant_authority_version'", []).unwrap(); + // Fixed small pool of representative unrelated JSON sizes, not a history. + let unrelated_bodies = [ + padded_body(json!({"fields": {"text": "synthetic conversation summary"}}), config.unrelated_body_bytes / 4), + padded_body(json!({"fields": {"text": "synthetic conversation message"}}), config.unrelated_body_bytes), + padded_body(json!({"fields": {"text": "synthetic terminal output"}}), config.unrelated_body_bytes.checked_mul(4).unwrap()), + ]; + for start in (0..config.rows).step_by(usize::try_from(config.transaction_rows).unwrap()) { + let transaction = connection.transaction().unwrap(); + { + let mut batch = transaction.prepare_cached( + /* sqlite-large-value: allow-for-now lv-h2686d79044aa owner=smallclaims::store::assistant_grant_authority_bench TODO=chunk-or-reference-exact-wire-values */ + "INSERT INTO batches(id,origin,replica_sequence,previous_hash,hash,accepted_at_unix_ms) + VALUES(?1,?2,?3,NULL,?4,'1791849600000')", + ).unwrap(); + let mut claim = transaction.prepare_cached( + /* sqlite-large-value: allow-for-now lv-h1d162e19a0a1 owner=smallclaims::store::assistant_grant_authority_bench TODO=prepare-body-and-predecessor-values */ + "INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) + VALUES(?1,?2,?3,?4,?5,?6,?7,'[]','1791849600000')", + ).unwrap(); + // Two writer batches per bounded transaction; no per-row envelope + // allocation and no growing collection of claim IDs or subjects. + let sequence = start / config.transaction_rows + 1; + for writer in [LOCAL, REMOTE] { + batch.execute(/* sqlite-large-value: allow-for-now lv-he7097c5f9f00 owner=smallclaims::store::assistant_grant_authority_bench TODO=trace-statement-and-value-representation */ params![format!("batch/{writer}/{sequence:064x}"), writer, sequence, format!("{sequence:064x}")]).unwrap(); + } + for row in start..config.rows.min(start.saturating_add(config.transaction_rows)) { + let offset = row % DENOMINATOR; + let id = format!("{:064x}", row + 1); + if offset < config.authority_bps { + let group = (row / DENOMINATOR) * (config.authority_bps / EVENTS) + offset / EVENTS; + let event = offset % EVENTS; + // A coprime stride spreads categories across short samples. + let category = group.wrapping_mul(7_919) % DENOMINATOR; + let malformed = category < config.malformed_bps; + let unauthenticated = !malformed && category < config.malformed_bps + config.unauthenticated_bps; + let writer = if unauthenticated { REMOTE } else { LOCAL }; + let revoked_group = group.wrapping_mul(3_571) % DENOMINATOR < config.revoked_bps; + let kind = match event { + 0 => assistant_grant_authority::GRANTED, + 4 if revoked_group => assistant_grant_authority::REVOKED, + _ => assistant_grant_authority::POLICY, + }; + raw_revocations += u64::from(kind == assistant_grant_authority::REVOKED); + let body = authority_body(group, event, malformed, config.authority_body_bytes); + authority_body_bytes += body.len() as u64; + expected_malformed_rows += u64::from(malformed); + expected_unauthenticated_rows += u64::from(unauthenticated); + if event == 0 && !malformed && !unauthenticated { + expected_effective += 1; + expected_revoked += u64::from(revoked_group); + } + claim.execute(/* sqlite-large-value: allow-for-now lv-hb16dbad8dff5 owner=smallclaims::store::assistant_grant_authority_bench TODO=trace-statement-and-value-representation */ params![id, format!("batch/{writer}/{sequence:064x}"), + format!("custom/client/assistant-v1-{group:024x}"), kind, writer, + "person/perf-operator", body]).unwrap(); + if writer == LOCAL { + // Model a genuine local append, not origin-based trust + // during upgrade of ambiguous historical raw rows. + transaction.execute( + /* sqlite-large-value: allow-for-now lv-h84ea96cecd57 owner=smallclaims::store::assistant_grant_authority_bench TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_local_appends(claim_id) VALUES(?1)", [&id], + ).unwrap(); + } + } else { + let bucket = match row % 100 { 0..=69 => 0, 70..=94 => 1, _ => 2 }; + let body = &unrelated_bodies[bucket]; + unrelated_body_bytes += body.len() as u64; + claim.execute(/* sqlite-large-value: allow-for-now lv-h5820156720c0 owner=smallclaims::store::assistant_grant_authority_bench TODO=trace-statement-and-value-representation */ params![id, format!("batch/{LOCAL}/{sequence:064x}"), + format!("conversation/synthetic/{:08x}", row % 100_000), + format!("synthetic.message.kind{}", row % 16), LOCAL, + "person/perf-operator", body]).unwrap(); + } + } + } + transaction.commit().unwrap(); + } + assert_eq!(connection.query_row("SELECT COUNT(*) FROM assistant_grant_dirty", [], |row| row.get::<_, u64>(0)).unwrap(), 0); + let checkpoint: (i64, i64, i64) = connection.query_row("PRAGMA wal_checkpoint(TRUNCATE)", [], |row| Ok((row.get(0)?, row.get(1)?, row.get(2)?))).unwrap(); + assert_eq!(checkpoint, (0, 0, 0)); + } + drop(store); + println!("authority_backfill_fixture_creation elapsed_ms={:.3}", fixture_started.elapsed().as_secs_f64() * 1_000.0); + let mut connection = open_connection(&path); + let raw_rows: u64 = connection.query_row("SELECT COUNT(*) FROM claims", [], |row| row.get(0)).unwrap(); + let raw_authority_rows: u64 = connection.query_row( + "SELECT COUNT(*) FROM claims WHERE kind IN (?1,?2,?3)", + params![assistant_grant_authority::GRANTED, assistant_grant_authority::POLICY, assistant_grant_authority::REVOKED], |row| row.get(0), + ).unwrap(); + assert_eq!(raw_rows, config.rows); + assert_eq!(raw_authority_rows, config.rows / DENOMINATOR * config.authority_bps); + let (fixture_db_bytes, fixture_wal_bytes) = physical_bytes(&path); + let (baseline_rss_kib, baseline_peak_kib) = memory_kib(); + + let started = Instant::now(); + let install_started = Instant::now(); + assistant_grant_authority::install(&connection, LOCAL).unwrap(); + let install_elapsed = install_started.elapsed(); + assert!(assistant_grant_authority::ready(&connection).is_err()); + // Force a resume probe even when the configured startup budget would finish + // the sample. Zero budget still processes and commits one real row. + let (done, resume_probe_elapsed) = slice(&mut connection, Duration::ZERO); + assert!(!done, "first slice must leave migration unready"); + let saved_cursors = cursors(&connection); + assert!(!saved_cursors.is_empty()); + drop(connection); + connection = open_connection(&path); + assert_eq!(cursors(&connection), saved_cursors, "cursor must survive connection restart"); + assert!(assistant_grant_authority::ready(&connection).is_err()); + let (mut done, startup_slice_elapsed) = slice(&mut connection, Duration::from_millis(config.startup_ms)); + let mut slices = 2_u64; + let mut max_slice = startup_slice_elapsed.max(resume_probe_elapsed); + let mut slice_elapsed = startup_slice_elapsed + resume_probe_elapsed; + while !done { + let (finished, elapsed) = slice(&mut connection, Duration::from_millis(config.slice_ms)); + done = finished; + slices += 1; + max_slice = max_slice.max(elapsed); + slice_elapsed += elapsed; + } + let backfill_elapsed = started.elapsed(); + let (final_db_bytes, final_wal_bytes) = physical_bytes(&path); + let (final_rss_kib, peak_rss_kib) = memory_kib(); + let effective: u64 = connection.query_row("SELECT COUNT(*) FROM assistant_grant_effective", [], |row| row.get(0)).unwrap(); + let revoked: u64 = connection.query_row("SELECT COUNT(*) FROM assistant_grant_effective WHERE revoked=1", [], |row| row.get(0)).unwrap(); + let authority: u64 = connection.query_row("SELECT COUNT(*) FROM assistant_grant_authority", [], |row| row.get(0)).unwrap(); + let unauthenticated: u64 = connection.query_row("SELECT COUNT(*) FROM assistant_grant_pending WHERE authenticated=0", [], |row| row.get(0)).unwrap(); + let pending_unauthenticated_grants: u64 = connection.query_row( + "SELECT COUNT(*) FROM assistant_grant_pending WHERE authenticated=0 AND kind=?1", + [assistant_grant_authority::GRANTED], |row| row.get(0), + ).unwrap(); + assert_eq!(effective, expected_effective); + assert!(effective > 0, "sample must include authenticated valid groups"); + assert_eq!(revoked, expected_revoked); + assert_eq!(authority, expected_effective * EVENTS); + assert_eq!(unauthenticated, expected_unauthenticated_rows); + assert_eq!(connection.query_row("SELECT COUNT(*) FROM assistant_grant_dirty", [], |row| row.get::<_, u64>(0)).unwrap(), 0); + assert_eq!(connection.query_row("SELECT value FROM meta WHERE key='assistant_grant_authority_version'", [], |row| row.get::<_, String>(0)).unwrap(), "1"); + // A second maintenance pass must not duplicate resumed rows or alter readiness. + let transaction = connection.transaction().unwrap(); + assert!(assistant_grant_authority::backfill_slice(&transaction, Duration::from_millis(config.slice_ms)).unwrap()); + transaction.commit().unwrap(); + assert_eq!(connection.query_row("SELECT COUNT(*) FROM assistant_grant_authority", [], |row| row.get::<_, u64>(0)).unwrap(), authority); + + println!("authority_backfill_compatibility pending_unauthenticated_grant_claims={pending_unauthenticated_grants}"); + let scale = config.target_bytes as f64 / fixture_db_bytes as f64; + println!("authority_backfill_fixture raw_claims={raw_rows} grant_kind_claims={raw_authority_rows} granted={} policies={} revocations={raw_revocations} malformed_rows={expected_malformed_rows} unauthenticated_rows={expected_unauthenticated_rows} effective_grants={effective} authority_rows={authority} authority_bps={} malformed_group_bps={} unauthenticated_group_bps={} revoked_group_bps={} unrelated_json_bytes={unrelated_body_bytes} authority_json_bytes={authority_body_bytes} fixture_db_bytes={fixture_db_bytes} fixture_wal_bytes={fixture_wal_bytes} final_db_bytes={final_db_bytes} final_wal_bytes={final_wal_bytes} transaction_rows={}", + raw_authority_rows / EVENTS, raw_authority_rows - raw_authority_rows / EVENTS - raw_revocations, + config.authority_bps, config.malformed_bps, config.unauthenticated_bps, config.revoked_bps, config.transaction_rows); + println!("authority_backfill_timing install_ms={:.3} startup_slice_ms={:.3} startup_total_ms={:.3} startup_budget_ms={} continuation_budget_ms={} slices={slices} max_slice_ms={:.3} slice_sum_ms={:.3} elapsed_with_restart_ms={:.3} resume_probe_ms={:.3} restart_count=1 readiness_checked_each_slice=true", + install_elapsed.as_secs_f64() * 1_000.0, startup_slice_elapsed.as_secs_f64() * 1_000.0, + (install_elapsed + startup_slice_elapsed).as_secs_f64() * 1_000.0, config.startup_ms, config.slice_ms, + max_slice.as_secs_f64() * 1_000.0, slice_elapsed.as_secs_f64() * 1_000.0, backfill_elapsed.as_secs_f64() * 1_000.0, + resume_probe_elapsed.as_secs_f64() * 1_000.0); + println!("authority_backfill_memory baseline_rss_kib={baseline_rss_kib} baseline_process_peak_kib={baseline_peak_kib} final_rss_kib={final_rss_kib} peak_rss_kib={peak_rss_kib} high_water_increase_kib={} sqlite_cache_kib={}", peak_rss_kib.saturating_sub(baseline_peak_kib), crate::sqlite::WRITE_CACHE_KIB); + println!("authority_backfill_extrapolation target_bytes={} scale={scale:.6} estimated_raw_claims={:.0} estimated_grant_kind_claims={:.0} linear_elapsed_seconds={:.3} fixed_working_set_peak_kib={peak_rss_kib} pessimistic_linear_peak_kib={:.0} methodology=target_divided_by_checkpointed_fixture_db_bytes_times_observed_work warning=synthetic_mix_not_production_distribution;time_assumes_constant_throughput_and_same_indexes_cache_storage;memory_fixed_cache_hypothesis_not_proven_at_50GB;linear_peak_is_sensitivity_not_prediction;VmHWM_includes_fixture_and_test_process;WAL_is_physical_recycled_bytes;startup_excludes_Store_open_and_includes_one_prior_resume_probe_row;no_cold_cache_claim", + config.target_bytes, raw_rows as f64 * scale, raw_authority_rows as f64 * scale, + backfill_elapsed.as_secs_f64() * scale, peak_rss_kib as f64 * scale); +} diff --git a/crates/smallclaims/src/store/assistant_grant_authority_tests.rs b/crates/smallclaims/src/store/assistant_grant_authority_tests.rs new file mode 100644 index 00000000000..16230812452 --- /dev/null +++ b/crates/smallclaims/src/store/assistant_grant_authority_tests.rs @@ -0,0 +1,1559 @@ +//! Maintenance controls use real sealed envelopes; the reference reads raw history only. +use super::assistant_grant_authority::{self as authority, GRANTED, POLICY, REVOKED}; +use super::runtime::Plain; +use super::*; +use crate::claim::ReplicaEnvelopeSignature; +use crate::fleet::MemberKey; +use crate::replication::ReplicationExchange; +use rusqlite::{StatementStatus, types::Value as SqlValue}; +use std::time::Duration; + +const FLEET: &str = "assistant-authority-maintenance"; +const SUBJECT: &str = "custom/client/assistant-v1-0123456789abcdef01234567"; +const OWNER: &str = "human/owner"; + +fn node(name: &str, anchor: Option<&str>) -> Store { + let store = Store::open_memory(name, Arc::new(Plain)).unwrap(); + store.bind_fleet(FLEET).unwrap(); + if let Some(anchor) = anchor { + store.pin_fleet_anchor(anchor).unwrap(); + } + store +} + +fn source() -> (Store, Arc) { + let store = node("anchor", None); + let key = Arc::new(MemberKey::generate().unwrap().0); + store.pin_fleet_anchor(key.public()).unwrap(); + store.set_member_key(Some(key.clone())).unwrap(); + store.admit_fleet_anchor(FLEET, key.public(), "listening").unwrap(); + store.seal_local_batches().unwrap(); + (store, key) +} + +fn fields() -> Value { + json!({ + "grant_id": "assistant-grant/0123456789abcdef01234567", + "issuer": OWNER, + "principal": "assistant/chatgpt", + "profile": "assistant", + "session_actor": "assistant/chatgpt/session/assistant-grant/0123456789abcdef01234567", + "credential_hash": "a".repeat(64), + "minimal_read_mode": "approval-once", + "disclosure_consent": true, + "expires_at_unix_ms": 10000, + "scopes": ["read.assistant.summary"] + }) +} + +fn service_fields() -> Value { + // Main's Service fixtures use bare grant IDs and omit assistant consent/read mode. + json!({ + "grant_id": "0123456789abcdef01234567", + "issuer": OWNER, + "principal": "plugin/test/reader", + "profile": "service", + "session_actor": "plugin/test/reader/session/0123456789abcdef01234567", + "credential_hash": "b".repeat(64), + "expires_at_unix_ms": 10000, + "scopes": ["read.claims", "read.work", "read.documents"] + }) +} + +#[test] +fn service_local_grant_authenticates_projection_immediately_without_assistant_consent() { + let store = node("issuer", None); + let grant = append(&store, SUBJECT, GRANTED, service_fields()); + let connection = store.readers.get(); + assert!(authority::contains(&connection, &grant.id).unwrap()); + assert_eq!(authority::by_credential(&connection, &"b".repeat(64)).unwrap().unwrap().id, grant.id); + let candidates = authority::candidates(&connection, "plugin/test/reader", OWNER, Some(0), None, None).unwrap(); + assert_eq!(candidates.len(), 1); + assert_eq!(candidates[0].id, grant.id); + let has_envelope: bool = connection.query_row( + "SELECT EXISTS(SELECT 1 FROM replica_records WHERE claim_id=?1)", + [&grant.id], |row| row.get(0), + ).unwrap(); + assert!(!has_envelope, "Service authority must not wait for sealing"); +} + +#[test] +fn service_projection_validators_enforce_closed_identity_policy_and_common_checks() { + let store = node("issuer", None); + let grant = append(&store, SUBJECT, GRANTED, service_fields()); + assert!(authority::structurally_valid(&grant, &grant)); + for (field, value) in [ + ("principal", json!("assistant/other")), + ("principal", json!("plugin//reader")), + ("principal", json!("plugin/test/reader/extra")), + ("principal", json!("plugin/test/read er")), + ("profile", json!("assistant")), + ("profile", Value::Null), + ("session_actor", json!("plugin/test/other/session/0123456789abcdef01234567")), + ("issuer", json!("human/other")), + ("grant_id", json!("bad")), + ("credential_hash", json!("not-a-digest")), + ("code_hash", json!("not-a-digest")), + ("credential", json!("raw-secret")), + ("code", json!("raw-code")), + ("expires_at_unix_ms", json!(-1)), + ("scopes", json!(["read.assistant.summary"])), + ("scopes", json!(["write.claims"])), + ("scopes", json!(["read.claims", 1])), + ] { + let mut malformed = grant.clone(); + malformed.body["fields"][field] = value; + assert!(!authority::structurally_valid(&malformed, &malformed), "accepted malformed {field}"); + } + for principal in ["plugin/issuer-name/reader_1.0", "plugin/Test/Reader"] { + let mut valid = grant.clone(); + valid.body["fields"]["principal"] = json!(principal); + valid.body["fields"]["session_actor"] = json!(format!("{principal}/session/0123456789abcdef01234567")); + assert!(authority::structurally_valid(&valid, &valid)); + } +} + +#[test] +fn service_late_signature_promotes_grant_policy_and_revocation() { + let (source, key) = source(); + let target = node("reader", Some(key.public())); + let grant = append(&source, SUBJECT, GRANTED, service_fields()); + let exchange = export(&source, &target); + receive(&target, &unsigned(&exchange)); + assert!(authority::by_credential(&target.readers.get(), &"b".repeat(64)).unwrap().is_none()); + receive(&target, &signatures(&exchange)); + assert_eq!(authority::by_credential(&target.readers.get(), &"b".repeat(64)).unwrap().unwrap().id, grant.id); + let mut changed = service_fields(); + changed["expires_at_unix_ms"] = json!(20000); + changed["scopes"] = json!(["read.work"]); + let policy = append(&source, SUBJECT, POLICY, changed); + receive(&target, &export(&source, &target)); + assert_eq!(authority::transition(&target.readers.get(), &grant, POLICY).unwrap().unwrap().id, policy.id); + let revoke = append(&source, SUBJECT, REVOKED, service_fields()); + let exchange = export(&source, &target); + receive(&target, &unsigned(&exchange)); + assert!(authority::transition(&target.readers.get(), &grant, REVOKED).is_err()); + receive(&target, &signatures(&exchange)); + assert_eq!(authority::transition(&target.readers.get(), &grant, REVOKED).unwrap().unwrap().id, revoke.id); + assert!(authority::candidates(&target.readers.get(), "plugin/test/reader", OWNER, Some(0), None, None).unwrap().is_empty()); +} + +#[test] +fn service_signed_and_local_unsealed_grants_survive_projection_backfill() { + let (store, _) = source(); + let sealed = append(&store, SUBJECT, GRANTED, service_fields()); + store.seal_local_batches().unwrap(); + store.connection.write().execute( + /* sqlite-large-value: allow-for-now lv-ha76427048a9d owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_local_appends WHERE claim_id=?1", [&sealed.id], + ).unwrap(); + let mut changed = service_fields(); + changed["credential_hash"] = json!("c".repeat(64)); + let unsealed = append(&store, SUBJECT, GRANTED, changed); + reset_projection(&store.connection.write()); + drain_authority(&store); + let connection = store.readers.get(); + assert!(authority::contains(&connection, &sealed.id).unwrap()); + assert!(authority::contains(&connection, &unsealed.id).unwrap()); + assert_eq!(authority::by_credential(&connection, &"b".repeat(64)).unwrap().unwrap().id, sealed.id); + assert_eq!(authority::by_credential(&connection, &"c".repeat(64)).unwrap().unwrap().id, unsealed.id); +} + +#[test] +fn legacy_service_on_assistant_remains_cross_profile_conflict_evidence() { + let store = node("issuer", None); + let assistant = append(&store, SUBJECT, GRANTED, fields()); + let mut legacy = fields(); + legacy["profile"] = json!("service"); + legacy["grant_id"] = json!("assistant-grant/fedcba9876543210fedcba98"); + legacy["session_actor"] = json!("assistant/chatgpt/session/assistant-grant/fedcba9876543210fedcba98"); + let service = append(&store, "custom/client/assistant-v1-fedcba9876543210fedcba98", GRANTED, legacy); + assert!(authority::structurally_valid(&service, &service)); + let connection = store.readers.get(); + let candidates = authority::candidates(&connection, "assistant/chatgpt", OWNER, Some(0), None, None).unwrap(); + assert_eq!(candidates.len(), 2); + assert!(candidates.iter().any(|claim| claim.id == assistant.id)); + assert!(candidates.iter().any(|claim| claim.id == service.id)); + let mut invalid = service.clone(); + invalid.body["fields"]["scopes"] = json!(["read.claims"]); + assert!(!authority::structurally_valid(&invalid, &invalid)); + invalid = service.clone(); + invalid.body["fields"]["disclosure_consent"] = Value::Null; + assert!(!authority::structurally_valid(&invalid, &invalid)); + invalid = service.clone(); + invalid.body["fields"]["minimal_read_mode"] = Value::Null; + assert!(!authority::structurally_valid(&invalid, &invalid)); +} + +fn append(store: &Store, subject: &str, kind: &str, fields: Value) -> ClaimRecord { + store.append_claim(&ClaimInput { + subject: subject.into(), kind: kind.into(), actor: Some(OWNER.into()), + fields: serde_json::from_value(fields).unwrap(), evidence: Vec::new(), + expected_subject: None, idempotency_key: None, + }).unwrap() +} + +fn export(source: &Store, target: &Store) -> ReplicationExchange { + source.seal_local_batches().unwrap(); + source.export_replication_exchange(FLEET, &target.replication_inventory().unwrap()).unwrap() +} + +fn receive(target: &Store, exchange: &ReplicationExchange) { + target.receive_replication_exchange(&exchange.peer, FLEET, exchange).unwrap(); + target.validate_replication_backlog().unwrap(); + target.project_replication_backlog().unwrap(); + drain_authority(target); +} + +fn unsigned(exchange: &ReplicationExchange) -> ReplicationExchange { + let mut result = exchange.clone(); + result.signatures.clear(); + for envelope in &mut result.envelopes { + envelope.member_key = None; + envelope.signature = None; + } + result +} + +fn signatures(exchange: &ReplicationExchange) -> ReplicationExchange { + let mut result = exchange.clone(); + result.signatures.extend(result.envelopes.iter().filter_map(|envelope| { + Some(ReplicaEnvelopeSignature { + writer: envelope.writer.clone(), sequence: envelope.sequence, + hash: envelope.hash.clone(), member_key: envelope.member_key.clone()?, + signature: envelope.signature.clone()?, + }) + })); + result.envelopes.clear(); + result +} + +fn snapshot(connection: &Connection) -> Vec> { + let mut statement = connection.prepare( + "SELECT claim_id,grant_subject,principal,owner,profile,expires_at,revoked,grant_record + FROM assistant_grant_effective ORDER BY claim_id" + ).unwrap(); + statement.query_map([], |row| (0..8).map(|index| row.get(index)).collect()) + .unwrap().collect::>().unwrap() +} + +fn raw_claims(store: &Store) -> Vec { + store.readers.get().prepare(/* sqlite-large-value: allow-for-now lv-hef28dd74e68f owner=smallclaims::store::assistant_grant_authority_tests TODO=trace-statement-and-value-representation */ &format!("SELECT {CLAIM_COLUMNS} FROM claims ORDER BY store_index")) + .unwrap().query_map([], claim_from_row).unwrap() + .collect::>().unwrap() +} + +// This intentionally knows the fixture's wire contract, not the projection's validator, +// pending table, or authority rows. Authentication goes through the public raw-provenance API. +fn reference(store: &Store) -> Vec<(String, String, bool)> { + let claims = raw_claims(store); + let trusted = |claim: &ClaimRecord| { + claim.origin == store.origin + || store.claim_has_authenticated_member_writer(&claim.id).unwrap() + }; + let identity = |claim: &ClaimRecord| { + let f = &claim.body["fields"]; + claim.subject == SUBJECT && claim.actor.as_deref() == Some(OWNER) + && f["issuer"] == OWNER && f["grant_id"] == fields()["grant_id"] + && f["principal"] == "assistant/chatgpt" && f["profile"] == "assistant" + }; + let policy = |claim: &ClaimRecord| { + let f = &claim.body["fields"]; + identity(claim) && f["session_actor"] == fields()["session_actor"] + && f["minimal_read_mode"] == "approval-once" && f["disclosure_consent"] == true + && f["expires_at_unix_ms"].as_u64().is_some() + && f["scopes"] == json!(["read.assistant.summary"]) + && f.get("credential").is_none() && f.get("code").is_none() + && f["credential_hash"].as_str().is_some_and(|s| s.len() == 64 && s.bytes().all(|b| b.is_ascii_hexdigit())) + }; + let mut expected = Vec::new(); + let base = |claim: &ClaimRecord| { + let f = &claim.body["fields"]; + identity(claim) && f.get("credential").is_none() && f.get("code").is_none() + && f["credential_hash"].as_str().is_some_and(|s| s.len() == 64 && s.bytes().all(|b| b.is_ascii_hexdigit())) + }; + for grant in claims.iter().filter(|claim| claim.kind == GRANTED && trusted(claim) && base(claim)) { + let selected = claims.iter().rev().find(|claim| { + claim.kind == POLICY && claim.origin == grant.origin && trusted(claim) && policy(claim) + }).unwrap_or(grant); + if !policy(selected) { continue; } + let revoked = claims.iter().any(|claim| { + claim.kind == REVOKED && claim.origin == grant.origin && trusted(claim) && identity(claim) + }); + expected.push((grant.id.clone(), format!("{:020}", selected.body["fields"]["expires_at_unix_ms"].as_u64().unwrap()), revoked)); + } + expected.sort(); + expected +} + +fn assert_reference_and_rebuild(store: &Store) { + let expected = reference(store); + let mut connection = store.connection.write(); + let actual: Vec<(String, String, bool)> = connection.prepare( + "SELECT claim_id,expires_at,revoked FROM assistant_grant_effective ORDER BY claim_id" + ).unwrap().query_map([], |row| Ok((row.get(0)?, row.get(1)?, row.get(2)?))) + .unwrap().collect::>().unwrap(); + assert_eq!(actual, expected, "incremental rows disagree with independent raw history"); + let before = snapshot(&connection); + let transaction = connection.transaction().unwrap(); + let subjects: Vec = transaction.prepare( + "SELECT DISTINCT grant_subject FROM assistant_grant_authority UNION SELECT grant_subject FROM assistant_grant_effective" + ).unwrap().query_map([], |row| row.get(0)).unwrap() + .collect::>().unwrap(); + for subject in subjects { + authority::rebuild_subject(&transaction, &subject).unwrap(); + } + assert_eq!(snapshot(&transaction), before, "full subject rebuild changed incremental state"); + transaction.commit().unwrap(); +} + +fn decisions(store: &Store, now: u64) -> Vec { + authority::candidates(&store.readers.get(), "assistant/chatgpt", OWNER, Some(now), None, None) + .unwrap().into_iter() + .filter(|claim| authority::contains(&store.readers.get(), &claim.id).unwrap()) + .map(|claim| claim.id).collect() +} + +#[test] +fn malformed_base_cannot_mask_a_valid_credential_but_valid_policy_can_repair_it() { + let store = node("issuer", None); + let granted = append(&store, SUBJECT, GRANTED, fields()); + let digest = fields()["credential_hash"].as_str().unwrap().to_owned(); + let mut malformed = fields(); + malformed["expires_at_unix_ms"] = Value::Null; + let pending = append(&store, SUBJECT, GRANTED, malformed); + assert!(!authority::contains(&store.readers.get(), &pending.id).unwrap()); + assert_eq!(authority::by_credential(&store.readers.get(), &digest).unwrap().unwrap().id, granted.id); + assert_eq!(authority::latest(&store.readers.get(), SUBJECT, GRANTED).unwrap().unwrap().id, granted.id); + let mut renewal = fields(); + renewal["expires_at_unix_ms"] = json!(20000); + append(&store, SUBJECT, POLICY, renewal); + assert!(authority::contains(&store.readers.get(), &pending.id).unwrap()); + assert_eq!(authority::by_credential(&store.readers.get(), &digest).unwrap().unwrap().id, pending.id); + assert_reference_and_rebuild(&store); +} + +#[test] +fn late_envelope_signature_promotes_previously_admitted_grant() { + let (source, key) = source(); + let target = node("reader", Some(key.public())); + let grant = append(&source, SUBJECT, GRANTED, fields()); + let exchange = export(&source, &target); + receive(&target, &unsigned(&exchange)); + assert!(raw_claims(&target).iter().any(|claim| claim.id == grant.id)); + assert!(decisions(&target, 0).is_empty()); + assert_reference_and_rebuild(&target); + receive(&target, &signatures(&exchange)); + assert_eq!(decisions(&target, 0), vec![grant.id]); + assert_reference_and_rebuild(&target); + receive(&target, &signatures(&exchange)); + assert_reference_and_rebuild(&target); +} + +fn backfill_markers(connection: &Connection) -> Vec<(String, String)> { + connection.prepare( + "SELECT key,value FROM meta WHERE key='assistant_grant_authority_version' + OR key LIKE 'assistant_grant_authority_cursor/%' ORDER BY key" + ).unwrap().query_map([], |row| Ok((row.get(0)?, row.get(1)?))) + .unwrap().collect::>().unwrap() +} + +fn insert_raw_signature(connection: &Connection, signature: &ReplicaEnvelopeSignature) { + connection.execute( + /* sqlite-large-value: allow-for-now lv-hdd61bb7dd3ca owner=smallclaims::store::assistant_grant_authority_tests TODO=chunk-or-reference-exact-wire-values */ "INSERT OR IGNORE INTO replica_envelope_signatures + (writer,sequence,envelope_hash,member_key,signature,stored_at_unix_ms) + VALUES(?1,?2,?3,?4,?5,'0')", + params![signature.writer,signature.sequence,signature.hash,signature.member_key,signature.signature], + ).unwrap(); +} + +#[test] +fn raw_signature_only_insert_survives_reopen_and_promotes_grant_policy_and_revoke_without_rescan() { + let directory = tempfile::tempdir().unwrap(); + let path = directory.path().join("late-signature.sqlite3"); + let (source, key) = source(); + let mut target = Store::open(&path, "reader", Arc::new(Plain)).unwrap(); + target.bind_fleet(FLEET).unwrap(); + target.pin_fleet_anchor(key.public()).unwrap(); + // Establish membership first: no membership change may drive these promotions. + receive(&target, &export(&source, &target)); + let mut grant_id = String::new(); + for kind in [GRANTED, POLICY, REVOKED] { + let mut value = fields(); + if kind == POLICY { value["expires_at_unix_ms"] = json!(20000); } + let claim = append(&source, SUBJECT, kind, value); + if kind == GRANTED { grant_id.clone_from(&claim.id); } + let exchange = export(&source, &target); + receive_pre_projection_unsigned_history(&target, &exchange); + assert!(raw_claims(&target).iter().any(|record| record.id == claim.id)); + assert!(!authority::contains(&target.readers.get(), &claim.id).unwrap()); + while !target.advance_assistant_grant_authority_backfill().unwrap() {} + let markers = backfill_markers(&target.readers.get()); + authority::ready(&target.readers.get()).unwrap(); + drop(target); + + // Simulate an older writer, bypassing every Store admission/refresh hook. + { + let connection = Connection::open(&path).unwrap(); + for signature in signatures(&exchange).signatures { + insert_raw_signature(&connection, &signature); + } + let dirty: Vec = connection.prepare( + "SELECT claim_id FROM assistant_grant_dirty ORDER BY claim_id" + ).unwrap().query_map([], |row| row.get(0)).unwrap() + .collect::>().unwrap(); + assert_eq!(dirty, vec![claim.id.clone()]); + authority::ready(&connection).unwrap(); + assert!(authority::maintenance_pending(&connection).unwrap()); + assert!(authority::subject_ready(&connection, SUBJECT).is_err()); + assert_eq!(backfill_markers(&connection), markers); + } + // Reopen before Store startup can drain the durable queue automatically. + { + let mut connection = Connection::open(&path).unwrap(); + authority::ready(&connection).unwrap(); + assert!(authority::maintenance_pending(&connection).unwrap()); + let transaction = connection.transaction().unwrap(); + assert!(authority::backfill_slice(&transaction, Duration::from_secs(60)).unwrap()); + authority::ready(&transaction).unwrap(); + assert!(authority::contains(&transaction, &claim.id).unwrap()); + assert_eq!(backfill_markers(&transaction), markers, "completed history or membership was rescanned"); + transaction.commit().unwrap(); + } + target = Store::open(&path, "reader", Arc::new(Plain)).unwrap(); + assert_reference_and_rebuild(&target); + if kind == REVOKED { + assert!(decisions(&target, 0).is_empty()); + let revoked: bool = target.readers.get().query_row( + "SELECT revoked FROM assistant_grant_effective WHERE claim_id=?1", + [&grant_id], |row| row.get(0), + ).unwrap(); + assert!(revoked); + } else { + assert_eq!(decisions(&target, 0), vec![grant_id.clone()]); + assert_eq!(decisions(&target, 15000).is_empty(), kind == GRANTED); + } + } +} + +#[test] +fn malformed_raw_signature_row_is_drained_without_authenticating_a_pending_revoke() { + let (source, key) = source(); + let target = node("reader", Some(key.public())); + let grant = append(&source, SUBJECT, GRANTED, fields()); + receive(&target, &export(&source, &target)); + let revoke = append(&source, SUBJECT, REVOKED, fields()); + let exchange = export(&source, &target); + receive_pre_projection_unsigned_history(&target, &exchange); + while !target.advance_assistant_grant_authority_backfill().unwrap() {} + let markers = backfill_markers(&target.readers.get()); + { + let mut connection = target.connection.write(); + for mut signature in signatures(&exchange).signatures { + signature.signature = "not-an-ed25519-signature".into(); + insert_raw_signature(&connection, &signature); + } + authority::ready(&connection).unwrap(); + assert!(authority::subject_ready(&connection, SUBJECT).is_err()); + let transaction = connection.transaction().unwrap(); + assert!(authority::backfill_slice(&transaction, Duration::from_secs(60)).unwrap()); + authority::ready(&transaction).unwrap(); + assert!(!authority::contains(&transaction, &revoke.id).unwrap()); + let authenticated: bool = transaction.query_row( + "SELECT authenticated FROM assistant_grant_pending WHERE claim_id=?1", + [&revoke.id], |row| row.get(0), + ).unwrap(); + assert!(!authenticated); + assert_eq!(backfill_markers(&transaction), markers); + transaction.commit().unwrap(); + } + assert!(decisions(&target, 0).is_empty()); + assert_bearer_rejected(&target, &grant); + assert_reference_and_rebuild(&target); +} + +#[test] +fn membership_sealed_after_grant_admission_promotes_pending_authority() { + let (source, key) = source(); + let target = node("reader", Some(key.public())); + let grant = append(&source, SUBJECT, GRANTED, fields()); + let exchange = export(&source, &target); + let mut delayed_anchor_signature = exchange.clone(); + let anchor_sequence = exchange.envelopes.iter().map(|e| e.sequence).min().unwrap(); + for envelope in &mut delayed_anchor_signature.envelopes { + if envelope.sequence == anchor_sequence { + envelope.member_key = None; + envelope.signature = None; + } + } + delayed_anchor_signature.signatures.retain(|s| s.sequence != anchor_sequence); + receive(&target, &delayed_anchor_signature); + assert!(raw_claims(&target).iter().any(|claim| claim.id == grant.id)); + assert!(decisions(&target, 0).is_empty()); + assert_reference_and_rebuild(&target); + let mut seal = signatures(&exchange); + seal.signatures.retain(|s| s.sequence == anchor_sequence); + receive(&target, &seal); + assert!(target.claim_has_authenticated_member_writer(&grant.id).unwrap()); + assert_eq!(decisions(&target, 0), vec![grant.id]); + assert_reference_and_rebuild(&target); +} + +#[test] +fn sealing_local_membership_promotes_an_already_received_peer_grant() { + let target = node("anchor", None); + let anchor_key = Arc::new(MemberKey::generate().unwrap().0); + target.pin_fleet_anchor(anchor_key.public()).unwrap(); + target.set_member_key(Some(anchor_key.clone())).unwrap(); + target.admit_fleet_anchor(FLEET, anchor_key.public(), "listening").unwrap(); + target.seal_local_batches().unwrap(); + + let peer = node("peer", Some(anchor_key.public())); + let peer_key = Arc::new(MemberKey::generate().unwrap().0); + peer.set_member_key(Some(peer_key.clone())).unwrap(); + let grant = append(&peer, SUBJECT, GRANTED, fields()); + receive(&target, &export(&peer, &target)); + assert!(raw_claims(&target).iter().any(|claim| claim.id == grant.id)); + assert!(decisions(&target, 0).is_empty()); + assert_reference_and_rebuild(&target); + + append(&target, "host/peer", "fleet.member-admitted", json!({ + "member_key": peer_key.public(), "via": "member", "sponsor": "anchor", + "writer_floor": 0, "mode": "listening" + })); + // The membership claim exists but does not yet have a sealed signer. + assert!(!target.claim_has_authenticated_member_writer(&grant.id).unwrap()); + assert!(decisions(&target, 0).is_empty()); + target.seal_local_batches().unwrap(); + drain_authority(&target); + assert!(target.claim_has_authenticated_member_writer(&grant.id).unwrap()); + assert_eq!(decisions(&target, 0), vec![grant.id]); + assert_reference_and_rebuild(&target); +} + +#[test] +fn revoke_before_grant_never_temporarily_authorizes() { + let (source, key) = source(); + let target = node("reader", Some(key.public())); + receive(&target, &export(&source, &target)); + append(&source, SUBJECT, REVOKED, fields()); + receive(&target, &export(&source, &target)); + assert!(decisions(&target, 0).is_empty()); + assert_reference_and_rebuild(&target); + let grant = append(&source, SUBJECT, GRANTED, fields()); + receive(&target, &export(&source, &target)); + assert!(authority::contains(&target.readers.get(), &grant.id).unwrap()); + assert!(decisions(&target, 0).is_empty()); + assert_reference_and_rebuild(&target); +} + +#[test] +fn deterministic_event_permutations_match_raw_history_and_subject_rebuilds() { + // Each seed shuffles raw grant/policy/revoke receipt, their signatures, and the + // anchor signature that seals membership. Signatures may arrive before records. + for seed in 1_u64..=16 { + let (source, key) = source(); + let target = node("reader", Some(key.public())); + let grant = append(&source, SUBJECT, GRANTED, fields()); + source.seal_local_batches().unwrap(); + let mut changed = fields(); + changed["expires_at_unix_ms"] = json!(20000); + append(&source, SUBJECT, POLICY, changed); + source.seal_local_batches().unwrap(); + append(&source, SUBJECT, REVOKED, fields()); + let exchange = export(&source, &target); + assert_eq!(exchange.envelopes.len(), 4); + let mut events = Vec::new(); + for envelope in &exchange.envelopes { + let mut single = exchange.clone(); + single.envelopes = vec![envelope.clone()]; + single.signatures.clear(); + events.push(unsigned(&single)); + events.push(signatures(&single)); + } + let mut state = seed; + for index in (1..events.len()).rev() { + state ^= state << 13; + state ^= state >> 7; + state ^= state << 17; + let selected = (state % (index as u64 + 1)) as usize; + events.swap(index, selected); + } + for event in events { + receive(&target, &event); + assert_reference_and_rebuild(&target); + } + // Drain predecessors that an out-of-order envelope initially held. + target.validate_replication_backlog().unwrap(); + target.project_replication_backlog().unwrap(); + drain_authority(&target); + assert_reference_and_rebuild(&target); + assert!(authority::contains(&target.readers.get(), &grant.id).unwrap()); + assert_eq!(reference(&target), vec![(grant.id, format!("{:020}", 20000), true)]); + assert!(decisions(&target, 0).is_empty()); + } +} + +fn reset_projection(connection: &Connection) { + connection.execute_batch( + /* sqlite-large-value: allow-for-now lv-ha93665c85209 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ + "DELETE FROM assistant_grant_effective; + DELETE FROM assistant_grant_authority; + DELETE FROM assistant_grant_pending; + DELETE FROM assistant_grant_membership_windows; + DELETE FROM assistant_grant_dirty; + DELETE FROM assistant_grant_auth_cursor; + DELETE FROM assistant_grant_additions; + DELETE FROM assistant_grant_retractions; + DELETE FROM assistant_grant_recompute; + DELETE FROM assistant_grant_proof_invalidations; + DELETE FROM assistant_grant_proof_rechecks; + UPDATE assistant_grant_membership_state SET applied_generation=-1 WHERE id=1; + UPDATE meta SET value=value WHERE key='fleet_anchor_key'; + DELETE FROM meta WHERE key='assistant_grant_authority_version' + OR key LIKE 'assistant_grant_authority_cursor/%';" + ).unwrap(); +} + +fn drain_authority(store: &Store) { + while !store.advance_assistant_grant_authority_backfill().unwrap() {} +} + +// Build the raw, unsigned keyed-writer history an older importer could leave. +// Today's admission correctly holds unsigned keyed envelopes before raw claims +// exist, so receive(unsigned(exchange)) cannot exercise projection authentication. +// Use the real signed transport to materialize batches/receipt records, then +// discard this exchange's proofs and rebuild the projection from the remaining +// evidence before making any assertion. Existing earlier signatures survive. +fn receive_pre_projection_unsigned_history(target: &Store, exchange: &ReplicationExchange) { + receive(target, exchange); + { + let mut connection = target.connection.write(); + let transaction = connection.transaction().unwrap(); + for signature in signatures(exchange).signatures { + transaction.execute( + /* sqlite-large-value: allow-for-now lv-h9b903d60d4d6 owner=smallclaims::store::assistant_grant_authority_tests TODO=chunk-or-reference-exact-wire-values */ "DELETE FROM replica_envelope_signatures + WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=?4", + params![signature.writer, signature.sequence, signature.hash, signature.member_key], + ).unwrap(); + } + reset_projection(&transaction); + transaction.commit().unwrap(); + } + drain_authority(target); +} + +fn assert_bearer_rejected(store: &Store, grant: &ClaimRecord) { + let digest = grant.body["fields"]["credential_hash"].as_str().unwrap(); + assert!(!authority::contains(&store.readers.get(), &grant.id).unwrap()); + assert!(authority::by_credential(&store.readers.get(), digest).unwrap().is_none()); + assert!(!decisions(store, 0).contains(&grant.id)); +} + +fn attacker_fork() -> (Store, ClaimRecord) { + // An admitted Legacy sender invents a fork of the victim's writer history. + // No member key or signature authenticates the claimed local origin. + let sender = node("victim", None); + let mut forged = fields(); + forged["credential_hash"] = json!("b".repeat(64)); + let grant = append(&sender, SUBJECT, GRANTED, forged); + (sender, grant) +} + +#[test] +fn unsigned_victim_origin_legacy_fork_is_rejected_on_receive_and_upgrade_backfill() { + let (sender, grant) = attacker_fork(); + let victim = node("victim", None); + receive(&victim, &unsigned(&export(&sender, &victim))); + assert!(victim.claim_by_id(&grant.id).unwrap().is_some(), "Legacy evidence was admitted"); + assert_bearer_rejected(&victim, &grant); + reset_projection(&victim.connection.write()); + drain_authority(&victim); + assert_bearer_rejected(&victim, &grant); +} + +#[test] +fn victim_origin_legacy_fork_injected_after_partial_cursor_cannot_authenticate() { + let victim = node("victim", None); + let local = append(&victim, SUBJECT, GRANTED, fields()); + { + let mut connection = victim.connection.write(); + reset_projection(&connection); + let transaction = connection.transaction().unwrap(); + assert!(!authority::backfill_slice(&transaction, Duration::ZERO).unwrap()); + transaction.commit().unwrap(); + } + let (sender, grant) = attacker_fork(); + receive(&victim, &unsigned(&export(&sender, &victim))); + drain_authority(&victim); + assert_bearer_rejected(&victim, &grant); + assert_bearer_rejected(&victim, &local); +} + +#[test] +fn older_build_raw_legacy_replication_cannot_authenticate_on_new_build_reopen() { + let directory = tempfile::tempdir().unwrap(); + let path = directory.path().join("victim.sqlite3"); + let (sender, grant) = attacker_fork(); + { + let victim = Store::open(&path, "victim", Arc::new(Plain)).unwrap(); + drain_authority(&victim); + // The pre-envelope import path wrote raw batches and claims without + // receipt records. Reproduce that older-build transaction, deliberately + // bypassing all new admission hooks and the local append marker. + let (sequence, previous, hash): (u64, Option, String) = sender.readers.get() + .query_row("SELECT replica_sequence,previous_hash,hash FROM batches WHERE id=?1", + [&grant.batch_id], |row| Ok((row.get(0)?, row.get(1)?, row.get(2)?))).unwrap(); + let mut connection = victim.connection.write(); + let transaction = connection.transaction().unwrap(); + transaction.execute( + /* sqlite-large-value: allow-for-now lv-hebabcaf7fd3f owner=smallclaims::store::assistant_grant_authority_tests TODO=chunk-or-reference-exact-wire-values */ "INSERT INTO batches(id,origin,replica_sequence,previous_hash,hash,accepted_at_unix_ms) + VALUES(?1,?2,?3,?4,?5,?6)", + params![grant.batch_id,grant.origin,sequence,previous,hash,grant.accepted_at_unix_ms.to_string()], + ).unwrap(); + transaction.execute( + /* sqlite-large-value: allow-for-now lv-he87b7a8b6b00 owner=smallclaims::store::assistant_grant_authority_tests TODO=prepare-body-and-predecessor-values */ "INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) + VALUES(?1,?2,?3,?4,?5,?6,?7,?8,?9)", + params![grant.id,grant.batch_id,grant.subject,grant.kind,grant.origin,grant.actor, + canonical_json_text(&grant.body).unwrap(),serde_json::to_string(&grant.predecessors).unwrap(), + grant.accepted_at_unix_ms.to_string()], + ).unwrap(); + transaction.commit().unwrap(); + authority::ready(&connection).unwrap(); + assert!(authority::maintenance_pending(&connection).unwrap()); + } + let reopened = Store::open(&path, "victim", Arc::new(Plain)).unwrap(); + drain_authority(&reopened); + assert_bearer_rejected(&reopened, &grant); +} + +#[test] +fn unsigned_remote_without_membership_drains_once_and_maintenance_goes_idle() { + let sender = node("unsigned-remote", None); + let grant = append(&sender, SUBJECT, GRANTED, fields()); + let target = node("reader", None); + drain_authority(&target); + { + let (sequence, previous, hash): (u64, Option, String) = sender.readers.get() + .query_row("SELECT replica_sequence,previous_hash,hash FROM batches WHERE id=?1", + [&grant.batch_id], |row| Ok((row.get(0)?, row.get(1)?, row.get(2)?))).unwrap(); + let mut connection = target.connection.write(); + let transaction = connection.transaction().unwrap(); + // Reproduce a pre-envelope remote import: no local append marker, + // replica receipt, signature, or membership window can authenticate it. + transaction.execute( + /* sqlite-large-value: allow-for-now lv-h99e2f6069dc7 owner=smallclaims::store::assistant_grant_authority_tests TODO=chunk-or-reference-exact-wire-values */ "INSERT INTO batches(id,origin,replica_sequence,previous_hash,hash,accepted_at_unix_ms) + VALUES(?1,?2,?3,?4,?5,?6)", + params![grant.batch_id,grant.origin,sequence,previous,hash,grant.accepted_at_unix_ms.to_string()], + ).unwrap(); + transaction.execute( + /* sqlite-large-value: allow-for-now lv-h4d9aa050b4a3 owner=smallclaims::store::assistant_grant_authority_tests TODO=prepare-body-and-predecessor-values */ "INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) + VALUES(?1,?2,?3,?4,?5,?6,?7,?8,?9)", + params![grant.id,grant.batch_id,grant.subject,grant.kind,grant.origin,grant.actor, + canonical_json_text(&grant.body).unwrap(),serde_json::to_string(&grant.predecessors).unwrap(), + grant.accepted_at_unix_ms.to_string()], + ).unwrap(); + assert!(authority::maintenance_pending(&transaction).unwrap()); + assert_eq!(transaction.query_row("SELECT COUNT(*) FROM assistant_grant_dirty", [], |row| row.get::<_,u64>(0)).unwrap(), 1); + transaction.commit().unwrap(); + } + assert!(target.advance_assistant_grant_authority_backfill().unwrap()); + { + let connection = target.readers.get(); + assert_eq!(connection.query_row("SELECT COUNT(*) FROM assistant_grant_dirty", [], |row| row.get::<_,u64>(0)).unwrap(), 0); + assert!(!connection.query_row( + "SELECT authenticated FROM assistant_grant_pending WHERE claim_id=?1", + [&grant.id], |row| row.get::<_,bool>(0)).unwrap()); + assert!(!authority::maintenance_pending(&connection).unwrap()); + } + assert!(!target.assistant_grant_authority_maintenance_pending().unwrap()); + let writes = target.connection.write().total_changes(); + for _ in 0..3 { + assert!(target.advance_assistant_grant_authority_backfill().unwrap()); + assert!(!target.assistant_grant_authority_maintenance_pending().unwrap()); + } + assert_eq!(target.connection.write().total_changes(), writes, "idle maintenance must not requeue or refresh unsigned evidence"); + assert_bearer_rejected(&target, &grant); +} + +#[test] +fn local_append_authenticates_immediately_and_local_unsealed_and_signed_history_survive_backfill() { + let (store, _) = source(); + let sealed = append(&store, SUBJECT, GRANTED, fields()); + store.seal_local_batches().unwrap(); + // A pre-marker sealed claim must stand on its real signature, not its + // origin. A post-upgrade unsealed claim stands on durable local admission. + store.connection.write().execute( + /* sqlite-large-value: allow-for-now lv-he990aaffd4df owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_local_appends WHERE claim_id=?1", [&sealed.id], + ).unwrap(); + let mut changed = fields(); + changed["credential_hash"] = json!("c".repeat(64)); + let unsealed = append(&store, SUBJECT, GRANTED, changed); + assert!(authority::by_credential(&store.readers.get(), &"c".repeat(64)).unwrap().is_some()); + let has_envelope: bool = store.readers.get().query_row( + "SELECT EXISTS(SELECT 1 FROM replica_records WHERE claim_id=?1)", + [&unsealed.id], |row| row.get(0), + ).unwrap(); + assert!(!has_envelope, "local authority has no signature/sealing delay"); + reset_projection(&store.connection.write()); + drain_authority(&store); + assert!(authority::contains(&store.readers.get(), &sealed.id).unwrap()); + assert!(authority::contains(&store.readers.get(), &unsealed.id).unwrap()); +} + +#[test] +fn ambiguous_pre_marker_local_unsealed_history_fails_closed() { + let store = node("victim", None); + let grant = append(&store, SUBJECT, GRANTED, fields()); + store.connection.write().execute(/* sqlite-large-value: allow-for-now lv-h2dd1bfa09a04 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_local_appends", []).unwrap(); + reset_projection(&store.connection.write()); + drain_authority(&store); + assert_bearer_rejected(&store, &grant); +} + +#[test] +fn committed_backfill_slice_resumes_after_reopen_and_is_idempotent() { + let directory = tempfile::tempdir().unwrap(); + let path = directory.path().join("authority.sqlite3"); + let expected; + { + let store = Store::open(&path, "anchor", Arc::new(Plain)).unwrap(); + for _ in 0..70 { + append(&store, SUBJECT, GRANTED, fields()); + } + let mut changed = fields(); + changed["expires_at_unix_ms"] = json!(20000); + append(&store, SUBJECT, POLICY, changed); + append(&store, SUBJECT, REVOKED, fields()); + let mut connection = store.connection.write(); + expected = snapshot(&connection); + assert_eq!(expected.len(), 70); + reset_projection(&connection); + let transaction = connection.transaction().unwrap(); + assert!(!authority::backfill_slice(&transaction, Duration::ZERO).unwrap()); + let cursor: String = transaction.query_row( + "SELECT value FROM meta WHERE key=?1", [format!("assistant_grant_authority_cursor/{GRANTED}")], |row| row.get(0) + ).unwrap(); + assert!(cursor.parse::().unwrap() > 0); + assert!(authority::ready(&transaction).is_err()); + transaction.commit().unwrap(); + } + // Reopen the durable connection before Store's startup continuation can finish it. + { + let mut connection = Connection::open(&path).unwrap(); + assert!(authority::ready(&connection).is_err()); + let remaining: u64 = connection.query_row("SELECT COUNT(*) FROM assistant_grant_authority", [], |row| row.get(0)).unwrap(); + assert_eq!(remaining, 1); + let mut slices = 0; + loop { + let transaction = connection.transaction().unwrap(); + let complete = authority::backfill_slice(&transaction, Duration::ZERO).unwrap(); + transaction.commit().unwrap(); + slices += 1; + if complete { break; } + assert!(slices < 200, "backfill failed to make durable forward progress"); + } + assert!(slices > 1); + assert_eq!(snapshot(&connection), expected); + let transaction = connection.transaction().unwrap(); + assert!(authority::backfill_slice(&transaction, Duration::ZERO).unwrap()); + assert_eq!(snapshot(&transaction), expected); + transaction.commit().unwrap(); + } + let reopened = Store::open(&path, "anchor", Arc::new(Plain)).unwrap(); + assert_eq!(snapshot(&reopened.readers.get()), expected); + assert_reference_and_rebuild(&reopened); + assert!(decisions(&reopened, 0).is_empty()); +} + +fn transition_cost(store: &Store, grant: &ClaimRecord) -> (String, i32, i32, usize) { + let connection = store.readers.get(); + let mut statement = connection.prepare(/* sqlite-large-value: allow-for-now lv-h611b5b2ef9a9 owner=smallclaims::store::assistant_grant_authority_tests TODO=trace-statement-and-value-representation */ authority::TRANSITION_QUERY).unwrap(); + let mut rows = statement.query(params![grant.subject, POLICY, grant.origin, grant.actor, grant.id]).unwrap(); + let mut records = Vec::new(); + while let Some(row) = rows.next().unwrap() { + records.push(row.get::<_, String>(0).unwrap()); + } + drop(rows); + let record: ClaimRecord = serde_json::from_str(&records[0]).unwrap(); + (record.id, statement.get_status(StatementStatus::VmStep), statement.get_status(StatementStatus::FullscanStep), records.len()) +} + +fn candidate_cost(store: &Store) -> (Vec, i32, i32) { + let connection = store.readers.get(); + let mut statement = connection.prepare(/* sqlite-large-value: allow-for-now lv-he990dace4c7d owner=smallclaims::store::assistant_grant_authority_tests TODO=trace-statement-and-value-representation */ authority::CANDIDATES_QUERY).unwrap(); + let mut rows = statement.query(params![ + "assistant/chatgpt", OWNER, format!("{:020}", 15000), + Option::::None, Option::::None + ]).unwrap(); + let mut ids = Vec::new(); + while let Some(row) = rows.next().unwrap() { + let record: String = row.get(0).unwrap(); + ids.push(serde_json::from_str::(&record).unwrap().id); + } + drop(rows); + (ids, statement.get_status(StatementStatus::VmStep), statement.get_status(StatementStatus::FullscanStep)) +} + +#[test] +fn malformed_and_unsigned_same_origin_flood_preserves_previous_authority_and_constant_reads() { + let (source, key) = source(); + let target = node("reader", Some(key.public())); + receive(&target, &export(&source, &target)); + let grant = append(&source, SUBJECT, GRANTED, fields()); + let mut valid = fields(); + valid["expires_at_unix_ms"] = json!(20000); + let policy = append(&source, SUBJECT, POLICY, valid); + receive(&target, &export(&source, &target)); + let before = transition_cost(&target, &grant); + assert_eq!(before.0, policy.id); + assert_eq!(before.2, 0); + assert_eq!(before.3, 1); + let candidate_before = candidate_cost(&target); + assert_eq!(candidate_before.0, vec![grant.id.clone()]); + assert_eq!(candidate_before.2, 0); + for count in [1, 128] { + for index in 0..count { + let mut malformed = fields(); + if index % 2 == 0 { malformed["issuer"] = json!("human/not-owner"); } + else { malformed["scopes"] = json!(["read.everything"]); } + append(&source, SUBJECT, POLICY, malformed); + } + // Malformed rows are genuinely signed by the correct same-origin member. + let mut malformed_rows = export(&source, &target); + // Do not accidentally deliver requested signatures for the earlier unsigned flood. + malformed_rows.signatures.clear(); + receive(&target, &malformed_rows); + for _ in 0..count { + let mut unauthenticated = fields(); + unauthenticated["expires_at_unix_ms"] = json!(30000); + append(&source, SUBJECT, POLICY, unauthenticated); + append(&source, SUBJECT, REVOKED, fields()); + } + let unsigned_rows = export(&source, &target); + receive_pre_projection_unsigned_history(&target, &unsigned_rows); + let after = transition_cost(&target, &grant); + assert_eq!(after, before, "same-origin flood changed selected authority or request VM/read cost at {count}"); + assert_eq!(candidate_cost(&target), candidate_before, "candidate request cost grew at {count}"); + assert!(decisions(&target, 15000).is_empty(), "pending revokes fence only this subject"); + assert_bearer_rejected(&target, &grant); + assert_reference_and_rebuild(&target); + } +} + +#[test] +fn duplicate_verified_signature_does_not_refresh_or_dirty_claims() { + let (source, key) = source(); + let target = node("reader", Some(key.public())); + let grant = append(&source, SUBJECT, GRANTED, fields()); + let exchange = export(&source, &target); + receive(&target, &exchange); + let signature = signatures(&exchange).signatures.into_iter().find(|signature| { + target.readers.get().query_row( + "SELECT EXISTS(SELECT 1 FROM replica_records WHERE claim_id=?1 AND sequence=?2)", + params![grant.id,signature.sequence], |row| row.get::<_,bool>(0)).unwrap() + }).unwrap(); + let mut connection = target.connection.write(); + // Any refresh would delete this sentinel. Abort that attempted write rather + // than merely checking the final projection, which might be unchanged. + connection.execute(/* sqlite-large-value: allow-for-now lv-hbf1fdaf2776a owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_dirty VALUES(?1)", [&grant.id]).unwrap(); + connection.execute_batch( + /* sqlite-large-value: allow-for-now lv-h9c6f8e69acbb owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "CREATE TEMP TRIGGER reject_duplicate_refresh BEFORE DELETE ON assistant_grant_dirty + BEGIN SELECT RAISE(ABORT,'duplicate refreshed authority'); END;", + ).unwrap(); + let transaction = connection.transaction().unwrap(); + assert_eq!(store_envelope_signature_tx( + &transaction,None,FLEET,&signature.writer,signature.sequence,&signature.hash, + &signature.member_key,&signature.signature,"1", + ).unwrap(), 0); + let dirty: usize = transaction.query_row("SELECT COUNT(*) FROM assistant_grant_dirty", [], |row| row.get(0)).unwrap(); + assert_eq!(dirty,1); + transaction.commit().unwrap(); + connection.execute_batch(/* sqlite-large-value: allow-for-now lv-h68996f133d87 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "DROP TRIGGER reject_duplicate_refresh; DELETE FROM assistant_grant_dirty;").unwrap(); + drop(connection); + assert_reference_and_rebuild(&target); +} + +#[test] +fn dirty_claim_flood_reserves_half_the_slice_for_other_maintenance() { + let store = node("issuer", None); + for index in 0..(authority::CLAIMS_PER_SLICE * 3 + 7) { + let mut invalid = fields(); + invalid["issuer"] = json!(format!("invalid/{index}")); + append(&store,SUBJECT,GRANTED,invalid); + } + drain_authority(&store); + let mut connection = store.connection.write(); + let markers = backfill_markers(&connection); + connection.execute(/* sqlite-large-value: allow-for-now lv-h4863c5bdfd48 owner=smallclaims::store::assistant_grant_authority_tests TODO=prepare-body-and-predecessor-values */ "INSERT INTO assistant_grant_dirty SELECT id FROM claims WHERE kind=?1", [GRANTED]).unwrap(); + let mut remaining = authority::CLAIMS_PER_SLICE * 3 + 7; + loop { + let transaction = connection.transaction().unwrap(); + let done = authority::backfill_slice(&transaction,Duration::from_secs(60)).unwrap(); + let after: usize = transaction.query_row("SELECT COUNT(*) FROM assistant_grant_dirty", [], |row| row.get(0)).unwrap(); + // Dirty authentication owns half the 64-unit slice; the other half + // remains available to proof withdrawals and membership additions. + assert_eq!(remaining-after, remaining.min(authority::CLAIMS_PER_SLICE.div_ceil(2))); + assert_eq!(backfill_markers(&transaction),markers,"completed history was rescanned"); + transaction.commit().unwrap(); + remaining = after; + if done { break; } + } + assert_eq!(remaining,0); +} + +fn authentication_key_cost(connection: &Connection, signature: &ReplicaEnvelopeSignature) -> (usize,i32,i32) { + let mut statement = connection.prepare(/* sqlite-large-value: allow-for-now lv-h418f3ec55f8d owner=smallclaims::store::assistant_grant_authority_tests TODO=trace-statement-and-value-representation */ authority::AUTHENTICATION_KEYS_QUERY).unwrap(); + let rows = statement.query_map( + params![signature.writer,signature.sequence,signature.hash,-1,"",authority::MEMBERSHIP_KEYS_PER_REFRESH], + |row| Ok((row.get::<_,String>(0)?,row.get::<_,Option>(1)?)), + ).unwrap().collect::>>().unwrap(); + (rows.len(),statement.get_status(StatementStatus::VmStep),statement.get_status(StatementStatus::FullscanStep)) +} + +#[test] +fn nonmember_signature_flood_has_constant_membership_first_vm_cost() { + let (source,key) = source(); + let target = node("reader",Some(key.public())); + receive(&target,&export(&source,&target)); + let grant = append(&source,SUBJECT,GRANTED,fields()); + let exchange = export(&source,&target); + receive_pre_projection_unsigned_history(&target, &exchange); + let signature = signatures(&exchange).signatures.into_iter().find(|signature| { + target.readers.get().query_row( + "SELECT EXISTS(SELECT 1 FROM replica_records WHERE claim_id=?1 AND sequence=?2)", + params![grant.id,signature.sequence], |row| row.get::<_,bool>(0)).unwrap() + }).unwrap(); + let mut connection = target.connection.write(); + let before = authentication_key_cost(&connection,&signature); + assert_eq!(before.0,1); + assert_eq!(before.2,0); + for count in [128,4096] { + for index in 0..count { + let mut nonmember = signature.clone(); + nonmember.member_key = format!("nonmember/{count}/{index:08}"); + nonmember.signature = "invalid".into(); + insert_raw_signature(&connection,&nonmember); + } + assert_eq!(authentication_key_cost(&connection,&signature),before, + "nonmember signature rows increased authentication VM work"); + let transaction = connection.transaction().unwrap(); + assert!(authority::backfill_slice(&transaction,Duration::from_secs(60)).unwrap()); + assert!(!authority::contains(&transaction,&grant.id).unwrap()); + transaction.commit().unwrap(); + } + // Real late evidence still verifies after the arbitrary-signature flood. + insert_raw_signature(&connection,&signature); + let transaction = connection.transaction().unwrap(); + assert!(authority::backfill_slice(&transaction,Duration::from_secs(60)).unwrap()); + assert!(authority::contains(&transaction,&grant.id).unwrap()); + transaction.commit().unwrap(); +} + +#[test] +fn eligible_evidence_beyond_first_key_page_resumes_and_cryptographically_verifies() { + let (source,key) = source(); + let target = node("reader",Some(key.public())); + receive(&target,&export(&source,&target)); + let grant = append(&source,SUBJECT,GRANTED,fields()); + let exchange = export(&source,&target); + receive_pre_projection_unsigned_history(&target, &exchange); + let signature = signatures(&exchange).signatures.into_iter().find(|signature| { + target.readers.get().query_row( + "SELECT EXISTS(SELECT 1 FROM replica_records WHERE claim_id=?1 AND sequence=?2)", + params![grant.id,signature.sequence], |row| row.get::<_,bool>(0)).unwrap() + }).unwrap(); + let mut connection = target.connection.write(); + let markers = backfill_markers(&connection); + // These deliberately malformed persisted proofs must not authenticate. + // Their eligible windows sort before the real member's key. + for index in 0..(authority::MEMBERSHIP_KEYS_PER_REFRESH*3+1) { + let mut invalid = signature.clone(); + invalid.member_key = format!("!{index:08}"); + invalid.signature = "invalid".into(); + connection.execute( + /* sqlite-large-value: allow-for-now lv-h02562e83e833 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_membership_windows VALUES(?1,?2,0,NULL)", + params![invalid.writer,invalid.member_key]).unwrap(); + insert_raw_signature(&connection,&invalid); + } + insert_raw_signature(&connection,&signature); + let cost = authentication_key_cost(&connection,&signature); + assert_eq!(cost.0,authority::MEMBERSHIP_KEYS_PER_REFRESH); + assert_eq!(cost.2,0); + let mut previous_key = String::new(); + for page in 0..4 { + let transaction = connection.transaction().unwrap(); + let done = authority::backfill_slice(&transaction,Duration::from_secs(60)).unwrap(); + assert_eq!(backfill_markers(&transaction),markers); + if page<3 { + assert!(!done,"invalid earlier evidence authenticated the claim"); + assert!(authority::ready(&transaction).is_ok()); + assert!(authority::subject_ready(&transaction, SUBJECT).is_err()); + assert!(authority::maintenance_pending(&transaction).unwrap()); + let cursor: String = transaction.query_row( + "SELECT member_key FROM assistant_grant_auth_cursor WHERE claim_id=?1", + [&grant.id], |row| row.get(0)).unwrap(); + assert!(cursor>previous_key,"authentication did not advance durably"); + previous_key = cursor; + let admitted: bool = transaction.query_row( + "SELECT authenticated FROM assistant_grant_pending WHERE claim_id=?1", [&grant.id], |row| row.get(0)).unwrap(); + assert!(!admitted); + } else { + assert!(done); + assert!(authority::contains(&transaction,&grant.id).unwrap()); + } + transaction.commit().unwrap(); + } +} + +#[test] +fn key_only_authentication_cursor_migration_requeues_without_trusting_old_position() { + let store = node("issuer",None); + let grant = append(&store,SUBJECT,GRANTED,fields()); + drain_authority(&store); + let connection = store.connection.write(); + connection.execute_batch( + /* sqlite-large-value: allow-for-now lv-h1ae4a2fcf40e owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "ALTER TABLE assistant_grant_auth_cursor DROP COLUMN membership_start;" + ).unwrap(); + connection.execute( + /* sqlite-large-value: allow-for-now lv-ha9371a8fef8c owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_auth_cursor VALUES(?1,9223372036854775807,9223372036854775807,'~stale')", + [&grant.id]).unwrap(); + authority::install(&connection,"issuer").unwrap(); + assert!(!connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_auth_cursor WHERE claim_id=?1)", + [&grant.id], |row| row.get::<_,bool>(0)).unwrap()); + assert!(connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_dirty WHERE claim_id=?1)", + [&grant.id], |row| row.get::<_,bool>(0)).unwrap(), + "migration must retain the interrupted authentication obligation"); + connection.execute( + /* sqlite-large-value: allow-for-now lv-hba715e11f267 owner=smallclaims::store::assistant_grant_authority_tests TODO=stage-generation-and-keyed-reclamation */ "INSERT INTO assistant_grant_auth_cursor VALUES(?1,7,9,'new-checkpoint',3)", + [&grant.id]).unwrap(); + authority::install(&connection,"issuer").unwrap(); + let cursor: (i64,i64,String,i64) = connection.query_row( + "SELECT position,record_rowid,member_key,membership_start FROM assistant_grant_auth_cursor WHERE claim_id=?1", + [&grant.id], |row| Ok((row.get(0)?,row.get(1)?,row.get(2)?,row.get(3)?))).unwrap(); + assert_eq!(cursor,(7,9,"new-checkpoint".into(),3), + "installing the current schema must preserve resumable work"); +} + +#[test] +fn expired_membership_windows_consume_bounded_pages_and_future_windows_stay_out_of_seek() { + let (source,key) = source(); + let target = node("reader",Some(key.public())); + receive(&target,&export(&source,&target)); + let grant = append(&source,SUBJECT,GRANTED,fields()); + let exchange = export(&source,&target); + receive_pre_projection_unsigned_history(&target, &exchange); + let signature = signatures(&exchange).signatures.into_iter().find(|signature| { + target.readers.get().query_row( + "SELECT EXISTS(SELECT 1 FROM replica_records WHERE claim_id=?1 AND sequence=?2)", + params![grant.id,signature.sequence], |row| row.get::<_,bool>(0)).unwrap() + }).unwrap(); + assert!(signature.sequence>0); + let mut connection = target.connection.write(); + // Put the real key after all expired windows by start, not member-key order. + connection.execute( + /* sqlite-large-value: allow-for-now lv-h06703a74a220 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "UPDATE assistant_grant_membership_windows SET start=?2 WHERE writer=?1 AND member_key=?3", + params![signature.writer,signature.sequence,signature.member_key]).unwrap(); + for index in 0..(authority::MEMBERSHIP_KEYS_PER_REFRESH*3+1) { + connection.execute( + /* sqlite-large-value: allow-for-now lv-h3bfdf85ceb51 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_membership_windows VALUES(?1,?2,0,0)", + params![signature.writer,format!("~expired/{index:08}")]).unwrap(); + } + insert_raw_signature(&connection,&signature); + let before = authentication_key_cost(&connection,&signature); + assert_eq!(before.0,authority::MEMBERSHIP_KEYS_PER_REFRESH); + assert_eq!(before.2,0); + for index in 0..4096 { + connection.execute( + /* sqlite-large-value: allow-for-now lv-h0e74c062c397 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_membership_windows VALUES(?1,?2,?3,NULL)", + params![signature.writer,format!("!future/{index:08}"),signature.sequence+1]).unwrap(); + } + assert_eq!(authentication_key_cost(&connection,&signature),before, + "future-only windows entered the candidate seek"); + let mut previous = (-1,String::new()); + for page in 0..4 { + let transaction = connection.transaction().unwrap(); + let done = authority::backfill_slice(&transaction,Duration::from_secs(60)).unwrap(); + if page<3 { + assert!(!done,"expired candidates must consume their own page budget"); + let cursor: (i64,String) = transaction.query_row( + "SELECT membership_start,member_key FROM assistant_grant_auth_cursor WHERE claim_id=?1", + [&grant.id], |row| Ok((row.get(0)?,row.get(1)?))).unwrap(); + assert!(cursor>previous,"window cursor did not advance monotonically"); + previous = cursor; + assert!(!authority::contains(&transaction,&grant.id).unwrap()); + } else { + assert!(done); + assert!(authority::contains(&transaction,&grant.id).unwrap()); + } + transaction.commit().unwrap(); + } + // The signature remains cryptographically valid, but an expired window + // must never authenticate it during a subsequent proof recheck. + connection.execute( + /* sqlite-large-value: allow-for-now lv-h64769f90bcc0 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "UPDATE assistant_grant_membership_windows SET start=0,end=0 WHERE writer=?1 AND member_key=?2", + params![signature.writer,signature.member_key]).unwrap(); + connection.execute( + /* sqlite-large-value: allow-for-now lv-h642b57ed2c8a owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT OR IGNORE INTO assistant_grant_proof_rechecks VALUES(?1)", [&grant.id]).unwrap(); + connection.execute( + /* sqlite-large-value: allow-for-now lv-hafd668e892ee owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT OR IGNORE INTO assistant_grant_dirty VALUES(?1)", [&grant.id]).unwrap(); + drop(connection); + drain_authority(&target); + assert!(!authority::contains(&target.readers.get(),&grant.id).unwrap(), + "an expired window authenticated a valid signature"); +} + +#[test] +fn membership_addition_receipt_flood_uses_the_same_fixed_refresh_budget() { + let (source,key) = source(); + let target = node("reader",Some(key.public())); + receive(&target,&export(&source,&target)); + for _ in 0..(authority::CLAIMS_PER_SLICE*2+7) { + append(&source,SUBJECT,GRANTED,fields()); + } + receive_pre_projection_unsigned_history(&target, &export(&source,&target)); + let mut connection = target.connection.write(); + let markers = backfill_markers(&connection); + connection.execute( + /* sqlite-large-value: allow-for-now lv-h00986dca7a94 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_additions(writer,member_key,lower_sequence,upper_sequence) + VALUES('anchor',?1,0,9223372036854775807)", [key.public()], + ).unwrap(); + connection.execute_batch( + /* sqlite-large-value: allow-for-now lv-h49244ed4f44b owner=smallclaims::store::assistant_grant_authority_tests TODO=chunk-or-reference-variable-columns */ "CREATE TEMP TABLE refreshed_items (claim_id TEXT); + CREATE TEMP TRIGGER count_membership_refresh AFTER UPDATE ON assistant_grant_additions + BEGIN INSERT INTO refreshed_items VALUES(NEW.sequence); END;", + ).unwrap(); + let transaction = connection.transaction().unwrap(); + assert!(!authority::backfill_slice(&transaction,Duration::from_secs(60)).unwrap()); + let refreshed: usize = transaction.query_row( + "SELECT COUNT(*) FROM refreshed_items", [], |row| row.get(0)).unwrap(); + assert_eq!(refreshed,authority::CLAIMS_PER_SLICE); + assert!(authority::ready(&transaction).is_ok()); + assert!(authority::subject_ready(&transaction, SUBJECT).is_err()); + assert!(authority::maintenance_pending(&transaction).unwrap()); + assert_eq!(backfill_markers(&transaction),markers); + transaction.commit().unwrap(); + drop(connection); + drain_authority(&target); + assert!(decisions(&target,0).is_empty(),"unsigned pending grants acquired authority"); +} + +#[test] +fn late_signature_restarts_an_in_progress_key_cursor_before_its_old_position() { + let (source,key) = source(); + let target = node("reader",Some(key.public())); + receive(&target,&export(&source,&target)); + let grant = append(&source,SUBJECT,GRANTED,fields()); + let exchange = export(&source,&target); + receive_pre_projection_unsigned_history(&target, &exchange); + let signature = signatures(&exchange).signatures.into_iter().find(|signature| { + target.readers.get().query_row( + "SELECT EXISTS(SELECT 1 FROM replica_records WHERE claim_id=?1 AND sequence=?2)", + params![grant.id,signature.sequence], |row| row.get::<_,bool>(0)).unwrap() + }).unwrap(); + let mut connection = target.connection.write(); + let member_start: u64 = connection.query_row( + "SELECT start FROM assistant_grant_membership_windows WHERE writer=?1 AND member_key=?2", + params![signature.writer,signature.member_key], |row| row.get(0), + ).unwrap(); + // The cursor now orders by (window start,key), not key alone. Keep these + // windows in the same start range so the genuine key precedes the cursor. + for index in 0..(authority::MEMBERSHIP_KEYS_PER_REFRESH*2) { + connection.execute( + /* sqlite-large-value: allow-for-now lv-h3135f9c18750 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_membership_windows VALUES(?1,?2,?3,NULL)", + params![signature.writer,format!("~{index:08}"),member_start]).unwrap(); + } + connection.execute(/* sqlite-large-value: allow-for-now lv-h403d59b4d3b8 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_dirty VALUES(?1)", [&grant.id]).unwrap(); + let transaction = connection.transaction().unwrap(); + assert!(!authority::backfill_slice(&transaction,Duration::from_secs(60)).unwrap()); + let cursor: String = transaction.query_row( + "SELECT member_key FROM assistant_grant_auth_cursor WHERE claim_id=?1", + [&grant.id], |row| row.get(0)).unwrap(); + assert!(cursor>signature.member_key); + transaction.commit().unwrap(); + insert_raw_signature(&connection,&signature); + let cursors: usize = connection.query_row( + "SELECT COUNT(*) FROM assistant_grant_auth_cursor WHERE claim_id=?1", + [&grant.id], |row| row.get(0)).unwrap(); + assert_eq!(cursors,0,"new evidence did not invalidate the earlier search position"); + let transaction = connection.transaction().unwrap(); + assert!(authority::backfill_slice(&transaction,Duration::from_secs(60)).unwrap()); + assert!(authority::contains(&transaction,&grant.id).unwrap()); + transaction.commit().unwrap(); +} + +#[test] +fn envelope_record_arriving_before_auth_cursor_restarts_preexisting_signature_search() { + let (source,key) = source(); + let target = node("reader",Some(key.public())); + receive(&target,&export(&source,&target)); + let grant = append(&source,SUBJECT,GRANTED,fields()); + let exchange = export(&source,&target); + receive_pre_projection_unsigned_history(&target, &exchange); + let signature = signatures(&exchange).signatures.into_iter().find(|signature| { + target.readers.get().query_row( + "SELECT EXISTS(SELECT 1 FROM replica_records WHERE claim_id=?1 AND sequence=?2)", + params![grant.id,signature.sequence], |row| row.get::<_,bool>(0)).unwrap() + }).unwrap(); + let mut connection = target.connection.write(); + // Keep an unsigned later-position copy, leaving the signed envelope with + // no attached claim record when its signature arrives. + connection.execute( + /* sqlite-large-value: allow-for-now lv-h664aa3828314 owner=smallclaims::store::assistant_grant_authority_tests TODO=chunk-or-reference-exact-wire-values */ "INSERT INTO replica_envelopes + SELECT writer,sequence,'decoy-envelope',previous_hash,accepted_at_unix_ms, + payload,batch_id,relay,receipt_state,validation_error,received_at_unix_ms + FROM replica_envelopes WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3", + params![signature.writer,signature.sequence,signature.hash]).unwrap(); + connection.execute( + /* sqlite-large-value: allow-for-now lv-h1c051df8af17 owner=smallclaims::store::assistant_grant_authority_tests TODO=chunk-or-reference-exact-wire-values */ "UPDATE replica_records SET envelope_hash='decoy-envelope',position=1 WHERE claim_id=?1", + [&grant.id]).unwrap(); + for index in 0..(authority::MEMBERSHIP_KEYS_PER_REFRESH*2) { + connection.execute( + /* sqlite-large-value: allow-for-now lv-hec4dd1196f81 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_membership_windows VALUES(?1,?2,0,NULL)", + params![signature.writer,format!("~{index:08}")]).unwrap(); + } + connection.execute(/* sqlite-large-value: allow-for-now lv-hcd2447942ecb owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT OR IGNORE INTO assistant_grant_dirty VALUES(?1)", [&grant.id]).unwrap(); + let transaction = connection.transaction().unwrap(); + assert!(!authority::backfill_slice(&transaction,Duration::from_secs(60)).unwrap()); + let position: i64 = transaction.query_row( + "SELECT position FROM assistant_grant_auth_cursor WHERE claim_id=?1", + [&grant.id], |row| row.get(0)).unwrap(); + assert_eq!(position,1); + transaction.commit().unwrap(); + insert_raw_signature(&connection,&signature); + let cursors: usize = connection.query_row( + "SELECT COUNT(*) FROM assistant_grant_auth_cursor WHERE claim_id=?1", + [&grant.id], |row| row.get(0)).unwrap(); + assert_eq!(cursors,1,"signature unexpectedly had a linked claim record"); + let transaction = connection.transaction().unwrap(); + transaction.execute( + /* sqlite-large-value: allow-for-now lv-h74c78298f3cf owner=smallclaims::store::assistant_grant_authority_tests TODO=chunk-or-reference-exact-wire-values */ "INSERT INTO replica_records + (record_ref,writer,sequence,envelope_hash,position,raw,state,claim_id,updated_at_unix_ms) + SELECT 'earlier-signed-record',writer,sequence,?2,0,raw,'valid',claim_id,'0' + FROM replica_records WHERE claim_id=?1", + params![grant.id,signature.hash]).unwrap(); + authority::refresh_envelope(&transaction,&signature.writer,signature.sequence,&signature.hash).unwrap(); + let cursor_exists: bool = transaction.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_auth_cursor WHERE claim_id=?1)", + [&grant.id], |row| row.get(0), + ).unwrap(); + assert!(!cursor_exists, "new earlier evidence must restart its authentication cursor"); + transaction.commit().unwrap(); + drop(connection); + drain_authority(&target); + assert!(authority::contains(&target.readers.get(),&grant.id).unwrap(), + "the earlier signed record was hidden behind the old position/key cursor"); +} + +fn independent_grant(store: &Store) -> ClaimRecord { + let suffix = "fedcba9876543210fedcba98"; + let mut independent = fields(); + independent["grant_id"] = json!(format!("assistant-grant/{suffix}")); + independent["session_actor"] = json!(format!("assistant/chatgpt/session/assistant-grant/{suffix}")); + independent["credential_hash"] = json!("b".repeat(64)); + append(store, &format!("custom/client/assistant-v1-{suffix}"), GRANTED, independent) +} + +fn assert_subject_fenced(connection: &Connection, grant: &ClaimRecord, independent: &ClaimRecord) { + authority::ready(connection).unwrap(); + assert!(authority::subject_ready(connection, &grant.subject).is_err()); + assert!(!authority::contains(connection, &grant.id).unwrap()); + assert!(authority::by_credential(connection, grant.body["fields"]["credential_hash"].as_str().unwrap()).unwrap().is_none()); + assert!(authority::latest(connection, &grant.subject, GRANTED).is_err()); + for kind in [POLICY, REVOKED] { + assert!(authority::transition(connection, grant, kind).is_err()); + } + authority::subject_ready(connection, &independent.subject).unwrap(); + assert!(authority::contains(connection, &independent.id).unwrap()); + assert_eq!(authority::by_credential(connection, independent.body["fields"]["credential_hash"].as_str().unwrap()).unwrap().unwrap().id, independent.id); + assert_eq!(authority::latest(connection, &independent.subject, GRANTED).unwrap().unwrap().id, independent.id); + for kind in [POLICY, REVOKED] { + assert!(authority::transition(connection, independent, kind).unwrap().is_none()); + } + for cutoff in [Some(0), None] { + let candidates = authority::candidates(connection, "assistant/chatgpt", OWNER, cutoff, None, None).unwrap(); + // Conflict snapshots retain this authenticated witness even while its + // own credential is fenced; a pending revoke cannot clear a conflict. + assert_eq!(candidates.iter().map(|claim| claim.id.as_str()).collect::>(), + BTreeSet::from([grant.id.as_str(), independent.id.as_str()])); + } +} + +#[test] +fn dirty_and_auth_cursor_work_fence_only_their_subject_on_every_read_path() { + let store = node("issuer", None); + let grant = append(&store, SUBJECT, GRANTED, fields()); + let independent = independent_grant(&store); + drain_authority(&store); + let connection = store.connection.write(); + connection.execute(/* sqlite-large-value: allow-for-now lv-hf6ea61b38c5c owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_dirty VALUES(?1)", [&grant.id]).unwrap(); + assert!(authority::maintenance_pending(&connection).unwrap()); + assert_subject_fenced(&connection, &grant, &independent); + connection.execute(/* sqlite-large-value: allow-for-now lv-h7494541ec904 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_dirty WHERE claim_id=?1", [&grant.id]).unwrap(); + connection.execute( + /* sqlite-large-value: allow-for-now lv-h5b218f4cabfc owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_auth_cursor(claim_id,position,record_rowid,member_key,membership_start) VALUES(?1,0,0,'',-1)", + [&grant.id], + ).unwrap(); + assert_subject_fenced(&connection, &grant, &independent); + connection.execute(/* sqlite-large-value: allow-for-now lv-h15542ec4c6ea owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1", [&grant.id]).unwrap(); + assert!(authority::contains(&connection, &grant.id).unwrap()); +} + +#[test] +fn unsigned_pending_revoke_fences_only_its_established_subject_after_dirty_work_drains() { + let (source, key) = source(); + let target = node("reader", Some(key.public())); + let grant = append(&source, SUBJECT, GRANTED, fields()); + receive(&target, &export(&source, &target)); + let independent = independent_grant(&target); + let revoke = append(&source, SUBJECT, REVOKED, fields()); + let exchange = export(&source, &target); + receive_pre_projection_unsigned_history(&target, &exchange); + drain_authority(&target); + { + let connection = target.readers.get(); + assert!(!authority::maintenance_pending(&connection).unwrap()); + let authenticated: bool = connection.query_row( + "SELECT authenticated FROM assistant_grant_pending WHERE claim_id=?1", + [&revoke.id], |row| row.get(0), + ).unwrap(); + assert!(!authenticated); + assert_subject_fenced(&connection, &grant, &independent); + } + receive(&target, &signatures(&exchange)); + let connection = target.readers.get(); + authority::subject_ready(&connection, SUBJECT).unwrap(); + assert_eq!(authority::transition(&connection, &grant, REVOKED).unwrap().unwrap().id, revoke.id); + assert_eq!(decisions(&target, 0), vec![independent.id]); +} + +#[test] +fn subject_readiness_seeks_only_its_indexed_obligations_with_large_unrelated_queues() { + let store = node("issuer", None); + let grant = append(&store, SUBJECT, GRANTED, fields()); + let independent = independent_grant(&store); + drain_authority(&store); + let connection = store.connection.write(); + connection.execute( + /* sqlite-large-value: allow-for-now lv-h5df4dd1dd74d owner=smallclaims::store::assistant_grant_authority_tests TODO=chunk-or-reference-exact-wire-values */ "UPDATE assistant_grant_pending SET auth_member_key='lost-key',auth_sequence=7, + auth_envelope_hash='proof' WHERE claim_id=?1", [&grant.id], + ).unwrap(); + connection.execute( + /* sqlite-large-value: allow-for-now lv-hc91d2f57cab1 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_retractions(writer,member_key,lower_sequence,upper_sequence) + VALUES(?1,'lost-key',7,7)", [&grant.origin], + ).unwrap(); + let cost = |subject: &str| { + let mut statement = connection.prepare(/* sqlite-large-value: allow-for-now lv-hb30e13c4dc6f owner=smallclaims::store::assistant_grant_authority_tests TODO=trace-statement-and-value-representation */ authority::SUBJECT_PENDING_QUERY).unwrap(); + let pending: bool = statement.query_row(/* sqlite-large-value: allow-for-now lv-hade54ba19418 owner=smallclaims::store::assistant_grant_authority_tests TODO=trace-statement-and-value-representation */ [subject], |row| row.get(0)).unwrap(); + (pending,statement.get_status(StatementStatus::VmStep), + statement.get_status(StatementStatus::FullscanStep)) + }; + let fenced = cost(&grant.subject); + let clean = cost(&independent.subject); + assert!(fenced.0); + assert!(!clean.0); + assert_eq!(fenced.2,0); + assert_eq!(clean.2,0); + for index in 0..4096 { + let writer = format!("unrelated-{index}"); + connection.execute( + /* sqlite-large-value: allow-for-now lv-hb8b541534641 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_retractions(writer,member_key,lower_sequence,upper_sequence) + VALUES(?1,'lost-key',0,100)", [&writer], + ).unwrap(); + connection.execute( + /* sqlite-large-value: allow-for-now lv-h77dca66dd9fc owner=smallclaims::store::assistant_grant_authority_tests TODO=chunk-or-reference-exact-wire-values */ "INSERT INTO assistant_grant_proof_invalidations(writer,sequence,envelope_hash,member_key) + VALUES(?1,7,'proof','lost-key')", [&writer], + ).unwrap(); + } + assert_eq!(cost(&grant.subject),fenced); + assert_eq!(cost(&independent.subject),clean); +} + +#[test] +fn legacy_membership_dirty_obligations_migrate_idempotently_to_verifier_rechecks() { + let (source,key) = source(); + let target = node("reader",Some(key.public())); + receive(&target,&export(&source,&target)); + let grant = append(&source,SUBJECT,GRANTED,fields()); + receive_pre_projection_unsigned_history(&target,&export(&source,&target)); + let connection = target.connection.write(); + connection.execute_batch( + /* sqlite-large-value: allow-for-now lv-h64bd448a0436 owner=smallclaims::store::assistant_grant_authority_tests TODO=chunk-or-reference-variable-columns */ "CREATE TABLE assistant_grant_membership_dirty ( + writer TEXT PRIMARY KEY, sequence INTEGER NOT NULL, claim_id TEXT NOT NULL);" + ).unwrap(); + connection.execute( + /* sqlite-large-value: allow-for-now lv-h8ae28328b54c owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_membership_dirty VALUES(?1,-1,'')", [&grant.origin], + ).unwrap(); + for _ in 0..2 { + authority::install(&connection,"reader").unwrap(); + assert!(!connection.query_row( + "SELECT EXISTS(SELECT 1 FROM sqlite_master WHERE name='assistant_grant_membership_dirty')", + [], |row| row.get::<_,bool>(0), + ).unwrap()); + assert!(connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_proof_rechecks WHERE claim_id=?1)", + [&grant.id], |row| row.get::<_,bool>(0), + ).unwrap()); + assert!(connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_auth_work WHERE writer=?1 AND claim_id=?2)", + params![grant.origin,grant.id], |row| row.get::<_,bool>(0), + ).unwrap()); + assert!(authority::subject_ready(&connection,SUBJECT).is_err()); + } +} + +#[test] +fn auth_work_set_is_idempotent_under_outer_upsert_conflict_policy() { + let store = node("issuer",None); + let grant = append(&store,SUBJECT,GRANTED,fields()); + drain_authority(&store); + let connection = store.connection.write(); + for _ in 0..2 { + connection.execute( + /* sqlite-large-value: allow-for-now lv-h5ae439b456a4 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_auth_cursor(claim_id,position,record_rowid,member_key,membership_start) + VALUES(?1,0,0,'',-1) ON CONFLICT(claim_id) DO UPDATE SET position=excluded.position", + [&grant.id], + ).unwrap(); + connection.execute( + /* sqlite-large-value: allow-for-now lv-hef325d41f3b7 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_proof_rechecks VALUES(?1) + ON CONFLICT(claim_id) DO UPDATE SET claim_id=excluded.claim_id", [&grant.id], + ).unwrap(); + assert_eq!(connection.query_row( + "SELECT COUNT(*) FROM assistant_grant_auth_work WHERE claim_id=?1", + [&grant.id], |row| row.get::<_,usize>(0), + ).unwrap(),1); + } + connection.execute(/* sqlite-large-value: allow-for-now lv-h32d93849d196 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1", [&grant.id]).unwrap(); + assert_eq!(connection.query_row( + "SELECT COUNT(*) FROM assistant_grant_auth_work WHERE claim_id=?1", + [&grant.id], |row| row.get::<_,usize>(0), + ).unwrap(),1,"another durable obligation still needs this claim"); + connection.execute(/* sqlite-large-value: allow-for-now lv-ha57a171023e8 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "DELETE FROM assistant_grant_proof_rechecks WHERE claim_id=?1", [&grant.id]).unwrap(); + assert_eq!(connection.query_row( + "SELECT COUNT(*) FROM assistant_grant_auth_work WHERE claim_id=?1", + [&grant.id], |row| row.get::<_,usize>(0), + ).unwrap(),0); +} + +#[test] +fn dirty_work_before_saved_round_robin_cursor_is_serviced_in_the_same_slice() { + let store = node("issuer",None); + let grant = append(&store,SUBJECT,GRANTED,fields()); + drain_authority(&store); + let mut connection = store.connection.write(); + connection.execute( + /* sqlite-large-value: allow-for-now lv-h74200cad8b0c owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT OR REPLACE INTO meta(key,value) VALUES('assistant_grant_dirty_cursor',?1)", + [format!("{}z",grant.id)], + ).unwrap(); + connection.execute(/* sqlite-large-value: allow-for-now lv-hb7abee1d3c34 owner=smallclaims::store::assistant_grant_authority_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_dirty VALUES(?1)", [&grant.id]).unwrap(); + let transaction = connection.transaction().unwrap(); + assert!(authority::backfill_slice(&transaction,Duration::from_secs(60)).unwrap()); + assert!(authority::contains(&transaction,&grant.id).unwrap()); + transaction.commit().unwrap(); +} + +/* sqlite-large-value: allow-for-now lv-h70e364d23629 owner=smallclaims::store::assistant_grant_authority_tests TODO=trace-statement-and-value-representation */ include!("assistant_grant_receipt_cost_tests.rs"); + +#[path = "assistant_grant_membership_property_tests.rs"] +mod membership_property_tests; diff --git a/crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs b/crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs new file mode 100644 index 00000000000..70eaac2bbe3 --- /dev/null +++ b/crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs @@ -0,0 +1,1293 @@ +//! Real-envelope event properties. Expected windows always come from a fresh raw fleet fold. +use super::*; + +type Windows = BTreeMap<(String, String), (u64, Option)>; + +fn windows(membership: &crate::fleet::Membership) -> Windows { + membership.incarnations().map(|member| ( + (member.name.clone(), member.member_key.clone()), (member.start, member.end), + )).collect() +} + +fn projection_rows(connection: &Connection) -> [Vec>; 3] { + [ + "SELECT * FROM assistant_grant_authority ORDER BY claim_id,base_claim_id", + "SELECT claim_id,grant_subject,kind,origin,actor,sequence,authenticated,record + FROM assistant_grant_pending ORDER BY claim_id", + "SELECT * FROM assistant_grant_effective ORDER BY claim_id", + ].map(|query| { + let mut statement = connection.prepare(/* sqlite-large-value: allow-for-now lv-hfff109a32004 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=trace-statement-and-value-representation */ query).unwrap(); + let columns = statement.column_count(); + statement.query_map([], |row| (0..columns).map(|index| row.get(index)).collect()) + .unwrap().collect::>().unwrap() + }) +} + +// Only wire validation is shared with production. Authentication comes from raw +// provenance and durable local admission; attachment/latest/revocation are a +// separate Rust fold, never a projection query or a backfill invocation. +fn oracle_pending_valid(claim: &ClaimRecord) -> bool { + let fields = &claim.body["fields"]; + let principal = fields.get("principal").and_then(Value::as_str).unwrap_or("assistant/chatgpt"); + let profile = fields.get("profile").and_then(Value::as_str).unwrap_or("assistant"); + let Some(id) = fields["grant_id"].as_str() else { return false; }; + let suffix = id.strip_prefix("assistant-grant/").unwrap_or(id); + let identity = fields.is_object() + && fields.get("principal").is_none_or(|value| value.as_str().is_some()) + && fields.get("profile").is_none_or(|value| value.as_str().is_some()) + && matches!(principal, "assistant/chatgpt" | "assistant/mcp") + && matches!(profile, "assistant" | "service") + && suffix.len() == 24 && suffix.bytes().all(|byte| byte.is_ascii_hexdigit()) + && claim.subject.strip_prefix("custom/client/assistant-v1-") == Some(suffix) + && claim.actor.as_deref().is_some_and(|actor| fields["issuer"].as_str() == Some(actor)); + let digest = |value: &Value| value.as_str().is_some_and(|text| + text.len() == 64 && text.bytes().all(|byte| byte.is_ascii_hexdigit())); + if !identity { return false; } + match claim.kind.as_str() { + GRANTED => fields.get("credential").is_none() && fields.get("code").is_none() + && digest(&fields["credential_hash"]) + && fields.get("code_hash").is_none_or(digest), + POLICY => { + // A policy need not carry a credential. Supply one only on its + // synthetic base to ask the shared structural validator about it. + let mut base = claim.clone(); + base.body["fields"]["credential_hash"] = json!("0".repeat(64)); + base.body["fields"].as_object_mut().unwrap().remove("credential"); + base.body["fields"].as_object_mut().unwrap().remove("code"); + base.body["fields"].as_object_mut().unwrap().remove("code_hash"); + authority::structurally_valid(&base, claim) + } + REVOKED => true, + _ => false, + } +} + +fn assert_raw_projection_oracle(store: &Store, expected_windows: &Windows, context: &str) { + let claims = raw_claims(store); + let connection = store.readers.get(); + let local_ids: std::collections::BTreeSet = connection.prepare( + "SELECT claim_id FROM assistant_grant_local_appends", + ).unwrap().query_map([], |row| row.get(0)).unwrap() + .collect::>().unwrap(); + let pending: Vec<_> = claims.iter().filter(|claim| oracle_pending_valid(claim)) + .map(|claim| { + let authenticated = (claim.origin == store.origin && local_ids.contains(&claim.id)) + || store.claim_has_authenticated_member_writer(&claim.id).unwrap(); + (claim, authenticated) + }).collect(); + let mut expected_pending: Vec<_> = pending.iter().map(|(claim, authenticated)| + (claim.id.clone(), *authenticated)).collect(); + expected_pending.sort(); + let actual_pending: Vec<(String, bool)> = connection.prepare( + "SELECT claim_id,authenticated FROM assistant_grant_pending ORDER BY claim_id", + ).unwrap().query_map([], |row| Ok((row.get(0)?,row.get(1)?))).unwrap() + .collect::>().unwrap(); + assert_eq!(actual_pending, expected_pending, "raw pending/authentication fold: {context}"); + for (claim, trusted) in &pending { + let (key, sequence, hash, position): (Option, Option, Option, Option) = + connection.query_row( + "SELECT auth_member_key,auth_sequence,auth_envelope_hash,auth_record_position + FROM assistant_grant_pending WHERE claim_id=?1", + [&claim.id], |row| Ok((row.get(0)?,row.get(1)?,row.get(2)?,row.get(3)?)), + ).unwrap(); + if !trusted { + assert_eq!((key, sequence, hash, position), (None, None, None, None), + "unauthenticated row retained a proof: {context}"); + continue; + } + if claim.origin == store.origin && local_ids.contains(&claim.id) { + assert_eq!((key, sequence, hash, position), (None, None, None, None), + "local admission is not a remote proof"); + continue; + } + let key = key.expect("authenticated remote row must record its verified key"); + let sequence = sequence.expect("authenticated remote row must record its proof sequence"); + let hash = hash.expect("authenticated remote row must record its proof envelope"); + let position = position.expect("authenticated remote row must record its proof record position"); + let (start, end) = expected_windows.get(&(claim.origin.clone(), key.clone())) + .expect("recorded proof key must remain in fresh fleet membership"); + assert!(sequence >= *start && end.is_none_or(|end| sequence <= end), + "recorded proof lost fresh window coverage: {context}"); + let fleet_id = fleet_meta(&connection, "assistant_grant_authority_fleet_id").unwrap().unwrap(); + let shard = fleet_meta(&connection, "shard_id").unwrap(); + let evidence: Vec = connection.prepare( + "SELECT signatures.signature FROM replica_records AS records + JOIN replica_envelopes AS envelopes USING(writer,sequence,envelope_hash) + JOIN replica_envelope_signatures AS signatures USING(writer,sequence,envelope_hash) + WHERE records.claim_id=?1 AND records.writer=?2 AND records.sequence=?3 + AND signatures.member_key=?4 AND records.state='valid' + AND records.envelope_hash=?5 AND records.position=?6 + AND envelopes.receipt_state IN ('validated','degraded')", + ).unwrap().query_map(params![claim.id,claim.origin,sequence,key,hash,position], + |row| row.get(0)).unwrap() + .collect::>().unwrap(); + assert!(evidence.iter().any(|signature| + VerifiedEnvelopeSignature::verify(shard.as_deref(), &fleet_id, &claim.origin, + sequence, &hash, &key, signature).is_some()), + "recorded proof was not actually verified: {context}"); + } + + let authenticated: Vec<_> = pending.iter().filter_map(|(claim, trusted)| + trusted.then_some(*claim)).collect(); + let text = |value: &str| SqlValue::Text(value.to_owned()); + let optional_text = |value: Option<&str>| value.map_or(SqlValue::Null, |value| text(value)); + let mut expected_authority = Vec::new(); + let mut expected_effective = Vec::new(); + for grant in authenticated.iter().copied().filter(|claim| claim.kind == GRANTED) { + let transitions: Vec<_> = authenticated.iter().copied().filter(|claim| + claim.kind != GRANTED && authority::transition_valid(grant, claim)).collect(); + let selected_policy = transitions.iter().copied().filter(|claim| claim.kind == POLICY) + .max_by_key(|claim| claim.store_index); + let base_attached = authority::structurally_valid(grant, grant) || selected_policy.is_some(); + for claim in base_attached.then_some(grant).into_iter().chain(transitions.iter().copied()) { + let fields = &claim.body["fields"]; + expected_authority.push(vec![ + text(&claim.id), text(&grant.id), text(&claim.subject), text(&claim.kind), + text(&claim.origin), optional_text(claim.actor.as_deref()), + text(fields["principal"].as_str().unwrap_or("assistant/chatgpt")), + text(fields["profile"].as_str().unwrap_or("assistant")), + text(&format!("{:020}", fields["expires_at_unix_ms"].as_u64().unwrap_or(0))), + SqlValue::Integer(claim.store_index as i64), + optional_text((claim.kind == GRANTED).then(|| fields["credential_hash"].as_str()).flatten()), + text(&serde_json::to_string(claim).unwrap()), + ]); + } + let policy = selected_policy.unwrap_or(grant); + if !authority::structurally_valid(grant, policy) { continue; } + let fields = &policy.body["fields"]; + expected_effective.push(vec![ + text(&grant.id), text(&grant.subject), + text(fields["principal"].as_str().unwrap_or("assistant/chatgpt")), + optional_text(grant.actor.as_deref()), + text(fields["profile"].as_str().unwrap_or("assistant")), + text(&format!("{:020}", fields["expires_at_unix_ms"].as_u64().unwrap())), + SqlValue::Integer(i64::from(transitions.iter().any(|claim| claim.kind == REVOKED))), + text(&serde_json::to_string(grant).unwrap()), + ]); + } + let row_key = |row: &Vec| { + let SqlValue::Text(claim_id) = &row[0] else { unreachable!() }; + let SqlValue::Text(base_id) = &row[1] else { unreachable!() }; + (claim_id.clone(), base_id.clone()) + }; + expected_authority.sort_by_key(row_key); + expected_effective.sort_by_key(row_key); + let [actual_authority, _, actual_effective] = projection_rows(&connection); + assert_eq!(actual_authority, expected_authority, "raw authority fold: {context}"); + assert_eq!(actual_effective, expected_effective, "raw effective fold: {context}"); +} + +// Recreate the projection from the same raw evidence, then roll it back. In +// particular, never seed the oracle with cached authenticated pending flags. +fn assert_fresh_backfill(store: &Store, expected_windows: &Windows, context: &str) { + let mut connection = store.connection.write(); + let actual = projection_rows(&connection); + let transaction = connection.transaction().unwrap(); + reset_projection(&transaction); + for ((writer, key), (start, end)) in expected_windows { + transaction.execute( + /* sqlite-large-value: allow-for-now lv-hbb32eb74d7c6 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_membership_windows VALUES(?1,?2,?3,?4)", + params![writer,key,start,end], + ).unwrap(); + } + transaction.execute( + /* sqlite-large-value: allow-for-now lv-h268eaf45d33c owner=smallclaims::store::assistant_grant_membership_property_tests TODO=bound-or-reference-values-and-reclamation */ "UPDATE assistant_grant_membership_state SET applied_generation=?1 WHERE id=1", + [fleet_generation(&transaction).unwrap()], + ).unwrap(); + while !authority::backfill_slice(&transaction, Duration::from_secs(1)).unwrap() {} + assert_eq!(actual, projection_rows(&transaction), + "authority, pending authentication, or effective rows differ from fresh backfill: {context}"); + transaction.rollback().unwrap(); +} + +fn assert_windows(store: &Store, authority_store: &Store, context: &str) { + drain_authority(store); + // Do not reuse the projection's preparation/diff helper, nor its membership cache. + let expected = windows(&fleet_membership_tx(&authority_store.readers.get()).unwrap()); + assert_eq!(windows(&authority_store.fleet_membership_sealed().unwrap()), expected, "sealed fold: {context}"); + let actual: Windows = store.readers.get().prepare( + "SELECT writer,member_key,start,end FROM assistant_grant_membership_windows ORDER BY writer,member_key", + ).unwrap().query_map([], |row| Ok(((row.get(0)?, row.get(1)?), (row.get(2)?, row.get(3)?)))) + .unwrap().collect::>().unwrap(); + assert_eq!(actual, expected, "persisted membership: {context}"); + assert_raw_projection_oracle(store, &expected, context); + assert_fresh_backfill(store, &expected, context); +} + +// Same deterministic xorshift generator as the existing event-permutation regression. +// Fixed seeds make every failing mutation/order reproducible without external RNG state. +fn next(state: &mut u64) -> u64 { + *state ^= *state << 13; + *state ^= *state >> 7; + *state ^= *state << 17; + *state +} + +fn shuffle(values: &mut [T], state: &mut u64) { + for index in (1..values.len()).rev() { + let selected = (next(state) % (index as u64 + 1)) as usize; + values.swap(index, selected); + } +} + +#[test] +fn seeded_membership_events_match_fresh_fleet_fold_after_every_event() { + for seed in 1..=8_u64 { + let (source, anchor) = source(); + let target = node("reader", Some(anchor.public())); + for index in 0..6 { + let member = MemberKey::generate().unwrap().0; + append(&source, &format!("host/member-{index}"), "fleet.member-admitted", json!({ + "member_key": member.public(), "via": "member", "sponsor": "anchor", + "writer_floor": index, "mode": "listening" + })); + source.seal_local_batches().unwrap(); + } + append(&source, SUBJECT, GRANTED, fields()); + let exchange = export(&source, &target); + let proofs: Vec<_> = signatures(&exchange).signatures.into_iter().filter(|proof| { + source.readers.get().query_row( + "SELECT EXISTS(SELECT 1 FROM batches JOIN claims ON claims.batch_id=batches.id + WHERE batches.origin=?1 AND batches.replica_sequence=?2 AND claims.kind='fleet.member-admitted')", + params![proof.writer,proof.sequence], |row| row.get::<_,bool>(0), + ).unwrap() + }).collect(); + let mut events = Vec::new(); + for envelope in &exchange.envelopes { + let mut single = exchange.clone(); + single.envelopes = vec![envelope.clone()]; + single.signatures.clear(); + events.push(unsigned(&single)); + events.push(signatures(&single)); + } + let mut state = seed; + shuffle(&mut events, &mut state); + // On alternating seeds force anchor authentication after every admission/grant. + // Other seeds freely allow signatures before envelopes and admission records. + if seed % 2 == 0 { + let anchor_sequence = exchange.envelopes.iter().map(|e| e.sequence).min().unwrap(); + let position = events.iter().position(|event| + event.envelopes.is_empty() && event.signatures.iter().any(|proof| proof.sequence == anchor_sequence) + ).unwrap(); + let delayed = events.remove(position); + events.push(delayed); + } + for (index, event) in events.iter().enumerate() { + receive(&target, event); + assert_windows(&target, &target, &format!("seed={seed} receipt={index}")); + } + // Ensure out-of-order held records have all become admissible before mutating history. + receive(&target, &exchange); + assert_windows(&target, &target, "complete signed history"); + assert!(!windows(&fleet_membership_tx(&target.readers.get()).unwrap()).is_empty()); + + // Every seed exercises every category, then a random suffix repeats mutations on + // random membership batches/signatures. Each mutation and restoration is an event. + let mut mutations: Vec = (0..4).collect(); + mutations.extend((0..20).map(|_| next(&mut state) % 4)); + for (index, mutation) in mutations.into_iter().enumerate() { + let proof = &proofs[(next(&mut state) as usize) % proofs.len()]; + let batch: (String, String, u64) = target.readers.get().query_row( + "SELECT batches.id,batches.origin,batches.replica_sequence FROM batches JOIN claims ON claims.batch_id=batches.id + WHERE claims.kind='fleet.member-admitted' ORDER BY claims.store_index LIMIT 1 OFFSET ?1", + [next(&mut state) % 7], |row| Ok((row.get(0)?, row.get(1)?, row.get(2)?)), + ).unwrap(); + { + let connection = target.connection.write(); + match mutation { + 0 => { connection.execute(/* sqlite-large-value: allow-for-now lv-hfb3ab4e9ffc0 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "DELETE FROM replica_envelope_signatures WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=?4", + params![proof.writer,proof.sequence,proof.hash,proof.member_key]).unwrap(); } + 1 => { connection.execute(/* sqlite-large-value: allow-for-now lv-hf715aec3d234 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "UPDATE replica_envelope_signatures SET member_key=?5 WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=?4", + params![proof.writer,proof.sequence,proof.hash,proof.member_key,format!("untrusted-{seed}-{index}")]).unwrap(); } + 2 => { connection.execute(/* sqlite-large-value: allow-for-now lv-h8a99bdf3afc3 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=bound-or-reference-values-and-reclamation */ "UPDATE batches SET origin=?2 WHERE id=?1", params![batch.0,format!("unrelated-{seed}-{index}")]).unwrap(); } + _ => { connection.execute(/* sqlite-large-value: allow-for-now lv-h9cad1e7a0461 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "UPDATE batches SET replica_sequence=?2 WHERE id=?1", params![batch.0,batch.2+10000]).unwrap(); } + } + } + assert_windows(&target, &target, &format!("seed={seed} mutation={index} kind={mutation}")); + { + let connection = target.connection.write(); + if mutation == 1 { + connection.execute(/* sqlite-large-value: allow-for-now lv-h55ce404e22db owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "DELETE FROM replica_envelope_signatures WHERE member_key=?1", [format!("untrusted-{seed}-{index}")]).unwrap(); + } + if mutation < 2 { insert_raw_signature(&connection, proof); } + else { + connection.execute(/* sqlite-large-value: allow-for-now lv-h6007bc2d61c3 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "UPDATE batches SET origin=?2,replica_sequence=?3 WHERE id=?1", params![batch.0,batch.1,batch.2]).unwrap(); + } + } + assert_windows(&target, &target, &format!("seed={seed} restored={index}")); + } + } +} + +#[test] +fn inherited_generation_membership_events_match_authoritative_raw_fold() { + let (source, anchor) = source(); + let authority_store = Arc::new(node("reader", Some(anchor.public()))); + let shard = Store::open_memory("shard-reader", Arc::new(Plain)).unwrap(); + shard.bind_shard(&crate::shards::ShardId::parse("membership-property").unwrap()).unwrap(); + shard.bind_fleet_authority(authority_store.clone()).unwrap(); + assert_windows(&shard, &authority_store, "initial inherited snapshot"); + let own_generation = fleet_generation(&shard.readers.get()).unwrap(); + for index in 0..5 { + let member = MemberKey::generate().unwrap().0; + append(&source, &format!("host/inherited-{index}"), "fleet.member-admitted", json!({ + "member_key": member.public(), "via": "member", "sponsor": "anchor", + "writer_floor": index, "mode": "listening" + })); + let exchange = export(&source, &authority_store); + receive(&authority_store, &unsigned(&exchange)); + assert_windows(&shard, &authority_store, "inherited unsigned admission"); + let mut proofs = signatures(&exchange); + proofs.signatures.reverse(); + for proof in proofs.signatures.clone() { + proofs.signatures = vec![proof]; + receive(&authority_store, &proofs); + assert_windows(&shard, &authority_store, "inherited late signature"); + } + // No local fleet event can be the trigger for any of these snapshot changes. + assert_eq!(fleet_generation(&shard.readers.get()).unwrap(), own_generation); + } + assert_eq!(windows(&fleet_membership_tx(&authority_store.readers.get()).unwrap()).len(), 6); +} + +fn fixture_fields(suffix: &str, profile: &str, digest: char) -> Value { + let mut value = fields(); + value["grant_id"] = json!(format!("assistant-grant/{suffix}")); + value["session_actor"] = json!(format!("assistant/chatgpt/session/assistant-grant/{suffix}")); + value["profile"] = json!(profile); + value["credential_hash"] = json!(digest.to_string().repeat(64)); + value +} + +// Independent raw-history oracle for this closed fixture contract. In particular this +// does not call structurally_valid, transition_valid, rebuild_subject or candidates, +// and never reads assistant_grant_* tables. Pending and dirty state is not authority. +fn raw_conflict_witnesses(store: &Store, ignored_profile: &str, now: u64) -> Vec { + let claims = raw_claims(store); + let trusted = |claim: &ClaimRecord| store.claim_has_authenticated_member_writer(&claim.id).unwrap(); + let matches = |grant: &ClaimRecord, claim: &ClaimRecord| { + claim.subject == grant.subject && claim.origin == grant.origin && claim.actor == grant.actor + && ["issuer", "grant_id", "principal", "profile"].iter().all(|field| + claim.body["fields"][*field] == grant.body["fields"][*field]) + }; + let mut result = Vec::new(); + for grant in claims.iter().filter(|claim| claim.kind == GRANTED && trusted(claim)) { + let fields = &grant.body["fields"]; + let suffix = fields["grant_id"].as_str().unwrap().strip_prefix("assistant-grant/").unwrap(); + assert_eq!(grant.subject, format!("custom/client/assistant-v1-{suffix}")); + assert_eq!(grant.actor.as_deref(), Some(OWNER)); + assert_eq!(fields["issuer"], OWNER); + assert_eq!(fields["principal"], "assistant/chatgpt"); + let selected = claims.iter().rev().find(|claim| + claim.kind == POLICY && matches(grant, claim) && trusted(claim) + ).unwrap_or(grant); + let policy = &selected.body["fields"]; + assert_eq!(policy["session_actor"], fields["session_actor"]); + assert_eq!(policy["disclosure_consent"], true); + assert_eq!(policy["scopes"], json!(["read.assistant.summary"])); + let revoked = claims.iter().any(|claim| + claim.kind == REVOKED && matches(grant, claim) && trusted(claim)); + if !revoked && policy["expires_at_unix_ms"].as_u64().unwrap() > now + && fields["profile"] != ignored_profile { + result.push(grant.id.clone()); + } + } + result.sort(); + result +} + +fn assert_conflict_oracle(store: &Store, own: &ClaimRecord, witness: &ClaimRecord, expected_witness: bool) { + let expected = raw_conflict_witnesses(store, "assistant", 0); + assert_eq!(expected.contains(&witness.id), expected_witness); + let mut actual: Vec<_> = authority::candidates(&store.readers.get(), "assistant/chatgpt", OWNER, + Some(0), Some(&own.id), Some("assistant")).unwrap().into_iter().map(|claim| claim.id).collect(); + actual.sort(); + assert_eq!(actual, expected, "conflict witnesses differ from authenticated raw history"); + assert!(authority::contains(&store.readers.get(), &own.id).unwrap(), "unrelated subject fence denied own bearer"); + assert_eq!(authority::by_credential(&store.readers.get(), &"a".repeat(64)).unwrap().unwrap().id, own.id); +} + +#[test] +fn fenced_opposite_profile_witness_matches_independent_raw_history_oracle() { + for seed in 1..=8_u64 { + let (source, key) = source(); + let target = node("reader", Some(key.public())); + let own = append(&source, SUBJECT, GRANTED, fields()); + let suffix = "abcdef0123456789abcdef01"; + let subject = format!("custom/client/assistant-v1-{suffix}"); + let service_fields = fixture_fields(suffix, "service", 'b'); + let witness = append(&source, &subject, GRANTED, service_fields.clone()); + receive(&target, &export(&source, &target)); + assert_conflict_oracle(&target, &own, &witness, true); + // A valid, genuinely signed policy remains the effective snapshot until a + // later revoke authenticates, even when that subject is dirty/fenced. + let mut renewal = service_fields.clone(); + renewal["expires_at_unix_ms"] = json!(20000); + append(&source, &subject, POLICY, renewal); + receive(&target, &export(&source, &target)); + append(&source, &subject, REVOKED, service_fields); + let revoke_exchange = export(&source, &target); + receive_pre_projection_unsigned_history(&target, &revoke_exchange); + assert_conflict_oracle(&target, &own, &witness, true); + assert!(!authority::contains(&target.readers.get(), &witness.id).unwrap()); + { + target.connection.write().execute(/* sqlite-large-value: allow-for-now lv-he4d6e9e7421e owner=smallclaims::store::assistant_grant_membership_property_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT OR IGNORE INTO assistant_grant_dirty VALUES(?1)", [&witness.id]).unwrap(); + } + assert_conflict_oracle(&target, &own, &witness, true); + drain_authority(&target); + assert_conflict_oracle(&target, &own, &witness, true); + let mut proofs = signatures(&revoke_exchange); + let mut state = seed; + shuffle(&mut proofs.signatures, &mut state); + for proof in proofs.signatures.clone() { + proofs.signatures = vec![proof]; + receive(&target, &proofs); + let expected = raw_conflict_witnesses(&target, "assistant", 0).contains(&witness.id); + assert_conflict_oracle(&target, &own, &witness, expected); + } + assert_conflict_oracle(&target, &own, &witness, false); + // Conversely, pending work on the bearer's own subject must deny that + // bearer, without changing the independent conflict-history answer. + append(&source, SUBJECT, POLICY, fields()); + receive_pre_projection_unsigned_history(&target, &export(&source, &target)); + assert!(!authority::contains(&target.readers.get(), &own.id).unwrap()); + assert!(authority::by_credential(&target.readers.get(), &"a".repeat(64)).unwrap().is_none()); + assert!(authority::subject_ready(&target.readers.get(), SUBJECT).is_err()); + assert!(raw_conflict_witnesses(&target, "assistant", 0).is_empty()); + assert!(authority::candidates(&target.readers.get(), "assistant/chatgpt", OWNER, + Some(0), Some(&own.id), Some("assistant")).unwrap().is_empty()); + } +} + +fn learned_fence_revalidates_signed_transition(kind: &str) { + for seed in 1..=8_u64 { + let (anchor, anchor_key) = source(); + let peer_key = Arc::new(MemberKey::generate().unwrap().0); + let peer = node("peer", Some(anchor_key.public())); + peer.set_member_key(Some(peer_key.clone())).unwrap(); + let target = node("reader", Some(anchor_key.public())); + let admission = append(&anchor, "host/peer", "fleet.member-admitted", json!({ + "member_key": peer_key.public(), "via": "member", "sponsor": "anchor", + "writer_floor": 0, "mode": "listening" + })); + let admitted = export(&anchor, &target); + receive(&target, &admitted); + assert_windows(&target, &target, "peer admitted"); + receive(&peer, &admitted); + let grant = append(&peer, SUBJECT, GRANTED, fields()); + let granted = export(&peer, &target); + let grant_sequence: u64 = peer.readers.get().query_row( + "SELECT replica_sequence FROM batches WHERE id=?1", [&grant.batch_id], + |row| row.get(0), + ).unwrap(); + receive(&target, &granted); + assert_windows(&target, &target, "signed base grant"); + let mut changed = fields(); + changed["expires_at_unix_ms"] = json!(20000); + let transition = append(&peer, SUBJECT, kind, changed); + receive(&target, &export(&peer, &target)); + assert_windows(&target, &target, "signed transition before fence"); + assert!(authority::transition(&target.readers.get(), &grant, kind).unwrap().is_some()); + // A queued retraction alone is not a fence while the recorded proof + // remains covered. Learn a real removal instead: only the transition + // lies beyond its high-water, while the base grant keeps coverage. + let removal = append(&anchor, "host/peer", "fleet.member-removed", json!({ + "member_key": peer_key.public(), "high_water": grant_sequence, + "reason": "membership equivalence regression" + })); + let fenced = export(&anchor, &target); + receive(&target, &fenced); + assert_windows(&target, &target, "later learned fence shrinks writer window"); + let retained: bool = target.readers.get().query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_authority WHERE claim_id=?1)", + [&transition.id], |row| row.get(0), + ).unwrap(); + assert!(!retained, "signed transition retained authority beyond its learned fence"); + assert!(!target.claim_has_authenticated_member_writer(&transition.id).unwrap()); + // Fresh backfill retains the unauthenticated transition as a subject + // fence, even though the effective conflict snapshot falls back. + assert!(authority::subject_ready(&target.readers.get(), SUBJECT).is_err()); + assert!(!authority::contains(&target.readers.get(), &grant.id).unwrap()); + let effective: (String, bool) = target.readers.get().query_row( + "SELECT expires_at,revoked FROM assistant_grant_effective WHERE claim_id=?1", + [&grant.id], |row| Ok((row.get(0)?,row.get(1)?)), + ).unwrap(); + assert_eq!(effective, (authority::expiry_key(10000), false)); + let authenticated: bool = target.readers.get().query_row( + "SELECT authenticated FROM assistant_grant_pending WHERE claim_id=?1", + [&transition.id], |row| row.get(0), + ).unwrap(); + assert!(!authenticated, "cached transition authentication survived shrink"); + + // Repeat window expansion/shrink and complete key deletion/restoration in + // seeded orders. Every event compares all projection columns, not just + // effective grants: a stale losing revoke must also disappear. + let proof_for = |claim: &ClaimRecord, exchange: &ReplicationExchange| { + let sequence: u64 = anchor.readers.get().query_row( + "SELECT replica_sequence FROM batches WHERE id=?1", [&claim.batch_id], + |row| row.get(0), + ).unwrap(); + signatures(exchange).signatures.into_iter().find(|proof| + proof.writer == "anchor" && proof.sequence == sequence).unwrap() + }; + let admission_proof = proof_for(&admission, &admitted); + let removal_proof = proof_for(&removal, &fenced); + let mut events = vec![&admission_proof, &removal_proof]; + let mut state = seed; + shuffle(&mut events, &mut state); + for (index, proof) in events.into_iter().enumerate() { + target.connection.write().execute( + /* sqlite-large-value: allow-for-now lv-hf625193e6fe4 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "DELETE FROM replica_envelope_signatures + WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=?4", + params![proof.writer,proof.sequence,proof.hash,proof.member_key], + ).unwrap(); + assert_windows(&target, &target, &format!("seed={seed} kind={kind} deleted={index}")); + if proof.sequence == admission_proof.sequence { + assert!(!authority::contains(&target.readers.get(), &grant.id).unwrap(), + "grant survived deletion of its membership key"); + } + insert_raw_signature(&target.connection.write(), proof); + assert_windows(&target, &target, &format!("seed={seed} kind={kind} restored={index}")); + } + } +} + +#[test] +fn signed_policy_beyond_later_learned_fence_loses_authority() { + learned_fence_revalidates_signed_transition(POLICY); +} + +#[test] +fn signed_revoke_beyond_later_learned_fence_loses_authority_and_unrevokes_effective_grant() { + learned_fence_revalidates_signed_transition(REVOKED); +} + +fn receive_without_authority_maintenance(target: &Store, exchange: &ReplicationExchange) { + target.receive_replication_exchange(&exchange.peer, FLEET, exchange).unwrap(); + target.validate_replication_backlog().unwrap(); + target.project_replication_backlog().unwrap(); +} + +fn assert_established_grants_ready(store: &Store, grants: &[ClaimRecord]) { + let connection = store.readers.get(); + for grant in grants { + assert!(authority::subject_ready(&connection, &grant.subject).is_ok(), + "unaffected subject fenced: {}", grant.subject); + assert!(authority::contains(&connection, &grant.id).unwrap(), + "unaffected grant denied: {}", grant.id); + } +} + +#[test] +fn repeated_future_floor_window_additions_do_not_reauthenticate_or_fence_established_history() { + let (sponsor, key) = source(); + let peer_key = Arc::new(MemberKey::generate().unwrap().0); + let source = node("peer", Some(key.public())); + source.set_member_key(Some(peer_key.clone())).unwrap(); + let target = node("reader", Some(key.public())); + append(&sponsor, "host/peer", "fleet.member-admitted", json!({ + "member_key": peer_key.public(), "via": "member", "sponsor": "anchor", + "writer_floor": 0, "mode": "listening" + })); + receive(&source, &export(&sponsor, &source)); + receive(&target, &export(&sponsor, &target)); + let grants: Vec<_> = (0..authority::CLAIMS_PER_SLICE * 3).map(|index| { + let suffix = format!("{index:024x}"); + append(&source, &format!("custom/client/assistant-v1-{suffix}"), GRANTED, + fixture_fields(&suffix, "assistant", 'a')) + }).collect(); + receive(&target, &export(&source, &target)); + assert_windows(&target, &target, "established authenticated history"); + for index in 0..6 { + let future_key = MemberKey::generate().unwrap().0; + append(&sponsor, "host/peer", "fleet.member-admitted", json!({ + "member_key": future_key.public(), "via": "member", "sponsor": "anchor", + "writer_floor": 1_000_000 + index, "mode": "listening" + })); + authority::take_authentication_attempts(); + authority::take_authentication_claims(); + receive_without_authority_maintenance(&target, &export(&sponsor, &target)); + assert_established_grants_ready(&target, &grants); + loop { + let complete = target.advance_assistant_grant_authority_backfill().unwrap(); + assert_established_grants_ready(&target, &grants); + if complete { break; } + } + let fresh_windows = windows(&fleet_membership_tx(&target.readers.get()).unwrap()); + assert_eq!(fresh_windows.len(), 3 + index as usize, + "future-floor admission failed to add a real window"); + assert!(fresh_windows.contains_key(&("peer".to_owned(), future_key.public().to_owned()))); + assert_eq!(authority::take_authentication_attempts(), 0, + "future-floor addition reauthenticated established history at event {index}"); + assert!(authority::take_authentication_claims().is_empty()); + assert_windows(&target, &target, &format!("future-floor addition {index}")); + } +} + +#[test] +fn membership_retraction_reauthenticates_only_rows_using_the_lost_recorded_key() { + let (anchor, anchor_key) = source(); + let first_key = Arc::new(MemberKey::generate().unwrap().0); + let second_key = Arc::new(MemberKey::generate().unwrap().0); + let peer = node("peer", Some(anchor_key.public())); + let target = node("reader", Some(anchor_key.public())); + for key in [&first_key, &second_key] { + append(&anchor, "host/peer", "fleet.member-admitted", json!({ + "member_key": key.public(), "via": "member", "sponsor": "anchor", + "writer_floor": 0, "mode": "listening" + })); + } + receive(&target, &export(&anchor, &target)); + receive(&peer, &export(&anchor, &peer)); + peer.set_member_key(Some(first_key.clone())).unwrap(); + let removed_grant = append(&peer, SUBJECT, GRANTED, fields()); + receive(&target, &export(&peer, &target)); + peer.set_member_key(Some(second_key.clone())).unwrap(); + let suffix = "abcdef0123456789abcdef01"; + let retained_grant = append(&peer, &format!("custom/client/assistant-v1-{suffix}"), + GRANTED, fixture_fields(suffix, "service", 'b')); + receive(&target, &export(&peer, &target)); + assert_windows(&target, &target, "two recorded proof keys on one writer"); + for (grant, key) in [(&removed_grant, &first_key), (&retained_grant, &second_key)] { + let recorded_key: String = target.readers.get().query_row( + "SELECT auth_member_key FROM assistant_grant_pending WHERE claim_id=?1", + [&grant.id], |row| row.get(0), + ).unwrap(); + assert_eq!(recorded_key, key.public()); + } + append(&anchor, "host/peer", "fleet.member-removed", json!({ + "member_key": first_key.public(), "high_water": 0, "reason": "proof-key regression" + })); + authority::take_authentication_attempts(); + authority::take_authentication_claims(); + receive_without_authority_maintenance(&target, &export(&anchor, &target)); + loop { + let complete = target.advance_assistant_grant_authority_backfill().unwrap(); + assert_established_grants_ready(&target, std::slice::from_ref(&retained_grant)); + if complete { break; } + } + // One failed key page followed by end-of-evidence may require more than one + // authentication call. Record exactly which claims were refreshed below. + assert!(authority::take_authentication_attempts() > 0); + let refreshed = authority::take_authentication_claims(); + assert!(!refreshed.is_empty()); + assert!(refreshed.iter().all(|claim_id| claim_id == &removed_grant.id), + "retraction refreshed rows using an unaffected proof key: {refreshed:?}"); + let connection = target.readers.get(); + let lost: bool = connection.query_row( + "SELECT authenticated FROM assistant_grant_pending WHERE claim_id=?1", + [&removed_grant.id], |row| row.get(0), + ).unwrap(); + assert!(!lost); + assert!(authority::subject_ready(&connection, &removed_grant.subject).is_err()); + drop(connection); + assert_windows(&target, &target, "only the lost proof key is retracted"); +} + +#[test] +fn sole_proof_withdrawal_survives_nonretracting_same_writer_window_addition() { + for mutation in ["signature-delete", "signature-update", "record-invalid", "record-delete", "record-invalid-refresh", "record-repaired-refresh", "envelope-invalid", "envelope-delete", "claim-delete"] { + let (anchor, anchor_key) = source(); + let peer_key = Arc::new(MemberKey::generate().unwrap().0); + let peer = node("peer", Some(anchor_key.public())); + peer.set_member_key(Some(peer_key.clone())).unwrap(); + let target = node("reader", Some(anchor_key.public())); + append(&anchor, "host/peer", "fleet.member-admitted", json!({ + "member_key": peer_key.public(), "via": "member", "sponsor": "anchor", + "writer_floor": 0, "mode": "listening" + })); + receive(&peer, &export(&anchor, &peer)); + receive(&target, &export(&anchor, &target)); + let grant = append(&peer, SUBJECT, GRANTED, fields()); + receive(&target, &export(&peer, &target)); + assert_windows(&target, &target, "sole signed proof established"); + let (sequence, hash, position): (u64, String, u64) = target.readers.get().query_row( + "SELECT auth_sequence,auth_envelope_hash,auth_record_position + FROM assistant_grant_pending WHERE claim_id=?1", + [&grant.id], |row| Ok((row.get(0)?,row.get(1)?,row.get(2)?)), + ).unwrap(); + let original_windows = windows(&fleet_membership_tx(&target.readers.get()).unwrap()); + let original_key = ("peer".to_owned(), peer_key.public().to_owned()); + let original_window = *original_windows.get(&original_key).unwrap(); + // writer_floor is the last excluded sequence, not the window start. + assert!(sequence >= original_window.0 + && original_window.1.is_none_or(|end| sequence <= end)); + { + let mut writer = target.connection.write(); + let connection = writer.transaction().unwrap(); + let query = match mutation { + "signature-delete" => + /* sqlite-large-value: allow-for-now lv-hbb5e6b92e1b0 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "DELETE FROM replica_envelope_signatures + WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=?4", + "signature-update" => + /* sqlite-large-value: allow-for-now lv-hbc780a1c9dac owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "UPDATE replica_envelope_signatures SET signature='invalid' + WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=?4", + "record-invalid" | "record-invalid-refresh" => + /* sqlite-large-value: allow-for-now lv-h054ba51f20f6 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "UPDATE replica_records SET state='invalid' + WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND position=?4", + "record-repaired-refresh" => + /* sqlite-large-value: allow-for-now lv-hc7948a0a84cd owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "UPDATE replica_records SET state='repaired' + WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND position=?4", + "record-delete" => + /* sqlite-large-value: allow-for-now lv-ha76a98dcc427 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "DELETE FROM replica_records + WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND position=?4", + "envelope-invalid" => + /* sqlite-large-value: allow-for-now lv-h6891eac9f9c6 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "UPDATE replica_envelopes SET receipt_state=?4 + WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3", + "envelope-delete" => + /* sqlite-large-value: allow-for-now lv-hf168a0847ffd owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "DELETE FROM replica_envelopes + WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND ?4 IS NOT NULL", + "claim-delete" => + /* sqlite-large-value: allow-for-now lv-h1a8e7267f37b owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "DELETE FROM claims WHERE id IN( + SELECT claim_id FROM assistant_grant_pending + WHERE origin=?1 AND auth_sequence=?2 AND auth_envelope_hash=?3 AND auth_record_position=?4)", + _ => unreachable!(), + }; + let last = if mutation.starts_with("signature-") { + SqlValue::Text(peer_key.public().to_owned()) + } else if mutation == "envelope-invalid" { + SqlValue::Text("pending".to_owned()) + } else { + SqlValue::Integer(position as i64) + }; + assert_eq!(connection.execute(/* sqlite-large-value: allow-for-now lv-h565adf25d451 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=trace-statement-and-value-representation */ query, params![grant.origin,sequence,hash,last]).unwrap(), 1); + if mutation.ends_with("-refresh") { + // Prepared-envelope revalidation changes evidence and invokes + // its non-verifying hook in the same writer transaction. + connection.execute( + /* sqlite-large-value: allow-for-now lv-hf26931e7ebc2 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT OR IGNORE INTO assistant_grant_dirty VALUES(?1)", [&grant.id], + ).unwrap(); + authority::refresh_envelope(&connection,&grant.origin,sequence,&hash).unwrap(); + assert!(!connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_dirty WHERE claim_id=?1)", + [&grant.id], |row| row.get::<_,bool>(0), + ).unwrap(), "fixture must exercise receipt clearing ordinary dirty work"); + assert!(connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_proof_rechecks WHERE claim_id=?1)", + [&grant.id], |row| row.get::<_,bool>(0), + ).unwrap(), "receipt must not discharge the real verification obligation"); + } + assert!(authority::subject_ready(&connection, &grant.subject).is_err(), + "withdrawal did not fence its dependent: {mutation}"); + assert!(!authority::contains(&connection, &grant.id).unwrap(), + "withdrawn proof still authorized its bearer: {mutation}"); + connection.commit().unwrap(); + } + // Keep the original key's coverage intact. This real new window on the + // same writer must not hide the queued loss behind an authenticated flag. + let future_key = MemberKey::generate().unwrap().0; + append(&anchor, "host/peer", "fleet.member-admitted", json!({ + "member_key": future_key.public(), "via": "member", "sponsor": "anchor", + "writer_floor": 1_000_000, "mode": "listening" + })); + receive_without_authority_maintenance(&target, &export(&anchor, &target)); + if mutation == "envelope-invalid" { + let mut writer = target.connection.write(); + let connection = writer.transaction().unwrap(); + let receipt_state: String = connection.query_row( + "SELECT receipt_state FROM replica_envelopes + WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3", + params![grant.origin,sequence,hash], |row| row.get(0), + ).unwrap(); + assert!(matches!(receipt_state.as_str(), "validated" | "degraded"), + "real receive must repair the pending receipt with its still-valid signature"); + // Backlog validation legitimately restores a pending receipt during + // the real admission receive. A valid signature cache may authorize + // that validated receipt again; this case instead tests evidence + // that remains withdrawn when authority maintenance finally runs. + let queued_before: i64 = connection.query_row( + "SELECT COUNT(*) FROM assistant_grant_proof_invalidations + WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=''", + params![grant.origin,sequence,hash], |row| row.get(0), + ).unwrap(); + assert_eq!(connection.execute( + /* sqlite-large-value: allow-for-now lv-h731a7b88489d owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "UPDATE replica_envelopes SET receipt_state='pending' + WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3", + params![grant.origin,sequence,hash], + ).unwrap(), 1); + let queued_after: i64 = connection.query_row( + "SELECT COUNT(*) FROM assistant_grant_proof_invalidations + WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=''", + params![grant.origin,sequence,hash], |row| row.get(0), + ).unwrap(); + assert_eq!(queued_after, queued_before+1, + "renewed withdrawal must enqueue its own bounded verification obligation"); + assert!(authority::subject_ready(&connection, &grant.subject).is_err()); + assert!(!authority::contains(&connection, &grant.id).unwrap(), + "renewed receipt withdrawal must immediately fence bearer authority"); + connection.commit().unwrap(); + } + let expected = windows(&fleet_membership_tx(&target.readers.get()).unwrap()); + assert_eq!(expected.get(&original_key), Some(&original_window)); + assert!(expected.contains_key(&("peer".to_owned(), future_key.public().to_owned()))); + assert!(!target.claim_has_authenticated_member_writer(&grant.id).unwrap(), "{mutation}"); + assert_windows(&target, &target, mutation); + assert!(!authority::contains(&target.readers.get(), &grant.id).unwrap(), "{mutation}"); + } +} + +#[test] +fn restored_window_coverage_cancels_pending_retraction_fence() { + let (anchor, anchor_key) = source(); + let peer_key = Arc::new(MemberKey::generate().unwrap().0); + let peer = node("peer", Some(anchor_key.public())); + peer.set_member_key(Some(peer_key.clone())).unwrap(); + let target = node("reader", Some(anchor_key.public())); + append(&anchor, "host/peer", "fleet.member-admitted", json!({ + "member_key": peer_key.public(), "via": "member", "sponsor": "anchor", + "writer_floor": 0, "mode": "listening" + })); + receive(&peer, &export(&anchor, &peer)); + receive(&target, &export(&anchor, &target)); + let grants: Vec<_> = (0..authority::CLAIMS_PER_SLICE * 3).map(|index| { + let suffix = format!("{index:024x}"); + append(&peer, &format!("custom/client/assistant-v1-{suffix}"), GRANTED, + fixture_fields(&suffix, "assistant", 'a')) + }).collect(); + receive(&target, &export(&peer, &target)); + assert_windows(&target, &target, "restoration fixture established"); + let removal = append(&anchor, "host/peer", "fleet.member-removed", json!({ + "member_key": peer_key.public(), "high_water": 0, "reason": "restore coverage regression" + })); + let removed = export(&anchor, &target); + let removal_sequence: u64 = anchor.readers.get().query_row( + "SELECT replica_sequence FROM batches WHERE id=?1", [&removal.batch_id], + |row| row.get(0), + ).unwrap(); + let proof = signatures(&removed).signatures.into_iter().find(|proof| + proof.writer == "anchor" && proof.sequence == removal_sequence).unwrap(); + receive_without_authority_maintenance(&target, &removed); + assert!(!target.advance_assistant_grant_authority_backfill().unwrap()); + let retained_id: String = target.readers.get().query_row( + "SELECT pending.claim_id FROM assistant_grant_pending AS pending + JOIN assistant_grant_retractions AS retractions + ON pending.origin=retractions.writer AND pending.auth_member_key=retractions.member_key + WHERE pending.authenticated=1 + AND pending.auth_sequence BETWEEN retractions.lower_sequence AND retractions.upper_sequence + ORDER BY pending.claim_id LIMIT 1", + [], |row| row.get(0), + ).unwrap(); + let retained = grants.iter().find(|grant| grant.id == retained_id).unwrap(); + assert!(authority::subject_ready(&target.readers.get(), &retained.subject).is_err()); + // Withdraw only the signed removal. Raw fleet history expands the original + // key again while its old retraction page is still outstanding. + target.connection.write().execute( + /* sqlite-large-value: allow-for-now lv-h187f367a46c6 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-exact-wire-values */ "DELETE FROM replica_envelope_signatures + WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=?4", + params![proof.writer,proof.sequence,proof.hash,proof.member_key], + ).unwrap(); + target.advance_assistant_grant_authority_backfill().unwrap(); + assert_established_grants_ready(&target, std::slice::from_ref(retained)); + let pending_retractions: u64 = target.readers.get().query_row( + "SELECT COUNT(*) FROM assistant_grant_retractions WHERE writer='peer' AND member_key=?1", + [peer_key.public()], |row| row.get(0), + ).unwrap(); + assert_eq!(pending_retractions, 0, "restored coverage retained a stale subject fence"); + assert_windows(&target, &target, "restored coverage after partial retraction"); + assert_established_grants_ready(&target, &grants); +} + +#[derive(Clone, Copy, Debug)] +enum AlternateProofCoverage { + MidPage, + AlreadyAdmitted, + AlreadyAdmittedOneUnit, + AfterDemotion, + FutureOnly, +} + +// Use only real admitted keys and cryptographically valid signatures. The +// alternate proof predates the cursor, so membership is the only late evidence. +fn admitted_recheck_finds_alternate_proof(seed: u64, coverage: AlternateProofCoverage) { + let add_coverage = !matches!(coverage, + AlternateProofCoverage::AlreadyAdmitted | AlternateProofCoverage::AlreadyAdmittedOneUnit); + let key_pages = if matches!(coverage, AlternateProofCoverage::FutureOnly) { 4 } else { 1 }; + let (anchor, anchor_key) = source(); + let mut keys: Vec<_> = (0..authority::MEMBERSHIP_KEYS_PER_REFRESH * key_pages + 2) + .map(|_| Arc::new(MemberKey::generate().unwrap().0)).collect(); + keys.sort_by(|left, right| left.public().cmp(right.public())); + let low = keys.remove(0); + let high = keys.pop().unwrap(); + let (original, alternate) = if add_coverage { (high, low) } else { (low, high) }; + let peer = node("peer", Some(anchor_key.public())); + peer.set_member_key(Some(original.clone())).unwrap(); + let target = node("reader", Some(anchor_key.public())); + let mut admitted = keys; + admitted.push(original.clone()); + if !add_coverage { admitted.push(alternate.clone()); } + let mut state = seed; + shuffle(&mut admitted, &mut state); + for key in admitted { + append(&anchor, "host/peer", "fleet.member-admitted", json!({ + "member_key": key.public(), "via": "member", "sponsor": "anchor", + "writer_floor": 0, "mode": "listening" + })); + } + receive(&peer, &export(&anchor, &peer)); + receive(&target, &export(&anchor, &target)); + let grant = append(&peer, SUBJECT, GRANTED, fields()); + let granted = export(&peer, &target); + receive(&target, &granted); + assert_windows(&target, &target, "original proof established"); + let recorded_key: String = target.readers.get().query_row( + "SELECT auth_member_key FROM assistant_grant_pending WHERE claim_id=?1", + [&grant.id], |row| row.get(0), + ).unwrap(); + assert_eq!(recorded_key, original.public()); + let mut alternate_proof = signatures(&granted).signatures.into_iter().find(|proof| { + target.readers.get().query_row( + "SELECT EXISTS(SELECT 1 FROM replica_records + WHERE claim_id=?1 AND writer=?2 AND sequence=?3 AND envelope_hash=?4)", + params![grant.id,proof.writer,proof.sequence,proof.hash], + |row| row.get::<_,bool>(0), + ).unwrap() + }).unwrap(); + alternate_proof.member_key = alternate.public().to_owned(); + alternate_proof.signature = alternate.sign(&crate::fleet::envelope_signature_message_in( + None, FLEET, &alternate_proof.writer, alternate_proof.sequence, &alternate_proof.hash, + )); + insert_raw_signature(&target.connection.write(), &alternate_proof); + append(&anchor, "host/peer", "fleet.member-removed", json!({ + "member_key": original.public(), "high_water": 0, "reason": "alternate proof regression" + })); + receive_without_authority_maintenance(&target, &export(&anchor, &target)); + assert!(!target.advance_assistant_grant_authority_backfill().unwrap()); + { + let connection = target.readers.get(); + let (authenticated, key): (bool, String) = connection.query_row( + "SELECT pending.authenticated,cursor.member_key + FROM assistant_grant_pending AS pending + JOIN assistant_grant_auth_cursor AS cursor USING(claim_id) + WHERE pending.claim_id=?1", + [&grant.id], |row| Ok((row.get(0)?,row.get(1)?)), + ).unwrap(); + assert!(authenticated, "fixture must retry an already admitted row"); + if add_coverage { + assert!(key.as_str() > alternate.public(), "new key must be below the saved cursor"); + } + assert!(connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_proof_rechecks WHERE claim_id=?1)", + [&grant.id], |row| row.get::<_,bool>(0), + ).unwrap(), "mid-page retry lost its durable obligation"); + assert!(connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_dirty WHERE claim_id=?1)", + [&grant.id], |row| row.get::<_,bool>(0), + ).unwrap(), "fixture must dispatch a dirty claim also owned by its recheck"); + assert!(authority::subject_ready(&connection, SUBJECT).is_err()); + assert!(!authority::contains(&connection, &grant.id).unwrap()); + } + if matches!(coverage, AlternateProofCoverage::FutureOnly) { + let cursor = || target.readers.get().query_row( + "SELECT position,record_rowid,membership_start,member_key FROM assistant_grant_auth_cursor WHERE claim_id=?1", + [&grant.id], |row| Ok((row.get::<_,i64>(0)?,row.get::<_,i64>(1)?,row.get::<_,i64>(2)?,row.get::<_,String>(3)?)), + ).optional().unwrap(); + let mut previous = cursor(); + let mut completed_at = None; + // Keep signed admissions arriving for substantially longer than the four + // original key pages. None covers an existing receipt, so none may + // restart that search or leave a durable addition task behind. + for unit in 0..16 { + let future_key = MemberKey::generate().unwrap().0; + let floor = 1_000_000 + unit as u64; + let highest: u64 = target.readers.get().query_row( + "SELECT MAX(sequence) FROM replica_records WHERE writer='peer'", + [], |row| row.get(0), + ).unwrap(); + assert!(floor > highest); + append(&anchor, "host/peer", "fleet.member-admitted", json!({ + "member_key": future_key.public(), "via": "member", "sponsor": "anchor", + "writer_floor": floor, "mode": "listening" + })); + receive_without_authority_maintenance(&target, &export(&anchor, &target)); + assert_eq!(cursor(), previous, "receiving membership restarted the recheck"); + target.advance_assistant_grant_authority_backfill().unwrap(); + let next = cursor(); + let connection = target.readers.get(); + let queued: u64 = connection.query_row( + "SELECT COUNT(*) FROM assistant_grant_additions WHERE writer='peer'", + [], |row| row.get(0), + ).unwrap(); + assert_eq!(queued, 0, "future-only admission queued historical retry work"); + assert!(connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_membership_windows + WHERE writer='peer' AND member_key=?1 AND start=?2)", + params![future_key.public(),floor + 1], |row| row.get::<_,bool>(0), + ).unwrap(), "signed admission must actually reach membership"); + if let (Some(before), Some(after)) = (&previous, &next) { + assert!(after > before, "future-only admission restarted or stalled the original cursor"); + } + let rechecking: bool = connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_proof_rechecks WHERE claim_id=?1)", + [&grant.id], |row| row.get(0), + ).unwrap(); + if !rechecking { + completed_at.get_or_insert(unit); + assert!(next.is_none(), "completed recheck retained its original cursor"); + let authenticated: bool = connection.query_row( + "SELECT authenticated FROM assistant_grant_pending WHERE claim_id=?1", + [&grant.id], |row| row.get(0), + ).unwrap(); + assert!(!authenticated, "uncovered alternate signature must fail closed"); + assert!(!authority::contains(&connection, &grant.id).unwrap()); + } else { + assert!(completed_at.is_none(), "later future-only admission recreated a finished recheck"); + } + previous = next; + } + assert!(completed_at.is_some_and(|unit| unit <= key_pages + 2), + "sustained future-only admissions prevented bounded recheck completion"); + assert_windows(&target, &target, &format!("seed={seed} future-only recheck")); + return; + } + if matches!(coverage, AlternateProofCoverage::AfterDemotion) { + // The valid earlier-key signature is already in raw provenance. Exhaust + // the old search before changing membership: restoration must come from + // the new key/range task, not an original cursor that still happens to run. + let mut demoted = false; + for _ in 0..key_pages + 3 { + target.advance_assistant_grant_authority_backfill().unwrap(); + let connection = target.readers.get(); + let authenticated: bool = connection.query_row( + "SELECT authenticated FROM assistant_grant_pending WHERE claim_id=?1", + [&grant.id], |row| row.get(0), + ).unwrap(); + if !authenticated { + assert!(!connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_auth_cursor WHERE claim_id=?1) + OR EXISTS(SELECT 1 FROM assistant_grant_proof_rechecks WHERE claim_id=?1)", + [&grant.id], |row| row.get::<_,bool>(0), + ).unwrap(), "demotion must finish the original retry obligation"); + assert!(!authority::contains(&connection, &grant.id).unwrap()); + demoted = true; + break; + } + } + assert!(demoted, "original recheck did not demote within its bounded key pages"); + } + if add_coverage { + append(&anchor, "host/peer", "fleet.member-admitted", json!({ + "member_key": alternate.public(), "via": "member", "sponsor": "anchor", + "writer_floor": 0, "mode": "listening" + })); + receive_without_authority_maintenance(&target, &export(&anchor, &target)); + } + if matches!(coverage, AlternateProofCoverage::AlreadyAdmitted | AlternateProofCoverage::AlreadyAdmittedOneUnit) { + // A dirty refresh and the durable recheck must share one verifier. + // Bound completion here so cursor restarts fail before the oracle's drain. + let mut finished = false; + for _ in 0..key_pages + 3 { + let done = if matches!(coverage, AlternateProofCoverage::AlreadyAdmittedOneUnit) { + let mut connection = target.connection.write(); + let transaction = connection.transaction().unwrap(); + let done = authority::backfill_slice(&transaction,Duration::ZERO).unwrap(); + transaction.commit().unwrap(); + done + } else { + target.advance_assistant_grant_authority_backfill().unwrap() + }; + if done { + finished = true; + break; + } + } + assert!(finished, "dual-signed recheck did not finish within its bounded key pages"); + assert!(!target.readers.get().query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_auth_cursor WHERE claim_id=?1) + OR EXISTS(SELECT 1 FROM assistant_grant_proof_rechecks WHERE claim_id=?1)", + [&grant.id], |row| row.get::<_,bool>(0), + ).unwrap(), "completed dual-signed maintenance retained its original retry obligation"); + } + // Newly eligible earlier keys have independent retry work; the original + // search need not restart or survive until that work restores authority. + assert_windows(&target, &target, &format!("seed={seed} coverage={coverage:?}")); + let recorded_key: String = target.readers.get().query_row( + "SELECT auth_member_key FROM assistant_grant_pending WHERE claim_id=?1", + [&grant.id], |row| row.get(0), + ).unwrap(); + assert_eq!(recorded_key, alternate.public()); + assert_established_grants_ready(&target, std::slice::from_ref(&grant)); +} + +#[test] +fn newly_admitted_key_below_mid_page_cursor_reauthenticates_already_admitted_row() { + for seed in 1..=4 { + admitted_recheck_finds_alternate_proof(seed, AlternateProofCoverage::MidPage); + } +} + +#[test] +fn same_row_dual_signed_proof_survives_recorded_key_removal_after_mid_page_recheck() { + for seed in 1..=4 { + admitted_recheck_finds_alternate_proof(seed, AlternateProofCoverage::AlreadyAdmitted); + } +} + +#[test] +fn dirty_owned_recheck_completes_with_one_unit_zero_duration_slices() { + for seed in 1..=4 { + admitted_recheck_finds_alternate_proof(seed,AlternateProofCoverage::AlreadyAdmittedOneUnit); + } +} + +#[test] +fn sustained_future_only_admissions_do_not_restart_mid_page_admitted_recheck() { + for seed in 1..=4 { + admitted_recheck_finds_alternate_proof(seed, AlternateProofCoverage::FutureOnly); + } +} + +#[test] +fn newly_admitted_earlier_key_restores_demoted_row_from_existing_signature() { + for seed in 1..=4 { + admitted_recheck_finds_alternate_proof(seed, AlternateProofCoverage::AfterDemotion); + } +} + +// Real past-covering admissions must visit the small set of grant rows needing +// authentication, not replay this writer's unrelated (or established) history. +fn past_covering_addition_backlog(unrelated: usize) -> (Store, Vec, Vec, usize) { + let (anchor, anchor_key) = source(); + let peer_key = Arc::new(MemberKey::generate().unwrap().0); + let peer = node("peer", Some(anchor_key.public())); + peer.set_member_key(Some(peer_key.clone())).unwrap(); + let target = node("reader", Some(anchor_key.public())); + append(&anchor, "host/peer", "fleet.member-admitted", json!({ + "member_key": peer_key.public(), "via": "member", "sponsor": "anchor", + "writer_floor": 0, "mode": "listening" + })); + receive(&peer, &export(&anchor, &peer)); + receive(&target, &export(&anchor, &target)); + for first in (0..unrelated).step_by(32) { + for index in first..(first + 32).min(unrelated) { + append(&peer, &format!("custom/unrelated/{index}"), "custom.unrelated.event", + json!({"index": index})); + } + receive(&target, &export(&peer, &target)); + } + let established: Vec<_> = (0..3).map(|index| { + let suffix = format!("{:024x}", index + 100); + append(&peer, &format!("custom/client/assistant-v1-{suffix}"), GRANTED, + fixture_fields(&suffix, "assistant", 'a')) + }).collect(); + receive(&target, &export(&peer, &target)); + let needy: Vec<_> = (0..2).map(|index| { + let suffix = format!("{:024x}", index + 200); + append(&peer, &format!("custom/client/assistant-v1-{suffix}"), GRANTED, + fixture_fields(&suffix, "assistant", 'b')) + }).collect(); + receive_pre_projection_unsigned_history(&target, &export(&peer, &target)); + assert_established_grants_ready(&target, &established); + for grant in &needy { + assert_bearer_rejected(&target, grant); + } + let receipts: usize = target.readers.get().query_row( + "SELECT COUNT(*) FROM replica_records WHERE writer='peer'", + [], |row| row.get(0), + ).unwrap(); + assert!(receipts >= unrelated + established.len() + needy.len()); + let additions = 24; + for _ in 0..additions { + let key = MemberKey::generate().unwrap().0; + append(&anchor, "host/peer", "fleet.member-admitted", json!({ + "member_key": key.public(), "via": "member", "sponsor": "anchor", + "writer_floor": 0, "mode": "listening" + })); + } + receive_without_authority_maintenance(&target, &export(&anchor, &target)); + (target, established, needy, additions) +} + +#[test] +fn many_past_covering_additions_visit_needy_grants_not_unrelated_receipts() { + for unrelated in [64, 512] { + let (target, established, needy, additions) = past_covering_addition_backlog(unrelated); + target.connection.write().execute_batch( + /* sqlite-large-value: allow-for-now lv-h8d3c6e9a6220 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=chunk-or-reference-variable-columns */ "CREATE TEMP TABLE addition_work (unit INTEGER); + CREATE TEMP TRIGGER count_addition_updates AFTER UPDATE ON assistant_grant_additions + BEGIN INSERT INTO addition_work VALUES(1); END; + CREATE TEMP TRIGGER count_addition_completion AFTER DELETE ON assistant_grant_additions + BEGIN INSERT INTO addition_work VALUES(1); END;", + ).unwrap(); + authority::take_authentication_attempts(); + authority::take_authentication_claims(); + // Apply the real membership delta, then use one-unit transactions so + // the completion bound cannot hide receipt scans inside a large slice. + target.advance_assistant_grant_authority_backfill().unwrap(); + let bound = additions * (needy.len() * 4 + 2) + 8; + let mut completed = false; + for _ in 0..bound { + let mut connection = target.connection.write(); + let transaction = connection.transaction().unwrap(); + let done = authority::backfill_slice(&transaction, Duration::ZERO).unwrap(); + transaction.commit().unwrap(); + drop(connection); + assert_established_grants_ready(&target, &established); + if done { + completed = true; + break; + } + } + assert!(completed, + "{unrelated} unrelated receipts exhausted a grant-row-proportional work bound"); + let work: usize = target.connection.write().query_row( + "SELECT COUNT(*) FROM addition_work", [], |row| row.get(0), + ).unwrap(); + assert!(work >= additions, "fixture did not exercise every real admission"); + assert!(work <= bound, + "addition work scaled with {unrelated} raw receipts rather than {} needy rows: {work}", + needy.len()); + assert_eq!(target.readers.get().query_row( + "SELECT COUNT(*) FROM assistant_grant_additions", [], |row| row.get::<_,usize>(0), + ).unwrap(), 0); + let refreshed = authority::take_authentication_claims(); + assert!(refreshed.iter().all(|id| needy.iter().any(|claim| &claim.id == id)), + "past-covering additions reauthenticated established rows: {refreshed:?}"); + for grant in &needy { + assert_bearer_rejected(&target, grant); + } + assert_windows(&target, &target, "past-covering additions over unrelated history"); + } +} + +#[test] +fn ordinary_dirty_subject_is_not_starved_by_past_covering_addition_backlog() { + let (target, established, _, _) = past_covering_addition_backlog(256); + // Preparing membership also consumes a normal slice; enough real addition + // work must remain to distinguish fairness from merely draining the queue. + target.advance_assistant_grant_authority_backfill().unwrap(); + let grant = &established[0]; + let mut connection = target.connection.write(); + let queued: usize = connection.query_row( + "SELECT COUNT(*) FROM assistant_grant_additions", [], |row| row.get(0), + ).unwrap(); + assert!(queued > 4, "fixture needs a sustained addition backlog"); + connection.execute( + /* sqlite-large-value: allow-for-now lv-h2483f627e2e6 owner=smallclaims::store::assistant_grant_membership_property_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT OR IGNORE INTO assistant_grant_dirty VALUES(?1)", [&grant.id], + ).unwrap(); + assert!(authority::subject_ready(&connection, &grant.subject).is_err()); + authority::take_authentication_claims(); + let mut serviced = false; + for _ in 0..4 { + let transaction = connection.transaction().unwrap(); + assert!(!authority::backfill_slice(&transaction, Duration::ZERO).unwrap()); + transaction.commit().unwrap(); + let dirty: bool = connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_dirty WHERE claim_id=?1)", + [&grant.id], |row| row.get(0), + ).unwrap(); + if !dirty { + serviced = true; + break; + } + } + assert!(serviced, "ordinary dirty subject starved behind addition tasks"); + assert!(connection.query_row( + "SELECT EXISTS(SELECT 1 FROM assistant_grant_additions)", + [], |row| row.get::<_,bool>(0), + ).unwrap(), "dirty work only progressed after the addition backlog drained"); + assert!(authority::take_authentication_claims().contains(&grant.id)); + assert!(authority::subject_ready(&connection, &grant.subject).is_ok()); + assert!(authority::contains(&connection, &grant.id).unwrap()); + drop(connection); + assert_windows(&target, &target, "dirty subject serviced during addition backlog"); +} diff --git a/crates/smallclaims/src/store/assistant_grant_receipt_cost_tests.rs b/crates/smallclaims/src/store/assistant_grant_receipt_cost_tests.rs new file mode 100644 index 00000000000..bb5e4a13d9a --- /dev/null +++ b/crates/smallclaims/src/store/assistant_grant_receipt_cost_tests.rs @@ -0,0 +1,211 @@ +// Included by assistant_grant_authority_tests to share its real replication fixtures. + +fn receipt_signature_for_claim(store: &Store, exchange: &ReplicationExchange, claim: &ClaimRecord) -> ReplicaEnvelopeSignature { + signatures(exchange).signatures.into_iter().find(|signature| { + store.readers.get().query_row( + "SELECT EXISTS(SELECT 1 FROM replica_records WHERE claim_id=?1 AND writer=?2 AND sequence=?3 AND envelope_hash=?4)", + params![claim.id, signature.writer, signature.sequence, signature.hash], + |row| row.get::<_, bool>(0), + ).unwrap() + }).unwrap() +} + +fn fresh_nonmember_proof(envelope: &ReplicaEnvelopeSignature) -> ReplicaEnvelopeSignature { + let key = MemberKey::generate().unwrap().0; + let message = crate::fleet::envelope_signature_message_in( + None, FLEET, &envelope.writer, envelope.sequence, &envelope.hash, + ); + ReplicaEnvelopeSignature { + writer: envelope.writer.clone(), sequence: envelope.sequence, hash: envelope.hash.clone(), + member_key: key.public().to_owned(), signature: key.sign(&message), + } +} + +fn complete_signature_receipt_cost(store: &Store, signature: &ReplicaEnvelopeSignature) -> crate::sqlite::work::SqliteWork { + // Match receipt's split: cryptographic verification precedes writer admission. + // Everything from acquiring the writer through BEGIN, store (including all + // triggers), COMMIT and returning the writer belongs to the measured scope. + let verified = VerifiedEnvelopeSignature::verify( + None, FLEET, &signature.writer, signature.sequence, &signature.hash, + &signature.member_key, &signature.signature, + ).expect("fresh proof must cryptographically verify"); + let scope = crate::sqlite::work::SqliteWorkScope::start(); + { + let mut connection = store.connection.write(); + let transaction = connection.transaction().unwrap(); + assert_eq!(verified.store(&transaction, "1").unwrap(), 1); + transaction.commit().unwrap(); + } + scope.finish() +} + +fn receipt_projection_work_state(connection: &Connection) -> Vec>> { + [ + "SELECT id,applied_generation FROM assistant_grant_membership_state ORDER BY id", + "SELECT claim_id,position,record_rowid,member_key,membership_start FROM assistant_grant_auth_cursor ORDER BY claim_id", + "SELECT claim_id FROM assistant_grant_dirty ORDER BY claim_id", + "SELECT id,writer,member_key,lower_sequence,upper_sequence,sequence,envelope_hash,position,claim_id,active_claim FROM assistant_grant_additions ORDER BY id", + "SELECT writer,claim_id FROM assistant_grant_auth_work ORDER BY writer,claim_id", + ].into_iter().map(|sql| { + let mut statement = connection.prepare(/* sqlite-large-value: allow-for-now lv-h2245e419e29e owner=smallclaims::store::assistant_grant_receipt_cost_tests TODO=trace-statement-and-value-representation */ sql).unwrap(); + let columns = statement.column_count(); + statement.query_map([], |row| (0..columns).map(|column| row.get(column)).collect()) + .unwrap().collect::>>>().unwrap() + }).collect() +} + +#[test] +fn fresh_nonmember_proof_receipt_has_constant_complete_transaction_vm_cost() { + let (source, key) = source(); + let target = node("reader", Some(key.public())); + let fleet_exchange = export(&source, &target); + receive(&target, &fleet_exchange); + let anchor = raw_claims(&source).into_iter().find(|claim| claim.kind=="fleet.member-admitted").unwrap(); + let grant = append(&source, SUBJECT, GRANTED, fields()); + let exchange = export(&source, &target); + receive_pre_projection_unsigned_history(&target, &exchange); + let envelope = receipt_signature_for_claim(&target, &fleet_exchange, &anchor); + { + let connection = target.connection.write(); + // Persist an interrupted authentication checkpoint and its queued claim. + // A proof from outside the writer's window must neither reset this + // checkpoint nor consume/recreate its work, even for the same envelope. + connection.execute( + /* sqlite-large-value: allow-for-now lv-hfe820094f334 owner=smallclaims::store::assistant_grant_receipt_cost_tests TODO=chunk-or-reference-exact-wire-values */ "INSERT INTO assistant_grant_auth_cursor(claim_id,position,record_rowid,member_key,membership_start) SELECT claim_id,position,rowid,?2,0 FROM replica_records WHERE claim_id=?1 LIMIT 1", + params![grant.id, key.public()], + ).unwrap(); + connection.execute(/* sqlite-large-value: allow-for-now lv-h18b15ee88afe owner=smallclaims::store::assistant_grant_receipt_cost_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_dirty VALUES(?1)", [&grant.id]).unwrap(); + } + let before = receipt_projection_work_state(&target.readers.get()); + assert_eq!(before[1].len(), 1, "checkpoint fixture must be nonempty"); + assert_eq!(before[2].len(), 1, "dirty fixture must be nonempty"); + let initial_signatures: usize = target.readers.get().query_row( + "SELECT COUNT(*) FROM replica_envelope_signatures WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3", + params![envelope.writer,envelope.sequence,envelope.hash], |row| row.get(0), + ).unwrap(); + let baseline = complete_signature_receipt_cost(&target, &fresh_nonmember_proof(&envelope)); + assert!(baseline.statements >= 3, "must account for BEGIN, insertion and COMMIT"); + assert!(baseline.vm_steps > 0, "SQL VM instrumentation must be active"); + assert_eq!(baseline.fullscan_steps, 0); + assert_eq!(baseline.sorts, 0); + assert_eq!(baseline.autoindex_rows, 0); + let mut retained = initial_signatures+1; + for count in [128, 1024] { + for _ in 0..count { + let proof = fresh_nonmember_proof(&envelope); + let work = complete_signature_receipt_cost(&target, &proof); + retained += 1; + assert_eq!(work, baseline, "complete receipt work grew with {retained} retained fresh proofs"); + } + let connection = target.readers.get(); + let stored: usize = connection.query_row( + "SELECT COUNT(*) FROM replica_envelope_signatures WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3", + params![envelope.writer, envelope.sequence, envelope.hash], |row| row.get(0), + ).unwrap(); + assert_eq!(stored, retained, "proofs must be new retained rows, not duplicate no-ops"); + assert_eq!(receipt_projection_work_state(&connection), before, + "irrelevant proofs changed projection revision, checkpoint or queued work"); + } +} + +#[test] +fn sustained_fresh_nonmember_proof_receipts_leave_unrelated_established_credential_live() { + let (source, key) = source(); + let target = node("reader", Some(key.public())); + let established = append(&source, SUBJECT, GRANTED, fields()); + let fleet_exchange = export(&source, &target); + receive(&target, &fleet_exchange); + let anchor = raw_claims(&source).into_iter().find(|claim| claim.kind=="fleet.member-admitted").unwrap(); + let mut pending_fields = fields(); + pending_fields["credential_hash"] = json!("b".repeat(64)); + pending_fields["grant_id"] = json!("assistant-grant/fedcba9876543210fedcba98"); + pending_fields["session_actor"] = json!("assistant/chatgpt/session/assistant-grant/fedcba9876543210fedcba98"); + let pending = append(&source, "custom/client/assistant-v1-fedcba9876543210fedcba98", GRANTED, pending_fields); + let exchange = export(&source, &target); + receive_pre_projection_unsigned_history(&target, &exchange); + let envelope = receipt_signature_for_claim(&target, &fleet_exchange, &anchor); + let before = receipt_projection_work_state(&target.readers.get()); + for arrival in 0..256 { + complete_signature_receipt_cost(&target, &fresh_nonmember_proof(&envelope)); + // Deliberately do not advance background maintenance between arrivals. + // Ongoing irrelevant evidence must not turn a completed grant into a + // globally pending projection, or authenticate the unsigned grant. + let connection = target.readers.get(); + assert_eq!(receipt_projection_work_state(&connection), before, "arrival {arrival} queued projection work"); + assert!(!authority::maintenance_pending(&connection).unwrap()); + assert!(authority::contains(&connection, &established.id).unwrap()); + assert_eq!(authority::by_credential(&connection, &"a".repeat(64)).unwrap().unwrap().id, established.id); + assert!(!authority::contains(&connection, &pending.id).unwrap()); + assert!(authority::by_credential(&connection, &"b".repeat(64)).unwrap().is_none()); + } +} + +#[test] +fn membership_window_changes_share_the_fixed_transaction_budget_without_replacing_unchanged_windows() { + let (store, key) = source(); + drain_authority(&store); + let stable_rowid: i64 = store.readers.get().query_row( + "SELECT rowid FROM assistant_grant_membership_windows WHERE writer='anchor' AND member_key=?1", + [key.public()], |row| row.get(0), + ).unwrap(); + let extra = authority::CLAIMS_PER_SLICE*2+7; + { + let mut connection = store.connection.write(); + let transaction = connection.transaction().unwrap(); + for index in 0..extra { + transaction.execute( + /* sqlite-large-value: allow-for-now lv-h6c78df838342 owner=smallclaims::store::assistant_grant_receipt_cost_tests TODO=bound-or-reference-values-and-reclamation */ "INSERT INTO assistant_grant_membership_windows VALUES('obsolete',?1,0,NULL)", + [format!("obsolete-{index:08}")], + ).unwrap(); + } + transaction.execute( + /* sqlite-large-value: allow-for-now lv-h896ccf48254e owner=smallclaims::store::assistant_grant_receipt_cost_tests TODO=bound-or-reference-values-and-reclamation */ "UPDATE meta SET value=value WHERE key='fleet_anchor_key'", [], + ).unwrap(); + transaction.commit().unwrap(); + } + assert!(!store.advance_assistant_grant_authority_backfill().unwrap()); + let remaining: usize = store.readers.get().query_row( + "SELECT COUNT(*) FROM assistant_grant_membership_windows WHERE writer='obsolete'", + [], |row| row.get(0), + ).unwrap(); + assert_eq!(extra-remaining, authority::CLAIMS_PER_SLICE, + "only the fixed number of changed/deleted windows may be applied"); + let unchanged_rowid: i64 = store.readers.get().query_row( + "SELECT rowid FROM assistant_grant_membership_windows WHERE writer='anchor' AND member_key=?1", + [key.public()], |row| row.get(0), + ).unwrap(); + assert_eq!(unchanged_rowid, stable_rowid, "unchanged windows are never deleted and reinserted"); + // Membership-only work is tracked by the Store's observed generation, not + // the connection-level claim/signature dirty queues. + assert!(store.assistant_grant_authority_maintenance_pending().unwrap()); + drain_authority(&store); + let remaining: usize = store.readers.get().query_row( + "SELECT COUNT(*) FROM assistant_grant_membership_windows WHERE writer='obsolete'", + [], |row| row.get(0), + ).unwrap(); + assert_eq!(remaining, 0); +} + +#[test] +fn unchanged_membership_generation_fold_does_not_enter_the_writer_or_reset_work() { + let (source, key) = source(); + let target = node("reader", Some(key.public())); + let exchange = export(&source, &target); + receive(&target, &exchange); + let anchor = raw_claims(&source).into_iter() + .find(|claim| claim.kind == "fleet.member-admitted").unwrap(); + let envelope = receipt_signature_for_claim(&target, &exchange, &anchor); + let before = receipt_projection_work_state(&target.readers.get()); + complete_signature_receipt_cost(&target, &fresh_nonmember_proof(&envelope)); + assert!(target.assistant_grant_authority_maintenance_pending().unwrap()); + let commits = std::sync::Arc::new(std::sync::atomic::AtomicUsize::new(0)); + let observed = commits.clone(); + let _observer = target.observe_commits(move |_| { + observed.fetch_add(1, std::sync::atomic::Ordering::SeqCst); + }); + assert!(target.advance_assistant_grant_authority_backfill().unwrap()); + assert_eq!(commits.load(std::sync::atomic::Ordering::SeqCst), 0, + "an unchanged authoritative window snapshot must not open a writer transaction"); + assert_eq!(receipt_projection_work_state(&target.readers.get()), before); + assert!(!target.assistant_grant_authority_maintenance_pending().unwrap()); +} diff --git a/crates/smallclaims/src/store/membership_query_tests.rs b/crates/smallclaims/src/store/membership_query_tests.rs index 8022ac07543..17023142724 100644 --- a/crates/smallclaims/src/store/membership_query_tests.rs +++ b/crates/smallclaims/src/store/membership_query_tests.rs @@ -5,6 +5,7 @@ use std::cell::Cell; thread_local! { static STATEMENTS: Cell = const { Cell::new(0) }; + pub(super) static SIGNATURE_VERIFICATIONS: Cell = const { Cell::new(0) }; } fn fixture() -> Connection { @@ -356,3 +357,298 @@ fn sealed_fleet_cache_tracks_batch_signers_after_envelope_identity_changes() { ); } } + +#[test] +fn sealed_membership_cache_reuses_cold_folds_and_recomputes_on_generation_changes() { + let mut connection = fixture(); + connection.execute_batch(/* sqlite-large-value: allow-for-now lv-hf348da4e378d owner=smallclaims::store::membership_query_tests TODO=trace-statement-and-value-representation */ &fleet_generation_schema()).unwrap(); + let anchor = admitted("anchor", "birch", "anchor-key", "anchor", "birch", 3); + insert_claim(&connection, &anchor); + let mut cache = None; + connection.trace(Some(|sql| { + if sql.starts_with("SELECT claims.id, claims.kind, claims.subject, claims.body,") { + STATEMENTS.with(|count| count.set(count.get() + 1)); + } + })); + STATEMENTS.with(|count| count.set(0)); + // Even an empty fold with local unsealed claims must be cached. + for _ in 0..8 { + assert!(!sealed_membership_tx(&connection, &mut cache).unwrap().counts("anchor")); + } + STATEMENTS.with(|count| assert_eq!(count.get(), 1)); + let unsealed_generation = cache.as_ref().unwrap().0; + envelope(&connection, &anchor, "sealed", &["anchor-key"]); + for _ in 0..8 { + assert!(sealed_membership_tx(&connection, &mut cache).unwrap().counts("anchor")); + } + assert!(cache.as_ref().unwrap().0 > unsealed_generation); + STATEMENTS.with(|count| assert_eq!(count.get(), 2)); + connection.execute(/* sqlite-large-value: allow-for-now lv-hbea4b67b6a13 owner=smallclaims::store::membership_query_tests TODO=chunk-or-reference-exact-wire-values */ "DELETE FROM replica_envelope_signatures", []).unwrap(); + for _ in 0..8 { + assert!(!sealed_membership_tx(&connection, &mut cache).unwrap().counts("anchor")); + } + STATEMENTS.with(|count| assert_eq!(count.get(), 3)); + connection.trace(None); +} + +#[test] +fn sealed_membership_request_cache_does_not_bypass_local_batch_sealing() { + let store = Store::open_memory("birch", Arc::new(super::runtime::Plain)).unwrap(); + store.bind_fleet("3e7a9c41-5d2b-4f86-b0c3-9a1e6d4f2b58").unwrap(); + let key = Arc::new(crate::fleet::MemberKey::generate().unwrap().0); + store.load_member_key(Some(key.clone())).unwrap(); + store.pin_fleet_anchor(key.public()).unwrap(); + let mut anchor = admitted("anchor", "birch", key.public(), "anchor", "birch", 1); + anchor.fields.insert( + "fleet_id".into(), + serde_json::json!("3e7a9c41-5d2b-4f86-b0c3-9a1e6d4f2b58"), + ); + let claim = store.append_claim(&ClaimInput { + subject: anchor.subject, + kind: anchor.kind, + actor: None, + fields: anchor.fields, + evidence: Vec::new(), + expected_subject: None, + idempotency_key: None, + }).unwrap(); + assert!(store.membership_cache.lock().unwrap().is_none()); + assert!(store.sealed_membership_cache.lock().unwrap().is_none()); + for _ in 0..3 { + assert!(!store.fleet_membership_sealed().unwrap().counts(&claim.id)); + } + assert!(store.sealed_membership_cache.lock().unwrap().is_some()); + assert!(store.membership_cache.lock().unwrap().is_none()); + assert!(store.fleet_membership().unwrap().counts(&claim.id)); + assert!(store.fleet_membership_sealed().unwrap().counts(&claim.id)); +} + +fn cache_member_window(store: &Store, key: &str, start: u64) { + let mut anchor = admitted("anchor", "birch", key, "anchor", "birch", start.max(1)); + anchor.fields.insert("writer_floor".into(), serde_json::json!(start.saturating_sub(1))); + anchor.signers.insert(key.into()); + let membership = Membership::fold(Some(key), &[anchor]); + assert!(membership.counts("anchor"), "the synthetic keyed window must have a valid anchor"); + let generation = fleet_generation(&store.readers.get()).unwrap(); + *store.membership_cache.lock().unwrap() = Some((generation, membership)); +} + +fn authenticated_member_fixture() -> (Store, String, Arc) { + const FLEET: &str = "3e7a9c41-5d2b-4f86-b0c3-9a1e6d4f2b58"; + let source = Store::open_memory("birch", Arc::new(super::runtime::Plain)).unwrap(); + source.bind_fleet(FLEET).unwrap(); + let key = Arc::new(crate::fleet::MemberKey::generate().unwrap().0); + source.load_member_key(Some(key.clone())).unwrap(); + let claim = source.append_claim(&ClaimInput { + subject: "note/provenance".into(), + kind: "example.note".into(), + actor: None, + fields: BTreeMap::new(), + evidence: Vec::new(), + expected_subject: None, + idempotency_key: None, + }).unwrap(); + let target = Store::open_memory("cedar", Arc::new(super::runtime::Plain)).unwrap(); + target.bind_fleet(FLEET).unwrap(); + let exchange = source.export_replication_exchange( + FLEET, &target.replication_inventory().unwrap(), + ).unwrap(); + target.receive_replication_exchange("birch", FLEET, &exchange).unwrap(); + assert_eq!(target.validate_replication_backlog().unwrap().valid, 1); + target.project_replication_backlog().unwrap(); + assert!(target.claim_by_id(&claim.id).unwrap().is_some()); + // Membership folding is tested above. Pin a sealed keyed window so these controls + // exercise provenance itself, including its warm request-path cache. + cache_member_window(&target, key.public(), 0); + (target, claim.id, key) +} + +#[test] +fn authenticated_member_writer_accepts_a_foreign_origin_from_sealed_membership() { + let (store, claim, _) = authenticated_member_fixture(); + assert!(!store.claim_has_authenticated_self_writer(&claim).unwrap()); + for _ in 0..3 { + assert!(store.claim_has_authenticated_member_writer(&claim).unwrap()); + } + assert!(!store.claim_has_authenticated_member_writer("missing").unwrap()); +} + +#[test] +fn authenticated_member_writer_accepts_valid_records_in_a_degraded_envelope() { + let (store, claim, key) = authenticated_member_fixture(); + store.connection.write().execute( + /* sqlite-large-value: allow-for-now lv-h6d03218a7182 owner=smallclaims::store::membership_query_tests TODO=chunk-or-reference-exact-wire-values */ + "UPDATE replica_envelopes SET receipt_state='degraded'", [], + ).unwrap(); + cache_member_window(&store, key.public(), 0); + assert!(store.claim_has_authenticated_member_writer(&claim).unwrap()); + assert_eq!( + store.claim_ids_with_authenticated_member_writers(std::slice::from_ref(&claim)).unwrap(), + BTreeSet::from([claim.clone()]), + ); + store.connection.write().execute( + /* sqlite-large-value: allow-for-now lv-h9e7e7a841384 owner=smallclaims::store::membership_query_tests TODO=chunk-or-reference-exact-wire-values */ + "UPDATE replica_envelope_signatures SET signature='invalid'", [], + ).unwrap(); + cache_member_window(&store, key.public(), 0); + assert!(!store.claim_has_authenticated_member_writer(&claim).unwrap()); + assert!(store.claim_ids_with_authenticated_member_writers(&[claim]).unwrap().is_empty()); +} + +#[test] +fn authenticated_member_writer_rejects_legacy_wrong_key_and_outside_window() { + let (store, claim, key) = authenticated_member_fixture(); + assert!(store.claim_has_authenticated_member_writer(&claim).unwrap()); + let generation = fleet_generation(&store.readers.get()).unwrap(); + *store.membership_cache.lock().unwrap() = Some((generation, Membership::default())); + assert!(!store.claim_has_authenticated_member_writer(&claim).unwrap()); + let other = crate::fleet::MemberKey::generate().unwrap().0; + cache_member_window(&store, other.public(), 0); + assert!(!store.claim_has_authenticated_member_writer(&claim).unwrap()); + cache_member_window(&store, key.public(), u64::MAX); + assert!(!store.claim_has_authenticated_member_writer(&claim).unwrap()); +} + +#[test] +fn authenticated_member_writer_requires_origin_valid_record_admitted_envelope_and_signature() { + for sql in [ + /* sqlite-large-value: allow-for-now lv-h908d794ad3e8 owner=smallclaims::store::membership_query_tests TODO=prepare-body-and-predecessor-values */ + "UPDATE claims SET origin='forged-origin'", + /* sqlite-large-value: allow-for-now lv-h6ff49ec4f026 owner=smallclaims::store::membership_query_tests TODO=chunk-or-reference-exact-wire-values */ + "UPDATE replica_records SET state='invalid'", + /* sqlite-large-value: allow-for-now lv-h98f2eff88ab2 owner=smallclaims::store::membership_query_tests TODO=chunk-or-reference-exact-wire-values */ + "UPDATE replica_records SET state='pending'", + /* sqlite-large-value: allow-for-now lv-ha41272fe6b10 owner=smallclaims::store::membership_query_tests TODO=chunk-or-reference-exact-wire-values */ + "UPDATE replica_envelopes SET receipt_state='pending'", + /* sqlite-large-value: allow-for-now lv-h93f4bed1c2b4 owner=smallclaims::store::membership_query_tests TODO=chunk-or-reference-exact-wire-values */ + "DELETE FROM replica_envelope_signatures", + /* sqlite-large-value: allow-for-now lv-h1c91a0dec004 owner=smallclaims::store::membership_query_tests TODO=chunk-or-reference-exact-wire-values */ + "UPDATE replica_envelope_signatures SET signature='invalid'", + /* sqlite-large-value: allow-for-now lv-hc8361ab9b858 owner=smallclaims::store::membership_query_tests TODO=chunk-or-reference-exact-wire-values */ + "UPDATE replica_envelope_signatures SET envelope_hash='other-envelope'", + ] { + let (store, claim, key) = authenticated_member_fixture(); + store.connection.write().execute_batch(/* sqlite-large-value: allow-for-now lv-h622f4fdd0f6d owner=smallclaims::store::membership_query_tests TODO=trace-statement-and-value-representation */ sql).unwrap(); + cache_member_window(&store, key.public(), 0); + assert!(!store.claim_has_authenticated_member_writer(&claim).unwrap(), "{sql}"); + assert!( + store.claim_ids_with_authenticated_member_writers(&[claim]).unwrap().is_empty(), + "{sql}", + ); + } +} + +#[test] +fn authenticated_member_writer_rejects_wrong_fleet_and_shard_signature_domains() { + for shard in [None, Some("another-shard")] { + let (store, claim, key) = authenticated_member_fixture(); + let connection = store.connection.write(); + let (sequence, hash): (u64, String) = connection.query_row( + "SELECT sequence, envelope_hash FROM replica_records WHERE claim_id=?1", + [&claim], |row| Ok((row.get(0)?, row.get(1)?)), + ).unwrap(); + let signature = key.sign(&crate::fleet::envelope_signature_message_in( + shard, + if shard.is_some() { + "3e7a9c41-5d2b-4f86-b0c3-9a1e6d4f2b58" + } else { + "another-fleet" + }, + "birch", sequence, &hash, + )); + connection.execute( + /* sqlite-large-value: allow-for-now lv-hf3e2d678372b owner=smallclaims::store::membership_query_tests TODO=chunk-or-reference-exact-wire-values */ + "UPDATE replica_envelope_signatures SET signature=?1", [&signature], + ).unwrap(); + drop(connection); + cache_member_window(&store, key.public(), 0); + assert!(!store.claim_has_authenticated_member_writer(&claim).unwrap()); + assert!(store.claim_ids_with_authenticated_member_writers(&[claim]).unwrap().is_empty()); + } +} + +#[test] +fn batch_authenticated_member_writers_match_scalar_keyed_and_legacy_windows() { + let (store, claim, key) = authenticated_member_fixture(); + let requested = vec![claim.clone(), "missing".into(), claim.clone()]; + let assert_parity = |expected: bool| { + let batch = store.claim_ids_with_authenticated_member_writers(&requested).unwrap(); + assert_eq!( + batch, + if expected { BTreeSet::from([claim.clone()]) } else { BTreeSet::new() }, + ); + for id in &requested { + assert_eq!(batch.contains(id), store.claim_has_authenticated_member_writer(id).unwrap()); + } + }; + assert_parity(true); + // The same signed envelope is legacy before its incarnation's floor. + cache_member_window(&store, key.public(), u64::MAX); + assert_parity(false); + let generation = fleet_generation(&store.readers.get()).unwrap(); + *store.membership_cache.lock().unwrap() = Some((generation, Membership::default())); + assert_parity(false); + let other = crate::fleet::MemberKey::generate().unwrap().0; + cache_member_window(&store, other.public(), 0); + assert_parity(false); + cache_member_window(&store, key.public(), 0); + assert_parity(true); + assert!(store.claim_ids_with_authenticated_member_writers(&[]).unwrap().is_empty()); +} + +#[test] +fn batch_authenticated_member_writers_verify_shared_envelope_signatures_once() { + let (store, claim, key) = authenticated_member_fixture(); + let sibling = store.append_claim(&ClaimInput { + subject: "note/provenance-sibling".into(), + kind: "example.note".into(), + actor: None, + fields: BTreeMap::new(), + evidence: Vec::new(), + expected_subject: None, + idempotency_key: None, + }).unwrap(); + // Invent a second admitted record in the same envelope: only the signed envelope + // identity matters to this query, not the record's retained payload. + { + let connection = store.connection.write(); + connection.execute( + /* sqlite-large-value: allow-for-now lv-hb5e52f377f02 owner=smallclaims::store::membership_query_tests TODO=prepare-body-and-predecessor-values */ + "UPDATE claims SET origin='birch' WHERE id=?1", [&sibling.id], + ).unwrap(); + connection.execute( + /* sqlite-large-value: allow-for-now lv-he6cdb35f9041 owner=smallclaims::store::membership_query_tests TODO=chunk-or-reference-exact-wire-values */ + "INSERT INTO replica_records( + record_ref, writer, sequence, envelope_hash, position, raw, state, + claim_id, updated_at_unix_ms + ) SELECT record_ref || '-sibling', writer, sequence, envelope_hash, + position + 1, raw, state, ?1, updated_at_unix_ms + FROM replica_records WHERE claim_id=?2", + params![sibling.id, claim], + ).unwrap(); + } + let requested = vec![claim.clone(), sibling.id.clone(), claim.clone(), sibling.id.clone()]; + for valid in [true, false] { + if !valid { + store.connection.write().execute( + /* sqlite-large-value: allow-for-now lv-h85da58ff0363 owner=smallclaims::store::membership_query_tests TODO=chunk-or-reference-exact-wire-values */ + "UPDATE replica_envelope_signatures SET signature='invalid'", [], + ).unwrap(); + } + cache_member_window(&store, key.public(), 0); + SIGNATURE_VERIFICATIONS.with(|count| count.set(0)); + let batch = store.claim_ids_with_authenticated_member_writers(&requested).unwrap(); + SIGNATURE_VERIFICATIONS.with(|count| assert_eq!(count.get(), 1)); + assert_eq!( + batch, + if valid { + BTreeSet::from([claim.clone(), sibling.id.clone()]) + } else { + BTreeSet::new() + }, + ); + for id in &requested { + assert_eq!(batch.contains(id), store.claim_has_authenticated_member_writer(id).unwrap()); + } + } +} diff --git a/crates/smallclaims/src/store/prepared_envelope.rs b/crates/smallclaims/src/store/prepared_envelope.rs index d4e58679cf1..014f5ecbd24 100644 --- a/crates/smallclaims/src/store/prepared_envelope.rs +++ b/crates/smallclaims/src/store/prepared_envelope.rs @@ -561,5 +561,8 @@ pub fn admit_prepared_envelope_tx( batch.id, ]) .map_err(internal)?; + super::assistant_grant_authority::refresh_envelope( + transaction, &envelope.writer, envelope.sequence, &envelope.hash, + ).map_err(internal)?; Ok(()) } diff --git a/crates/smallclaims/src/store/prepared_seal.rs b/crates/smallclaims/src/store/prepared_seal.rs index 9b1d25ad0a2..6cb550154b2 100644 --- a/crates/smallclaims/src/store/prepared_seal.rs +++ b/crates/smallclaims/src/store/prepared_seal.rs @@ -349,6 +349,9 @@ pub(crate) fn write_sealed_batch_tx( ], )?; } + super::assistant_grant_authority::refresh_envelope( + transaction, &batch.writer, batch.sequence, &sealed.envelope_hash, + )?; Ok(()) } @@ -618,6 +621,9 @@ impl Store { now ], )?; + super::assistant_grant_authority::refresh_envelope( + transaction, &self.origin, envelope.0, &envelope.1, + )?; } } Ok(true) diff --git a/docs/st3/backups.md b/docs/st3/backups.md index 11a74a0a696..bc4027eb6b3 100644 --- a/docs/st3/backups.md +++ b/docs/st3/backups.md @@ -32,6 +32,13 @@ Without `--database`, restore selects `claims.sqlite3` in the configured `store_ `state_dir` when `store_dir` is unset. Stop the daemon before restoring there. Neither command installs services or starts a daemon. +Logical restore assigns a new writer and does not carry the source member's local +append markers for external grants. Unsigned pre-restore grants fail closed rather +than inheriting local authority. The configured owner must explicitly reissue them +using the same [grant reissue procedure](external-assistants.md#upgrade-reissue-grants-without-authenticated-historical-provenance) +as unsigned pre-upgrade grants; retaining an old bearer or editing provenance +markers is not recovery. + A backup of a member also holds the whole text of the [long messages](long-messages.md) that member owns, which are files outside the database; restore checks each against its hash and its claim and returns them to the product state root. Moving the database with `store_dir` does not diff --git a/docs/st3/client-v0/schemas/client-v0.schema.json b/docs/st3/client-v0/schemas/client-v0.schema.json index 3daf13f9002..b14d33cf020 100644 --- a/docs/st3/client-v0/schemas/client-v0.schema.json +++ b/docs/st3/client-v0/schemas/client-v0.schema.json @@ -629,6 +629,8 @@ "peer-too-old", "validation-failed", "idempotency-conflict", + "grant-profile-conflict", + "assistant-grant-authority-not-ready", "legacy-action-receipt-untrusted", "issuer-required", "pairing-origin-required", @@ -3944,6 +3946,35 @@ "write.assistant.answers" ] }, "AssistantMinimalReadMode": { "enum": ["approval-once", "caller-bound-allow"] }, + "ExternalGrantProfile": { "enum": ["assistant", "service"] }, + "GrantProfileConflictCause": { "enum": ["revoked", "expired"] }, + "GrantProfileWitness": { + "type": "object", + "additionalProperties": false, + "required": ["grant_id", "origin", "profile"], + "properties": { + "grant_id": { "type": ["string", "null"], "description": "Grant ID; null only for legacy local fixtures without an ID." }, + "origin": { "type": "string" }, + "profile": { "$ref": "#/$defs/ExternalGrantProfile" } + } + }, + "GrantProfileConflictWitness": { + "type": "object", + "additionalProperties": false, + "required": ["grants"], + "properties": { + "grants": { "type": "array", "items": { "$ref": "#/$defs/GrantProfileWitness" } } + } + }, + "ClearedGrantProfileConflictWitness": { + "type": "object", + "additionalProperties": false, + "required": ["grants", "cause"], + "properties": { + "grants": { "type": "array", "items": { "$ref": "#/$defs/GrantProfileWitness" } }, + "cause": { "$ref": "#/$defs/GrantProfileConflictCause" } + } + }, "AssistantGrant": { "type": "object", "additionalProperties": false, @@ -3965,6 +3996,8 @@ "disclosure_consent": { "type": "boolean" }, "consent_evidence": { "type": "string", "minLength": 1, "maxLength": 512 }, "revoked": { "type": "boolean" }, + "conflict": { "anyOf": [{ "$ref": "#/$defs/GrantProfileConflictWitness" }, { "type": "null" }], "description": "Current opposite-profile conflict, or null when no active conflict exists. Present only on daemon-configured-owner grant inspection with witness=1; omitted from default inspection, bearer authentication errors, pairing and mutation responses." }, + "cleared_conflicts": { "type": "array", "items": { "$ref": "#/$defs/ClearedGrantProfileConflictWitness" }, "description": "Revoked or expired opposite-profile witnesses; emitted only on daemon-configured-owner grant inspection with witness=1 when conflict is null. Never disclosed by bearer authentication errors or pairing." }, "read_trust": { "$ref": "#/$defs/AssistantReadTrust", "description": "Owner-provisioned public pins for SCG read proofs. Absent means every assistant read is denied." } } }, diff --git a/docs/st3/client-v0/schemas/operations.json b/docs/st3/client-v0/schemas/operations.json index 059afe7765e..40212f1c40d 100644 --- a/docs/st3/client-v0/schemas/operations.json +++ b/docs/st3/client-v0/schemas/operations.json @@ -17,6 +17,17 @@ "public_listener": false, "remote_mode": "online-thin-client" }, + "assistant_grant_authority_contract": { + "projection_version": 1, + "backfill": "resumable-background", + "compatibility_reconciliation": "commit-notification-driven-background-dirty-drain", + "authorization_during_backfill": "fail-closed", + "not_ready_error": { + "code": "assistant-grant-authority-not-ready", + "http_status": 503, + "retryable": true + } + }, "agents_publication_contract": { "description": "Complete current agents publications with an explicit version-1 collections-stream opt-in. No HTTP endpoint or capability availability is added.", "metadata": "AgentsPublicationMetadata", @@ -136,7 +147,7 @@ { "id": "action.submit", "method": "POST", "path": "/v1/client/actions", "request": "ActionRequest", "response": "ActionResult" }, { "id": "pairing.begin", "method": "POST", "path": "/v1/client/pairings", "request": "PairingBegin", "response": "PairingChallenge", "local_only": true }, { "id": "pairing.complete", "method": "POST", "path": "/v1/client/pairings/{id}/complete", "request": "PairingComplete", "response": "PairedSession" }, - { "id": "assistant.grant.get", "method": "GET", "path": "/v1/client/assistant/grants/{id}", "response": "AssistantGrant", "local_only": true, "actor": "daemon-configured-owner", "capability": "assistant.grants.v1" }, + { "id": "assistant.grant.get", "method": "GET", "path": "/v1/client/assistant/grants/{id}", "response": "AssistantGrant", "local_only": true, "actor": "daemon-configured-owner", "capability": "assistant.grants.v1", "query": { "witness": "optional; only 1 opts into conflict and cleared_conflicts fields for daemon-configured-owner inspection. Omitted or any other value retains the pre-witness response shape. Witnesses are owner-only, never exposed by bearer authentication, pairing or grant mutations. Bearer and pairing profile conflicts return HTTP 409 with code grant-profile-conflict and the fixed message principal has active grants of opposite profiles; revoke one to clear the conflict, without witness details." } }, { "id": "assistant.grant.revoke", "method": "POST", "path": "/v1/client/assistant/grants/{id}/revoke", "response": "AssistantGrant", "local_only": true, "actor": "daemon-configured-owner", "capability": "assistant.grants.v1" }, { "id": "assistant.grant.policy", "method": "POST", "path": "/v1/client/assistant/grants/{id}/policy", "request": "AssistantGrantPolicy", "response": "AssistantGrant", "local_only": true, "actor": "daemon-configured-owner", "capability": "assistant.grants.v1" }, { "id": "assistant.grant.read-trust", "method": "POST", "path": "/v1/client/assistant/grants/{id}/read-trust", "request": "AssistantReadTrustRequest", "response": "AssistantGrant", "local_only": true, "actor": "daemon-configured-owner", "capability": "assistant.grants.v1", "increments_policy_revision": true }, diff --git a/docs/st3/external-assistants.md b/docs/st3/external-assistants.md index 62d3c943beb..101fc1e9747 100644 --- a/docs/st3/external-assistants.md +++ b/docs/st3/external-assistants.md @@ -157,6 +157,149 @@ requests still require independent owning-person confirmation. Older daemons reject the new principal rather than accepting it as ChatGPT or a person; do not work around rejection by switching credentials. +### Upgrade: reissue grants without authenticated historical provenance + +The authority projection remains version 1 (unreleased). A durable local-append +marker is written only when this member appends a new grant, policy, or revocation +claim locally. Upgrade does not manufacture markers for existing claims. An +unmarked historical claim needs a verified member envelope signature and matching +admitted membership window, even when its origin names this member. Unsigned or +unsealed Legacy history fails closed; merely retaining the old bearer is not +sufficient. Grants issued before upgrade without a verifiable member signature +stay unusable and the configured owner must reissue them. + +A logical backup restore assigns a new writer and does not carry this member's +local-append markers. Unsigned pre-restore grants therefore fail closed, even if +they authenticated before backup. The same configured-owner reissue procedure +below applies; a restore is not a way to manufacture historical provenance. + +Authority maintenance is lifecycle-owned. While work remains, pages execute +back-to-back as bounded transactions, releasing the writer between pages and +yielding to the runtime rather than using sleep-based pacing. +Each transaction shares a 64-unit budget across changed membership windows, +history, dirty-signature claims, and membership retries; empty membership-writer +tasks also consume one unit. Membership folding and snapshot comparison happen +on readers before writer admission; only changed keys are applied, never a full +window replacement in a receipt transaction. +Each authentication refresh visits one indexed replica record and at most 16 +writer membership keys, looking up signatures by their full +`(writer, sequence, envelope_hash, member_key)` key rather than enumerating +nonmember signatures. Durable record/key cursors continue across units so later +eligible evidence is eventually checked. Only relevant member-key evidence or +membership retries reset that progress. Fresh nonmember signatures neither +reset cursors nor enqueue projection work. They can invalidate the inherited +fleet-generation cache: maintenance folds the authoritative sealed view on +readers, compares windows, and observes an unchanged snapshot in memory without +opening a writer transaction or resetting authentication work. No parallel +membership-invalidation revision or trigger set is maintained. An identical +signature is also a no-op. + +Global not-ready applies only during initial/version backfill. Thereafter dirty +or pending authentication fences only that grant subject, including a pending +revoke; established credentials for unrelated subjects remain usable. The last +authenticated effective snapshot remains a conflict witness until an authenticated +transition changes it: pending work cannot clear an existing opposite-profile +conflict. The inherited fleet-generation fold can still aggregate historical +signature keys on readers; that pre-existing amplification is tracked by #6124 +and is not claimed fixed here. During a transient subject fence, bearer clients +receive generic credential rejection, not a subject-maintenance reason. This is +intentional: distinguishing a fenced credential from an invalid credential would +create an authentication oracle. Operators can see the cause in trusted-local +`fractal doctor`. Writer-time subject fences also retain the generic +authorization denial. Clean-grant inspection omits optional cleared-conflict +explanations for other subjects whose authentication is pending, rather than +denying inspection or weakening an established conflict witness. + +After the authority backfill completes, `fractal doctor` lists every pending +unauthenticated, unmarked local grant claim ID under the claim-store check with +reason `grant predates local-append provenance; re-issue`. It also lists remote +unmarked grants, but reports missing verified provenance and unknown issuance age: +the absence of this member's local marker does not prove remote history predates +upgrade. A verified historical signature removes the unauthenticated warning. +The same private provenance check lists affected grant subjects and their +maintenance causes: dirty claims awaiting projection, signature authentication +cursors in progress, unauthenticated grant/policy/revocation evidence, or queued +writer membership revalidation. Retractions revisit only claims authenticated by +the affected member key at sequences that lost window coverage; unaffected +authenticated subjects are not fenced by new membership windows. Durable +key/range cursors and per-base authority deletion/effective recomputation share +the 64-unit transaction budget. A membership warning covers only those precise +proof dependencies beyond its cursor and clears as maintenance advances. +Restored window coverage immediately exempts covered proof dependencies from +the retraction fence; maintenance trims or cancels the queued ranges within its +budget. A legitimate key removal still costs \(O(\text{rows authenticated by +that key})\) in total, across bounded transactions, and affected subjects remain +fenced until rechecked. Only an authenticated fleet member already authorized +to remove members can trigger this membership cost. + +Each remote authentication records its complete proof identity: writer, +sequence, envelope hash, record position and member key. Signature deletion or +replacement, record invalidation/deletion, and envelope invalidation/deletion +persistently queue only dependent proofs in the mutating transaction. Indexed +maintenance visits one dependent claim per unit; an unrelated membership +addition cannot hide proof withdrawal. Private doctor diagnostics include +`authentication proof evidence changed`. Raw claims removed by checkpoint trim +retire their cached authority through the same bounded demotion path. +Proof withdrawal creates a separate durable verification obligation, not just an +ordinary projection-dirty row. Non-verifying receipt/envelope refreshes cannot +clear that obligation, including when revalidation changes a record to invalid +or repaired and refreshes its envelope in the same transaction. Only maintenance +using current membership can discharge it after verification finishes; partial +authentication pages retain the obligation and subject fence. +Coverage additions queue durable writer/key/range tasks, capped at the writer's +stored receipt frontier; future-only additions create no historical work. Tasks +seek only grant claims needing authentication through a body-free writer/claim +work index, maintained atomically with unauthenticated rows and cursor/recheck +obligations. Each task then seeks that claim's own receipts in the added range. +One claim selection, receipt attempt or claim completion consumes a budget unit; +unrelated history is never enumerated. Total work is proportional to needing +grant rows and their own matching receipts, not all writer receipts. Ordinary +dirty authentication receives the first half of each transaction with a durable +round-robin cursor, so an addition backlog cannot keep dirty subjects fenced. +Late dirty work sorting before the saved cursor wraps within the same slice, +without waiting for a later maintenance wakeup. Repeated cursor or recheck writes +retain one work-set entry even under an outer SQL upsert's conflict policy. +A claim with a durable proof recheck has exactly one authentication-cursor +owner: the recheck verifier. Ordinary dirty dispatch invokes that same verifier +step and discharges the obligation on completion, so even a one-unit or +zero-duration slice makes progress without authenticating the claim twice or +waiting indefinitely to reach a later queue. +Original authentication cursors never rewind for membership additions. Key +pages seek `(writer,start,member_key)` with start at or below the receipt sequence; +expired windows are filtered after the fixed candidate limit and still consume +the budget. A key learned below a cursor can restore a demoted row through its +independent addition task. On upgrade, committed legacy writer-retry obligations +become durable verifier rechecks before their old queue is dropped. Old key-only +cursors are requeued rather than interpreted in the new start/key ordering. +Subject readiness starts with indexed subject claims and probes the queued +obligations by their keys; unrelated queue growth does not cause a queue scan. +It is not constant cost: a subject with many claims or matching proof/range +obligations costs more. The q39 measurement must include queued retractions for +the measured subject, not only a clean subject or unrelated queued work. +These details remain on trusted-local doctor only: paired clients with +`read.projections` cannot retrieve the provenance check through either the +operations collection or operation detail. Clients continue to receive generic +credential rejection during subject maintenance, without those diagnostic details. + +Reissue means **a new explicit pairing**, not renewal of the old grant or a SQL +edit. On the daemon host, use the configured owner and original assistant +principal with only explicitly approved scopes and recorded disclosure consent: + +```sh +fractal devices --as person/OWNER pair --assistant assistant/mcp \ + --scope read.assistant.summary \ + --disclose-to-openai --consent-evidence '' +fractal devices complete MEMBER_URL PAIRING_ID --assistant \ + --profile /absolute/path/to/new-profile.json +``` + +Use `assistant/chatgpt` instead when replacing a ChatGPT grant; never switch +principals to work around rejection. Complete the printed challenge using stdin, +then provision the newly issued credential in a protected token file as described +above and remove the old adapter credential. Service-profile issuance remains +disabled; this procedure does not enable it. Do not insert provenance markers, +rewrite signed history, or delete claims to make old grants authenticate. + ## Adapter call diagnostics `fractal-chatgpt` emits one structured `tracing` completion event per dispatched tool @@ -213,6 +356,7 @@ commands from a local terminal on the same host; SSH sessions are not supported. - Each request rechecks the authoritative grant, revocation, expiry, and current policy. Revocation targets the exact grant, not a shared device actor. Restart must not revive a revoked or expired grant. - Completion, authenticated assistant requests, renewal/policy changes, and revocation must reach the authoritative grant-issuer member. Replicated grants cannot establish current revocation/policy authority or enable cross-member proof replay. - Versioned assistant grant/revocation claims are separate from historical person claims. Credentials are stored authoritatively as digests, never bearers. Public projections must not expose credential digests. Rebuildable projections are not sole authorization authority. +- Replicated grant, policy, and revocation claims acquire projection authority only after their envelope signatures verify against the keyed membership window. A persistent SQLite trigger queues affected grant-kind records when a signature is inserted, including by older writers without projection hooks. Background draining survives reopen and reruns cryptographic authentication without rescanning completed claim history or requiring a membership change; signature-row presence alone never grants authority. - Creation, completion, renewal, policy change, and revocation outcomes must retain issuer, actor, transport, timestamps, and claim references for audit. Logs and public CLI output must not expose bearer credentials or private keys. ### Pairing verifier and recovery diff --git a/docs/st3/large-value-sites.json b/docs/st3/large-value-sites.json index 9d4c8ab214b..78616c9dd12 100644 --- a/docs/st3/large-value-sites.json +++ b/docs/st3/large-value-sites.json @@ -411,143 +411,142 @@ {"site": "lv-h932a52c91553", "path": "crates/fractal-store/src/store/work_summaries_ivm.rs", "table_pattern": "local_work_summary_clock", "columns": [{"name": "singleton", "declared_type": "INTEGER", "declaration": "INTEGER PRIMARY KEY CHECK(singleton=1)", "value_size_proven": false}, {"name": "through_ms", "declared_type": "BLOB", "declaration": "BLOB NOT NULL CHECK(length(through_ms)=16)", "value_size_proven": false}], "unresolved_template": false}, {"site": "lv-h932a52c91553", "path": "crates/fractal-store/src/store/work_summaries_ivm.rs", "table_pattern": "local_work_summaries", "columns": [{"name": "key", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "attempt", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "progress", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "progress_at", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "completion", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "next_at", "declared_type": "BLOB", "declaration": "BLOB CHECK(next_at IS NULL OR length(next_at)=16)", "value_size_proven": false}], "unresolved_template": false}, {"site": "lv-h932a52c91553", "path": "crates/fractal-store/src/store/work_summaries_ivm.rs", "index_pattern": "local_work_summaries_deadline", "table_pattern": "local_work_summaries", "key_expression_and_predicate": "(next_at,key) WHERE next_at IS NOT NULL", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "desired", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "kind", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES claims(id)", "value_size_proven": false}, {"name": "body", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "member", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "owner_run", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "owner_generation", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "owner_step", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_desired_write_witness", "columns": [{"name": "id", "declared_type": "INTEGER", "declaration": "INTEGER PRIMARY KEY CHECK(id=1)", "value_size_proven": false}, {"name": "generation", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL CHECK(typeof(generation)='integer' AND generation>=0)", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "mission_run_requests", "columns": [{"name": "operation_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "request_hash", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "message_index", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "created_index", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "closed", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_native_delivery_receipts_v2", "columns": [{"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY REFERENCES claims(id) ON DELETE CASCADE", "value_size_proven": false}, {"name": "claim_hash", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "session_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "native_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "actor", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "origin", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "store_index", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "capabilities", "columns": [{"name": "secret_hash", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "kind", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "incarnation_id", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "expires_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "used", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "mission_revisions", "columns": [{"name": "mission_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "state", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "body", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES claims(id)", "value_size_proven": false}, {"name": "created_index", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "mission_definitions", "columns": [{"name": "mission_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "state", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES claims(id)", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "mission_runs", "columns": [{"name": "id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "mission_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "initial_revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "current_generation_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "root_revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "root_run_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "parent_step_run", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "workspace", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "requester", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "inputs", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "mode", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "status", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "phase", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "created_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "updated_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "mission_run_deadlines", "columns": [{"name": "run_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY REFERENCES mission_runs(id)", "value_size_proven": false}, {"name": "timeout_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "deadline_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "mission_run_after", "columns": [{"name": "run_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY REFERENCES mission_runs(id)", "value_size_proven": false}, {"name": "after_run", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "run_generations", "columns": [{"name": "id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "run_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES mission_runs(id)", "value_size_proven": false}, {"name": "revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "predecessor_id", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "status", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "actor", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "reason", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "created_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "updated_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "step_runs", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "run_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES mission_runs(id)", "value_size_proven": false}, {"name": "generation_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES run_generations(id)", "value_size_proven": false}, {"name": "step_path", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "definition_hash", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "status", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "attempt", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "assignee", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "available_to", "declared_type": "TEXT", "declaration": "TEXT NOT NULL DEFAULT '[]'", "value_size_proven": false}, {"name": "agentless", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 1", "value_size_proven": false}, {"name": "title", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "goals", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "worker_reported", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "lease_owner", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "lease_incarnation", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "lease_expires_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "blocked_reason", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "not_before_unix_ms", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "activated_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "readiness_epoch", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "created_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "updated_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "constraints", "declared_type": "TEXT", "declaration": "TEXT NOT NULL DEFAULT '[]'", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_harness_question_generations", "columns": [{"name": "question", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "generation", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_mailbox_owners", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "component", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "incarnation", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "epoch", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_mailbox_bindings", "columns": [{"name": "token", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "component", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "incarnation", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "epoch", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_mailbox_argv_bindings", "columns": [{"name": "token", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "component", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "incarnation", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "epoch", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "member", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_mailbox_leases", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "component", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "incarnation", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "provider", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "session", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "sequence", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "pid", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "process_token", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "token", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "epoch", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "revoked", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_work_lease_renewals", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "attempt", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "lease_owner", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "lease_incarnation", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "lease_expires_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "updated_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_observations", "columns": [{"name": "id", "declared_type": "INTEGER", "declaration": "INTEGER PRIMARY KEY AUTOINCREMENT", "value_size_proven": false}, {"name": "after_store_index", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "kind", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "actor", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "body", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "dedupe_key", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "request_digest", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "observed_at_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "client_diagnostic_receipts", "columns": [{"name": "device", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "event_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "accepted_at_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_subscription_mission_deferrals", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "request", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "not_before_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "attempts", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_usage_spend", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "incarnation_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "model", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "account", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "owner_run", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "owner_step", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "host", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "input_tokens", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "output_tokens", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "cache_write_tokens", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "cache_write_1h_tokens", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "cached_tokens", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "total_tokens", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "cost_microusd", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "reported_cost_microusd", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "unpriced_tokens", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "observed_at_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_usage_provenance", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "slot", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "pricing", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_limit_stops", "columns": [{"name": "account", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "episode", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "seat", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "stopped_at_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_seat_accounts", "columns": [{"name": "seat", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "account", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "chosen_at_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_usage_responses", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "source_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "observed_at_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_latest_slots", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "kind", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "slot", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "published_at_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "published_fields", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "pending_local_id", "declared_type": "INTEGER", "declaration": "INTEGER", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "claims_stored", "columns": [{"name": "kind", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "writer", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "since_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "claims", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "bytes", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "revision_proposals", "columns": [{"name": "id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "run_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES mission_runs(id)", "value_size_proven": false}, {"name": "source_generation_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES run_generations(id)", "value_size_proven": false}, {"name": "candidate_revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "actor", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "reason", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "status", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "cutover", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "compatible_steps", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "reviewers", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "approvals", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "preview_hash", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "successor_generation_id", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "created_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "updated_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "planning_sessions", "columns": [{"name": "id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "mission_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "request_ref", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "workspace", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "requester", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "planner", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "planner_spec_json", "declared_type": "TEXT", "declaration": "TEXT NOT NULL DEFAULT '{\"provider\":\"codex\"}'", "value_size_proven": false}, {"name": "status", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "target_run_id", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "source_generation_id", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "published_revision", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "created_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "updated_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "planning_candidates", "columns": [{"name": "session_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES planning_sessions(id)", "value_size_proven": false}, {"name": "variant", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "revision", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "markdown_ref", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "kdl_ref", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "mission_revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "submitted_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "table_pattern": "planning_previews", "columns": [{"name": "session_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES planning_sessions(id)", "value_size_proven": false}, {"name": "variant", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "candidate_revision", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "hash", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "store_index", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "graph", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "diff", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "mission_response", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "created_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_owned_set_subject_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject) WHERE json_extract(body,'$.owned_set') IS NOT NULL", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_terminal_history_index", "table_pattern": "claims", "key_expression_and_predicate": "(store_index) WHERE kind IN ('mission-run.state','step-run.state','work.failed') AND json_extract(body,'$.fields.status') IN ('failed','cancelled','completed')", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_terminal_capability_hash_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.capability_hash'), store_index) WHERE kind='custom.client.terminal-attached'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_receipt_actor_key_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.receipt.actor_key'), origin, subject) WHERE kind='harness-question.resolved' AND actor IS NULL", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_message_to_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.to'), subject) WHERE kind='message.sent'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_run_report_to_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.report_to'), subject) WHERE kind IN ('mission-run.created','mission-run.report-to')", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_message_from_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.from'), store_index) WHERE kind='message.sent'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_message_legacy_to_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.to'), store_index) WHERE kind='message.sent' AND json_type(body, '$.fields') IS NULL", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_message_legacy_from_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.from'), store_index) WHERE kind='message.sent' AND json_type(body, '$.fields') IS NULL", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_resume_host_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.host'), subject) WHERE kind='runtime.action.requested' AND json_extract(body,'$.fields.action')='resume'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_actor_activity_time_index", "table_pattern": "claims", "key_expression_and_predicate": "(actor, length(accepted_at_unix_ms), accepted_at_unix_ms, store_index) WHERE kind IN ('work.progress', 'work.submitted')", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_message_from_activity_time_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.from'), length(accepted_at_unix_ms), accepted_at_unix_ms, store_index) WHERE kind='message.sent'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_message_to_activity_time_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.to'), length(accepted_at_unix_ms), accepted_at_unix_ms, store_index) WHERE kind='message.sent'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_timeline_activity_time_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.incarnation_id'), length(accepted_at_unix_ms), accepted_at_unix_ms, store_index) WHERE kind='harness.timeline' AND json_extract(body, '$.fields.entry_type') IN ('message','content','tool_call','tool_result')", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_actor_work_activity_index", "table_pattern": "claims", "key_expression_and_predicate": "(actor, json_extract(body, '$.fields.claim_incarnation'), store_index) WHERE kind IN ('work.claimed', 'work.progress')", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subagent_appeared_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.subagent_id')) WHERE kind='subagent.appeared'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subagent_renewed_max_lease_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.subagent_id'), CAST(json_extract(body, '$.fields.lease_expires_at_unix_ms') AS INTEGER)) WHERE kind='subagent.renewed'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subagent_ended_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.subagent_id')) WHERE kind='subagent.ended'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subagent_appeared_lease_index", "table_pattern": "claims", "key_expression_and_predicate": "(CAST(json_extract(body, '$.fields.lease_expires_at_unix_ms') AS INTEGER)) WHERE kind='subagent.appeared'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subagent_renewed_lease_index", "table_pattern": "claims", "key_expression_and_predicate": "(CAST(json_extract(body, '$.fields.lease_expires_at_unix_ms') AS INTEGER)) WHERE kind='subagent.renewed'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_timeline_incarnation_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, kind, json_extract(body, '$.fields.incarnation_id'), store_index) WHERE kind='harness.timeline'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subscription_finished_request_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.request')) WHERE kind IN ( 'subscription.mission-started', 'subscription.mission-failed', 'subscription.mission-request-cancelled' )", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subscription_delivery_key_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.delivery_key')) WHERE kind='subscription.mission-requested'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subscription_started_run_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.mission_run')) WHERE kind='subscription.mission-started'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subscription_mission_resource_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.mission'), json_extract(body, '$.fields.resource')) WHERE kind='subscription.mission-requested'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_authored_pull_request_url_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.facts.url')) WHERE kind='resource.observed' AND subject LIKE 'resource/mission-run/%/pull-request'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_authored_pull_request_number_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.facts.repository'), json_extract(body, '$.fields.facts.number')) WHERE kind='resource.observed' AND subject LIKE 'resource/mission-run/%/pull-request'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subscription_deferred_request_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.request'), store_index) WHERE kind='subscription.mission-deferred'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subscription_deferred_deadline_index", "table_pattern": "claims", "key_expression_and_predicate": "(CAST(json_extract(body, '$.fields.not_before_unix_ms') AS INTEGER)) WHERE kind='subscription.mission-deferred'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_schedule_started_request_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.request')) WHERE kind='schedule.work-started'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_message_to_order_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.to'), store_index) WHERE kind='message.sent'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_current_view_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, store_index) WHERE kind='intent.desired' OR json_extract(body, '$.fields.status') NOT IN ('stopped', 'absent', 'exited') OR json_extract(body, '$.status') NOT IN ('stopped', 'absent', 'exited')", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_human_gate_request_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.reviewer'), store_index) WHERE kind='gate.requested' AND json_extract(body, '$.fields.reviewer') IS NOT NULL", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_human_gate_reassignment_request_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.request'), subject) WHERE kind='gate.reviewer-reassigned'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_human_gate_reassignment_reviewer_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.reviewer'), json_extract(body, '$.fields.request')) WHERE kind='gate.reviewer-reassigned'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_human_gate_answer_request_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.request'), subject) WHERE kind='gate.result'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_human_gate_episode_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.owner'), json_extract(body, '$.fields.reviewer'), json_extract(body, '$.fields.attempt'), json_extract(body, '$.fields.mission_revision'), json_extract(body, '$.fields.step_definition')) WHERE kind='gate.requested' AND json_extract(body, '$.fields.reviewer') IS NOT NULL", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_runtime_subject_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, store_index) WHERE kind='runtime.observed'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_client_pairing_actor_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.session_actor')) WHERE kind='custom.client.pairing-completed'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_assistant_v1_credential_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.credential_hash'), store_index) WHERE kind='custom.client.assistant.v1.granted'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_assistant_v1_principal_index", "table_pattern": "claims", "key_expression_and_predicate": "(kind, COALESCE(json_extract(body,'$.fields.principal'),'assistant/chatgpt'))", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_incarnation_accepted_index", "table_pattern": "claims", "key_expression_and_predicate": "( subject, json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END), length(accepted_at_unix_ms), accepted_at_unix_ms ) WHERE json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END) IS NOT NULL", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_incarnation_accepted_index", "table_pattern": "claims", "key_expression_and_predicate": "( subject, json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END), length(accepted_at_unix_ms), accepted_at_unix_ms ) WHERE kind='harness.observed' AND json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END) IS NOT NULL", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_episode_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.ownership_sequence'), json_extract(body, '$.fields.transition_sequence'), length(accepted_at_unix_ms), accepted_at_unix_ms) WHERE kind='harness.observed'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_unnamed_accepted_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, length(accepted_at_unix_ms), accepted_at_unix_ms) WHERE kind='harness.observed' AND (json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END) IS NULL OR typeof(json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END))!='text')", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_claude_attachment_index", "table_pattern": "claims", "key_expression_and_predicate": "( subject, json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END), store_index ) WHERE kind='harness.diagnostic' AND json_extract(body, '$.fields.code') IN ('claude-channel-unattached','claude-channel-attached')", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_state_incarnation_accepted_index", "table_pattern": "claims", "key_expression_and_predicate": "( subject, CASE WHEN json_type(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END)='text' THEN json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END) END, length(accepted_at_unix_ms), accepted_at_unix_ms ) WHERE kind='harness.observed' AND json_type(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.state' ELSE '$.fields.state' END)='text'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_auth_incarnation_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.incarnation_id'), length(accepted_at_unix_ms), accepted_at_unix_ms) WHERE kind='harness.observed' AND json_type(body, '$.fields.provider_auth') IN ('true','false')", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_auth_diagnostic_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.incarnation_id'), length(accepted_at_unix_ms), accepted_at_unix_ms) WHERE kind='harness.diagnostic' AND json_extract(body, '$.fields.code') IN ('provider-auth-expired','provider-auth-restored')", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_login_candidate_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject) WHERE (kind='harness.observed' AND ( json_type(body, '$.fields.provider_auth')='false' OR json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.reason' ELSE '$.fields.reason' END)='providerAuth' OR json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.state' ELSE '$.fields.state' END)='needs-login')) OR (kind='harness.diagnostic' AND json_extract(body, '$.fields.code')='provider-auth-expired')", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_kind_subject_index", "table_pattern": "desired", "key_expression_and_predicate": "(kind, subject)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_owner_step_index", "table_pattern": "desired", "key_expression_and_predicate": "(owner_step, subject)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_owner_run_index", "table_pattern": "desired", "key_expression_and_predicate": "(owner_run, subject)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_claim_index", "table_pattern": "desired", "key_expression_and_predicate": "(claim_id)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_agent_subject_index", "table_pattern": "desired", "key_expression_and_predicate": "(subject) WHERE kind='agent'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_agent_host_index", "table_pattern": "desired", "key_expression_and_predicate": "(json_extract(member, '$.host'), subject) WHERE kind='agent'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_message_subject_index", "table_pattern": "desired", "key_expression_and_predicate": "(subject) WHERE kind='message'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_watch_agent_index", "table_pattern": "desired", "key_expression_and_predicate": "(substr(substr(substr(substr(subject, 20), instr(substr(subject, 20), '/') + 1), instr(substr(substr(subject, 20), instr(substr(subject, 20), '/') + 1), '/') + 1), instr(substr(substr(substr(subject, 20), instr(substr(subject, 20), '/') + 1), instr(substr(substr(subject, 20), instr(substr(subject, 20), '/') + 1), '/') + 1), '/') + 1)) WHERE subject >= 'subscription/watch/' AND subject < 'subscription/watch0'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_run_root_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.root_mission_run')) WHERE kind='mission-run.created'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_run_generation_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.current_generation')) WHERE kind='mission-run.created'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_generation_run_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.run')) WHERE kind='run-generation.created'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_proposal_run_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.run')) WHERE kind='revision-proposal.created'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_run_revision_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.revision')) WHERE kind='mission-run.created'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_generation_revision_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.revision')) WHERE kind='run-generation.created'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_proposal_revision_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.candidate_revision')) WHERE kind='revision-proposal.created'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_person_ask_generation_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.generation')) WHERE kind='work.person-asked'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_person_ask_run_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.run')) WHERE kind='work.person-asked'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_person_ask_owner_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.owner_run')) WHERE kind='work.person-asked'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_person_ask_origin_step_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.origin_step')) WHERE kind='work.person-asked'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_person_ask_recipient_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.person')) WHERE kind='work.person-asked'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "message_index_open", "table_pattern": "message_index", "key_expression_and_predicate": "(closed, created_index)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_native_delivery_identity_v2", "table_pattern": "local_native_delivery_receipts_v2", "key_expression_and_predicate": "(session_id, native_id, actor, origin, store_index)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_native_delivery_owner_cut_v2", "table_pattern": "local_native_delivery_receipts_v2", "key_expression_and_predicate": "(actor, store_index)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_revisions_claim_index", "table_pattern": "mission_revisions", "key_expression_and_predicate": "(claim_id)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_definitions_claim_index", "table_pattern": "mission_definitions", "key_expression_and_predicate": "(claim_id)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_runs_mission_index", "table_pattern": "mission_runs", "key_expression_and_predicate": "(mission_id, created_at_unix_ms)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_runs_requester_index", "table_pattern": "mission_runs", "key_expression_and_predicate": "(requester)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_runs_collection_latest_index", "table_pattern": "mission_runs", "key_expression_and_predicate": "(mission_id, created_at_unix_ms DESC, id DESC)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_runs_collection_live_index", "table_pattern": "mission_runs", "key_expression_and_predicate": "(mission_id, status) WHERE status IN ('running','standing')", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_runs_root_page_index", "table_pattern": "mission_runs", "key_expression_and_predicate": "(root_run_id, created_at_unix_ms, id)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_runs_open_index", "table_pattern": "mission_runs", "key_expression_and_predicate": "(created_at_unix_ms, id) WHERE status NOT IN ('completed','failed','cancelled')", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "run_generations_run_index", "table_pattern": "run_generations", "key_expression_and_predicate": "(run_id, created_at_unix_ms)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_run_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(run_id, generation_id, step_path)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_generation_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(generation_id)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_definition_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(definition_hash, run_id, generation_id)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_runs_parent_step_index", "table_pattern": "mission_runs", "key_expression_and_predicate": "(parent_step_run) WHERE parent_step_run IS NOT NULL", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_assignee_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(assignee, status)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_lease_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(lease_owner) WHERE lease_owner IS NOT NULL", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_single_agent_offer_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(available_to, run_id) WHERE CASE WHEN json_valid(available_to) THEN json_array_length(available_to)=1 ELSE 0 END", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_available_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(run_id) WHERE available_to!='[]'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_open_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(created_at_unix_ms, step_path) WHERE status NOT IN ('completed','failed','cancelled')", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_observations_subject_kind_index", "table_pattern": "local_observations", "key_expression_and_predicate": "(subject, kind, id)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_observations_subject_id_index", "table_pattern": "local_observations", "key_expression_and_predicate": "(subject, id)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_observations_after_store_index", "table_pattern": "local_observations", "key_expression_and_predicate": "(after_store_index)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_observations_time_index", "table_pattern": "local_observations", "key_expression_and_predicate": "(observed_at_unix_ms)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_observations_dedupe_index", "table_pattern": "local_observations", "key_expression_and_predicate": "(dedupe_key) WHERE dedupe_key IS NOT NULL", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_observations_timeline_index", "table_pattern": "local_observations", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.incarnation_id'), id) WHERE kind='harness.timeline'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_observations_roster_frontier_index", "table_pattern": "local_observations", "key_expression_and_predicate": "(id, after_store_index) WHERE kind='harness.timeline' AND subject LIKE 'agent/%'", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "client_diagnostic_receipts_time_index", "table_pattern": "client_diagnostic_receipts", "key_expression_and_predicate": "(accepted_at_unix_ms)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "client_diagnostic_receipts_device_time_index", "table_pattern": "client_diagnostic_receipts", "key_expression_and_predicate": "(device, accepted_at_unix_ms)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_subscription_mission_deferrals_deadline_index", "table_pattern": "local_subscription_mission_deferrals", "key_expression_and_predicate": "(not_before_unix_ms)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_usage_responses_age_index", "table_pattern": "local_usage_responses", "key_expression_and_predicate": "(observed_at_unix_ms)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "revision_proposals_run_index", "table_pattern": "revision_proposals", "key_expression_and_predicate": "(run_id)", "value_size_proven": false}, - {"site": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "index_pattern": "revision_proposals_generation_index", "table_pattern": "revision_proposals", "key_expression_and_predicate": "(source_generation_id)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "desired", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "kind", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES claims(id)", "value_size_proven": false}, {"name": "body", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "member", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "owner_run", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "owner_generation", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "owner_step", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_desired_write_witness", "columns": [{"name": "id", "declared_type": "INTEGER", "declaration": "INTEGER PRIMARY KEY CHECK(id=1)", "value_size_proven": false}, {"name": "generation", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL CHECK(typeof(generation)='integer' AND generation>=0)", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "mission_run_requests", "columns": [{"name": "operation_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "request_hash", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "message_index", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "created_index", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "closed", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_native_delivery_receipts_v2", "columns": [{"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY REFERENCES claims(id) ON DELETE CASCADE", "value_size_proven": false}, {"name": "claim_hash", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "session_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "native_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "actor", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "origin", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "store_index", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "capabilities", "columns": [{"name": "secret_hash", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "kind", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "incarnation_id", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "expires_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "used", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "mission_revisions", "columns": [{"name": "mission_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "state", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "body", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES claims(id)", "value_size_proven": false}, {"name": "created_index", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "mission_definitions", "columns": [{"name": "mission_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "state", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES claims(id)", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "mission_runs", "columns": [{"name": "id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "mission_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "initial_revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "current_generation_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "root_revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "root_run_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "parent_step_run", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "workspace", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "requester", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "inputs", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "mode", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "status", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "phase", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "created_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "updated_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "mission_run_deadlines", "columns": [{"name": "run_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY REFERENCES mission_runs(id)", "value_size_proven": false}, {"name": "timeout_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "deadline_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "mission_run_after", "columns": [{"name": "run_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY REFERENCES mission_runs(id)", "value_size_proven": false}, {"name": "after_run", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "run_generations", "columns": [{"name": "id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "run_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES mission_runs(id)", "value_size_proven": false}, {"name": "revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "predecessor_id", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "status", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "actor", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "reason", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "created_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "updated_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "step_runs", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "run_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES mission_runs(id)", "value_size_proven": false}, {"name": "generation_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES run_generations(id)", "value_size_proven": false}, {"name": "step_path", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "definition_hash", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "status", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "attempt", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "assignee", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "available_to", "declared_type": "TEXT", "declaration": "TEXT NOT NULL DEFAULT '[]'", "value_size_proven": false}, {"name": "agentless", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 1", "value_size_proven": false}, {"name": "title", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "goals", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "worker_reported", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "lease_owner", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "lease_incarnation", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "lease_expires_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "blocked_reason", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "not_before_unix_ms", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "activated_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "readiness_epoch", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "created_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "updated_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "constraints", "declared_type": "TEXT", "declaration": "TEXT NOT NULL DEFAULT '[]'", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_harness_question_generations", "columns": [{"name": "question", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "generation", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_mailbox_owners", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "component", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "incarnation", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "epoch", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_mailbox_bindings", "columns": [{"name": "token", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "component", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "incarnation", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "epoch", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_mailbox_argv_bindings", "columns": [{"name": "token", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "component", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "incarnation", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "epoch", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "member", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_mailbox_leases", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "component", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "incarnation", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "provider", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "session", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "sequence", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "pid", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "process_token", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "token", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "epoch", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "revoked", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_work_lease_renewals", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "attempt", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "lease_owner", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "lease_incarnation", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "lease_expires_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "updated_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_observations", "columns": [{"name": "id", "declared_type": "INTEGER", "declaration": "INTEGER PRIMARY KEY AUTOINCREMENT", "value_size_proven": false}, {"name": "after_store_index", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "kind", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "actor", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "body", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "dedupe_key", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "request_digest", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "observed_at_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "client_diagnostic_receipts", "columns": [{"name": "device", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "event_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "accepted_at_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_subscription_mission_deferrals", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "request", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "not_before_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "attempts", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_usage_spend", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "incarnation_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "model", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "account", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "owner_run", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "owner_step", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "host", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "input_tokens", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "output_tokens", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "cache_write_tokens", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "cache_write_1h_tokens", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "cached_tokens", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "total_tokens", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "cost_microusd", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "reported_cost_microusd", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "unpriced_tokens", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT 0", "value_size_proven": false}, {"name": "observed_at_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_usage_provenance", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "slot", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "pricing", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_limit_stops", "columns": [{"name": "account", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "episode", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "seat", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "stopped_at_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_seat_accounts", "columns": [{"name": "seat", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "account", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "chosen_at_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_usage_responses", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "source_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "observed_at_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "local_latest_slots", "columns": [{"name": "subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "kind", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "slot", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "published_at_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "published_fields", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "pending_local_id", "declared_type": "INTEGER", "declaration": "INTEGER", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "claims_stored", "columns": [{"name": "kind", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "writer", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "since_unix_ms", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "claims", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "bytes", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "revision_proposals", "columns": [{"name": "id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "run_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES mission_runs(id)", "value_size_proven": false}, {"name": "source_generation_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES run_generations(id)", "value_size_proven": false}, {"name": "candidate_revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "actor", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "reason", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "status", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "cutover", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "compatible_steps", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "reviewers", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "approvals", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "preview_hash", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "successor_generation_id", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "created_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "updated_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "planning_sessions", "columns": [{"name": "id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "mission_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "request_ref", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "workspace", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "requester", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "planner", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "planner_spec_json", "declared_type": "TEXT", "declaration": "TEXT NOT NULL DEFAULT '{\"provider\":\"codex\"}'", "value_size_proven": false}, {"name": "status", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "target_run_id", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "source_generation_id", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "published_revision", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "created_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "updated_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "planning_candidates", "columns": [{"name": "session_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES planning_sessions(id)", "value_size_proven": false}, {"name": "variant", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "revision", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "markdown_ref", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "kdl_ref", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "mission_revision", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "submitted_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "table_pattern": "planning_previews", "columns": [{"name": "session_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL REFERENCES planning_sessions(id)", "value_size_proven": false}, {"name": "variant", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "candidate_revision", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "hash", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "store_index", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "graph", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "diff", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "mission_response", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "created_at_unix_ms", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_owned_set_subject_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject) WHERE json_extract(body,'$.owned_set') IS NOT NULL", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_terminal_history_index", "table_pattern": "claims", "key_expression_and_predicate": "(store_index) WHERE kind IN ('mission-run.state','step-run.state','work.failed') AND json_extract(body,'$.fields.status') IN ('failed','cancelled','completed')", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_terminal_capability_hash_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.capability_hash'), store_index) WHERE kind='custom.client.terminal-attached'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_receipt_actor_key_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.receipt.actor_key'), origin, subject) WHERE kind='harness-question.resolved' AND actor IS NULL", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_message_to_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.to'), subject) WHERE kind='message.sent'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_run_report_to_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.report_to'), subject) WHERE kind IN ('mission-run.created','mission-run.report-to')", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_message_from_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.from'), store_index) WHERE kind='message.sent'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_message_legacy_to_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.to'), store_index) WHERE kind='message.sent' AND json_type(body, '$.fields') IS NULL", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_message_legacy_from_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.from'), store_index) WHERE kind='message.sent' AND json_type(body, '$.fields') IS NULL", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_resume_host_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.host'), subject) WHERE kind='runtime.action.requested' AND json_extract(body,'$.fields.action')='resume'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_actor_activity_time_index", "table_pattern": "claims", "key_expression_and_predicate": "(actor, length(accepted_at_unix_ms), accepted_at_unix_ms, store_index) WHERE kind IN ('work.progress', 'work.submitted')", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_message_from_activity_time_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.from'), length(accepted_at_unix_ms), accepted_at_unix_ms, store_index) WHERE kind='message.sent'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_message_to_activity_time_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.to'), length(accepted_at_unix_ms), accepted_at_unix_ms, store_index) WHERE kind='message.sent'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_timeline_activity_time_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.incarnation_id'), length(accepted_at_unix_ms), accepted_at_unix_ms, store_index) WHERE kind='harness.timeline' AND json_extract(body, '$.fields.entry_type') IN ('message','content','tool_call','tool_result')", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_actor_work_activity_index", "table_pattern": "claims", "key_expression_and_predicate": "(actor, json_extract(body, '$.fields.claim_incarnation'), store_index) WHERE kind IN ('work.claimed', 'work.progress')", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subagent_appeared_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.subagent_id')) WHERE kind='subagent.appeared'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subagent_renewed_max_lease_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.subagent_id'), CAST(json_extract(body, '$.fields.lease_expires_at_unix_ms') AS INTEGER)) WHERE kind='subagent.renewed'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subagent_ended_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.subagent_id')) WHERE kind='subagent.ended'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subagent_appeared_lease_index", "table_pattern": "claims", "key_expression_and_predicate": "(CAST(json_extract(body, '$.fields.lease_expires_at_unix_ms') AS INTEGER)) WHERE kind='subagent.appeared'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subagent_renewed_lease_index", "table_pattern": "claims", "key_expression_and_predicate": "(CAST(json_extract(body, '$.fields.lease_expires_at_unix_ms') AS INTEGER)) WHERE kind='subagent.renewed'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_timeline_incarnation_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, kind, json_extract(body, '$.fields.incarnation_id'), store_index) WHERE kind='harness.timeline'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subscription_finished_request_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.request')) WHERE kind IN ( 'subscription.mission-started', 'subscription.mission-failed', 'subscription.mission-request-cancelled' )", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subscription_delivery_key_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.delivery_key')) WHERE kind='subscription.mission-requested'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subscription_started_run_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.mission_run')) WHERE kind='subscription.mission-started'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subscription_mission_resource_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.mission'), json_extract(body, '$.fields.resource')) WHERE kind='subscription.mission-requested'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_authored_pull_request_url_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.facts.url')) WHERE kind='resource.observed' AND subject LIKE 'resource/mission-run/%/pull-request'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_authored_pull_request_number_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.facts.repository'), json_extract(body, '$.fields.facts.number')) WHERE kind='resource.observed' AND subject LIKE 'resource/mission-run/%/pull-request'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subscription_deferred_request_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.request'), store_index) WHERE kind='subscription.mission-deferred'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_subscription_deferred_deadline_index", "table_pattern": "claims", "key_expression_and_predicate": "(CAST(json_extract(body, '$.fields.not_before_unix_ms') AS INTEGER)) WHERE kind='subscription.mission-deferred'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_schedule_started_request_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.request')) WHERE kind='schedule.work-started'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_message_to_order_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.to'), store_index) WHERE kind='message.sent'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_current_view_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, store_index) WHERE kind='intent.desired' OR json_extract(body, '$.fields.status') NOT IN ('stopped', 'absent', 'exited') OR json_extract(body, '$.status') NOT IN ('stopped', 'absent', 'exited')", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_human_gate_request_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.reviewer'), store_index) WHERE kind='gate.requested' AND json_extract(body, '$.fields.reviewer') IS NOT NULL", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_human_gate_reassignment_request_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.request'), subject) WHERE kind='gate.reviewer-reassigned'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_human_gate_reassignment_reviewer_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.reviewer'), json_extract(body, '$.fields.request')) WHERE kind='gate.reviewer-reassigned'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_human_gate_answer_request_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.request'), subject) WHERE kind='gate.result'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_human_gate_episode_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.owner'), json_extract(body, '$.fields.reviewer'), json_extract(body, '$.fields.attempt'), json_extract(body, '$.fields.mission_revision'), json_extract(body, '$.fields.step_definition')) WHERE kind='gate.requested' AND json_extract(body, '$.fields.reviewer') IS NOT NULL", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_runtime_subject_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, store_index) WHERE kind='runtime.observed'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_client_pairing_actor_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.session_actor')) WHERE kind='custom.client.pairing-completed'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_assistant_v1_credential_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.credential_hash'), store_index) WHERE kind='custom.client.assistant.v1.granted'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_incarnation_accepted_index", "table_pattern": "claims", "key_expression_and_predicate": "( subject, json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END), length(accepted_at_unix_ms), accepted_at_unix_ms ) WHERE json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END) IS NOT NULL", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_incarnation_accepted_index", "table_pattern": "claims", "key_expression_and_predicate": "( subject, json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END), length(accepted_at_unix_ms), accepted_at_unix_ms ) WHERE kind='harness.observed' AND json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END) IS NOT NULL", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_episode_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.ownership_sequence'), json_extract(body, '$.fields.transition_sequence'), length(accepted_at_unix_ms), accepted_at_unix_ms) WHERE kind='harness.observed'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_unnamed_accepted_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, length(accepted_at_unix_ms), accepted_at_unix_ms) WHERE kind='harness.observed' AND (json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END) IS NULL OR typeof(json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END))!='text')", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_claude_attachment_index", "table_pattern": "claims", "key_expression_and_predicate": "( subject, json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END), store_index ) WHERE kind='harness.diagnostic' AND json_extract(body, '$.fields.code') IN ('claude-channel-unattached','claude-channel-attached')", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_state_incarnation_accepted_index", "table_pattern": "claims", "key_expression_and_predicate": "( subject, CASE WHEN json_type(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END)='text' THEN json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.incarnation_id' ELSE '$.fields.incarnation_id' END) END, length(accepted_at_unix_ms), accepted_at_unix_ms ) WHERE kind='harness.observed' AND json_type(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.state' ELSE '$.fields.state' END)='text'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_auth_incarnation_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.incarnation_id'), length(accepted_at_unix_ms), accepted_at_unix_ms) WHERE kind='harness.observed' AND json_type(body, '$.fields.provider_auth') IN ('true','false')", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_auth_diagnostic_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.incarnation_id'), length(accepted_at_unix_ms), accepted_at_unix_ms) WHERE kind='harness.diagnostic' AND json_extract(body, '$.fields.code') IN ('provider-auth-expired','provider-auth-restored')", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_harness_login_candidate_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject) WHERE (kind='harness.observed' AND ( json_type(body, '$.fields.provider_auth')='false' OR json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.reason' ELSE '$.fields.reason' END)='providerAuth' OR json_extract(body, CASE WHEN json_type(body, '$.fields') IS NULL THEN '$.state' ELSE '$.fields.state' END)='needs-login')) OR (kind='harness.diagnostic' AND json_extract(body, '$.fields.code')='provider-auth-expired')", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_kind_subject_index", "table_pattern": "desired", "key_expression_and_predicate": "(kind, subject)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_owner_step_index", "table_pattern": "desired", "key_expression_and_predicate": "(owner_step, subject)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_owner_run_index", "table_pattern": "desired", "key_expression_and_predicate": "(owner_run, subject)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_claim_index", "table_pattern": "desired", "key_expression_and_predicate": "(claim_id)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_agent_subject_index", "table_pattern": "desired", "key_expression_and_predicate": "(subject) WHERE kind='agent'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_agent_host_index", "table_pattern": "desired", "key_expression_and_predicate": "(json_extract(member, '$.host'), subject) WHERE kind='agent'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_message_subject_index", "table_pattern": "desired", "key_expression_and_predicate": "(subject) WHERE kind='message'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "desired_watch_agent_index", "table_pattern": "desired", "key_expression_and_predicate": "(substr(substr(substr(substr(subject, 20), instr(substr(subject, 20), '/') + 1), instr(substr(substr(subject, 20), instr(substr(subject, 20), '/') + 1), '/') + 1), instr(substr(substr(substr(subject, 20), instr(substr(subject, 20), '/') + 1), instr(substr(substr(subject, 20), instr(substr(subject, 20), '/') + 1), '/') + 1), '/') + 1)) WHERE subject >= 'subscription/watch/' AND subject < 'subscription/watch0'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_run_root_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.root_mission_run')) WHERE kind='mission-run.created'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_run_generation_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.current_generation')) WHERE kind='mission-run.created'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_generation_run_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.run')) WHERE kind='run-generation.created'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_proposal_run_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.run')) WHERE kind='revision-proposal.created'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_run_revision_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.revision')) WHERE kind='mission-run.created'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_generation_revision_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.revision')) WHERE kind='run-generation.created'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_proposal_revision_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.candidate_revision')) WHERE kind='revision-proposal.created'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_person_ask_generation_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.generation')) WHERE kind='work.person-asked'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_person_ask_run_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.run')) WHERE kind='work.person-asked'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_person_ask_owner_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.owner_run')) WHERE kind='work.person-asked'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_person_ask_origin_step_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.origin_step')) WHERE kind='work.person-asked'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_person_ask_recipient_index", "table_pattern": "claims", "key_expression_and_predicate": "(json_extract(body, '$.fields.person')) WHERE kind='work.person-asked'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "message_index_open", "table_pattern": "message_index", "key_expression_and_predicate": "(closed, created_index)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_native_delivery_identity_v2", "table_pattern": "local_native_delivery_receipts_v2", "key_expression_and_predicate": "(session_id, native_id, actor, origin, store_index)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_native_delivery_owner_cut_v2", "table_pattern": "local_native_delivery_receipts_v2", "key_expression_and_predicate": "(actor, store_index)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_revisions_claim_index", "table_pattern": "mission_revisions", "key_expression_and_predicate": "(claim_id)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_definitions_claim_index", "table_pattern": "mission_definitions", "key_expression_and_predicate": "(claim_id)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_runs_mission_index", "table_pattern": "mission_runs", "key_expression_and_predicate": "(mission_id, created_at_unix_ms)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_runs_requester_index", "table_pattern": "mission_runs", "key_expression_and_predicate": "(requester)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_runs_collection_latest_index", "table_pattern": "mission_runs", "key_expression_and_predicate": "(mission_id, created_at_unix_ms DESC, id DESC)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_runs_collection_live_index", "table_pattern": "mission_runs", "key_expression_and_predicate": "(mission_id, status) WHERE status IN ('running','standing')", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_runs_root_page_index", "table_pattern": "mission_runs", "key_expression_and_predicate": "(root_run_id, created_at_unix_ms, id)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_runs_open_index", "table_pattern": "mission_runs", "key_expression_and_predicate": "(created_at_unix_ms, id) WHERE status NOT IN ('completed','failed','cancelled')", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "run_generations_run_index", "table_pattern": "run_generations", "key_expression_and_predicate": "(run_id, created_at_unix_ms)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_run_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(run_id, generation_id, step_path)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_generation_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(generation_id)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_definition_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(definition_hash, run_id, generation_id)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "mission_runs_parent_step_index", "table_pattern": "mission_runs", "key_expression_and_predicate": "(parent_step_run) WHERE parent_step_run IS NOT NULL", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_assignee_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(assignee, status)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_lease_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(lease_owner) WHERE lease_owner IS NOT NULL", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_single_agent_offer_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(available_to, run_id) WHERE CASE WHEN json_valid(available_to) THEN json_array_length(available_to)=1 ELSE 0 END", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_available_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(run_id) WHERE available_to!='[]'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "step_runs_open_index", "table_pattern": "step_runs", "key_expression_and_predicate": "(created_at_unix_ms, step_path) WHERE status NOT IN ('completed','failed','cancelled')", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_observations_subject_kind_index", "table_pattern": "local_observations", "key_expression_and_predicate": "(subject, kind, id)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_observations_subject_id_index", "table_pattern": "local_observations", "key_expression_and_predicate": "(subject, id)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_observations_after_store_index", "table_pattern": "local_observations", "key_expression_and_predicate": "(after_store_index)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_observations_time_index", "table_pattern": "local_observations", "key_expression_and_predicate": "(observed_at_unix_ms)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_observations_dedupe_index", "table_pattern": "local_observations", "key_expression_and_predicate": "(dedupe_key) WHERE dedupe_key IS NOT NULL", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_observations_timeline_index", "table_pattern": "local_observations", "key_expression_and_predicate": "(subject, json_extract(body, '$.fields.incarnation_id'), id) WHERE kind='harness.timeline'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_observations_roster_frontier_index", "table_pattern": "local_observations", "key_expression_and_predicate": "(id, after_store_index) WHERE kind='harness.timeline' AND subject LIKE 'agent/%'", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "client_diagnostic_receipts_time_index", "table_pattern": "client_diagnostic_receipts", "key_expression_and_predicate": "(accepted_at_unix_ms)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "client_diagnostic_receipts_device_time_index", "table_pattern": "client_diagnostic_receipts", "key_expression_and_predicate": "(device, accepted_at_unix_ms)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_subscription_mission_deferrals_deadline_index", "table_pattern": "local_subscription_mission_deferrals", "key_expression_and_predicate": "(not_before_unix_ms)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "local_usage_responses_age_index", "table_pattern": "local_usage_responses", "key_expression_and_predicate": "(observed_at_unix_ms)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "revision_proposals_run_index", "table_pattern": "revision_proposals", "key_expression_and_predicate": "(run_id)", "value_size_proven": false}, + {"site": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "index_pattern": "revision_proposals_generation_index", "table_pattern": "revision_proposals", "key_expression_and_predicate": "(source_generation_id)", "value_size_proven": false}, {"site": "lv-h7792d6e9101c", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_runtime_id_subject_index", "table_pattern": "claims", "key_expression_and_predicate": "({RUNTIME_ID_FIELD}, subject, store_index) WHERE {ACTUAL_STATE_CLAIM} AND typeof({RUNTIME_ID_FIELD})='text'", "value_size_proven": false}, {"site": "lv-h7792d6e9101c", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_actual_accepted_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, length(accepted_at_unix_ms), accepted_at_unix_ms) WHERE {ACTUAL_STATE_CLAIM}", "value_size_proven": false}, {"site": "lv-h7792d6e9101c", "path": "crates/fractal-store/src/store.rs", "index_pattern": "claims_runtime_origin_accepted_index", "table_pattern": "claims", "key_expression_and_predicate": "(subject, origin, length(accepted_at_unix_ms), accepted_at_unix_ms) WHERE kind='runtime.observed'", "value_size_proven": false}, @@ -605,6 +604,43 @@ {"site": "lv-h3f7d4d7d63f4", "path": "crates/smallclaims/src/sqlite/read_lifetime/tests.rs", "table_pattern": "payload", "columns": [{"name": "value", "declared_type": "INTEGER", "declaration": "INTEGER", "value_size_proven": false}], "unresolved_template": false}, {"site": "lv-h1ba817f95aef", "path": "crates/smallclaims/src/sqlite/writer_queue/tests.rs", "table_pattern": "claims", "columns": [{"name": "store_index", "declared_type": "INTEGER", "declaration": "INTEGER PRIMARY KEY AUTOINCREMENT", "value_size_proven": false}], "unresolved_template": false}, {"site": "lv-h1ba817f95aef", "path": "crates/smallclaims/src/sqlite/writer_queue/tests.rs", "table_pattern": "values_", "columns": [{"name": "id", "declared_type": "INTEGER", "declaration": "INTEGER PRIMARY KEY", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_authority", "columns": [{"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "base_claim_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "grant_subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "kind", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "origin", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "actor", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "principal", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "profile", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "expires_at", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "store_index", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "credential_hash", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "record", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_effective", "columns": [{"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "grant_subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "principal", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "owner", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "profile", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "expires_at", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "revoked", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "grant_record", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_pending", "columns": [{"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "grant_subject", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "kind", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "origin", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "actor", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "sequence", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "authenticated", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "record", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "auth_member_key", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "auth_sequence", "declared_type": "INTEGER", "declaration": "INTEGER", "value_size_proven": false}, {"name": "auth_envelope_hash", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}, {"name": "auth_record_position", "declared_type": "INTEGER", "declaration": "INTEGER", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_proof_invalidations", "columns": [{"name": "id", "declared_type": "INTEGER", "declaration": "INTEGER PRIMARY KEY", "value_size_proven": false}, {"name": "writer", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "sequence", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "envelope_hash", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "member_key", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL DEFAULT ''", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_proof_rechecks", "columns": [{"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_dirty", "columns": [{"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_auth_cursor", "columns": [{"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "position", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "record_rowid", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "member_key", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "membership_start", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT -1", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_additions", "columns": [{"name": "id", "declared_type": "INTEGER", "declaration": "INTEGER PRIMARY KEY", "value_size_proven": false}, {"name": "writer", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "member_key", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "lower_sequence", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "upper_sequence", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "sequence", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT -1", "value_size_proven": false}, {"name": "envelope_hash", "declared_type": "TEXT", "declaration": "TEXT NOT NULL DEFAULT ''", "value_size_proven": false}, {"name": "position", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT -1", "value_size_proven": false}, {"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL DEFAULT ''", "value_size_proven": false}, {"name": "active_claim", "declared_type": "TEXT", "declaration": "TEXT NOT NULL DEFAULT ''", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_auth_work", "columns": [{"name": "writer", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_retractions", "columns": [{"name": "id", "declared_type": "INTEGER", "declaration": "INTEGER PRIMARY KEY", "value_size_proven": false}, {"name": "writer", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "member_key", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "lower_sequence", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "upper_sequence", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "sequence", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT -1", "value_size_proven": false}, {"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL DEFAULT ''", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_recompute", "columns": [{"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_membership_state", "columns": [{"name": "id", "declared_type": "INTEGER", "declaration": "INTEGER PRIMARY KEY CHECK(id=1)", "value_size_proven": false}, {"name": "applied_generation", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_local_appends", "columns": [{"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_membership_windows", "columns": [{"name": "writer", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "member_key", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}, {"name": "start", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "end", "declared_type": "INTEGER", "declaration": "INTEGER", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_authority_transition_index", "table_pattern": "assistant_grant_authority", "key_expression_and_predicate": "(grant_subject,kind,origin,actor,base_claim_id,store_index DESC)", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_authority_latest_index", "table_pattern": "assistant_grant_authority", "key_expression_and_predicate": "(grant_subject,kind,store_index DESC)", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_authority_credential_index", "table_pattern": "assistant_grant_authority", "key_expression_and_predicate": "(credential_hash,store_index DESC) WHERE kind='custom.client.assistant.v1.granted'", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_effective_active_index", "table_pattern": "assistant_grant_effective", "key_expression_and_predicate": "(principal,owner,revoked,expires_at,profile)", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_effective_subject_index", "table_pattern": "assistant_grant_effective", "key_expression_and_predicate": "(grant_subject)", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_pending_subject_index", "table_pattern": "assistant_grant_pending", "key_expression_and_predicate": "(grant_subject,authenticated,origin,actor,kind)", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_pending_writer_index", "table_pattern": "assistant_grant_pending", "key_expression_and_predicate": "(origin,authenticated,sequence,claim_id)", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_pending_evidence_index", "table_pattern": "assistant_grant_pending", "key_expression_and_predicate": "(origin,auth_member_key,auth_sequence,claim_id)", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_pending_signature_index", "table_pattern": "assistant_grant_pending", "key_expression_and_predicate": "(origin,auth_sequence,auth_envelope_hash,auth_member_key,claim_id)", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_pending_envelope_index", "table_pattern": "assistant_grant_pending", "key_expression_and_predicate": "(origin,auth_sequence,auth_envelope_hash,claim_id)", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_proof_invalidations_identity_index", "table_pattern": "assistant_grant_proof_invalidations", "key_expression_and_predicate": "(writer,sequence,envelope_hash,member_key)", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_pending_unauthenticated_index", "table_pattern": "assistant_grant_pending", "key_expression_and_predicate": "(origin,claim_id) WHERE authenticated=0", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_auth_work_claim_index", "table_pattern": "assistant_grant_auth_work", "key_expression_and_predicate": "(claim_id)", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "replica_records_grant_proof_index", "table_pattern": "replica_records", "key_expression_and_predicate": "(claim_id,writer,sequence,envelope_hash,position)", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_retractions_writer_key_index", "table_pattern": "assistant_grant_retractions", "key_expression_and_predicate": "(writer,member_key,lower_sequence,upper_sequence)", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_authority_base_index", "table_pattern": "assistant_grant_authority", "key_expression_and_predicate": "(base_claim_id,kind,store_index DESC)", "value_size_proven": false}, + {"site": "lv-hbfff283c1bdb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "index_pattern": "assistant_grant_membership_windows_seek", "table_pattern": "assistant_grant_membership_windows", "key_expression_and_predicate": "(writer,start,member_key)", "value_size_proven": false}, + {"site": "lv-h7b614d59afc6", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_auth_cursor", "operation": "add-column", "columns": [{"name": "membership_start", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL DEFAULT -1", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hed00daccc56e", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_additions", "operation": "add-column", "columns": [{"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL DEFAULT ''", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-hed00daccc56e", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "table_pattern": "assistant_grant_additions", "operation": "add-column", "columns": [{"name": "active_claim", "declared_type": "TEXT", "declaration": "TEXT NOT NULL DEFAULT ''", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h49244ed4f44b", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "table_pattern": "refreshed_items", "columns": [{"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h64bd448a0436", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "table_pattern": "assistant_grant_membership_dirty", "columns": [{"name": "writer", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "sequence", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}, {"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT NOT NULL", "value_size_proven": false}], "unresolved_template": false}, + {"site": "lv-h8d3c6e9a6220", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "table_pattern": "addition_work", "columns": [{"name": "unit", "declared_type": "INTEGER", "declaration": "INTEGER", "value_size_proven": false}], "unresolved_template": false}, {"site": "lv-ha962eb0285cf", "path": "crates/smallclaims/src/store/canonical.rs", "table_pattern": "claim_positions", "columns": [{"name": "claim_id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}, {"name": "position", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, {"site": "lv-h315c8b6f5aa8", "path": "crates/smallclaims/src/store/checkpoint.rs", "table_pattern": "canonical_index", "columns": [{"name": "old", "declared_type": "INTEGER", "declaration": "INTEGER PRIMARY KEY", "value_size_proven": false}, {"name": "new", "declared_type": "INTEGER", "declaration": "INTEGER NOT NULL", "value_size_proven": false}], "unresolved_template": false}, {"site": "lv-h298c5b9a94f9", "path": "crates/smallclaims/src/store/checkpoint.rs", "table_pattern": "sealed_claims", "columns": [{"name": "id", "declared_type": "TEXT", "declaration": "TEXT PRIMARY KEY", "value_size_proven": false}], "unresolved_template": false}, @@ -809,7 +845,7 @@ {"id": "flow-hae49bfcdc951", "path": "crates/fractal-store/src/store.rs", "function": "insert_event", "owner": "fractal_store::store", "fingerprint": "9cdeca113f2b75bcf56424758796dc68d0158e63ba3c7520de898551700bbf4e", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "description": "Event positions/publication must retain canonical pointer/body and ordering semantics."}, {"id": "flow-hcc1764594fd2", "path": "crates/fractal-store/src/store/backup.rs", "function": "receive_backup_page", "owner": "fractal_store::store::backup", "fingerprint": "35b1ec2cf1835ef24f9f29107f60813ca41eb4197e8a2be9a98b5771cbccaed7", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "description": "Backup import permits valid historical records under its own record/page limits, not client extractor limits."}, {"id": "flow-he7b2f39a2da2", "path": "crates/smallclaims/src/store.rs", "function": "append_claim_record_tx", "owner": "smallclaims::store", "fingerprint": "fd48ee537bf54b5b208b4e3da218640c9239c63fd3b76ab3e836cf6ef81b97b8", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "description": "Local append serializes the logical body and predecessor identities; no route-limit inference."}, - {"id": "flow-h8ff255a3c271", "path": "crates/smallclaims/src/store.rs", "function": "insert_claim", "owner": "smallclaims::store", "fingerprint": "c1f2beebb8654792635657bffc14ee4fa7e2f3303e803360b91feb922790e708", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "description": "Direct claim insert: body, predecessors and identifiers; bound parameters enter claims."}, + {"id": "flow-h8ff255a3c271", "path": "crates/smallclaims/src/store.rs", "function": "insert_claim", "owner": "smallclaims::store", "fingerprint": "fc23d9c153911c180ab0e94b133cfa4a9716b3b2fa4727f9b5aa6df134859883", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "description": "Direct claim insert: body, predecessors and identifiers; bound parameters enter claims."}, {"id": "flow-h9a1973bf379a", "path": "crates/smallclaims/src/store.rs", "function": "promote_claim_blobs", "owner": "smallclaims::store", "fingerprint": "3a7eace9c6a74cbe44a5fbe23b9321f47c241c2662186a405ce7e863170442d5", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "description": "Blob promotion copies staged bytes to durable graph storage without changing logical identity."}, {"id": "flow-hd4562283f4d7", "path": "crates/smallclaims/src/store.rs", "function": "put_blob", "owner": "smallclaims::store", "fingerprint": "46f2545418004329783b4f1be7c2e0c5d5bd0a271694c3168a91ad3264c354ec", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "description": "Immutable blob bytes are independently variable values; retain digest/length/promotion semantics."}, {"id": "flow-h5298e6bf0818", "path": "crates/smallclaims/src/store.rs", "function": "put_document_as", "owner": "smallclaims::store", "fingerprint": "d4b8d676c6eef326bc2fc38e9da42ba86b602aab489539e83a0eec6310543298", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "description": "Document API/local producer body, identity and predecessors reach the common claim writer."}, @@ -836,6 +872,7 @@ {"id": "lv-h007497d73c53", "path": "crates/fractal-store/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "9c20b409f669351299b9007fcd2272d94726d494a3b3bd13f9be9dd02657c935", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 7311, "excerpt": "params ! [ \"agent/grove/cedar\" , i64 : : MAX , \"current\" ] , | row | row . get ( 0 ) ,"}, {"id": "lv-h007aa9af14d7", "path": "crates/fractal-store/src/store/custom/tests_shared_delivery.rs", "kind": "included-source", "fingerprint": "5d604bf3342897bb94342ddbdbe8296d87ee778849bee124dd73f3c81b8f6a26", "owner": "fractal_store::store::custom::tests_shared_delivery", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 5, "excerpt": "include_str ! ( \"../../../../../examples/fractal/custom-review.json\" )"}, {"id": "lv-h0096cec23ed6", "path": "crates/fractal-store/src/store/missions.rs", "kind": "unresolved-sql-sink", "fingerprint": "7dd0455cce1946a0302ec6170c9685b5cf554bf030abb03f64e42e8cfc0ee8b2", "owner": "fractal_store::store::missions", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1775, "excerpt": "SEAT_STEP_ROWS"}, + {"id": "lv-h00986dca7a94", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "8cd8a3171023b91c89093e99dfb85136d58156711bf929a08cc5b37431931f19", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1219, "excerpt": "INSERT INTO assistant_grant_additions(writer,member_key,lower_sequence,upper_sequence) VALUES('anchor',?1,0,9223372036854775807)"}, {"id": "lv-h00a05218092d", "path": "crates/fractal-store/src/store/completion_state_tests.rs", "kind": "sql-template", "fingerprint": "0589ba968572e6a678d0ac68d6c2e0acbeaa7215df89a0bf47ba531618af967c", "owner": "fractal_store::store::completion_state_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 113, "excerpt": "UPDATE batches SET origin='example-other' WHERE id=(SELECT batch_id FROM claims WHERE id=?1)"}, {"id": "lv-h00a84a128fb3", "path": "crates/fractal-attention/src/store/alert_action_controls.rs", "kind": "sql-template", "fingerprint": "9c3cc559875ebe0a94e643619c71f932fc461b5c162d951994629a87f3181794", "owner": "fractal_attention::store::alert_action_controls", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 289, "excerpt": "UPDATE mission_runs SET current_generation_id='missing-fixture-generation' WHERE id=?1"}, {"id": "lv-h00ac58224c7e", "path": "crates/smallclaims/src/store/projection_busy_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "f10e20728e77f302935d7b4f1031c77dca8743a680305ee8cdf2f818e584bbb5", "owner": "smallclaims::store::projection_busy_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 586, "excerpt": "\"ROLLBACK\""}, @@ -865,6 +902,7 @@ {"id": "lv-h021ae8b69609", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "e94bd28f1846b881dd447c7042f58b9a4f42bcadc51c37baea159d3744121440", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 5210, "excerpt": "[ ] , | row | row . get : : < _ , u64 > ( 0 )"}, {"id": "lv-h021fd4a251f0", "path": "crates/smallclaims/src/store/prepared_seal_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "073f0674ea549904cd096ef9525813f5e9c3756e2384e0fc0d7db65b1213aa6c", "owner": "smallclaims::store::prepared_seal_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 925, "excerpt": "[ & claim . id ] , | row | row . get : : < _ , String > ( 0 )"}, {"id": "lv-h0229e9f947a7", "path": "crates/fractal-store/src/store/actual_state_sorter_tests.rs", "kind": "sql-template", "fingerprint": "63367cae9b2483ae6c2870fab43663366ebe99bd52dcad137a15c6a08841d829", "owner": "fractal_store::store::actual_state_sorter_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 326, "excerpt": "WITH RECURSIVE history(n) AS (SELECT 0 UNION ALL SELECT n+1 FROM history WHERE n+1 > ( 0 )"}, {"id": "lv-h0a744b38f746", "path": "crates/smallclaims/src/sqlite.rs", "kind": "unresolved-sql-sink", "fingerprint": "789b44b9990c7d88da3542aa5c6b25148409a57d64b88f00362513cda78a031f", "owner": "smallclaims::sqlite", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1435, "excerpt": "\"COMMIT\""}, {"id": "lv-h0a89658553a0", "path": "crates/fractal-store/src/store/fleet_admission_tests.rs", "kind": "sql-template", "fingerprint": "4f071e2a27103f0a187e4532655086fdea007d7c5016d28bd9c00ac53ed8439a", "owner": "fractal_store::store::fleet_admission_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 82, "excerpt": "INSERT INTO claims VALUES (?1,'agent/worker','runtime.observed','{}')"}, + {"id": "lv-h0a908802271b", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "a1283ec5bf87b372df96534f09c45e898f5571cce47da6cbbcd01e0f6c82c16f", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 825, "excerpt": "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1"}, {"id": "lv-h0aa596146f27", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "c3735e2d7f745ccea05f9928aef871e2c1cc8d0274e1cd2d711d1f56ce0601a9", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6827, "excerpt": "& format ! ( \"{LOCAL_OBSERVATION_COLUMNS} WHERE subject=?1 AND kind='harness.timeline' AND json_extract(body, '$.fields.incarnation_id')=?2 AND (?3 IS NULL OR after_store_indexreplica.writer) FROM replica WHERE replica.write"}, + {"id": "lv-h0c36a77fc900", "path": "crates/fractal/src/assistant_grant_authority_wake_tests.rs", "kind": "sql-template", "fingerprint": "5c73502d1a0eac710d0c7a661b93832863b57c95bf4288427f58ec111c1cfa2f", "owner": "fractal::assistant_grant_authority_wake_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 47, "excerpt": "BEGIN; INSERT INTO batches(id,origin,replica_sequence,hash,accepted_at_unix_ms) VALUES('batch/race','node',1,'race','1'); INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,acc"}, {"id": "lv-h0c48864065b9", "path": "crates/fractal-store/src/store/idle_mail.rs", "kind": "sql-template", "fingerprint": "6b3f4975325fcaf6b45ce9dfb49840720d7666ae9879b812ed4f446013df3de6", "owner": "fractal_store::store::idle_mail", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 160, "excerpt": "BEGIN IMMEDIATE; DELETE FROM meta WHERE key='local_idle_messages_backfill_after'; INSERT OR IGNORE INTO meta(key,value) VALUES('local_idle_messages_v1','1'); COMMIT;"}, {"id": "lv-h0c4a6c9a0a71", "path": "crates/fractal-store/src/store/fleet_admission_tests.rs", "kind": "sql-template", "fingerprint": "7d3e7a6d5bcb9e35be86d9e8451c13b5c5d12222634ea89db3027a47199cfba9", "owner": "fractal_store::store::fleet_admission_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 563, "excerpt": "DELETE FROM meta WHERE key='publication_pending_collision_requeued'"}, {"id": "lv-h0c4a81edd532", "path": "crates/fractal-kernel/src/conversation_search.rs", "kind": "unresolved-sql-sink", "fingerprint": "78f00a9f7cac15eaa19687119385ad7c1f84207bcd902cc463aa1ea290537efa", "owner": "fractal_kernel::conversation_search", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 58, "excerpt": "params ! [ source , entry . conversation_id , entry . entry_id , entry . agent_id , normalized_timestamp ( & entry . timestamp ) ? , entry . entry_type , entry . text ]"}, @@ -1040,8 +1082,9 @@ {"id": "lv-h0c52737877d8", "path": "crates/fractal-delivery/src/store/terminal_gate_evidence/native_source/tests.rs", "kind": "sql-template", "fingerprint": "615abc33275eebdb0ea1d3a18a14d8cff9428f4b36e5cbb96db19582105c5393", "owner": "fractal_delivery::store::terminal_gate_evidence::native_source::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 195, "excerpt": "UPDATE claims SET body='{broken' WHERE subject='exec/one/probe' AND kind='runtime.observed'"}, {"id": "lv-h0c7212755048", "path": "crates/fractal-store/src/store/completion_state.rs", "kind": "sql-template", "fingerprint": "cfb2841390dfb7a0fde55d422e9609e61418a982cef18fa5d221035da4060377", "owner": "fractal_store::store::completion_state", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 85, "excerpt": "DELETE FROM local_completion_health_v1_backfill"}, {"id": "lv-h0c96917a1e85", "path": "crates/fractal-attention/src/store/attention.rs", "kind": "unresolved-sql-sink", "fingerprint": "ddeff9e9abf773cc2802f751233e89fb87b31bb0b50b2b8c852af9df9bdd7835", "owner": "fractal_attention::store::attention", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 12, "excerpt": "& canonical_sql ( \"SELECT request.id, request.store_index, request.batch_id, request.subject, request.kind, request.origin, request.actor, request.body, request.predecessors, request.accepted_at_unix_"}, - {"id": "lv-h0c9cd59bf805", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "sql-template", "fingerprint": "3821719cd9da9c7336b0bc4df86f909befb861c0beebc5f63ddb5497dd3a5579", "owner": "smallclaims::store::checkpoint_staging", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1212, "excerpt": "UPDATE meta SET plan=NULL WHERE id=1"}, - {"id": "lv-h0c9f4b3ffede", "path": "crates/fractal-store/src/store/ordered_membership.rs", "kind": "sql-template", "fingerprint": "e32a001f16ab76dc15f424dbb35e9d0fab4c21741a7ee76041e637f50449d0fa", "owner": "fractal_store::store::ordered_membership", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 334, "excerpt": "INSERT INTO ordered_membership_heads(container,member,position,revision,winner) VALUES(?1,?2,?3,?4,?5) ON CONFLICT(container,member) DO UPDATE SET position=excluded.position,revision=excluded.revision"}, + {"id": "lv-h0c9cd59bf805", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "sql-template", "fingerprint": "3821719cd9da9c7336b0bc4df86f909befb861c0beebc5f63ddb5497dd3a5579", "owner": "smallclaims::store::checkpoint_staging", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1134, "excerpt": "UPDATE meta SET plan=NULL WHERE id=1"}, + {"id": "lv-h0c9f4b3ffede", "path": "crates/fractal-store/src/store/ordered_membership.rs", "kind": "sql-template", "fingerprint": "e32a001f16ab76dc15f424dbb35e9d0fab4c21741a7ee76041e637f50449d0fa", "owner": "fractal_store::store::ordered_membership", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 305, "excerpt": "INSERT INTO ordered_membership_heads(container,member,position,revision,winner) VALUES(?1,?2,?3,?4,?5) ON CONFLICT(container,member) DO UPDATE SET position=excluded.position,revision=excluded.revision"}, + {"id": "lv-h0ce05c43b4a2", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "f7412e6b548e10558b244b2fddac940865d0ba0ea06704ee689f162668f676e0", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 325, "excerpt": "INSERT OR REPLACE INTO meta(key,value) VALUES('assistant_grant_authority_fleet_id',?1)"}, {"id": "lv-h0cfe32b4b70b", "path": "crates/fractal-store/src/store/message_send_tests.rs", "kind": "sql-template", "fingerprint": "0bd2d5c434f44597ecbcc5314b9145e9e7eb02befdb5fe272c0227b94fc3d18a", "owner": "fractal_store::store::message_send_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 36, "excerpt": "DELETE FROM operations WHERE id='op/invented-parity'"}, {"id": "lv-h0d17d2d43780", "path": "crates/smallclaims/src/ivm/claim_source.rs", "kind": "sql-template", "fingerprint": "1927c02e6052e0416b46a82eaaea94815ca0b8805edcf46d02c26f04e0c067f9", "owner": "smallclaims::ivm::claim_source", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 159, "excerpt": "CREATE TRIGGER IF NOT EXISTS ivm_install_claim_{name} {event} WHEN {condition} BEGIN UPDATE ivm_install_sources SET available=0 WHERE name IN ({sources}); UPDATE ivm_install_jobs SET phase='stopped',e"}, {"id": "lv-h0d1d3d43ff50", "path": "crates/fractal-store/src/store/resources_preparation_tests.rs", "kind": "sql-template", "fingerprint": "da375a6ef935682d924483cbd6c26b9c32a0a576b639560d3ec18290cfd5125b", "owner": "fractal_store::store::resources_preparation_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 1222, "excerpt": "DELETE FROM claims WHERE id=?1"}, @@ -1050,6 +1093,7 @@ {"id": "lv-h0d4be1f82a93", "path": "crates/fractal-missions/src/store/mission_eval_reuse_tests.rs", "kind": "sql-template", "fingerprint": "515abc9b9242b8378e9537f71883bb3586644491135d6d14f6968a9e67a23edc", "owner": "fractal_missions::store::mission_eval_reuse_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 131, "excerpt": "INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) VALUES(?1,(SELECT id FROM batches LIMIT 1),?2,?3,'node',NULL,?4,'[]',?5)"}, {"id": "lv-h0d4ee8b8c2be", "path": "crates/fractal-missions/src/store/mission_list.rs", "kind": "unresolved-sql-sink", "fingerprint": "b6dcca8910b4e531384e6493d66664d731f5dd979cda086c8ace119dd8ebe5ca", "owner": "fractal_missions::store::mission_list", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 226, "excerpt": "[ generation ] , | row | row . get : : < _ , String > ( 0 )"}, {"id": "lv-h0d7940fcc7d1", "path": "crates/fractal-store/src/store/published_list.rs", "kind": "unresolved-sql-sink", "fingerprint": "b3ceb5173ece93d4521ad854d33abdc671a641e46154dc8b9d6e61ece8c76d69", "owner": "fractal_store::store::published_list", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 451, "excerpt": "[ ask ] , | row | Ok ( ( row . get : : < _ , Option < String > > ( 0 ) ? , row . get : : < _ , Option < String > > ( 1 ) ? ) )"}, + {"id": "lv-h0d8e722e48bb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "6deb99663396912b4801baedf96facd1f2164ba6d1c97f672ca199d84ca3a012", "owner": "smallclaims::store::assistant_grant_authority", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 352, "excerpt": "DROP TRIGGER IF EXISTS assistant_grant_proof_record_{event}; CREATE TRIGGER assistant_grant_proof_record_{event} AFTER {event} ON replica_records WHEN {changed}EXISTS({dependent}) BEGIN INSERT OR IGNO"}, {"id": "lv-h0d9e7d2f2f5e", "path": "crates/fractal-store/src/store/resources_preparation.rs", "kind": "sql-template", "fingerprint": "3cdd07f1efae9a3e2e7202956636c31042f833f22c09269a22d5aa4d6e751099", "owner": "fractal_store::store::resources_preparation", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 250, "excerpt": "INSERT INTO local_resource_preparation_deferred(subject) SELECT OLD.subject WHERE (substr(OLD.subject,1,9)='resource/' OR OLD.kind='resource.observed' OR EXISTS (SELECT 1 FROM local_resource_preparati"}, {"id": "lv-h0dbb3a5ec63d", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "5eb30c5c6d9d85bd92886402a0dcb13a51dae9638e40c9ae61a8f3048f57c675", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 17769, "excerpt": "\"ROLLBACK TO project_claim; RELEASE project_claim\""}, {"id": "lv-h0dd03fc3bafa", "path": "crates/fractal-store/src/store/checkpoint_capture_epoch_tests.rs", "kind": "sql-template", "fingerprint": "1b6324559ab37a1f208ac78d29e2575ee95e0d141efedbb8f858988ab6c257e2", "owner": "fractal_store::store::checkpoint_capture_epoch_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 176, "excerpt": "INSERT OR REPLACE INTO mission_definitions(mission_id,revision,state,claim_id) SELECT mission_id,revision,state,'uncaptured' FROM mission_definitions"}, @@ -1067,6 +1111,7 @@ {"id": "lv-h0e5d8235b642", "path": "crates/fractal-store/src/store/resources_preparation_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "de98181aaaa8b079141f8839f4d33ebd652a1ecb22a7b82546542a3c936fbed1", "owner": "fractal_store::store::resources_preparation_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 31, "excerpt": "& canonical_sql ( \"SELECT accepted_at_unix_ms FROM claims WHERE subject=?1 AND kind='resource.observed' ORDER BY COALESCE(json_extract(body, '$.fields.attribution_only'), 0), CANONICAL_DESC(claims) LI"}, {"id": "lv-h0e67d9bae7b1", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "19dad968052f39e717f6020bbe24031d0806b70b895e810e3c2aabf0380d35dd", "owner": "fractal_missions::store::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 7026, "excerpt": "INSERT OR IGNORE INTO claim_positions(claim_id,position) SELECT id,store_index FROM claims WHERE subject=?1"}, {"id": "lv-h0e67e1bad682", "path": "crates/smallclaims/src/store/checkpoint_trim/local_trim_tests.rs", "kind": "sql-template", "fingerprint": "aa7f42c670ae72973b14f5f03000c6c80f666bf7a1d8318b7f64173fe4872b5d", "owner": "smallclaims::store::checkpoint_trim::local_trim_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 24, "excerpt": "CREATE TABLE IF NOT EXISTS desired(claim_id TEXT); CREATE TABLE IF NOT EXISTS mission_definitions(claim_id TEXT); CREATE TABLE IF NOT EXISTS mission_revisions(claim_id TEXT); CREATE TABLE IF NOT EXIST"}, + {"id": "lv-h0e74c062c397", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "9898dd409eca3fa0ca731f22f89d6ce68090545212b7d97948663318ffac01cc", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1169, "excerpt": "INSERT INTO assistant_grant_membership_windows VALUES(?1,?2,?3,NULL)"}, {"id": "lv-h0e7c4a7b63d7", "path": "crates/fractal-store/src/store/run_eta.rs", "kind": "unresolved-sql-sink", "fingerprint": "1bfb384a37dc329650ef055c1a834dcc2dc66b3da69ab0e6d53742f0823a3e95", "owner": "fractal_store::store::run_eta", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 157, "excerpt": "CANDIDATES_SQL"}, {"id": "lv-h0e8db7b3952c", "path": "crates/fractal-store/src/store/resources.rs", "kind": "sql-template", "fingerprint": "d5f799731c54c85671bd2bd82975d5e15dd7f548afebfe37a98a2ff8ccefdc91", "owner": "fractal_store::store::resources", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 288, "excerpt": "INSERT INTO resource_observations(subject,claim_id,kind,facts,observed_at,opened_by,opened_by_run) VALUES(?1,?2,?3,?4,?5,?6,?7) ON CONFLICT(subject) DO UPDATE SET claim_id=excluded.claim_id,kind=exclu"}, {"id": "lv-h0ea1cc60275f", "path": "crates/fractal-attention/src/store/attention.rs", "kind": "unresolved-sql-sink", "fingerprint": "db2489b7eb5e625f2c44a94cd69af254f19922080132a4485d6fac1a702f538f", "owner": "fractal_attention::store::attention", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 250, "excerpt": "& canonical_sql ( \"SELECT DISTINCT subject FROM claims WHERE kind='attention.requested' AND (?1 IS NULL OR json_extract(body, '$.fields.reviewer')=?1) ORDER BY CANONICAL_ASC(claims)\" , )"}, @@ -1162,6 +1207,7 @@ {"id": "lv-h150e2cf396af", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "1074deafc5b28c388c2638c07b9faf342ad63b137ddc726add2ba01c9d46a56d", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 345, "excerpt": "INSERT INTO replica_envelope_signatures VALUES('birch',3,'sealed','anchor-key')"}, {"id": "lv-h151e6a39c85e", "path": "crates/fractal-store/src/store/resources_preparation.rs", "kind": "unresolved-sql-sink", "fingerprint": "c83d4eb3cac4498659dfb2301cc20db436468a70a7b592332b53c753ec20e27c", "owner": "fractal_store::store::resources_preparation", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 790, "excerpt": "[ id ] , | row | { let accepted = row . get_ref ( 1 ) ? . as_str ( ) ? ; let origin = match row . get_ref ( 2 ) ? { rusqlite : : types : : ValueRef : : Null = > None , value = > Some ( value . as_str "}, {"id": "lv-h153f9754e6d8", "path": "crates/fractal-store/src/store/resources_preparation_tests.rs", "kind": "sql-template", "fingerprint": "a873849ea5821c7bbc8d7cf711b597d62515758f8fa790509e09072c13d42b1b", "owner": "fractal_store::store::resources_preparation_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 474, "excerpt": "UPDATE batches SET origin='example-zzz' WHERE id=(SELECT batch_id FROM claims WHERE id=?1)"}, + {"id": "lv-h15542ec4c6ea", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "a1283ec5bf87b372df96534f09c45e898f5571cce47da6cbbcd01e0f6c82c16f", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1399, "excerpt": "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1"}, {"id": "lv-h1567ca2616c9", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "f042aa9953000359b5fa81208e97c68d555ca7eeaf0710add3d4d89cd1259650", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 3938, "excerpt": "INSERT INTO mission_definitions(mission_id, revision, state, claim_id) VALUES (?1, ?2, ?3, ?4) ON CONFLICT(mission_id) DO UPDATE SET revision=excluded.revision, state=excluded.state, claim_id=excluded"}, {"id": "lv-h156962f6c4eb", "path": "crates/fractal-seats/src/store/accounts.rs", "kind": "sql-template", "fingerprint": "8b5bac7647edd57523f67e6da5bbf796cb1c097957fa283fba8602bf7abb6c29", "owner": "fractal_seats::store::accounts", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 465, "excerpt": "INSERT INTO local_limit_stops(account,episode,seat,stopped_at_unix_ms) VALUES (?1,?2,?3,?4)"}, {"id": "lv-h157e44be6c3c", "path": "crates/fractal-reconcile/src/reconcile.rs", "kind": "included-source", "fingerprint": "1bdea25b989adba467e9ecf833902be8f450becc4a33294aa2d60d93ea7db006", "owner": "fractal_reconcile::reconcile", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 46142, "excerpt": "include_str ! ( \"../../fractal-drivers/tests/fixtures/blocking-screens/claude-working.txt\" )"}, @@ -1177,7 +1223,8 @@ {"id": "lv-h16304247d6f3", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "f3ef16c81d712129e6126bb98384cc37d2d8a15aa96316fd35523277083c9ace", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 17765, "excerpt": "\"RELEASE project_claim\""}, {"id": "lv-h164d197fb0c6", "path": "crates/fractal-store/src/store/checkpoint_identity_reuse_tests.rs", "kind": "sql-template", "fingerprint": "15decfaeb5c26cecac153848d12c87738052d4cae641e66c1505ade456c89476", "owner": "fractal_store::store::checkpoint_identity_reuse_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 155, "excerpt": "UPDATE claims SET accepted_at_unix_ms='5000' WHERE id IN ( SELECT records.claim_id FROM replica_records records JOIN replica_envelopes envelopes ON records.writer=envelopes.writer AND records.sequence"}, {"id": "lv-h1650bf6a58bc", "path": "crates/fractal-missions/src/store/resource_preparation/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "713a1c59ffff86cb801fa5892aec98a04d6796cb005c7ef94339e94c3da332f6", "owner": "fractal_missions::store::resource_preparation::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 117, "excerpt": "& other , | _ | ( )"}, - {"id": "lv-h16586c1e56da", "path": "crates/smallclaims/src/store/principals.rs", "kind": "sql-template", "fingerprint": "bf5873267aa948343437eaa2ca0053f5e123c1b8d089c7c933a34e432baa6d90", "owner": "smallclaims::store::principals", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 284, "excerpt": "INSERT OR IGNORE INTO claim_signature_candidates(claim_id,signature,key,nonce) VALUES (?1,?2,?3,?4)"}, + {"id": "lv-h16586c1e56da", "path": "crates/smallclaims/src/store/principals.rs", "kind": "sql-template", "fingerprint": "bf5873267aa948343437eaa2ca0053f5e123c1b8d089c7c933a34e432baa6d90", "owner": "smallclaims::store::principals", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 279, "excerpt": "INSERT OR IGNORE INTO claim_signature_candidates(claim_id,signature,key,nonce) VALUES (?1,?2,?3,?4)"}, + {"id": "lv-h1665a4a8cfdf", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "unresolved-sql-sink", "fingerprint": "b7eafcbb01a79e6feb02839905b41bafc8a5be2f355d21ab6b4b392a34092eac", "owner": "smallclaims::store::assistant_grant_authority", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 241, "excerpt": "& QUERY"}, {"id": "lv-h166835b7b8cb", "path": "crates/smallclaims/src/store/saved_inventory.rs", "kind": "unresolved-sql-sink", "fingerprint": "fca5d96f6c68c4cc7e0a68c2245ed850d4a3f62fc48485354ad7706c45b31ac4", "owner": "smallclaims::store::saved_inventory", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 73, "excerpt": "[ rowid ] , | row | { Ok ( ReplicaEnvelopeId { writer : row . get ( 0 ) ? , sequence : row . get ( 1 ) ? , hash : row . get ( 2 ) ? , } ) }"}, {"id": "lv-h16928b5eb896", "path": "crates/fractal-api-core/src/api/published_lists_tests.rs", "kind": "sql-template", "fingerprint": "c3a0532ab17a84e1ad0287749b26ea41efe293bb61b1c62a42a4093e94414017", "owner": "fractal_api_core::api::published_lists_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 320, "excerpt": "UPDATE step_runs SET assignee=?2, available_to=?3 WHERE subject=?1"}, {"id": "lv-h1693db03cced", "path": "crates/smallclaims/src/store/prepared_envelope.rs", "kind": "sql-template", "fingerprint": "7512424f1b97db6e6318c1bce828a00664863a9c0fca3740e0629c5e37936fe6", "owner": "smallclaims::store::prepared_envelope", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 455, "excerpt": "INSERT INTO replica_records( record_ref, writer, sequence, envelope_hash, position, raw, state, claim_id, subject_hint, kind_hint, error_code, error_message, updated_at_unix_ms ) VALUES (?1, ?2, ?3, ?"}, @@ -1197,6 +1244,7 @@ {"id": "lv-h1749b705b741", "path": "crates/fractal-reconcile/src/reconcile/tests/ownership_guard_tests.rs", "kind": "sql-template", "fingerprint": "a466c1bb6842b49c1d34a00a24fdcb27190d6711850fee20c555c3c6c8bfc672", "owner": "fractal_reconcile::reconcile::tests::ownership_guard_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 1048, "excerpt": "UPDATE claims SET accepted_at_unix_ms=?1 WHERE id=?2"}, {"id": "lv-h175352b3edc3", "path": "crates/smallclaims/src/store/checkpoint_trim/pacing_tests.rs", "kind": "sql-template", "fingerprint": "45c22b9ad5d861cda111564b63c37f3e96f76a87b8ae5dadf42ace4d40c3a263", "owner": "smallclaims::store::checkpoint_trim::pacing_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 10, "excerpt": "CREATE TABLE checkpoint_envelopes(writer TEXT, sequence INTEGER, envelope_hash TEXT, accepted_at_unix_ms INTEGER, PRIMARY KEY(writer,sequence,envelope_hash)); CREATE TABLE replica_envelopes(writer TEX"}, {"id": "lv-h176268083051", "path": "crates/fractal-store/src/store/publication.rs", "kind": "unresolved-sql-sink", "fingerprint": "84fd7f5dc2c44bd31133a45a09e5a115cda11d6d13e2bca019c61f9b7b487709", "owner": "fractal_store::store::publication", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 42, "excerpt": "params ! [ subject , origin , incarnation , at . min ( i64 : : MAX as u64 ) ] , | row | Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? ) ) ,"}, + {"id": "lv-h177538cdd4af", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "aee6e9fe0719452a559a27953733db020360f73d0451154a61dfed3548e440b1", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 923, "excerpt": "DELETE FROM assistant_grant_membership_windows WHERE writer=?1 AND member_key=?2"}, {"id": "lv-h1776f9a0fd34", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "sql-template", "fingerprint": "eed391928c6b42b9a00df9243740fbc0d910229ad2339605fe4d634ea822d71e", "owner": "smallclaims::store::checkpoint", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 946, "excerpt": "INSERT OR REPLACE INTO temp.proof_answers(phase, subject, text, object) VALUES (?1, ?2, ?3, ?4)"}, {"id": "lv-h178cf16dd35e", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "sql-template", "fingerprint": "475096cce07b91b6096b190fea6b4b3d686796031280a412511247cb3c536ae1", "owner": "smallclaims::store::checkpoint_staging", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 1196, "excerpt": "UPDATE claims SET protected=1 WHERE protected=0 AND kind NOT IN ({})"}, {"id": "lv-h1795cee573e7", "path": "crates/smallclaims/src/store/receive_writer_tests.rs", "kind": "sql-template", "fingerprint": "9eaa155b6dd70c9a817324637efac8a417fecb0840e633aa50db17e64a33ae07", "owner": "smallclaims::store::receive_writer_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1204, "excerpt": "INSERT INTO meta(key,value) VALUES('signing-fairness','committed')"}, @@ -1211,8 +1259,11 @@ {"id": "lv-h18348778d982", "path": "crates/fractal-seats/src/store/seats.rs", "kind": "unresolved-sql-sink", "fingerprint": "e57a91b9ecf4257ffe98bffa381e88ebd974069c91e71b4ace9bfdd5537ea369", "owner": "fractal_seats::store::seats", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1719, "excerpt": "RETIRED_OWNED_INTAKE_SUBJECTS"}, {"id": "lv-h18680c8a2948", "path": "crates/fractal-store/src/store/checkpoint_identity_reuse_tests.rs", "kind": "sql-template", "fingerprint": "dc7ee7721a24a4ca72df1d12c1beb80223bebf763d06d85f6d06f457ca0a707a", "owner": "fractal_store::store::checkpoint_identity_reuse_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 253, "excerpt": "DELETE FROM replica_envelopes WHERE rowid=?1"}, {"id": "lv-h1877300f33b6", "path": "crates/fractal-store/src/store/custom/tests_shared_delivery.rs", "kind": "included-source", "fingerprint": "cbb2fe623a9a369113e6c2384627b6c1a790ec4da761cf8aef3d335a94409d3b", "owner": "fractal_store::store::custom::tests_shared_delivery", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 102, "excerpt": "include_str ! ( \"../../../../../examples/fractal/decision-tree.json\" )"}, + {"id": "lv-h187f367a46c6", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "1157c18cbc3978d614122978ddb498546dfdc8ce18082716845436a03ff6100f", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 875, "excerpt": "DELETE FROM replica_envelope_signatures WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=?4"}, + {"id": "lv-h188a54cc0c91", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "a1283ec5bf87b372df96534f09c45e898f5571cce47da6cbbcd01e0f6c82c16f", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 861, "excerpt": "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1"}, {"id": "lv-h189746109b84", "path": "crates/fractal-store/src/store/run_eta_tests.rs", "kind": "sql-template", "fingerprint": "0620f07a03a8ddb71b248e9a7be45ef11ec57e2ed6fb248796e4e8cceb72a703", "owner": "fractal_store::store::run_eta_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 364, "excerpt": "DELETE FROM local_run_eta_samples WHERE run_id IN(SELECT run_id FROM local_run_eta_pending); INSERT INTO local_run_eta_samples VALUES('s-70','r-70','hash','build',80,79); DELETE FROM local_run_eta_pen"}, {"id": "lv-h18ab046ede43", "path": "crates/fractal-api-core/src/api/tests.rs", "kind": "sql-template", "fingerprint": "d916eeef4f4b8829f02d4fc853091aba2e3090cfb6db676adf9f8ba0b214c6fa", "owner": "fractal_api_core::api::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 13776, "excerpt": "INSERT INTO batches(id,origin,replica_sequence,hash,accepted_at_unix_ms) VALUES ('summary-notice','node',9000,'fixture','1700000000000'); INSERT INTO claims(id,batch_id,subject,kind,origin,body,predec"}, + {"id": "lv-h18b15ee88afe", "path": "crates/smallclaims/src/store/assistant_grant_receipt_cost_tests.rs", "kind": "sql-template", "fingerprint": "ccbdb4ad2b0e9e2d65c7429708b5ebf324a43876f080303e18def587249485e6", "owner": "smallclaims::store::assistant_grant_receipt_cost_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 77, "excerpt": "INSERT INTO assistant_grant_dirty VALUES(?1)"}, {"id": "lv-h18dd59167769", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "f9d2d78c1902d5fc8f34da2f9ea4ab1b736b8b3ece2dde36110dc9302628fe69", "owner": "fractal_store::store::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 11861, "excerpt": "UPDATE batches SET replica_sequence=10000-(SELECT MIN(store_index) FROM claims WHERE claims.batch_id=batches.id)"}, {"id": "lv-h18dd79b21618", "path": "crates/fractal-store/src/store/notice_authority_tests.rs", "kind": "sql-template", "fingerprint": "1d306ca6f8d0ac404bd039bda5b4330f1befc3c5af2cbb683b0ea08b3b3a7a25", "owner": "fractal_store::store::notice_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 288, "excerpt": "DELETE FROM documents WHERE name=?1 AND hash=?2"}, {"id": "lv-h18e23473abaf", "path": "crates/fractal-delivery/src/store/terminal_gate_evidence/native_source/tests.rs", "kind": "sql-template", "fingerprint": "5a66247d8f7ecaea9d55cd03b41096c4c0175a3572cf61790f6930987c671751", "owner": "fractal_delivery::store::terminal_gate_evidence::native_source::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 312, "excerpt": "UPDATE test_native_terminal_guard SET pending=0 WHERE id=1"}, @@ -1220,6 +1271,7 @@ {"id": "lv-h1923419271b7", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "19f6c92406524d4f1e21d93717491852ee29c50077d9a6ff1384164a75a51579", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6418, "excerpt": "& canonical_sql ( LATEST_CLAIM_QUERY )"}, {"id": "lv-h193645d36e0f", "path": "crates/fractal-reconcile/src/reconcile.rs", "kind": "included-source", "fingerprint": "23bef6856b048e52b60b69a713a07339768128a512d6487d2388a7ffaba34a1c", "owner": "fractal_reconcile::reconcile", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 46543, "excerpt": "include_str ! ( \"../../fractal-drivers/tests/fixtures/blocking-screens/claude-login.txt\" )"}, {"id": "lv-h1939f319556d", "path": "crates/fractal-store/src/store/arrangements.rs", "kind": "sql-template", "fingerprint": "8326b0def65d092d55ca567201f98deb44744f6078e4566c7df9423c49a602e4", "owner": "fractal_store::store::arrangements", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 68, "excerpt": "DELETE FROM meta WHERE key>=?1 AND key ( 0 ) ? . max ( 0 ) as u64 , row . get ( 1 ) ? ) )"}, {"id": "lv-h1a3d7af4e5fb", "path": "crates/fractal-store/src/store/gate_runners.rs", "kind": "unresolved-sql-sink", "fingerprint": "bbfac8f07b9a24bc278443aa0d496ef7bbd0019ed35cee7698f44b358102850e", "owner": "fractal_store::store::gate_runners", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 138, "excerpt": "[ ] , | row | row . get ( 0 )"}, + {"id": "lv-h1a4864d9f6c8", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "a1283ec5bf87b372df96534f09c45e898f5571cce47da6cbbcd01e0f6c82c16f", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 626, "excerpt": "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1"}, {"id": "lv-h1a537769038f", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "sql-template", "fingerprint": "7ea8e67a7a92078dbdc50c161b256d324410159eb8f2119f2f61e9ea19df7fe2", "owner": "smallclaims::store::checkpoint_trim", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 1091, "excerpt": "INSERT INTO checkpoints( id, cut_unix_ms, state, drop_digest, detail, updated_at_unix_ms) VALUES (?1, ?2, ?6, ?3, ?4, ?5) ON CONFLICT(id) DO UPDATE SET state=excluded.state, drop_digest=excluded.drop_"}, {"id": "lv-h1a592490a5fb", "path": "crates/fractal-daemon/src/store_tests/attention_ivm.rs", "kind": "sql-template", "fingerprint": "7c59153878f63036757b4edb00eab01e19febe8c2ea9b95771bfa159d8ef5a59", "owner": "fractal_daemon::store_tests::attention_ivm", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 729, "excerpt": "UPDATE step_runs SET status='ready' WHERE assignee='person/avery'"}, {"id": "lv-h1a5e4594acca", "path": "crates/fractal-store/src/store/run_eta_tests.rs", "kind": "sql-template", "fingerprint": "ed381253d90afc8d2d16ecc24211247017ecd2192a80593694a61ef9d530522f", "owner": "fractal_store::store::run_eta_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 195, "excerpt": "INSERT INTO step_runs VALUES('active-step','active','generation','hash','build',1,'working')"}, {"id": "lv-h1a64f1c87528", "path": "crates/fractal-store/src/store/push_registrations.rs", "kind": "sql-template", "fingerprint": "a99e2bda9295643e22322d66653b9ad743b6089f3aaf78e771b695c48b6fba63", "owner": "fractal_store::store::push_registrations", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 158, "excerpt": "DELETE FROM local_push_registrations WHERE pairing_grant=?1"}, {"id": "lv-h1a72f3f86c24", "path": "crates/fractal-api-core/src/api/agents_request_slo/ledger.rs", "kind": "sql-template", "fingerprint": "6e20943c5d7a0e36260fedae93f9e47c2a88c3d81a4dd53f4db770aaa5156941", "owner": "fractal_api_core::api::agents_request_slo::ledger", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 49, "excerpt": "DELETE FROM minute_receipts WHERE slot >= ?1"}, {"id": "lv-h1a7eefa5184a", "path": "crates/fractal-missions/src/store/adhoc_work.rs", "kind": "unresolved-sql-sink", "fingerprint": "b7f58d4097d6bccf42f00e3abb6a5a1ef693e9a49d69ce6dd1d823059ac3d45e", "owner": "fractal_missions::store::adhoc_work", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 338, "excerpt": "& canonical_sql ( \"SELECT id,store_index,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms FROM claims WHERE subject=?1 AND kind='mission-run.created' ORDER BY CANONICAL_ASC(cla"}, + {"id": "lv-h1a8e7267f37b", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "30c65e64f817a236e2162d88ca3e15d5d15aed65e779ae99e518649784465f32", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 741, "excerpt": "DELETE FROM claims WHERE id IN( SELECT claim_id FROM assistant_grant_pending WHERE origin=?1 AND auth_sequence=?2 AND auth_envelope_hash=?3 AND auth_record_position=?4)"}, {"id": "lv-h1a8f3dc99fe4", "path": "crates/fractal-store/src/store/message_outbox.rs", "kind": "sql-template", "fingerprint": "c2fc7e00a8daf2ab9712aa44e0ab862ef137cc05a8129298c503266bab9a4558", "owner": "fractal_store::store::message_outbox", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 233, "excerpt": "UPDATE local_message_outbox SET attempts=attempts+1, last_error=?2 WHERE subject=?1"}, {"id": "lv-h1a9cad174821", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "f0de6fed71e475e772a0e727f08a594a458fe086d057b11462fb07ca669507ae", "owner": "smallclaims::store::membership_query_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 288, "excerpt": "INSERT INTO claims VALUES('new','fleet.member-left','host/birch','{\"fields\":{}}','anchor')"}, {"id": "lv-h1abbf8648a66", "path": "crates/fractal-store/src/store/gate_runners_tests.rs", "kind": "sql-template", "fingerprint": "7e12df6e3ed2fb9a1710a2b5d070afed6cd54cff54b2a9c4c239a577dcfb52a0", "owner": "fractal_store::store::gate_runners_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 140, "excerpt": "DELETE FROM local_gate_runners"}, {"id": "lv-h1abca1927a82", "path": "crates/fractal-store/src/store/directive_notes.rs", "kind": "sql-template", "fingerprint": "4a6bfa2d9861b492965176483d8c6bb97b3a3548751338406f577d6534a9c679", "owner": "fractal_store::store::directive_notes", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 195, "excerpt": "INSERT INTO person_directive_notes(person,claim_id,head_key) VALUES(?1,?2,?3) ON CONFLICT(person) DO UPDATE SET claim_id=excluded.claim_id,head_key=excluded.head_key WHERE excluded.head_key>person_dir"}, {"id": "lv-h1acbff13fa60", "path": "crates/fractal-api-core/src/api/agents_request_slo/ledger.rs", "kind": "sql-template", "fingerprint": "3411db2d14a35b478385b0f16931edc17b0086b71ca3f4860e9e28613b63a48f", "owner": "fractal_api_core::api::agents_request_slo::ledger", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 139, "excerpt": "INSERT INTO fault_outbox (reviewer, status, current, through_ms) VALUES (?1, ?2, ?3, ?4)"}, {"id": "lv-h1acd02af02ee", "path": "crates/fractal-store/src/store/run_eta_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "4ec7c53222c8a758c722e2111541035ce700d5ae7bd0898c5f1b1a743e6450fd", "owner": "fractal_store::store::run_eta_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 144, "excerpt": "sql"}, + {"id": "lv-h1ae4a2fcf40e", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "0a2cf6d7913fe58d1055f3e2ee28e52d16cf4744ed9b69b3a61e60b5b42a4d9d", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1115, "excerpt": "ALTER TABLE assistant_grant_auth_cursor DROP COLUMN membership_start;"}, {"id": "lv-h1b389162d86b", "path": "crates/smallclaims/src/sqlite/managed_commit_counter_tests.rs", "kind": "sql-template", "fingerprint": "a89601989957b47a3563f65a3206cf93bde1dff4462bd595d0c45cc113480795", "owner": "smallclaims::sqlite::managed_commit_counter_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 52, "excerpt": "INSERT INTO parent VALUES(2)"}, {"id": "lv-h1b4b3bc67b94", "path": "crates/fractal-seats/src/store/canonical_audit.rs", "kind": "sql-template", "fingerprint": "d2135ccfc11b8e1a90e00a374a6c6cb5fb97798b9724d1e6e92a21a109cc28db", "owner": "fractal_seats::store::canonical_audit", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1311, "excerpt": "UPDATE desired SET member=json_set(member, '$.host', 'elm') WHERE subject='agent/alder.worker'"}, {"id": "lv-h1b62cdb0c2d2", "path": "crates/fractal-store/src/store/notice_authority.rs", "kind": "sql-template", "fingerprint": "3c4f23d84bb81c22f7b629a0e2d61dd58a194e53d41c4506010d4bba703d57e4", "owner": "fractal_store::store::notice_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 141, "excerpt": "INSERT INTO local_custom_dirty SELECT subject FROM custom_sources WHERE subject LIKE 'custom/attention/%' ON CONFLICT(subject) DO UPDATE SET subject=excluded.subject"}, @@ -1267,6 +1322,7 @@ {"id": "lv-h1beb36252742", "path": "crates/fractal-seats/src/store/resource_preparation/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "dc372daedd324b47f1261987900c1a08eff3ccdf253bfcf666d0ebecf17142ad", "owner": "fractal_seats::store::resource_preparation::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 271, "excerpt": "& store , | _ | ( )"}, {"id": "lv-h1bf70a74e357", "path": "crates/fractal-api-core/src/api/client_push/tests.rs", "kind": "sql-template", "fingerprint": "0a87b6ca1c3206e8e53b141ed709386caa959f2c69d6f181138e4850400b77ea", "owner": "fractal_api_core::api::client_push::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 226, "excerpt": "UPDATE claims SET origin='foreign-member' WHERE subject=?1"}, {"id": "lv-h1bfc6939d6e9", "path": "crates/smallclaims/src/sqlite/writer_queue/tests.rs", "kind": "sql-template", "fingerprint": "71f5d5423100ec2c92b15b2e0ab52a4b5fdff952a65c8ae40607bcf2bd19ee10", "owner": "smallclaims::sqlite::writer_queue::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 347, "excerpt": "INSERT INTO values_ VALUES(1)"}, + {"id": "lv-h1c051df8af17", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "3734d25e713a65107da10b24793feb957d9cc09dc5229560903c6861d4b56ba8", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 1309, "excerpt": "UPDATE replica_records SET envelope_hash='decoy-envelope',position=1 WHERE claim_id=?1"}, {"id": "lv-h1c1d0a07d9ef", "path": "crates/fractal-seats/src/store/runtime_starts.rs", "kind": "unresolved-sql-sink", "fingerprint": "524d11472218a40bbe81ad32ca17ac18e24e0f794e597e9e0ad8c0cb08ad1256", "owner": "fractal_seats::store::runtime_starts", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 641, "excerpt": "& format ! ( \"SELECT * FROM local_runtime_starts WHERE {PENDING} ORDER BY id\" )"}, {"id": "lv-h1c1e8afac510", "path": "crates/fractal-api-client-v0/src/api/client_v0/runtime_start_diagnostics/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "4ec7c53222c8a758c722e2111541035ce700d5ae7bd0898c5f1b1a743e6450fd", "owner": "fractal_api_client_v0::api::client_v0::runtime_start_diagnostics::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 97, "excerpt": "sql"}, {"id": "lv-h1c315e6d5b5b", "path": "crates/fractal-store/src/store/shared.rs", "kind": "sql-template", "fingerprint": "fcb74cd0f861438e431998d8d16c6c6d5ad3c3cc2a58f09d3403116cc7df6065", "owner": "fractal_store::store::shared", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 244, "excerpt": "INSERT OR IGNORE INTO claims(id, batch_id, subject, kind, origin, actor, body, predecessors, accepted_at_unix_ms) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9)"}, @@ -1277,12 +1333,14 @@ {"id": "lv-h1c54bb0d403b", "path": "crates/fractal-store/src/store/glass_heads.rs", "kind": "unresolved-sql-sink", "fingerprint": "a11ff17b351a8a31b9d385dd17f6f0c5b983c8147434a126bef9fd827da833f9", "owner": "fractal_store::store::glass_heads", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 221, "excerpt": "& canonical_sql ( \"SELECT id FROM claims WHERE subject=?1 AND kind='glass.upserted' ORDER BY CANONICAL_ASC(claims) LIMIT 1\" , ) , [ subject ] , | row | row . get ( 0 ) ,"}, {"id": "lv-h1c6769be2fee", "path": "crates/fractal-github/src/changes/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "bb3beb90db6d03b3fab4ef5029cccc3de43c7be1d9cde0dbf6e2e2ec075bb0af", "owner": "fractal_github::changes::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 286, "excerpt": "fixture . record . clone ( )"}, {"id": "lv-h1c8ff1061589", "path": "crates/fractal-missions/src/store/schedule_active_run_tests.rs", "kind": "sql-template", "fingerprint": "a12b67671e84f2d0c5fd25f9e7a6bf1ea4c375ccfd8c746b8576529292381c97", "owner": "fractal_missions::store::schedule_active_run_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 278, "excerpt": "UPDATE mission_runs SET status='running' WHERE id='cut-old'"}, + {"id": "lv-h1c91a0dec004", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "701329c99c19076f8b477e2f84c40f1a2ece7974203ef799364c1f2382fd1875", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 520, "excerpt": "UPDATE replica_envelope_signatures SET signature='invalid'"}, {"id": "lv-h1cb47a19f4af", "path": "crates/smallclaims/src/store/principals/legacy.rs", "kind": "unresolved-sql-sink", "fingerprint": "afa4f2f42f5c1e1d453ac252ee5e4b5cf16394c8ade4c7b4faabff40a76b109c", "owner": "smallclaims::store::principals::legacy", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 345, "excerpt": "[ link ]"}, {"id": "lv-h1cbf9f654bef", "path": "crates/fractal-missions/src/store/terminal_step_guard_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "5c837a5d02243070e3c6603ce60216ac048233a983b6f1f132929b1d0d4f1cd6", "owner": "fractal_missions::store::terminal_step_guard_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 256, "excerpt": "sql , [ & run . id ]"}, {"id": "lv-h1ccf70ddc42b", "path": "crates/fractal-store/src/store/publication_facts.rs", "kind": "sql-template", "fingerprint": "497b3cf606200236a44630442de821dd931e1de2e44da4ef517b2be8a170e9de", "owner": "fractal_store::store::publication_facts", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 432, "excerpt": "INSERT OR REPLACE INTO local_publication_starts SELECT id,subject,COALESCE(json_extract(body,'$.fields.incarnation_id'),'') FROM local_observations WHERE id=?1 AND json_extract(body,'$.fields.action')"}, {"id": "lv-h1cd0c334c601", "path": "crates/smallclaims/src/store/checkpoint_staging/scoped.rs", "kind": "unresolved-sql-sink", "fingerprint": "1d113d0b96055d2eb943d4583a6d063286362f10c8dd29d6ff78b1f92dc645f5", "owner": "smallclaims::store::checkpoint_staging::scoped", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 174, "excerpt": "& format ! ( \"SELECT EXISTS(SELECT 1 FROM {table} WHERE {column}=?1)\" )"}, {"id": "lv-h1ceb045a5bba", "path": "crates/fractal-api-core/src/api/agents_publication_tests.rs", "kind": "sql-template", "fingerprint": "e846c20eb3e898f19682ca10d28077acad1a8755eac4c271436a5d7ec8ad731d", "owner": "fractal_api_core::api::agents_publication_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 29, "excerpt": "UPDATE claims SET kind='custom.attention.notice-created' WHERE id=?1"}, - {"id": "lv-h1cfeccc638b4", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "included-source", "fingerprint": "8ef6196bfe9ddc5fec4d91fc9f7cd38957da979065419b476fd08e15e82c77b5", "owner": "fractal_missions::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 11217, "excerpt": "include ! ( \"mission_deadline_tests.rs\" )"}, + {"id": "lv-h1cfeccc638b4", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "included-source", "fingerprint": "8ef6196bfe9ddc5fec4d91fc9f7cd38957da979065419b476fd08e15e82c77b5", "owner": "fractal_missions::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 10842, "excerpt": "include ! ( \"mission_deadline_tests.rs\" )"}, + {"id": "lv-h1d162e19a0a1", "path": "crates/smallclaims/src/store/assistant_grant_authority_bench.rs", "kind": "sql-template", "fingerprint": "d87ece4bef5693d88f75ad121e36213674ad1844f2d3fefc7966040e264ca808", "owner": "smallclaims::store::assistant_grant_authority_bench", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 196, "excerpt": "INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) VALUES(?1,?2,?3,?4,?5,?6,?7,'[]','1791849600000')"}, {"id": "lv-h1d33e113f99a", "path": "crates/fractal-seats/src/store/resource_preparation/tests.rs", "kind": "sql-template", "fingerprint": "009305292d103e33ece00c14453d37d8bc85d08938ca4227d33a6ebbef6ad872", "owner": "fractal_seats::store::resource_preparation::tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 172, "excerpt": "CREATE TABLE invented_ddl(value TEXT)"}, {"id": "lv-h1d40fe723c4f", "path": "crates/fractal-api-core/src/api/tests.rs", "kind": "sql-template", "fingerprint": "2df63921cfb3b8303927c2ec8a88ff1e4e1a56b2c3f24fbbf6759713842fbbb8", "owner": "fractal_api_core::api::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 4523, "excerpt": "DROP TRIGGER retention_quick_failure"}, {"id": "lv-h1d410ca78a3b", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "90dbe74bec90013705bd92e02619372a20cb7733a5375be33830ea72c895a370", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6419, "excerpt": "[ subject ] , | row | row . get ( 0 )"}, @@ -1303,6 +1361,7 @@ {"id": "lv-h1e1e50547a90", "path": "crates/fractal-store/src/store/observation_trim_tests.rs", "kind": "sql-template", "fingerprint": "96459e6b70633f2ef33e13398876c6abfee63ce0414fcf900ed35793ff782e96", "owner": "fractal_store::store::observation_trim_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 24, "excerpt": "DELETE FROM local_observations WHERE id IN ( SELECT id FROM local_observations AS old WHERE observed_at_unix_ms < ?1 AND kind NOT IN ('agent.launcher-bound', 'agent.helper-launched') AND NOT EXISTS (S"}, {"id": "lv-h1e27c5bc693c", "path": "crates/fractal-store/src/store/agent_view.rs", "kind": "sql-template", "fingerprint": "384dc72b149df9e50dae97703444c8c15d47137c61626dca9307ec02a0dbcf65", "owner": "fractal_store::store::agent_view", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 429, "excerpt": "CREATE TABLE IF NOT EXISTS local_agent_harness_rows(subject TEXT PRIMARY KEY, observed TEXT);"}, {"id": "lv-h1e30d65a948a", "path": "crates/fractal-store/src/store/run_eta_tests.rs", "kind": "sql-template", "fingerprint": "c4a744d197d165cc930eb95b6a1f721854c8cd02460bd0f1dd96db71497bc7ed", "owner": "fractal_store::store::run_eta_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 263, "excerpt": "UPDATE mission_runs SET phase='terminal',status='completed' WHERE id=?1"}, + {"id": "lv-h1e384e782172", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "f976829d92148bf8272636fa56bba04a4f9d9e930e4c6ac48b48a3be13a46258", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1103, "excerpt": "DELETE FROM assistant_grant_proof_rechecks WHERE claim_id=?1"}, {"id": "lv-h1e3e5d5be065", "path": "crates/fractal-seats/src/store/person_work/reconcile_candidates_tests.rs", "kind": "sql-template", "fingerprint": "3c6aae4cccf6cfd4f4bcde133ebf6c8638b09a6f161aea9cfdbfc02ec95686f3", "owner": "fractal_seats::store::person_work::reconcile_candidates_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 46, "excerpt": "INSERT INTO step_runs(subject,run_id,generation_id,step_path,definition_hash,status, attempt,assignee,available_to,agentless,title,goals,created_at_unix_ms,updated_at_unix_ms,constraints) SELECT ?1,ru"}, {"id": "lv-h1e6ea42f1255", "path": "crates/fractal-store/src/store/message_send_tests.rs", "kind": "sql-template", "fingerprint": "97bd9b2d9b5d8ecfd294950ad4fde6ba2af020fc5cbce1d3d053f98aacef9736", "owner": "fractal_store::store::message_send_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 41, "excerpt": "INSERT INTO replica_records(record_ref,writer,sequence,envelope_hash,position, raw,state,claim_id,updated_at_unix_ms) VALUES ('record/invented-repair','invented-peer', 1,'invented-envelope',0,X'','rep"}, {"id": "lv-h1e9a7dd429b3", "path": "crates/fractal-store/src/store/message_marks_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "4ec7c53222c8a758c722e2111541035ce700d5ae7bd0898c5f1b1a743e6450fd", "owner": "fractal_store::store::message_marks_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 83, "excerpt": "sql"}, @@ -1328,6 +1387,7 @@ {"id": "lv-h1fe09bdc7663", "path": "crates/smallclaims/src/store/prepared_envelope_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "4a3da462d9361a9ad6877f8bd96c6c1927bba42a51eeedf09eae1a7d631635e8", "owner": "smallclaims::store::prepared_envelope_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 399, "excerpt": "params ! [ record_ref , envelope . writer , envelope . sequence , envelope . hash , position , raw , claim . id , claim . subject , claim . kind , error . code , error . message , now ]"}, {"id": "lv-h1fe81cd46767", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "88f39a247bc73155391086642793fbf63e967e417aefd1f2a8064224c59aabe6", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 2187, "excerpt": "[ origin ] , | row | { let high_water : u64 = row . get ( 0 ) ? ; let floor : u64 = row . get ( 1 ) ? ; let ( sequence , _ ) = crate : : writer_chain : : writer_continuation ( high_water , floor , Non"}, {"id": "lv-h1ff8d4bcbbe8", "path": "crates/fractal-store/src/store/message_canonical_sort_tests.rs", "kind": "sql-template", "fingerprint": "a3e7396e526873aa02bc0fb1963b6335f8ea9ced82e9f880ae88ea8394904582", "owner": "fractal_store::store::message_canonical_sort_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 222, "excerpt": "UPDATE claims SET accepted_at_unix_ms=x'00' WHERE id='claim-4'"}, + {"id": "lv-h20114a3e8154", "path": "crates/fractal-api-core/src/api/tests.rs", "kind": "sql-template", "fingerprint": "baf93edc8d5fce45ce68cf0c53d92c5b3b1a1019bed1e6bbc48ccabec8b7cd50", "owner": "fractal_api_core::api::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1259, "excerpt": "INSERT INTO assistant_grant_retractions(writer,member_key,lower_sequence,upper_sequence,sequence,claim_id) VALUES('birch','key/birch',7,7,7,'claim/a')"}, {"id": "lv-h2013f7d4439f", "path": "crates/smallclaims/src/sqlite.rs", "kind": "unresolved-sql-sink", "fingerprint": "c83f38676f69d44ad4e1f672c6f2a6fdcbfc9d7a23a8a343be52957e96b084db", "owner": "smallclaims::sqlite", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1051, "excerpt": "\"ROLLBACK TO batched_write; RELEASE batched_write\""}, {"id": "lv-h2014510a7d86", "path": "crates/fractal-store/src/store/card_fold.rs", "kind": "unresolved-sql-sink", "fingerprint": "cfab26c30639b74621a53061272990ac9a218d019b7fe75013178a4acaa05eb8", "owner": "fractal_store::store::card_fold", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 128, "excerpt": "& canonical_sql ( \"SELECT claims.subject, claims.id, claims.body, claims.predecessors FROM json_each(?1) subjects CROSS JOIN claims INDEXED BY claims_subject_kind_index ON claims.subject=subjects.valu"}, {"id": "lv-h201c47f6e232", "path": "crates/fractal-store/src/store/checkpoint_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "5c36a09e177543f8ec168acf6ddefaa4a97acb83f92ab61446e1757cb08ecb20", "owner": "fractal_store::store::checkpoint_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 394, "excerpt": "& canonical_sql ( \"SELECT claims.id FROM claims JOIN replica_records records ON records.claim_id=claims.id WHERE records.state<>'repaired' ORDER BY CANONICAL_ASC(claims)\" , )"}, @@ -1342,11 +1402,12 @@ {"id": "lv-h20b4ce3791b8", "path": "crates/fractal-store/src/store/published_list.rs", "kind": "unresolved-sql-sink", "fingerprint": "00e16953f852b16396fd7199a772beaa8544e3ecb26b3e18f6e8461c55971338", "owner": "fractal_store::store::published_list", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 476, "excerpt": "CHILD_RUNS"}, {"id": "lv-h20b53be73fcd", "path": "crates/fractal-store/src/store/unread_mail.rs", "kind": "sql-template", "fingerprint": "2a8edbf699d49eff37c507413dc8753c65bbafc0f44d4bf8c2d05e44b4ab0efa", "owner": "fractal_store::store::unread_mail", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 108, "excerpt": "BEGIN IMMEDIATE; DELETE FROM unread_mail; DELETE FROM unread_mail_prefixes; INSERT INTO unread_mail(subject,sent_time) SELECT subject,MAX(CAST(accepted_at_unix_ms AS INTEGER)) FROM claims WHERE kind='"}, {"id": "lv-h20b935346aaf", "path": "crates/fractal-store/src/store/checkpoint_tests.rs", "kind": "sql-template", "fingerprint": "a466c1bb6842b49c1d34a00a24fdcb27190d6711850fee20c555c3c6c8bfc672", "owner": "fractal_store::store::checkpoint_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 493, "excerpt": "UPDATE claims SET accepted_at_unix_ms=?1 WHERE id=?2"}, - {"id": "lv-h20bffcbd0763", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "sql-template", "fingerprint": "f742addfcfcc6af8ad5172ff290f31172a85780c82d523ed4e99b3b71e76f2e2", "owner": "smallclaims::store::checkpoint_staging", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 510, "excerpt": "INSERT INTO meta(id, identity, phase, cursor) VALUES (1, ?1, ?2, 0)"}, - {"id": "lv-h20ede67dacaa", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "6d5b306c813337790dcc59d3ea0244058138d994c293b1d1b62b4d21f61d94ca", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1816, "excerpt": "params ! [ subject , store_index ] , | row | row . get : : < _ , u64 > ( 0 )"}, + {"id": "lv-h20bffcbd0763", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "sql-template", "fingerprint": "f742addfcfcc6af8ad5172ff290f31172a85780c82d523ed4e99b3b71e76f2e2", "owner": "smallclaims::store::checkpoint_staging", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 455, "excerpt": "INSERT INTO meta(id, identity, phase, cursor) VALUES (1, ?1, ?2, 0)"}, + {"id": "lv-h20ede67dacaa", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "6d5b306c813337790dcc59d3ea0244058138d994c293b1d1b62b4d21f61d94ca", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1608, "excerpt": "params ! [ subject , store_index ] , | row | row . get : : < _ , u64 > ( 0 )"}, {"id": "lv-h20ff92cef130", "path": "crates/fractal-store/src/store/resources_preparation_tests.rs", "kind": "sql-template", "fingerprint": "da375a6ef935682d924483cbd6c26b9c32a0a576b639560d3ec18290cfd5125b", "owner": "fractal_store::store::resources_preparation_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 1352, "excerpt": "DELETE FROM claims WHERE id=?1"}, {"id": "lv-h2102123ed04c", "path": "crates/fractal-missions/src/store/work_renew_tests.rs", "kind": "sql-template", "fingerprint": "d388a6fd1d0276096452f9c77d126ef8afbe0de0b89086f5df09f5c4c8b8bb5a", "owner": "fractal_missions::store::work_renew_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 818, "excerpt": "UPDATE step_runs SET lease_owner=?2 WHERE subject=?1"}, {"id": "lv-h21121b909ab8", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "2beeceba08cc58c8d4101eebee3d7bdc5ff8260a291b89568ff5ea3680d6d8c7", "owner": "fractal_missions::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6708, "excerpt": "& format ! ( \"SELECT json_extract(claims.body, '$.fields.state'), claims.accepted_at_unix_ms FROM claims JOIN batches ON batches.id=claims.batch_id WHERE claims.subject=?1 AND claims.kind='harness.obs"}, + {"id": "lv-h212901f6fe4a", "path": "crates/fractal/src/assistant_grant_authority_wake_tests.rs", "kind": "sql-template", "fingerprint": "eba7614ee77ee4242958e09652ea628a016323a4c438c7e8a8759af0144fdba9", "owner": "fractal::assistant_grant_authority_wake_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 14, "excerpt": "INSERT INTO batches(id,origin,replica_sequence,hash,accepted_at_unix_ms) VALUES('batch/old-writer','node',1,'old-writer','1');"}, {"id": "lv-h212e51b40c29", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "edfd88af61f0d89329bd18c65812dcd3cbfa77084f879f2aba400ba1e8046e83", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 10559, "excerpt": "CHECKPOINT_OPERATION_KEYED_QUERY"}, {"id": "lv-h213133341fb4", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "adf3de0c2d3da5d7033336aaa81da7847ca9767ac4bc8794fb5b9517cb6252bf", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 408, "excerpt": "params ! [ subject , kind , actor ]"}, {"id": "lv-h213ce5834efa", "path": "crates/fractal-delivery/src/store/projection_divergence_tests.rs", "kind": "sql-template", "fingerprint": "4b44be87f8859990bdcd12e7561ff354feddef671df0f26f3fc8460d5037eccf", "owner": "fractal_delivery::store::projection_divergence_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 66, "excerpt": "PRAGMA foreign_keys=OFF; INSERT INTO desired SELECT * FROM wrong_desired; PRAGMA foreign_keys=ON; DROP TABLE wrong_desired;"}, @@ -1367,14 +1428,15 @@ {"id": "lv-h21fc474d17db", "path": "crates/fractal-store/src/store/push_registrations.rs", "kind": "sql-template", "fingerprint": "c6ffb2975a30d37b1637f4167d39f2a32300fd51f9528c711dcc6b4e95fbd648", "owner": "fractal_store::store::push_registrations", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 163, "excerpt": "INSERT INTO local_push_registrations(person,device_id,pairing_grant,pairing_index,expires_at,token,environment,bundle_id,app_version) VALUES(?1,?2,?3,?4,?5,?6,?7,?8,?9) ON CONFLICT(person,device_id) D"}, {"id": "lv-h222fc582e23e", "path": "crates/smallclaims/src/ivm/events.rs", "kind": "unresolved-sql-sink", "fingerprint": "fec187433c4f392fddb9c0d1400a095648f252e10b441a3cf1058bac6f7d78d9", "owner": "smallclaims::ivm::events", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 188, "excerpt": "SCHEMA"}, {"id": "lv-h223ed936348d", "path": "crates/fractal-store/src/store/idle_mail.rs", "kind": "unresolved-sql-sink", "fingerprint": "d5e90e009630aa3b7cc98b8129c8209ca6f3736dce850af637ba17b9736b4c02", "owner": "fractal_store::store::idle_mail", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 134, "excerpt": "[ subject ]"}, + {"id": "lv-h2245e419e29e", "path": "crates/smallclaims/src/store/assistant_grant_receipt_cost_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "4ec7c53222c8a758c722e2111541035ce700d5ae7bd0898c5f1b1a743e6450fd", "owner": "smallclaims::store::assistant_grant_receipt_cost_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 50, "excerpt": "sql"}, {"id": "lv-h226b05161e4d", "path": "crates/fractal-missions/src/store/fleet_admission_tests.rs", "kind": "sql-template", "fingerprint": "8501af8ee20076569f886d3675507790807a8bcb152b1696b1d633effa58beae", "owner": "fractal_missions::store::fleet_admission_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 265, "excerpt": "DROP TABLE projection_digest_repaired_claims; CREATE TABLE projection_digest_repaired_claims(id TEXT PRIMARY KEY);"}, {"id": "lv-h2272bf9b3ced", "path": "crates/fractal-store/src/store/ordered_membership.rs", "kind": "sql-template", "fingerprint": "663b589ef273e048bb53dfdf855f4b4e6bbe73fba55605d6bda47d853874488e", "owner": "fractal_store::store::ordered_membership", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 200, "excerpt": "INSERT OR IGNORE INTO ordered_membership_counts(container,changed_index) VALUES(?1,?2)"}, {"id": "lv-h22782312d531", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "cc0556d587878891fa2e58b23e2b32af4593cd7e14c9e5c58d35ee5e3f2599c2", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1207, "excerpt": "& retired_facts : : schema ( )"}, {"id": "lv-h228af6311daa", "path": "crates/smallclaims/src/store/schema_install_tests.rs", "kind": "sql-template", "fingerprint": "38231cc4bbe5890b83f211c980c6ba022fbc73804c22a61ec1055e682c4b5c7a", "owner": "smallclaims::store::schema_install_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 227, "excerpt": "CREATE TABLE SQLITEbirds(value TEXT);"}, - {"id": "lv-h2292dc1d64ce", "path": "crates/fractal-store/src/store/resources_preparation_tests.rs", "kind": "sql-template", "fingerprint": "7fdacf0b676749ef7e233c73cff0450ca127d576821ec0d44ff697de7d278bfb", "owner": "fractal_store::store::resources_preparation_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 840, "excerpt": "CREATE TABLE batches(id TEXT PRIMARY KEY, origin TEXT, replica_sequence INTEGER); CREATE TABLE claims(store_index INTEGER PRIMARY KEY, id TEXT UNIQUE, batch_id TEXT, subject TEXT, accepted_at_unix_ms "}, - {"id": "lv-h22a91f01cbf8", "path": "crates/smallclaims/src/store/operation_claim_digests.rs", "kind": "sql-template", "fingerprint": "8a29c9ee715b72489f004b87a541a70f4a0ded9592c97a261217b337712378ad", "owner": "smallclaims::store::operation_claim_digests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 194, "excerpt": "INSERT OR IGNORE INTO operation_claim_digests SELECT ?1, ?2, ?3, ?4 WHERE EXISTS(SELECT 1 FROM claims WHERE store_index=?1 AND id=?2 AND json_type(body,'$._operation.id')='text' AND json_type(body,'$."}, - {"id": "lv-h22d300873cad", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "sql-template", "fingerprint": "000a9fbb87ccf5b119bb3eb0ede02c74aebfec064e5c0bcd205296391ea3d316", "owner": "fractal_store::store::client_messages", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 586, "excerpt": "INSERT INTO local_client_message_selectors_v1(subject,born_index,sender,recipient,mailbox,closed,reminder,version,sent_key,created_index,desired_mask,native_mailbox,global_current,recipient_current) S"}, - {"id": "lv-h22ea9a9f4b42", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "27a8e9d02166de7fadd597ad3edd2737d3db0009ef06fb630d22859a19bf3f0c", "owner": "smallclaims::store::repair_operation_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 705, "excerpt": "\"ROLLBACK TO old_full_operation_dml; RELEASE old_full_operation_dml\""}, + {"id": "lv-h2292dc1d64ce", "path": "crates/fractal-store/src/store/resources_preparation_tests.rs", "kind": "sql-template", "fingerprint": "7fdacf0b676749ef7e233c73cff0450ca127d576821ec0d44ff697de7d278bfb", "owner": "fractal_store::store::resources_preparation_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 780, "excerpt": "CREATE TABLE batches(id TEXT PRIMARY KEY, origin TEXT, replica_sequence INTEGER); CREATE TABLE claims(store_index INTEGER PRIMARY KEY, id TEXT UNIQUE, batch_id TEXT, subject TEXT, accepted_at_unix_ms "}, + {"id": "lv-h22a91f01cbf8", "path": "crates/smallclaims/src/store/operation_claim_digests.rs", "kind": "sql-template", "fingerprint": "8a29c9ee715b72489f004b87a541a70f4a0ded9592c97a261217b337712378ad", "owner": "smallclaims::store::operation_claim_digests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 186, "excerpt": "INSERT OR IGNORE INTO operation_claim_digests SELECT ?1, ?2, ?3, ?4 WHERE EXISTS(SELECT 1 FROM claims WHERE store_index=?1 AND id=?2 AND json_type(body,'$._operation.id')='text' AND json_type(body,'$."}, + {"id": "lv-h22d300873cad", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "sql-template", "fingerprint": "000a9fbb87ccf5b119bb3eb0ede02c74aebfec064e5c0bcd205296391ea3d316", "owner": "fractal_store::store::client_messages", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 510, "excerpt": "INSERT INTO local_client_message_selectors_v1(subject,born_index,sender,recipient,mailbox,closed,reminder,version,sent_key,created_index,desired_mask,native_mailbox,global_current,recipient_current) S"}, + {"id": "lv-h22ea9a9f4b42", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "27a8e9d02166de7fadd597ad3edd2737d3db0009ef06fb630d22859a19bf3f0c", "owner": "smallclaims::store::repair_operation_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 655, "excerpt": "\"ROLLBACK TO old_full_operation_dml; RELEASE old_full_operation_dml\""}, {"id": "lv-h22fa37082c14", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "unresolved-sql-sink", "fingerprint": "d4a2e52a9158cd5573935d2222690a70c9ecc8d502b20cf5593f4635fbd86519", "owner": "smallclaims::store::checkpoint", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 413, "excerpt": "[ & claim . id ]"}, {"id": "lv-h230ac67996e0", "path": "crates/smallclaims/src/store/checkpoint_staging/scoped.rs", "kind": "unresolved-sql-sink", "fingerprint": "289d119346b7dcd4b3694a72f93eaab144184687770aad714bcea6c219a990ac", "owner": "smallclaims::store::checkpoint_staging::scoped", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 177, "excerpt": "[ id ] , | row | row . get : : < _ , bool > ( 0 )"}, {"id": "lv-h23116f518f45", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "7350c00910310adc0208b841f002127949040ed41d54bf678bd3ec11b1c2405c", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 277, "excerpt": "UPDATE replica_envelope_signatures SET member_key='other-key'"}, @@ -1407,6 +1469,7 @@ {"id": "lv-h246fe5ecff77", "path": "crates/fractal-missions/src/store/person_work.rs", "kind": "unresolved-sql-sink", "fingerprint": "e997736db7522c512c1ac4a39535e1e61fa6f648a81dee532ddae4423ed10d46", "owner": "fractal_missions::store::person_work", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 710, "excerpt": "HAS_PERSON_ASKS_FOR_RECONCILE"}, {"id": "lv-h247fda7620dc", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "sql-template", "fingerprint": "fc8f68eb0978b77d8bc7efc99cfb812e560da4b0aa4913d685654c3c107c275d", "owner": "smallclaims::store::checkpoint_trim", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 1386, "excerpt": "UPDATE sqlite_sequence SET seq=seq+1 WHERE name='claims'"}, {"id": "lv-h248251de0d26", "path": "crates/fractal-store/src/store/custom.rs", "kind": "sql-template", "fingerprint": "793bab6d66c0cce14b8837968e9f87de7e540b3ffca4d32f23940b41f890b279", "owner": "fractal_store::store::custom", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 235, "excerpt": "CREATE TRIGGER "}, + {"id": "lv-h2483f627e2e6", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "95e8e633cf9b10cbf2350d442c4e2d17323229225566b6311a5ee0e304ad0039", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1265, "excerpt": "INSERT OR IGNORE INTO assistant_grant_dirty VALUES(?1)"}, {"id": "lv-h2498c1312ce1", "path": "crates/fractal-store/src/store/slo_breaches.rs", "kind": "sql-template", "fingerprint": "6473120b13d667bd781ef4051817d3a33f1604dd3cdbf510dbe71c005625e779", "owner": "fractal_store::store::slo_breaches", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 148, "excerpt": "DELETE FROM slo_episode_events WHERE episode=?1"}, {"id": "lv-h249f83b43d4d", "path": "crates/fractal-delivery/src/store/terminal_gate_evidence/native_source/tests.rs", "kind": "sql-template", "fingerprint": "6df12a2e51ab2593733e55da6abfc7532b931eb306161dfe428b5cb1b5ad4239", "owner": "fractal_delivery::store::terminal_gate_evidence::native_source::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 94, "excerpt": "UPDATE desired SET owner_generation='run-generation/other' WHERE subject='exec/one/probe'"}, {"id": "lv-h24b42abf0707", "path": "crates/fractal-delivery/src/store/terminal_gate_evidence/native_source/tests.rs", "kind": "sql-template", "fingerprint": "88cc99569a302f2b0287d6d32d83866353e9aeed4ea970b3168ae27cbf726645", "owner": "fractal_delivery::store::terminal_gate_evidence::native_source::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 205, "excerpt": "UPDATE claims SET body=x'00' WHERE subject='exec/one/probe' AND kind='runtime.observed'"}, @@ -1427,10 +1490,11 @@ {"id": "lv-h25cdda228fae", "path": "crates/fractal-store/src/store/ordered_membership.rs", "kind": "sql-template", "fingerprint": "4ede4cd6edfc4d15a7f2b6debe3598cdae54d0ecf16a7d0c17957000eb0e5bfd", "owner": "fractal_store::store::ordered_membership", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 272, "excerpt": "DELETE FROM local_ordered_membership_pending"}, {"id": "lv-h25d326f14966", "path": "crates/smallclaims/src/store/schema_install_tests.rs", "kind": "sql-template", "fingerprint": "b077f5f3b187130c621611107048b1c05d928013cb39bc5b0b3c979a7724c52e", "owner": "smallclaims::store::schema_install_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 261, "excerpt": "CREATE TABLE {reserved}(value TEXT);"}, {"id": "lv-h25d6eed211d2", "path": "crates/fractal-delivery/src/store/conversation_deliveries_tests.rs", "kind": "sql-template", "fingerprint": "76ef26834ee7e7466075a10630f7c4d683b3ae12c37e1ad9451eacc53b7d029b", "owner": "fractal_delivery::store::conversation_deliveries_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 187, "excerpt": "DELETE FROM operations WHERE id=?1"}, - {"id": "lv-h25eeeac696a4", "path": "crates/fractal-store/src/store/message_marks.rs", "kind": "unresolved-sql-sink", "fingerprint": "a6a3b37876cf51a02823494089378b13b4cfb767c3cfcb27c1863e13041d0f36", "owner": "fractal_store::store::message_marks", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 293, "excerpt": "[ message ] , | row | row . get ( 0 )"}, + {"id": "lv-h25eeeac696a4", "path": "crates/fractal-store/src/store/message_marks.rs", "kind": "unresolved-sql-sink", "fingerprint": "a6a3b37876cf51a02823494089378b13b4cfb767c3cfcb27c1863e13041d0f36", "owner": "fractal_store::store::message_marks", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 277, "excerpt": "[ message ] , | row | row . get ( 0 )"}, {"id": "lv-h25f2de100e85", "path": "crates/fractal-store/src/store/agent_review_transaction.rs", "kind": "unresolved-sql-sink", "fingerprint": "f26e72430caa18cb9f2da97e0dbd2aec932968402525b8af934a68413b0000a2", "owner": "fractal_store::store::agent_review_transaction", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 103, "excerpt": "\"RELEASE agent_review_answer\""}, - {"id": "lv-h25f8cba63deb", "path": "crates/fractal-delivery/src/store/delivery.rs", "kind": "unresolved-sql-sink", "fingerprint": "c53ef4a9147f68e712a6146f1a9a02ede98e067255f97cbc95342ec91dba7487", "owner": "fractal_delivery::store::delivery", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 105, "excerpt": "params ! [ fence . subject , fence . component , fence . token ] , | row | Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? , row . get ( 2 ) ? ) ) ,"}, - {"id": "lv-h26214094cec7", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "a07b2af24ca5ab021fe4b21e8353c58beb343552ea83e0a6b54c50510d16194e", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 11621, "excerpt": "UPDATE step_runs SET updated_at_unix_ms=?2, activated_at_unix_ms=CASE WHEN ?3='ready' THEN ?2 ELSE activated_at_unix_ms END WHERE subject=?1"}, + {"id": "lv-h25f52ee4e4eb", "path": "crates/fractal-api-core/src/api/tests.rs", "kind": "sql-template", "fingerprint": "79277a1f953c88ad5dacb3c83a00f7309fb8b08503b02cee37c17edb6ac5d04d", "owner": "fractal_api_core::api::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1271, "excerpt": "UPDATE assistant_grant_retractions SET claim_id='claim/b' WHERE writer='birch'"}, + {"id": "lv-h25f8cba63deb", "path": "crates/fractal-delivery/src/store/delivery.rs", "kind": "unresolved-sql-sink", "fingerprint": "c53ef4a9147f68e712a6146f1a9a02ede98e067255f97cbc95342ec91dba7487", "owner": "fractal_delivery::store::delivery", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 89, "excerpt": "params ! [ fence . subject , fence . component , fence . token ] , | row | Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? , row . get ( 2 ) ? ) ) ,"}, + {"id": "lv-h26214094cec7", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "a07b2af24ca5ab021fe4b21e8353c58beb343552ea83e0a6b54c50510d16194e", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 10422, "excerpt": "UPDATE step_runs SET updated_at_unix_ms=?2, activated_at_unix_ms=CASE WHEN ?3='ready' THEN ?2 ELSE activated_at_unix_ms END WHERE subject=?1"}, {"id": "lv-h26499c07fb74", "path": "crates/fractal-store/src/store/backup_ledgers.rs", "kind": "sql-template", "fingerprint": "82ef1754ebbe92b8c59537d3d036d29e853a5dcedb16b6876ead32eed5d5dc7e", "owner": "fractal_store::store::backup_ledgers", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 176, "excerpt": "INSERT OR IGNORE INTO stream_lifecycle(subject, kind, actor, fields, recorded_at_unix_ms) \\ VALUES ({0}, {1}, {2}, {3}, {4})"}, {"id": "lv-h264c7ed571bb", "path": "crates/smallclaims/src/ivm.rs", "kind": "sql-template", "fingerprint": "9286a5341579a997059a7eb029b78dbc0b6584a28f67d45b8a7d42291cfc5424", "owner": "smallclaims::ivm", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1011, "excerpt": "UPDATE ivm_views SET deferred_local_generation=MAX(deferred_local_generation,?2) WHERE name=?1"}, {"id": "lv-h26512c176d95", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "c40c825e3f560b060d1f8d9c67e790832cd2ec75806dde3bb03626c07da15aee", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 18442, "excerpt": "UPDATE step_runs SET assignee=?2, available_to='[]', status='ready', lease_owner=NULL, lease_incarnation=NULL, lease_expires_at_unix_ms=NULL, readiness_epoch=?3, updated_at_unix_ms=?4 WHERE subject=?1"}, @@ -1438,7 +1502,9 @@ {"id": "lv-h2674a34ea2b3", "path": "crates/smallclaims/src/ivm/installed.rs", "kind": "unresolved-sql-sink", "fingerprint": "fec187433c4f392fddb9c0d1400a095648f252e10b441a3cf1058bac6f7d78d9", "owner": "smallclaims::ivm::installed", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 161, "excerpt": "SCHEMA"}, {"id": "lv-h267c69ac4deb", "path": "crates/fractal-missions/src/store/mission_deadline_tests.rs", "kind": "sql-template", "fingerprint": "7875c2ca183eeee7e2e91f4cfb7f29268655a81f04fe533186836f6dc7fc298d", "owner": "fractal_missions::store::mission_deadline_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 535, "excerpt": "DELETE FROM {table} WHERE {key}='legacy-waiter'"}, {"id": "lv-h267d0b31a73d", "path": "crates/fractal-store/src/store/checkpoint_rules/staged.rs", "kind": "sql-template", "fingerprint": "c08a9a47d9fe76f40633516feaa4d10cc59bf0b5bd93263e29e93a3e4c635fbb", "owner": "fractal_store::store::checkpoint_rules::staged", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 78, "excerpt": "UPDATE claims SET status_keep=1 WHERE pos=?1"}, + {"id": "lv-h2686d79044aa", "path": "crates/smallclaims/src/store/assistant_grant_authority_bench.rs", "kind": "sql-template", "fingerprint": "79941ef737f879d325667511d1b8a5c17d876f62842a1e5dd62af910589ffe2f", "owner": "smallclaims::store::assistant_grant_authority_bench", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 191, "excerpt": "INSERT INTO batches(id,origin,replica_sequence,previous_hash,hash,accepted_at_unix_ms) VALUES(?1,?2,?3,NULL,?4,'1791849600000')"}, {"id": "lv-h268b21b0f384", "path": "crates/fractal-store/src/store/tests.rs", "kind": "included-source", "fingerprint": "bc1dfa1b7da786a88317855c35a334fb27d30223f3a901fe513013227ed12fec", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 362, "excerpt": "include ! ( \"subagents_purity_tests.rs\" )"}, + {"id": "lv-h268eaf45d33c", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "3e4e5b793d88ee37521d1c23ca67308212b227a4f3208044d40ffbbf1ef903c2", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 194, "excerpt": "UPDATE assistant_grant_membership_state SET applied_generation=?1 WHERE id=1"}, {"id": "lv-h269f60dbbc67", "path": "crates/fractal-delivery/src/store/message_point_qualification/tests.rs", "kind": "sql-template", "fingerprint": "30ddcb111b39daa8bb1fb3d1b16a5470dfc5c28bc5a313f3d7a3a1668f441a14", "owner": "fractal_delivery::store::message_point_qualification::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 163, "excerpt": "INSERT INTO desired(subject,kind,revision,claim_id,body) VALUES(?1,?2,'fixture',?3,?4)"}, {"id": "lv-h26c9483553d8", "path": "crates/fractal-store/src/store/resource_references.rs", "kind": "sql-template", "fingerprint": "fa0f796eee926ebefc2a625de0fd9c061173760791fe318c08d1ce81650da20b", "owner": "fractal_store::store::resource_references", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 88, "excerpt": "INSERT INTO declared_resource_edges(owner,name,target,reason) SELECT owner,name,target,reason FROM declared_resource_edges_v1; DROP TABLE declared_resource_edges_v1;"}, {"id": "lv-h26cd1e644d89", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "66f13ef32b4afb0063fb401d47f969b093acc63dbd4a71d7fd42479f3e0fd0a5", "owner": "fractal_store::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1249, "excerpt": "INSERT INTO meta(key, value) VALUES ('refused', 'written')"}, @@ -1478,12 +1544,14 @@ {"id": "lv-h28928374ca14", "path": "crates/fractal-missions/src/store/work_renew_tests.rs", "kind": "sql-template", "fingerprint": "1d84c831a4aa0ece376bf0e40064fb0bd36cd58e7f04211c859df103c1e40e8c", "owner": "fractal_missions::store::work_renew_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 823, "excerpt": "UPDATE step_runs SET status=?2 WHERE subject=?1"}, {"id": "lv-h28991f3f5745", "path": "crates/fractal-store/src/store/schedule_active_run_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "90dbe74bec90013705bd92e02619372a20cb7733a5375be33830ea72c895a370", "owner": "fractal_store::store::schedule_active_run_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 89, "excerpt": "[ subject ] , | row | row . get ( 0 )"}, {"id": "lv-h28ac822f10fc", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "unresolved-sql-sink", "fingerprint": "ed5f7c6ec77211c2891b82298edc2d1b76ae76f8ed8e33a3298e288b1bd8d322", "owner": "fractal_store::store::client_messages", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 374, "excerpt": "[ & work . subject ] , | row | Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? ) )"}, + {"id": "lv-h28b4c5d9b4eb", "path": "crates/fractal-api-core/src/api/tests.rs", "kind": "sql-template", "fingerprint": "a2c10efe873193c1a9aa209f567c8262407e04d10281afe5d82794ee7ff5cde5", "owner": "fractal_api_core::api::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1276, "excerpt": "UPDATE assistant_grant_pending SET authenticated=1"}, {"id": "lv-h28bd1a5d15fb", "path": "crates/smallclaims/src/store/saved_inventory_tests.rs", "kind": "sql-template", "fingerprint": "d8c07a9a3bd4948049486819192015c314d0a617ea538ab66f285ebd7b75a291", "owner": "smallclaims::store::saved_inventory_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 678, "excerpt": "CREATE TEMP TABLE held AS SELECT {COLUMNS} FROM replica_envelopes ORDER BY rowid; DELETE FROM replica_envelopes; INSERT INTO replica_envelopes({COLUMNS}) SELECT {COLUMNS} FROM held;"}, {"id": "lv-h28c9f90473a5", "path": "crates/fractal-delivery/src/store/terminal_gate_evidence/native_source/transaction_hooks/tests/operator_errors.rs", "kind": "unresolved-sql-sink", "fingerprint": "76e4b1ed746771ba11c63efd3b92d6009bd8b5e1e87a4167d0cd83bb0c12ef03", "owner": "fractal_delivery::store::terminal_gate_evidence::native_source::transaction_hooks::tests::operator_errors", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 96, "excerpt": "& format ! ( \"PRAGMA max_page_count={max}\" ) , [ ] , | r | r . get ( 0 )"}, {"id": "lv-h28ce9ec17c3e", "path": "crates/smallclaims/src/store/prepared_envelope_tests.rs", "kind": "sql-template", "fingerprint": "0b9aff06440162faa1a45fa16dcf188efdcbb399a226335793990c41cb49049b", "owner": "smallclaims::store::prepared_envelope_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 372, "excerpt": "INSERT INTO replica_records( record_ref, writer, sequence, envelope_hash, position, raw, state, claim_id, subject_hint, kind_hint, error_code, error_message, updated_at_unix_ms ) VALUES (?1, ?2, ?3, ?"}, {"id": "lv-h28d625e3f51a", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "861ae77d8b9421fa21c0de36fb94ae80d2b589f44a1eb28e3ee97f385d319402", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1762, "excerpt": "[ claim_id ]"}, {"id": "lv-h28d782e2dd8a", "path": "crates/smallclaims/src/store/document_pages/tests.rs", "kind": "sql-template", "fingerprint": "78a9068b0de99ac53f0297d9ed4bcdce767c2657600bfdde5e43c92942f7146b", "owner": "smallclaims::store::document_pages::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 845, "excerpt": "DROP TRIGGER projection_digest_documents_insert; DROP TRIGGER projection_digest_documents_update; DROP TRIGGER projection_digest_documents_delete; DROP INDEX document_canonical_latest; ALTER TABLE doc"}, {"id": "lv-h28dc30b4e384", "path": "crates/fractal-store/src/store/idle_mail.rs", "kind": "unresolved-sql-sink", "fingerprint": "b2cbbe76784ce7e1e5c37479f1d38c960c8035dd74974ae04e0aad4649d0dc87", "owner": "fractal_store::store::idle_mail", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 129, "excerpt": "\"BEGIN IMMEDIATE\""}, + {"id": "lv-h28df63bc590a", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "a554a1cdcbfa87c9b8cf50e0b25cfc03af4d207d1aedd6ca236d99e957b1c151", "owner": "smallclaims::store::assistant_grant_authority", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 619, "excerpt": "UPDATE assistant_grant_pending SET authenticated=0,auth_member_key=NULL, auth_sequence=NULL,auth_envelope_hash=NULL,auth_record_position=NULL WHERE claim_id=?1"}, {"id": "lv-h28f656ff259d", "path": "crates/fractal-store/src/store/authored_pull_requests_tests_shared_missions.rs", "kind": "sql-template", "fingerprint": "64cdefba1ee20ed93d718cc11bbda8a9e07de01eb5e9afe3ce349c0876c13753", "owner": "fractal_store::store::authored_pull_requests_tests_shared_missions", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 8, "excerpt": "INSERT INTO batches(id,origin,replica_sequence,hash,accepted_at_unix_ms) VALUES(?1,'node',1,?1,?2)"}, {"id": "lv-h290a4481e607", "path": "crates/fractal-api-client-v0/src/api/client_v0/observer_subscription_detail_tests.rs", "kind": "sql-template", "fingerprint": "43f7f13965b57be8e8df1572af7d89523646ca3c18e28f0c468899788aa5986a", "owner": "fractal_api_client_v0::api::client_v0::observer_subscription_detail_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 620, "excerpt": "UPDATE desired SET {column}=?2 WHERE subject=?1"}, {"id": "lv-h29105e98503c", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "861ae77d8b9421fa21c0de36fb94ae80d2b589f44a1eb28e3ee97f385d319402", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1805, "excerpt": "[ claim_id ]"}, @@ -1498,6 +1566,7 @@ {"id": "lv-h299c9d664791", "path": "crates/smallclaims/src/store/sealed_view_cache_tests.rs", "kind": "sql-template", "fingerprint": "ca335a56183e768701e4df38383fcbdb7baa673c2409505ae129fc5907564e7f", "owner": "smallclaims::store::sealed_view_cache_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 248, "excerpt": "UPDATE replica_envelope_signatures SET member_key='untrusted-key' WHERE member_key=?1"}, {"id": "lv-h29af83d2853e", "path": "crates/fractal-store/src/store/resources_preparation_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "4ec7c53222c8a758c722e2111541035ce700d5ae7bd0898c5f1b1a743e6450fd", "owner": "fractal_store::store::resources_preparation_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1432, "excerpt": "sql"}, {"id": "lv-h29af95d541e4", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "unresolved-sql-sink", "fingerprint": "c32b884bb11aa9d33ad9fa5b6cbd7b18be6b5eec40e5397aa0319a5e4069ab0d", "owner": "smallclaims::store::checkpoint_staging", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 676, "excerpt": "& sql"}, + {"id": "lv-h29b7dbf310f3", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "ebb537caf4d0e377d4e6cb718657f1da7f8ac42dc5793e0addd8f54675c21eb4", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1169, "excerpt": "INSERT OR REPLACE INTO meta(key,value) VALUES('assistant_grant_dirty_cursor',?1)"}, {"id": "lv-h29c67486ee08", "path": "crates/fractal-seats/src/store/reconcile_work_context/tests.rs", "kind": "sql-template", "fingerprint": "7501569747653ae5c630b4ad8576011b51d2687d91cfb7765a71c42d6c62caf5", "owner": "fractal_seats::store::reconcile_work_context::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1040, "excerpt": "UPDATE mission_revisions SET body=?1"}, {"id": "lv-h29c99d643170", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "b80c6952e38419e4adced7a4360fb6f84bb338c6b70af278eb497b82587a6ea7", "owner": "smallclaims::store::membership_query_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 268, "excerpt": "UPDATE claims SET subject='host/cedar'"}, {"id": "lv-h29d8b28e7f44", "path": "crates/fractal-delivery/src/store/conversation_reads.rs", "kind": "unresolved-sql-sink", "fingerprint": "7fa637ccaeda584ef8ece3b7e9c0352ed65a87e39ed408679fbb57087b89b64c", "owner": "fractal_delivery::store::conversation_reads", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 554, "excerpt": "& format ! ( \"SELECT {CLAIM_COLUMNS} FROM claims WHERE id IN (SELECT value FROM json_each(?1)) ORDER BY store_index DESC\" , )"}, @@ -1569,7 +1638,9 @@ {"id": "lv-h2d897e2887b5", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "99c1fbbbe339e4405cd0bcd36ce3ae0d624c8f1263218ce3bf1f5694c12e4b8c", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 17761, "excerpt": "\"SAVEPOINT project_claim\""}, {"id": "lv-h2da16c217e2d", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "sql-template", "fingerprint": "a783559ff8da7105c3e1f9d79d519c09c9e87f3e2c9baf282b4d4d902746ced6", "owner": "smallclaims::store::repair_operation_tests", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 974, "excerpt": "UPDATE checkpoint_claims SET request_digest=x'80' WHERE id='cp/bad'"}, {"id": "lv-h2da375ffc244", "path": "crates/fractal-store/src/store/glass_heads.rs", "kind": "sql-template", "fingerprint": "e0584d394b5c1c1e8dd541923e8e36b46deea1e1f1173d9bef4428bdae18aa0c", "owner": "fractal_store::store::glass_heads", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 154, "excerpt": "INSERT OR REPLACE INTO meta(key,value) VALUES('glass_heads_version',?1)"}, + {"id": "lv-h2daf7a592c21", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "a1283ec5bf87b372df96534f09c45e898f5571cce47da6cbbcd01e0f6c82c16f", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1224, "excerpt": "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1"}, {"id": "lv-h2db357b9aaf3", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "50b2f5391480a08894d0cddced31284c7952f9bc0147de6a67175e11919c115c", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 17227, "excerpt": "RUN_HAS_PRIOR_CLAIMS , params ! [ frontier , claim . subject , generation , format ! ( \"step-run/{generation_id}/\" ) , format ! ( \"step-run/{generation_id}0\" ) , ] , | row | row . get ( 0 ) ,"}, + {"id": "lv-h2dd1bfa09a04", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "c65dc70362b317d3c1de19e86ea3a54a8a1c450f41b800ee4c58a9019f6798a1", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 807, "excerpt": "DELETE FROM assistant_grant_local_appends"}, {"id": "lv-h2de007f2a038", "path": "crates/fractal-store/src/store/message_point_qualification_tests_shared_delivery.rs", "kind": "sql-template", "fingerprint": "8193cdda414b6012447c9d7fd2ae0330a50ccf7fc92b83d4f8917d73789cefe1", "owner": "fractal_store::store::message_point_qualification_tests_shared_delivery", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 30, "excerpt": "INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) VALUES(?1,?2,?3,?4,'host/fixture',NULL,?5,'[]',?6)"}, {"id": "lv-h2df7510c47cd", "path": "crates/fractal-store/src/store/gate_runners.rs", "kind": "unresolved-sql-sink", "fingerprint": "82c7f685a2bedf2548325d89525f888916dba0d7273a1111f5a7b8e98311a11c", "owner": "fractal_store::store::gate_runners", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 183, "excerpt": "& format ! ( \"SELECT claim_id FROM ({FROM_CLAIMS} AND request.store_index>?1 AND request.store_index<=?2)\" )"}, {"id": "lv-h2e12f8d6c4f9", "path": "crates/fractal-api-core/src/api/client_messages_cursor_tests.rs", "kind": "sql-template", "fingerprint": "e4e779b71d265dd0a0ea852e09808efa82d60d77c3e72484e7e8947db12dfef1", "owner": "fractal_api_core::api::client_messages_cursor_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 175, "excerpt": "DELETE FROM claims WHERE subject='message/cursor-binding-1'"}, @@ -1605,6 +1676,7 @@ {"id": "lv-h2f8c434ea374", "path": "crates/smallclaims/src/ivm/installed.rs", "kind": "unresolved-sql-sink", "fingerprint": "951caf3cac7c1b17539859a8c6eaee820630e42d5a00a405404f7b83c8715f09", "owner": "smallclaims::ivm::installed", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 107, "excerpt": "\"ROLLBACK TO ivm_installed_bridge; RELEASE ivm_installed_bridge\""}, {"id": "lv-h2f8f0ac99841", "path": "crates/fractal-seats/src/store/seats.rs", "kind": "unresolved-sql-sink", "fingerprint": "15d436f49f3475d69779e881f68807ce72e8691ad5f773c188d79236896ee0ae", "owner": "fractal_seats::store::seats", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 2230, "excerpt": "params ! [ subject , incarnation ] , | row | { let time : String = row . get ( 0 ) ? ; Ok ( ( time . parse : : < u128 > ( ) . unwrap_or ( u128 : : MAX ) , row . get ( 1 ) ? ) ) }"}, {"id": "lv-h2fa8a75ae8ac", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "sql-template", "fingerprint": "5fbfb1863f95e179ff4061354d6d4085cccace75d9f8822bab84bd27784bd01c", "owner": "fractal_missions::store::missions", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 8194, "excerpt": "INSERT OR REPLACE INTO meta(key, value) VALUES ('canonical_replay_settled', ?1)"}, + {"id": "lv-h2fc5feb42670", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "e45d5d53b17411eb1999872c0ffbaf7821c8a39a760d68531eddf71122125240", "owner": "smallclaims::store::assistant_grant_authority", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 932, "excerpt": "INSERT INTO assistant_grant_additions(writer,member_key,lower_sequence,upper_sequence) SELECT ?1,?2,?3,MIN(?4,sequence) FROM replica_records WHERE writer=?1 AND sequence>=?3 ORDER BY sequence DESC LIM"}, {"id": "lv-h30059d79413f", "path": "crates/fractal-store/src/store/checkpoint_rules/staged.rs", "kind": "sql-template", "fingerprint": "9df469e3143469c0100002c6a956c0dd3adbf75ce4145061638789830567a453", "owner": "fractal_store::store::checkpoint_rules::staged", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 193, "excerpt": "UPDATE claims SET dropped=0 WHERE pos=?1"}, {"id": "lv-h301f0cf2b659", "path": "crates/fractal-seats/src/store/usage_period.rs", "kind": "unresolved-sql-sink", "fingerprint": "c68cc8fc0489cb400a083b1304892536e6a1d6be36bc35ffff0f92926730f82c", "owner": "fractal_seats::store::usage_period", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 19, "excerpt": "& format ! ( \"SELECT {observed} FROM claims INDEXED BY {INDEX} WHERE {PREDICATE} AND {series}=?1 AND {observed}<=?2 ORDER BY {observed} DESC LIMIT 1\" )"}, {"id": "lv-h302a4fb16aef", "path": "crates/smallclaims/src/sync/worker_tests.rs", "kind": "sql-template", "fingerprint": "49e9394a123c9c0a5485f9634e816344a1e234aefb8fcb4304cbdd237a6ff63c", "owner": "smallclaims::sync::worker_tests", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 6637, "excerpt": "UPDATE checkpoints SET state='graph-changed' WHERE id='checkpoint/stopped'"}, @@ -1633,6 +1705,7 @@ {"id": "lv-h31293be3b203", "path": "crates/fractal-api-core/src/api/agents_request_slo/ledger.rs", "kind": "sql-template", "fingerprint": "d3cd0ed2c215a788549cc2f4e41a456edad7a506930c3b753388969f9ad76c0d", "owner": "fractal_api_core::api::agents_request_slo::ledger", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 134, "excerpt": "INSERT INTO fault_overflow VALUES (1)"}, {"id": "lv-h31318388fa67", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "e26392eee8b6e1a238a504fa397d9198c114ecc1c520486f4dffe827ad296582", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 17697, "excerpt": "BASE_REPLAY_PAGE_SQL"}, {"id": "lv-h31356a8318b1", "path": "crates/fractal-store/src/store/custom.rs", "kind": "sql-template", "fingerprint": "1a3eccdcb64559c4c45ef9d734d5f16ad27589437dbafa86a9c72c335162085a", "owner": "fractal_store::store::custom", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 284, "excerpt": "DELETE FROM local_custom_dirty"}, + {"id": "lv-h3135f9c18750", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "9898dd409eca3fa0ca731f22f89d6ce68090545212b7d97948663318ffac01cc", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1264, "excerpt": "INSERT INTO assistant_grant_membership_windows VALUES(?1,?2,?3,NULL)"}, {"id": "lv-h314a3080bc73", "path": "crates/fractal-api-core/src/api/client_v0/related_runs.rs", "kind": "unresolved-sql-sink", "fingerprint": "47622b87da9e8d2f6d3972c9459402094f347c5d8e58e7fee498393d6c3f2b4b", "owner": "fractal_api_core::api::client_v0::related_runs", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 33, "excerpt": "RELATED"}, {"id": "lv-h314ea5b7655f", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "861ae77d8b9421fa21c0de36fb94ae80d2b589f44a1eb28e3ee97f385d319402", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 329, "excerpt": "[ claim_id ]"}, {"id": "lv-h315c8b6f5aa8", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "sql-template", "fingerprint": "66a220cda62793a5aac5702bc2f3ad478dea455187fcc21f4530f9f1ad4b95d2", "owner": "smallclaims::store::checkpoint", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 727, "excerpt": "CREATE TEMP TABLE canonical_index(old INTEGER PRIMARY KEY, new INTEGER NOT NULL); INSERT INTO temp.canonical_index(old, new) SELECT claims.store_index, ROW_NUMBER() OVER (ORDER BY {CANONICAL_ORDER}) F"}, @@ -1650,16 +1723,18 @@ {"id": "lv-h31e6b9a5b373", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "c67c712ce5da6a1ff04971ccf246b2c0ff390c0baa40e723d87e410918851ab8", "owner": "fractal_store::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 6730, "excerpt": "DROP TABLE mission_run_deadlines"}, {"id": "lv-h3219948c367c", "path": "crates/fractal-store/src/store/delivery.rs", "kind": "unresolved-sql-sink", "fingerprint": "43d1857c4bfcd1485e154141188b57d4caa70f75fbecba154e4c6b43cb951f05", "owner": "fractal_store::store::delivery", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 28, "excerpt": "concat ! ( \"WITH candidates AS ( SELECT DISTINCT subject FROM claims INDEXED BY claims_message_to_index WHERE kind='message.sent' AND \" , message_sent_recipient_match ! ( ) , \" ) SELECT claims.subject"}, {"id": "lv-h32202a30ba60", "path": "crates/fractal-store/src/store/resources_preparation_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "4ec7c53222c8a758c722e2111541035ce700d5ae7bd0898c5f1b1a743e6450fd", "owner": "fractal_store::store::resources_preparation_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1491, "excerpt": "sql"}, - {"id": "lv-h3235673ff0ac", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "ac93616a08120148d8a02b0bf6d273edbba012bbc915a6d4c619ffe70f948b9b", "owner": "fractal_store::store::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 7017, "excerpt": "INSERT INTO batches(id,origin,replica_sequence,hash,accepted_at_unix_ms) VALUES(?1,'alder',?2,?1,?3)"}, - {"id": "lv-h3236adb69a56", "path": "crates/fractal-store/src/store/message_versions/tests.rs", "kind": "sql-template", "fingerprint": "f91ca080ea5b24706b33d6a619062fa15c3a7e0584d1156a065edb851c2681b5", "owner": "fractal_store::store::message_versions::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 48, "excerpt": "DELETE FROM claims WHERE store_index=9"}, - {"id": "lv-h323ef019de87", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "a9e32b69d52ad92d349f0a1e7a7f822c1b9418c6bc5098051f6cc3cf49311055", "owner": "smallclaims::store", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 1291, "excerpt": "INSERT OR IGNORE INTO meta(key,value) VALUES('replication_admitted_index',?1)"}, - {"id": "lv-h3247614039e2", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "unresolved-sql-sink", "fingerprint": "e0deafc42429b6c22ca6d321370c5a7887000da97c60eaadf337089510968a5c", "owner": "smallclaims::store::checkpoint", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1829, "excerpt": "SEALED_IDENTITY_ENVELOPES_SQL"}, - {"id": "lv-h32544824cbd4", "path": "crates/fractal-store/src/store/run_eta_tests.rs", "kind": "sql-template", "fingerprint": "1a305a6762d1be10e6c7e519c6eda179283044cb3745b314d3b861959ddad761", "owner": "fractal_store::store::run_eta_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 428, "excerpt": "INSERT INTO mission_runs(id,current_generation_id,phase,status) VALUES(?1,'current',?2,?3)"}, + {"id": "lv-h3221720b83b7", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "76c974fbbff4b942b7f7c3ccbeecca6927f4ea15b252083fddd6622385ad1d34", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 255, "excerpt": "DELETE FROM assistant_grant_dirty WHERE claim_id=?1"}, + {"id": "lv-h3235673ff0ac", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "ac93616a08120148d8a02b0bf6d273edbba012bbc915a6d4c619ffe70f948b9b", "owner": "fractal_store::store::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 6463, "excerpt": "INSERT INTO batches(id,origin,replica_sequence,hash,accepted_at_unix_ms) VALUES(?1,'alder',?2,?1,?3)"}, + {"id": "lv-h3236adb69a56", "path": "crates/fractal-store/src/store/message_versions/tests.rs", "kind": "sql-template", "fingerprint": "f91ca080ea5b24706b33d6a619062fa15c3a7e0584d1156a065edb851c2681b5", "owner": "fractal_store::store::message_versions::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 42, "excerpt": "DELETE FROM claims WHERE store_index=9"}, + {"id": "lv-h323ef019de87", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "a9e32b69d52ad92d349f0a1e7a7f822c1b9418c6bc5098051f6cc3cf49311055", "owner": "smallclaims::store", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 1176, "excerpt": "INSERT OR IGNORE INTO meta(key,value) VALUES('replication_admitted_index',?1)"}, + {"id": "lv-h3247614039e2", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "unresolved-sql-sink", "fingerprint": "e0deafc42429b6c22ca6d321370c5a7887000da97c60eaadf337089510968a5c", "owner": "smallclaims::store::checkpoint", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1739, "excerpt": "SEALED_IDENTITY_ENVELOPES_SQL"}, + {"id": "lv-h32544824cbd4", "path": "crates/fractal-store/src/store/run_eta_tests.rs", "kind": "sql-template", "fingerprint": "1a305a6762d1be10e6c7e519c6eda179283044cb3745b314d3b861959ddad761", "owner": "fractal_store::store::run_eta_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 246, "excerpt": "INSERT INTO mission_runs(id,current_generation_id,phase,status) VALUES(?1,'current',?2,?3)"}, {"id": "lv-h32924f6f704c", "path": "crates/fractal-store/src/store/observer_subscription_detail.rs", "kind": "unresolved-sql-sink", "fingerprint": "9fe4b7ca7ed21cedb5909330466e54e646eeb1879c14f56f5b6a6a8166094920", "owner": "fractal_store::store::observer_subscription_detail", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 114, "excerpt": "[ subject ] , | row | Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? ) )"}, {"id": "lv-h32bc64f4521e", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "included-source", "fingerprint": "698c3fe0fd96fd53f04a1b7b67a61f29699904a70d72b3653c27522728148df8", "owner": "fractal_missions::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 11227, "excerpt": "include ! ( \"run_capacity_tests.rs\" )"}, {"id": "lv-h32cdd83a1513", "path": "crates/fractal-store/src/store/fleet_admission_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "b1ba36043540dac2c2704562244f85385a4e8cf2647806fe4ade9fadcf524de2", "owner": "fractal_store::store::fleet_admission_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 39, "excerpt": "SUBJECT_KINDS_AT_QUERY"}, {"id": "lv-h32d0f4bf9e74", "path": "crates/fractal-seats/src/store/runtime_starts.rs", "kind": "sql-template", "fingerprint": "7586760a723faf231054ad6964683d92e3fb02059db4dedb6b4227fb49de8ebb", "owner": "fractal_seats::store::runtime_starts", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 761, "excerpt": "UPDATE local_runtime_starts SET revoked_by=COALESCE(revoked_by,?2) WHERE id=?1"}, {"id": "lv-h32d92a921bc0", "path": "crates/fractal-store/src/store/missions.rs", "kind": "sql-template", "fingerprint": "24fe9f5eee2b4ec648382d10e62d66cce4aae5e947493e7544426c8d7f1d824a", "owner": "fractal_store::store::missions", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 434, "excerpt": "INSERT INTO mission_runs(id, mission_id, initial_revision, current_generation_id, root_revision, root_run_id, parent_step_run, workspace, requester, inputs, mode, status, phase, created_at_unix_ms, up"}, + {"id": "lv-h32d93849d196", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "a1283ec5bf87b372df96534f09c45e898f5571cce47da6cbbcd01e0f6c82c16f", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1527, "excerpt": "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1"}, {"id": "lv-h32ebf7345050", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "bf17261b04eb86c61ae224bdd937c34c53a8f60f529250c2245d1f411d89a7a3", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 11023, "excerpt": "UPDATE planning_sessions SET status='approved', published_revision=?2, updated_at_unix_ms=?3 WHERE id=?1"}, {"id": "lv-h32f2838ce121", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "7687bbedd9ca3681a66cb2bf57aa16e373968e3128e13f1568d0e2cb7a1b3ee0", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 9387, "excerpt": "BEGIN IMMEDIATE; INSERT OR IGNORE INTO local_usage_responses(subject, source_id, observed_at_unix_ms) SELECT subject, source_id, {} FROM local_usage_seen; DROP TABLE local_usage_seen; COMMIT;"}, {"id": "lv-h330632e16a3b", "path": "crates/fractal-store/src/store/unread_mail.rs", "kind": "unresolved-sql-sink", "fingerprint": "d12f4ddbceb5a4ef08dbcc2a0cbee40b089c4f77143653c32711de9a023a3f08", "owner": "fractal_store::store::unread_mail", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 153, "excerpt": "OVERDUE_TO"}, @@ -1766,12 +1841,12 @@ {"id": "lv-h38b527d3f169", "path": "crates/fractal-store/src/store/real_part_rebuild_bench.rs", "kind": "unresolved-sql-sink", "fingerprint": "19487461f2e24e9c5f1223d06ece888c4f1c43444e22e5707eed90338e5294b9", "owner": "fractal_store::store::real_part_rebuild_bench", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 170, "excerpt": "& format ! ( \"SELECT COUNT(*) FROM claims JOIN batches ON batches.id=claims.batch_id WHERE claims.subject=?1 {suffix}\" )"}, {"id": "lv-h38deff9f35b4", "path": "crates/fractal-store/src/store/unread_mail.rs", "kind": "unresolved-sql-sink", "fingerprint": "fec187433c4f392fddb9c0d1400a095648f252e10b441a3cf1058bac6f7d78d9", "owner": "fractal_store::store::unread_mail", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 65, "excerpt": "SCHEMA"}, {"id": "lv-h38e8310f56ed", "path": "crates/fractal-store/src/store/message_canonical_sort_tests.rs", "kind": "sql-template", "fingerprint": "85e8f261359b01f70579086619ff0d8cfddd8e33bda59431720d8f22c1429b9f", "owner": "fractal_store::store::message_canonical_sort_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 61, "excerpt": "INSERT INTO replica_records VALUES(?1,?2)"}, - {"id": "lv-h38eff0d38ab8", "path": "crates/fractal-store/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "791226088a58829bd5e62c75abafcf371e3280cf1ac7482db356727739abe186", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 3779, "excerpt": "& format ! ( \"EXPLAIN QUERY PLAN SELECT claims.id FROM claims INDEXED BY claims_subject_kind_index JOIN batches ON batches.id=claims.batch_id WHERE claims.subject=?1 AND {ACTUAL_STATE_CLAIM} AND claim"}, - {"id": "lv-h38f8702967df", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "unresolved-sql-sink", "fingerprint": "af656693b7fe93f4395dee1cb34cd92b44fefdaa85ff14aad07bd577cbf196a9", "owner": "smallclaims::store::checkpoint_staging", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 921, "excerpt": "params ! [ writer , sequence , hash , accepted_at ]"}, - {"id": "lv-h38f92dcb8168", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "0473f167c97511bbdd9eb4b5981ca5dd8f4f07c0d376ae46558f7621f8f4f633", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 23268, "excerpt": "UPDATE local_observations SET body=?1 WHERE id=?2"}, - {"id": "lv-h38ff906d5d58", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "1498d37ddf288bc74a801d2f887e1175a0327895bfd6f1c034513f205a83e3d9", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 21580, "excerpt": "UPDATE run_generations SET status=CASE WHEN status IN ('running','standing','blocked') THEN 'cancelled' ELSE status END, updated_at_unix_ms=?2 WHERE id=?1 AND status IN ('running','standing','blocked'"}, - {"id": "lv-h3933f68b777b", "path": "crates/fractal-reconcile/src/reconcile.rs", "kind": "included-source", "fingerprint": "4a3ceee6ca945340bd372f38022b59800f50d60458e48485ba0fc0e5d0df0ae9", "owner": "fractal_reconcile::reconcile", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 45842, "excerpt": "include_str ! ( \"../../fractal-drivers/tests/fixtures/blocking-screens/claude-permission-dialog.txt\" )"}, - {"id": "lv-h393cfa7a224d", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "ffd223b017f7c9d4769f1a6f385078667f64bbc2ce522ffcab24be892e8175af", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 7528, "excerpt": "INSERT INTO mission_run_after(run_id, after_run) VALUES (?1, ?2)"}, + {"id": "lv-h38eff0d38ab8", "path": "crates/fractal-store/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "791226088a58829bd5e62c75abafcf371e3280cf1ac7482db356727739abe186", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 3322, "excerpt": "& format ! ( \"EXPLAIN QUERY PLAN SELECT claims.id FROM claims INDEXED BY claims_subject_kind_index JOIN batches ON batches.id=claims.batch_id WHERE claims.subject=?1 AND {ACTUAL_STATE_CLAIM} AND claim"}, + {"id": "lv-h38f8702967df", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "unresolved-sql-sink", "fingerprint": "af656693b7fe93f4395dee1cb34cd92b44fefdaa85ff14aad07bd577cbf196a9", "owner": "smallclaims::store::checkpoint_staging", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 839, "excerpt": "params ! [ writer , sequence , hash , accepted_at ]"}, + {"id": "lv-h38f92dcb8168", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "0473f167c97511bbdd9eb4b5981ca5dd8f4f07c0d376ae46558f7621f8f4f633", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 21239, "excerpt": "UPDATE local_observations SET body=?1 WHERE id=?2"}, + {"id": "lv-h38ff906d5d58", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "1498d37ddf288bc74a801d2f887e1175a0327895bfd6f1c034513f205a83e3d9", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 19635, "excerpt": "UPDATE run_generations SET status=CASE WHEN status IN ('running','standing','blocked') THEN 'cancelled' ELSE status END, updated_at_unix_ms=?2 WHERE id=?1 AND status IN ('running','standing','blocked'"}, + {"id": "lv-h3933f68b777b", "path": "crates/fractal-reconcile/src/reconcile.rs", "kind": "included-source", "fingerprint": "4a3ceee6ca945340bd372f38022b59800f50d60458e48485ba0fc0e5d0df0ae9", "owner": "fractal_reconcile::reconcile", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 41383, "excerpt": "include_str ! ( \"../../fractal-drivers/tests/fixtures/blocking-screens/claude-permission-dialog.txt\" )"}, + {"id": "lv-h393cfa7a224d", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "ffd223b017f7c9d4769f1a6f385078667f64bbc2ce522ffcab24be892e8175af", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 6445, "excerpt": "INSERT INTO mission_run_after(run_id, after_run) VALUES (?1, ?2)"}, {"id": "lv-h393dcf4b427c", "path": "crates/fractal-delivery/src/store/terminal_gate_evidence/native_source/tests.rs", "kind": "sql-template", "fingerprint": "6b3823f2f143ab2244075588dbaf9e8bf386ed8250474992d6adfbee5ca02c07", "owner": "fractal_delivery::store::terminal_gate_evidence::native_source::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 397, "excerpt": "UPDATE test_native_terminal_guard SET gap=?1,pending=1 WHERE id=1"}, {"id": "lv-h393f3464e93e", "path": "crates/fractal-delivery/src/store/message_point_qualification/tests.rs", "kind": "sql-template", "fingerprint": "a2e34179aab4626fa76a1af36f1e0146879a32dc6b1433fe8553966251995631", "owner": "fractal_delivery::store::message_point_qualification::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 633, "excerpt": "INSERT INTO desired(subject,kind,revision,claim_id,body,owner_run) VALUES('message/selected','message','r','sent','{}',?1)"}, {"id": "lv-h394b74dae3bd", "path": "crates/fractal-seats/src/store/resource_preparation/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "dc372daedd324b47f1261987900c1a08eff3ccdf253bfcf666d0ebecf17142ad", "owner": "fractal_seats::store::resource_preparation::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 249, "excerpt": "& store , | _ | ( )"}, @@ -1791,10 +1866,10 @@ {"id": "lv-h3a36e2e6f506", "path": "crates/fractal-missions/src/store/fault_history_tests.rs", "kind": "sql-template", "fingerprint": "607ab1d3c9ceb437114a3e4e902c0dfa0ac681d893acfcc0c581bdfc6c7e6aa4", "owner": "fractal_missions::store::fault_history_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 218, "excerpt": "UPDATE claims SET actor='daemon/runtime' WHERE id=?1"}, {"id": "lv-h3a37f31e4de5", "path": "crates/smallclaims/src/store/saved_inventory_tests.rs", "kind": "sql-template", "fingerprint": "a29611e7374e609ad6cd8f40b024bcdedf914f833c9c54f1d831110b229cff2f", "owner": "smallclaims::store::saved_inventory_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 281, "excerpt": "INSERT INTO replica_envelopes(rowid, {COLUMNS}) SELECT ?1, 'invented-peer', sequence+1000000+?1, ?2, previous_hash, accepted_at_unix_ms, payload, batch_id, relay, receipt_state, validation_error, rece"}, {"id": "lv-h3a3a58673aaa", "path": "crates/fractal-store/src/store/directive_notes.rs", "kind": "unresolved-sql-sink", "fingerprint": "fec187433c4f392fddb9c0d1400a095648f252e10b441a3cf1058bac6f7d78d9", "owner": "fractal_store::store::directive_notes", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 156, "excerpt": "SCHEMA"}, - {"id": "lv-h3a6af971ba05", "path": "crates/fractal-store/src/store/arrangements.rs", "kind": "sql-template", "fingerprint": "b317eca0692dfa6bd6e29af3a3d88041437d27179c85a7c20d3a9cd02a16f2d6", "owner": "fractal_store::store::arrangements", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 261, "excerpt": "UPDATE arrangements SET changed_index=MAX(changed_index,?2) WHERE subject=?1"}, - {"id": "lv-h3a753a5db0a5", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "9ec302384fb1a68378cddbbb9136351e5bb169f47124d1e4bfe85edb9ca82a4a", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 21506, "excerpt": "UPDATE step_runs SET status='cancelled', blocked_reason=?2, lease_owner=NULL, lease_incarnation=NULL, lease_expires_at_unix_ms=NULL, updated_at_unix_ms=?3 WHERE generation_id=?1 AND (status NOT IN ('c"}, - {"id": "lv-h3a97fb63cb60", "path": "crates/fractal-store/src/store/resources_preparation.rs", "kind": "sql-template", "fingerprint": "9e6b9762a1d1563aba10b1009549bc602b8f86b63452f2663d2551322bf3c39b", "owner": "fractal_store::store::resources_preparation", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 235, "excerpt": "DROP TRIGGER IF EXISTS preparation_claims_dirty_DELETE; DROP TRIGGER IF EXISTS preparation_claims_dirty_delete_ranked"}, - {"id": "lv-h3a9e73d4f2c3", "path": "crates/fractal-store/src/store/messages_shard.rs", "kind": "sql-template", "fingerprint": "98473053752d372a2a8009e0c0c18acc27f9ef7f5a9377c40032a68546e6024c", "owner": "fractal_store::store::messages_shard", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 42, "excerpt": " CREATE TABLE IF NOT EXISTS stream_messages ( subject TEXT PRIMARY KEY, recipient TEXT NOT NULL, sender TEXT NOT NULL, store_index INTEGER NOT NULL ); CREATE INDEX IF NOT EXISTS stream_messages_recipi"}, + {"id": "lv-h3a6af971ba05", "path": "crates/fractal-store/src/store/arrangements.rs", "kind": "sql-template", "fingerprint": "b317eca0692dfa6bd6e29af3a3d88041437d27179c85a7c20d3a9cd02a16f2d6", "owner": "fractal_store::store::arrangements", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 242, "excerpt": "UPDATE arrangements SET changed_index=MAX(changed_index,?2) WHERE subject=?1"}, + {"id": "lv-h3a753a5db0a5", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "9ec302384fb1a68378cddbbb9136351e5bb169f47124d1e4bfe85edb9ca82a4a", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 19561, "excerpt": "UPDATE step_runs SET status='cancelled', blocked_reason=?2, lease_owner=NULL, lease_incarnation=NULL, lease_expires_at_unix_ms=NULL, updated_at_unix_ms=?3 WHERE generation_id=?1 AND (status NOT IN ('c"}, + {"id": "lv-h3a97fb63cb60", "path": "crates/fractal-store/src/store/resources_preparation.rs", "kind": "sql-template", "fingerprint": "9e6b9762a1d1563aba10b1009549bc602b8f86b63452f2663d2551322bf3c39b", "owner": "fractal_store::store::resources_preparation", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 289, "excerpt": "DROP TRIGGER IF EXISTS preparation_claims_dirty_DELETE; DROP TRIGGER IF EXISTS preparation_claims_dirty_delete_ranked"}, + {"id": "lv-h3a9e73d4f2c3", "path": "crates/fractal-store/src/store/messages_shard.rs", "kind": "sql-template", "fingerprint": "98473053752d372a2a8009e0c0c18acc27f9ef7f5a9377c40032a68546e6024c", "owner": "fractal_store::store::messages_shard", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 40, "excerpt": " CREATE TABLE IF NOT EXISTS stream_messages ( subject TEXT PRIMARY KEY, recipient TEXT NOT NULL, sender TEXT NOT NULL, store_index INTEGER NOT NULL ); CREATE INDEX IF NOT EXISTS stream_messages_recipi"}, {"id": "lv-h3ab29ee56e28", "path": "crates/fractal-store/src/store/terminal_gate_evidence/native_source/transaction_hooks/tests.rs", "kind": "sql-template", "fingerprint": "c2503cf07e38dad7d27c18ff7473454891a4445b52dc61567c0a679fd462c8e4", "owner": "fractal_store::store::terminal_gate_evidence::native_source::transaction_hooks::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 59, "excerpt": "DELETE FROM test_native_terminal_guard"}, {"id": "lv-h3ab5d0e4a39c", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "c191ad7b482dac1c6cc5eb374bb0d52f333769d7a7848d25bbe9d4026f0c1ad9", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1197, "excerpt": "canonical : : POSITION_SCHEMA"}, {"id": "lv-h3acc81c36e22", "path": "crates/fractal-store/src/store/client_messages_version_benchmark.rs", "kind": "sql-template", "fingerprint": "6989c13c9a52e244b864a7a0462629f8280c8820ff0b597963b6979943da9195", "owner": "fractal_store::store::client_messages_version_benchmark", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 134, "excerpt": "DELETE FROM local_client_message_retirements WHERE at_unix_ms ( 0 )"}, - {"id": "lv-h3f0f377d0d3b", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "unresolved-sql-sink", "fingerprint": "6a8bc964399f5a0d2b85daf17489b50e8d75ff83f232d1a1b72fd95b8d8daca8", "owner": "smallclaims::store::checkpoint_trim", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1604, "excerpt": "params ! [ envelope . writer , envelope . sequence , envelope . envelope_hash ] , | row | row . get ( 0 )"}, + {"id": "lv-h3f0f377d0d3b", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "unresolved-sql-sink", "fingerprint": "6a8bc964399f5a0d2b85daf17489b50e8d75ff83f232d1a1b72fd95b8d8daca8", "owner": "smallclaims::store::checkpoint_trim", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1068, "excerpt": "params ! [ envelope . writer , envelope . sequence , envelope . envelope_hash ] , | row | row . get ( 0 )"}, + {"id": "lv-h3f117dab1bdd", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "801a71dd84fdd9b15bd1daead009f00c28527f55cd56eed75d659cb819273233", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 122, "excerpt": "INSERT OR REPLACE INTO meta(key,value) VALUES('assistant_grant_authority_local_origin',?1)"}, {"id": "lv-h3f4254f45299", "path": "crates/fractal-store/src/store/observer_subscription_detail.rs", "kind": "unresolved-sql-sink", "fingerprint": "90dbe74bec90013705bd92e02619372a20cb7733a5375be33830ea72c895a370", "owner": "fractal_store::store::observer_subscription_detail", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 124, "excerpt": "[ subject ] , | row | row . get ( 0 )"}, + {"id": "lv-h3f49c0e579cd", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "d32ac2e4d08dda85b0bdcd99da38e8413afd3c164a0de0295122f56508ee57ce", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 361, "excerpt": "INSERT OR REPLACE INTO meta(key,value) VALUES(?1,?2)"}, + {"id": "lv-h3f4f98505546", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "930318de99ef60e426e23f56f28c0965fa8e91aedc3d177e8fdfa65e1daebbd5", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 545, "excerpt": "INSERT INTO assistant_grant_effective(claim_id,grant_subject,principal,owner,profile,expires_at,revoked,grant_record) VALUES(?1,?2,?3,?4,?5,?6,?7,?8)"}, {"id": "lv-h3f5784d30226", "path": "crates/fractal-store/src/store/backup_ledgers.rs", "kind": "sql-template", "fingerprint": "db9d5daac3d9c10af3297e8724dfd6d386f827e0d6ba268f0979bca285e3d6ee", "owner": "fractal_store::store::backup_ledgers", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 102, "excerpt": "INSERT OR IGNORE INTO retired_claim_ancestry(claim_id, subject, kind, predecessors) \\ VALUES ({0}, {1}, {2}, {3})"}, {"id": "lv-h3f5f5a18a499", "path": "crates/smallclaims/src/store/prepared_seal_tests.rs", "kind": "sql-template", "fingerprint": "4c324910290e8101c7e0877e900b61cc935f6391fa3f309a48d81786ddbd658a", "owner": "smallclaims::store::prepared_seal_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 449, "excerpt": "UPDATE meta SET value=?1 WHERE key='fleet_id'"}, {"id": "lv-h3f6355c99f88", "path": "crates/smallclaims/src/store/fleet_residue_page_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "a8b771920b8319e47251d1360f5e880bc18e8d329b0f0d003ea3c7e615558947", "owner": "smallclaims::store::fleet_residue_page_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 70, "excerpt": "query"}, @@ -1877,6 +1956,7 @@ {"id": "lv-h401219150349", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "37562a94c45b4861f29f5194fc82cbff46f733094b2951073dee100cc89970ec", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6610, "excerpt": "& canonical_sql ( \"SELECT documents.binding_claim_id FROM documents WHERE documents.name=?1 ORDER BY binding_key DESC LIMIT 1\" ) , [ name ] , | row | row . get ( 0 ) ,"}, {"id": "lv-h401827c1a9e4", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "3a12fb3e5c3e75ce3d09f0e23d17a2f455c9fd0874187c6b4266bf1f740c6050", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 21613, "excerpt": "[ run_id ] , | row | row . get : : < _ , String > ( 0 ) ,"}, {"id": "lv-h40220adb3766", "path": "crates/fractal-store/src/store/client_messages_version_benchmark.rs", "kind": "sql-template", "fingerprint": "a26c35648e178be59a8579da0be6571772423c4ec0d19573b3b16eb1798f94b9", "owner": "fractal_store::store::client_messages_version_benchmark", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 68, "excerpt": "INSERT OR IGNORE INTO local_client_message_pending SELECT subject FROM message_index"}, + {"id": "lv-h403d59b4d3b8", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "ccbdb4ad2b0e9e2d65c7429708b5ebf324a43876f080303e18def587249485e6", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1267, "excerpt": "INSERT INTO assistant_grant_dirty VALUES(?1)"}, {"id": "lv-h4049fea3aa76", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "2ce936b116680070358fee2ba7f5199da480055ee99d53f45a628dbb0c61b8e2", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 18655, "excerpt": "[ proposal_id ] , | row | row . get : : < _ , bool > ( 0 ) ,"}, {"id": "lv-h407801ac4b65", "path": "crates/fractal-store/src/store/resources_preparation.rs", "kind": "sql-template", "fingerprint": "c85ab9c83751d87d4e595060c8f197a681004a431c5b8694dc537eee8dad7915", "owner": "fractal_store::store::resources_preparation", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 373, "excerpt": "DELETE FROM local_resource_preparation; DELETE FROM local_resource_preparation_claims; DELETE FROM local_resource_preparation_pending; DELETE FROM local_resource_preparation_dirty; DELETE FROM local_r"}, {"id": "lv-h407916e8f5b5", "path": "crates/smallclaims/src/store/saved_inventory_tests.rs", "kind": "sql-template", "fingerprint": "7f803950b8fa2362a48e086aa1ce1a57897c8178474b36611a3a3cf3d711d21e", "owner": "smallclaims::store::saved_inventory_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 476, "excerpt": "INSERT INTO retired_envelopes(writer, sequence, envelope_hash) SELECT writer, sequence, {} FROM replica_envelopes WHERE rowid=(SELECT MIN(rowid)+2 FROM replica_envelopes)"}, @@ -1898,6 +1978,7 @@ {"id": "lv-h417a0c76a6cf", "path": "crates/fractal-daemon/src/store_tests/client_message_reminder_deletion.rs", "kind": "sql-template", "fingerprint": "d2da5add2a6bd9c2b42af648a45c2fb4a91ee554df73cb72641783884838bfe1", "owner": "fractal_daemon::store_tests::client_message_reminder_deletion", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 213, "excerpt": "DELETE FROM reminder_selector_writes"}, {"id": "lv-h417aa229a9e1", "path": "crates/fractal-store/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "44cba8e02853958d5c489d37a3f67b1e521fc375da1ac8acaecb6b014a9ccbca", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6946, "excerpt": "& format ! ( \"EXPLAIN QUERY PLAN {}\" , claims_for_subject_query ( true ) )"}, {"id": "lv-h41841329a315", "path": "crates/fractal-seats/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "670380e6c1568143746eefd5717d30685a73d61436c5663c11ede8fb9d9aec6f", "owner": "fractal_seats::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1555, "excerpt": "& format ! ( \"EXPLAIN QUERY PLAN {query}\" )"}, + {"id": "lv-h418f3ec55f8d", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "b3efcc24914c42fca8ae7a62b15caa28927e12c24b86d47dbcd90e7857ee2d6a", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1005, "excerpt": "authority : : AUTHENTICATION_KEYS_QUERY"}, {"id": "lv-h41b006e9c464", "path": "crates/fractal-store/src/store/person_work.rs", "kind": "unresolved-sql-sink", "fingerprint": "b7eafcbb01a79e6feb02839905b41bafc8a5be2f355d21ab6b4b392a34092eac", "owner": "fractal_store::store::person_work", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 889, "excerpt": "& QUERY"}, {"id": "lv-h41f24e6ed994", "path": "crates/fractal-store/src/store/terminal_gate_evidence/native_source_shared.rs", "kind": "unresolved-sql-sink", "fingerprint": "20af065de68131a4213acc53126e6af2cfd7dcb8ccfe1cbb20d4b27827e50ff4", "owner": "fractal_store::store::terminal_gate_evidence::native_source_shared", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 119, "excerpt": "& format ! ( \"SELECT rowid FROM {table} WHERE {column}=?1\" ) , [ key ] , | r | r . get ( 0 ) ,"}, {"id": "lv-h4207bd94c16e", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "861ae77d8b9421fa21c0de36fb94ae80d2b589f44a1eb28e3ee97f385d319402", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 955, "excerpt": "[ claim_id ]"}, @@ -1993,9 +2074,9 @@ {"id": "lv-h47454d1a25b6", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "sql-template", "fingerprint": "d1afaa8c9a82bd6bf778c0b93f3e14dbf2bd37bcc8edf7181f59d23060ac954f", "owner": "smallclaims::store::repair_operation_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 635, "excerpt": "UPDATE operations SET request_digest='wrong'"}, {"id": "lv-h4746913336a7", "path": "crates/fractal-store/src/store/resources_preparation.rs", "kind": "unresolved-sql-sink", "fingerprint": "b7eafcbb01a79e6feb02839905b41bafc8a5be2f355d21ab6b4b392a34092eac", "owner": "fractal_store::store::resources_preparation", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 819, "excerpt": "& QUERY"}, {"id": "lv-h475b9c435b3b", "path": "crates/smallclaims/src/store/prepared_envelope_tests.rs", "kind": "sql-template", "fingerprint": "86a3507a2d90f069218b25e0f4583211402e34c38f3366a24130d5adf9ae9592", "owner": "smallclaims::store::prepared_envelope_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1161, "excerpt": "INSERT INTO meta(key, value) VALUES ('gate', 'open')"}, - {"id": "lv-h476756b0f558", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "unresolved-sql-sink", "fingerprint": "ffab679bb75b8a325d503bcd0b5026ea6500de964c0bd80aa0be822e0b4e1851", "owner": "fractal_store::store::client_messages", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 868, "excerpt": "[ BACKFILL_MARKER ] , | row | row . get ( 0 )"}, - {"id": "lv-h479424100c1a", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "096dec60c53b20d1b3af93a466b7d7159879452d670da3cecd70bd0f3e591211", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 8843, "excerpt": "\"RELEASE project_incremental\""}, - {"id": "lv-h47a0a723f1b0", "path": "crates/fractal/src/main_tests.rs", "kind": "included-source", "fingerprint": "ade115a25cbf169314b7a727ce07ca2995c0e33b3cac801ac29f37b3e7a883cc", "owner": "fractal::main_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 3401, "excerpt": "include_str ! ( \"main.rs\" )"}, + {"id": "lv-h476756b0f558", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "unresolved-sql-sink", "fingerprint": "ffab679bb75b8a325d503bcd0b5026ea6500de964c0bd80aa0be822e0b4e1851", "owner": "fractal_store::store::client_messages", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 705, "excerpt": "[ BACKFILL_MARKER ] , | row | row . get ( 0 )"}, + {"id": "lv-h479424100c1a", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "096dec60c53b20d1b3af93a466b7d7159879452d670da3cecd70bd0f3e591211", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 7962, "excerpt": "\"RELEASE project_incremental\""}, + {"id": "lv-h47a0a723f1b0", "path": "crates/fractal/src/main_tests.rs", "kind": "included-source", "fingerprint": "ade115a25cbf169314b7a727ce07ca2995c0e33b3cac801ac29f37b3e7a883cc", "owner": "fractal::main_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 3039, "excerpt": "include_str ! ( \"main.rs\" )"}, {"id": "lv-h47a74825ea0b", "path": "crates/smallclaims/src/ivm.rs", "kind": "sql-template", "fingerprint": "6ced509bbfde28bcd496accab408ece517608b668fb5a9cdf68e064e85cc7e07", "owner": "smallclaims::ivm", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1358, "excerpt": "UPDATE ivm_views SET ready=0 WHERE name=?1"}, {"id": "lv-h47aaff9ea590", "path": "crates/fractal-store/src/store/resources_preparation.rs", "kind": "sql-template", "fingerprint": "e538a541b202f73d038670361be2df304e073c399248b3f37650de6a69bd72f7", "owner": "fractal_store::store::resources_preparation", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 217, "excerpt": "CREATE TRIGGER IF NOT EXISTS preparation_{table}_old_update AFTER UPDATE ON {table} BEGIN INSERT INTO local_resource_preparation_pending(claim_id) SELECT OLD.{identity} WHERE OLD.{identity} IS NOT NUL"}, {"id": "lv-h47baaed9ab31", "path": "crates/fractal-store/src/store/work_summaries_ivm.rs", "kind": "unresolved-sql-sink", "fingerprint": "547e01aefa58292fcd2d1b845f7e711e71c5c4502688b3b59a7cdb3b1bf5ba5a", "owner": "fractal_store::store::work_summaries_ivm", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 168, "excerpt": "WINNER , params ! [ VIEW , key , register , upper . as_slice ( ) ] , | row | row . get ( 0 ) ,"}, @@ -2007,6 +2088,7 @@ {"id": "lv-h483f134075db", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "7ceaf4d59f36e9dd6c8f18204424f99f72a15b9062c24b0eea79146be268cac6", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 2157, "excerpt": "& format ! ( \"SELECT {CLAIM_COLUMNS} FROM claims JOIN batches ON batches.id=claims.batch_id WHERE claims.kind=?1 AND (?2 IS NULL OR claims.subject=?2) ORDER BY claims.store_index DESC LIMIT ?3\" )"}, {"id": "lv-h484ea3403f07", "path": "crates/fractal-missions/src/store/adhoc_work.rs", "kind": "sql-template", "fingerprint": "66ffa0a54706e5da61fcf54b0ed18c531b6e15db0b1113b98c19b4763a1de2f1", "owner": "fractal_missions::store::adhoc_work", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 85, "excerpt": "UPDATE step_runs SET assignee=?2, available_to='[]' WHERE subject=?1"}, {"id": "lv-h4852c7521fdc", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "sql-template", "fingerprint": "95c1cabf9e99c7c6f66130c6ed2d6a307e8a559d047d54b6cf3ba0e124127653", "owner": "smallclaims::store::checkpoint_trim", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 1012, "excerpt": "INSERT INTO checkpoints(id, cut_unix_ms, state, updated_at_unix_ms) VALUES (?1, ?2, ?3, ?4) ON CONFLICT(id) DO UPDATE SET state=excluded.state, updated_at_unix_ms=excluded.updated_at_unix_ms"}, + {"id": "lv-h4863c5bdfd48", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "044067d2709ea3652e9fc4b04bee68bf82c3065e69811b8eb5714b16fd7567c0", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 987, "excerpt": "INSERT INTO assistant_grant_dirty SELECT id FROM claims WHERE kind=?1"}, {"id": "lv-h487b327aa403", "path": "crates/fractal-api-core/src/api/legacy_handler_guard_tests.rs", "kind": "included-source", "fingerprint": "c0eb01a47bf27ac621b1caf4e09f60673aa837af87d97a590b98ce8e94cfa028", "owner": "fractal_api_core::api::legacy_handler_guard_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 15, "excerpt": "include_str ! ( \"native_delivery.rs\" )"}, {"id": "lv-h488727939c7c", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "unresolved-sql-sink", "fingerprint": "559ef6e99b22377724184ffa43ffffbd55137a7c1368d65f20fafb5030e5f02e", "owner": "fractal_missions::store::missions", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 4691, "excerpt": "& open_mission_run_headers_query ( )"}, {"id": "lv-h488b50c88484", "path": "crates/fractal-store/src/store/real_part_rebuild_bench.rs", "kind": "unresolved-sql-sink", "fingerprint": "f401c624e254f1ccb29e465c2941ffdcba00867c9fa83fac93351e37153d0f23", "owner": "fractal_store::store::real_part_rebuild_bench", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 174, "excerpt": "[ subject ] , | row | row . get : : < _ , i64 > ( 0 )"}, @@ -2026,6 +2108,7 @@ {"id": "lv-h49163266974a", "path": "crates/fractal-store/src/store/mailbox_lease.rs", "kind": "unresolved-sql-sink", "fingerprint": "5c311e4d7829e93fb994379db06ba8173b088820b9ecd3ebe101ce1f989d4977", "owner": "fractal_store::store::mailbox_lease", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 83, "excerpt": "[ & fence . token ] , | row | Ok ( ( Fence { token : fence . token . clone ( ) , subject : row . get ( 0 ) ? , component : row . get ( 1 ) ? , incarnation : row . get ( 2 ) ? , epoch : row . get ( 3 )"}, {"id": "lv-h491af119020d", "path": "crates/smallclaims/src/sqlite/read_admission_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "5b6b40a906a01449b1777c0aa965073d786de369e2f1e74d6af78bfa11963f53", "owner": "smallclaims::sqlite::read_admission_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 466, "excerpt": "\"BEGIN\""}, {"id": "lv-h49207ad0162b", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "346cce717c98b9bdfad68a97541dd53467adff798ecd049a53213d22fc0ca1ce", "owner": "fractal_store::store::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 7424, "excerpt": "INSERT INTO claims(store_index,id,batch_id,subject,kind,origin,body,predecessors,accepted_at_unix_ms) VALUES (?1,?2,'cost-batch','agent/legacy-cost','harness.observed','legacy-cost',?3,'[]',?4)"}, + {"id": "lv-h49244ed4f44b", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "4b6cb5f3338bd974ed0a823f92601752b8be79b1ee6c4878f29a1a6bfb5c4d25", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 1223, "excerpt": "CREATE TEMP TABLE refreshed_items (claim_id TEXT); CREATE TEMP TRIGGER count_membership_refresh AFTER UPDATE ON assistant_grant_additions BEGIN INSERT INTO refreshed_items VALUES(NEW.sequence); END;"}, {"id": "lv-h49273ccc63c3", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "8eedd7524228ebc9bc31f5c96d3459ac2c472c24dbaa9da0e3aed8d5368e6f1d", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 21598, "excerpt": "UPDATE mission_runs SET status=CASE WHEN status IN ('running','standing','blocked') THEN 'cancelled' ELSE status END, phase=CASE WHEN status IN ('running','standing','blocked') THEN 'terminal' ELSE ph"}, {"id": "lv-h4935436a2ebd", "path": "crates/smallclaims/src/store/sealed_view_cache_tests/mutation_tests.rs", "kind": "sql-template", "fingerprint": "f9e340c1660b3ccb0954bcc00e86e2905f10d2ddfcf15e0672f0fdf46896bfb0", "owner": "smallclaims::store::sealed_view_cache_tests::mutation_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 32, "excerpt": "UPDATE claims SET id='renamed-anchor-admission' WHERE id=?1"}, {"id": "lv-h493aa8cab034", "path": "crates/fractal-store/src/store/deploy/tests.rs", "kind": "sql-template", "fingerprint": "24627020606adfa3d478550f3d316f490f26d67e712b22673594e490f412fadb", "owner": "fractal_store::store::deploy::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 69, "excerpt": "UPDATE replication_peers SET last_success_at_unix_ms=?1 WHERE peer='host-b'"}, @@ -2077,6 +2160,7 @@ {"id": "lv-h4bb1e49aa5a7", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "sql-template", "fingerprint": "0b3f908ea7927f0bc109e8f74facc69eb356c34e7ce241f5b4812694d4187800", "owner": "smallclaims::store::repair_operation_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1015, "excerpt": "UPDATE operations SET request_digest='prior-corruption' WHERE id='unrelated/damaged'"}, {"id": "lv-h4bc3d0704188", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "c7df6c718f7f19a676ce4d40c2b67be629c5aba1beb55f42c49533e7ba4a4c6a", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 11648, "excerpt": "UPDATE planning_sessions SET updated_at_unix_ms=?2 WHERE id=?1"}, {"id": "lv-h4bcba70ae933", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "b7eafcbb01a79e6feb02839905b41bafc8a5be2f355d21ab6b4b392a34092eac", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 22229, "excerpt": "& QUERY"}, + {"id": "lv-h4bcc00c86e41", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "96e32c9d38bbb6fd279240c6b77d56a10a305572cbfdf7f1c4bb98ca714996ae", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1059, "excerpt": "DELETE FROM assistant_grant_additions WHERE id=?1"}, {"id": "lv-h4bd147f61506", "path": "crates/fractal-store/src/store/schedule_active_run_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "ee1b3ee03689f60851d724136eae59b9edc3b1f7b03d309c8e6398c94b48c397", "owner": "fractal_store::store::schedule_active_run_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 80, "excerpt": "Store : : SCHEDULE_ACTIVE_STARTED_RUN_QUERY"}, {"id": "lv-h4bdc5d594924", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "unresolved-sql-sink", "fingerprint": "5577f5390827b54296ab7905eb32913f85f39cc202b979969746473ce9e647c8", "owner": "smallclaims::store::checkpoint", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 958, "excerpt": "params ! [ phase , subject , i64 : : try_from ( ordinal ) ? , reader , canonical_json_text ( value ) ? ]"}, {"id": "lv-h4be145dfeee8", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "sql-template", "fingerprint": "7c23f7cc7bbe2c77f819254ca737610cbe37c33bed69eee5772f09d7ac4bbfc2", "owner": "smallclaims::store::repair_operation_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 883, "excerpt": "INSERT INTO projection_digest_repaired_claims(id) VALUES ('cp/repaired')"}, @@ -2115,6 +2199,7 @@ {"id": "lv-h4d909c3fd602", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "sql-template", "fingerprint": "794f7bbfce8200793f335af7596ce61ef8992c039b9e6b5703f582601c7779c7", "owner": "smallclaims::store::checkpoint_trim", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1347, "excerpt": "INSERT OR REPLACE INTO meta(key, value) VALUES (?1, ?2)"}, {"id": "lv-h4d9343dd017a", "path": "crates/fractal-seats/src/store/resource_preparation/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "dc372daedd324b47f1261987900c1a08eff3ccdf253bfcf666d0ebecf17142ad", "owner": "fractal_seats::store::resource_preparation::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 241, "excerpt": "& store , | _ | ( )"}, {"id": "lv-h4d94de7d92a4", "path": "crates/fractal-store/src/store/run_eta_tests.rs", "kind": "sql-template", "fingerprint": "87a2287f72da56b40207b535faafb631611727e195a1a5b0c601d0652692fdbb", "owner": "fractal_store::store::run_eta_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 460, "excerpt": "CREATE INDEX claims_kind_index ON claims(kind,store_index); CREATE INDEX claims_person_ask_origin_step_index ON claims(json_extract(body,'$.fields.origin_step')) WHERE kind='work.person-asked'; CREATE"}, + {"id": "lv-h4d9aa050b4a3", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "c7530f326023f53723029e84cb2ddffcca815af393c4e1c660b0bcfd169c94e5", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 749, "excerpt": "INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) VALUES(?1,?2,?3,?4,?5,?6,?7,?8,?9)"}, {"id": "lv-h4da262ac8192", "path": "crates/smallclaims/src/store/checkpoint_agreement.rs", "kind": "sql-template", "fingerprint": "39453e2c9af2d529ca23d232b6fe554d0efffe1ce3d8e587a79d953214cb655e", "owner": "smallclaims::store::checkpoint_agreement", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1403, "excerpt": "INSERT INTO temp.write_clock(offset_ms) VALUES (?1)"}, {"id": "lv-h4db2288f7bae", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "unresolved-sql-sink", "fingerprint": "62e8981702347121e1ec7e9b11e1dd77f1985af128e26c55c006b61b0cddd483", "owner": "smallclaims::store::checkpoint", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 354, "excerpt": "params ! [ envelope . writer , envelope . sequence , envelope . envelope_hash , i64 : : try_from ( envelope . accepted_at_unix_ms ) ? , checkpoint ]"}, {"id": "lv-h4db959eeeb8b", "path": "crates/fractal-store/src/store/fleet_admission_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "b16bfc76312bdaa8b65712a8a1874bc1a7d6b5f37abec1e689eee5824263a2c2", "owner": "fractal_store::store::fleet_admission_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 118, "excerpt": "CONFLICT_CLAIM_QUERY"}, @@ -2124,6 +2209,8 @@ {"id": "lv-h4df2825a9017", "path": "crates/smallclaims/src/sqlite/read_lifetime/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "b9283c516994655464005fe7fa6a76668a5882d422a5e887edfcec25ae8624ae", "owner": "smallclaims::sqlite::read_lifetime::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 224, "excerpt": "\"BEGIN; SELECT * FROM payload\""}, {"id": "lv-h4df8c4c1af39", "path": "crates/fractal/src/response_expiry_tests.rs", "kind": "sql-template", "fingerprint": "dd2b5f9f07e0760d8d29d36a0234e46940679161a2bccaeec3851ef4253997eb", "owner": "fractal::response_expiry_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 242, "excerpt": "UPDATE idempotency SET expires_at_unix_ms=0"}, {"id": "lv-h4e038f127bd7", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "unresolved-sql-sink", "fingerprint": "a7f1b5a54d4b7c640127d0f5fa14486a3e104188afa53479ce0f33c96f9d24b9", "owner": "fractal_missions::store::missions", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 4983, "excerpt": "& canonical_sql ( \"SELECT origin FROM claims WHERE subject=?1 AND kind='mission-run.created' ORDER BY CANONICAL_ASC(claims) LIMIT 1\" ) , [ subject ] , | row | row . get ( 0 ) ,"}, + {"id": "lv-h4e1ea146a20c", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "a1283ec5bf87b372df96534f09c45e898f5571cce47da6cbbcd01e0f6c82c16f", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1102, "excerpt": "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1"}, + {"id": "lv-h4e21f68dabd5", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "3f67714f1224b5cd6f9252352a4159e37b374bd87a655d6731c13dcfb1c42e31", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1024, "excerpt": "DELETE FROM assistant_grant_retractions WHERE id=?1"}, {"id": "lv-h4e2308a48e9d", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "included-source", "fingerprint": "715ca99ee83dd671212c5b525a61b2a6fa5bf7b6c8682f3498a2adb95ad37d5a", "owner": "fractal_missions::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 11211, "excerpt": "include ! ( \"mission_deadline_probe.rs\" )"}, {"id": "lv-h4e383ba176b1", "path": "crates/fractal-store/src/store/checkpoint_tests.rs", "kind": "sql-template", "fingerprint": "874593cab0d6e1166dee40258f5a3fe9744c02e24f48e48b0af617917ac79797", "owner": "fractal_store::store::checkpoint_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 2506, "excerpt": "UPDATE claims SET body=json_set(body, '$.fields.total_tokens', 250) WHERE id=?1"}, {"id": "lv-h4e3c47b4ff2b", "path": "crates/fractal-store/src/store/step_labels.rs", "kind": "unresolved-sql-sink", "fingerprint": "d80eef577245eb7c0dc5788e29a4834b05723e8bcf6734f1b172ce3e12e29acd", "owner": "fractal_store::store::step_labels", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 20, "excerpt": "QUERY"}, @@ -2211,6 +2298,7 @@ {"id": "lv-h527d45a1ba30", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "unresolved-sql-sink", "fingerprint": "813d76d116d1f9be63900379c327443643cb2e20bd3d152634c0fa2e18039b26", "owner": "smallclaims::store::checkpoint_trim", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 975, "excerpt": "& format ! ( \"SELECT rowid, checkpoint FROM {table} ORDER BY rowid DESC LIMIT 1\" )"}, {"id": "lv-h52813697cfa2", "path": "crates/fractal-missions/src/store/resource_preparation/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "dc372daedd324b47f1261987900c1a08eff3ccdf253bfcf666d0ebecf17142ad", "owner": "fractal_missions::store::resource_preparation::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 56, "excerpt": "& store , | _ | ( )"}, {"id": "lv-h528549379644", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "f2d51c48f91998fdbe61280f810b31227aec31f5360f27b9d20a6a5e104501b0", "owner": "fractal_missions::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 3211, "excerpt": "DELETE FROM meta WHERE key='canonical_shared_projection_rules'"}, + {"id": "lv-h52b61956c36c", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "944de795e1c96b5afc4ab4efa4a713c1dedb427ce485b6979f8edef83eedcdc4", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 2238, "excerpt": "INSERT INTO assistant_grant_local_appends(claim_id) VALUES(?1)"}, {"id": "lv-h52d499a31337", "path": "crates/fractal-store/src/store/checkpoint_rules/staged.rs", "kind": "unresolved-sql-sink", "fingerprint": "e2f8cc1b2710f335398d7f16bff682f9fbd311ad26e922501dccd85c341d4631", "owner": "fractal_store::store::checkpoint_rules::staged", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 88, "excerpt": "[ members [ position ] . 0 ]"}, {"id": "lv-h530c819d8d97", "path": "crates/fractal-reconcile/src/reconcile.rs", "kind": "sql-template", "fingerprint": "a466c1bb6842b49c1d34a00a24fdcb27190d6711850fee20c555c3c6c8bfc672", "owner": "fractal_reconcile::reconcile", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 39169, "excerpt": "UPDATE claims SET accepted_at_unix_ms=?1 WHERE id=?2"}, {"id": "lv-h530faa15f55a", "path": "crates/fractal-delivery/src/store/unread_mail.rs", "kind": "sql-template", "fingerprint": "9fb93ece0c287435b75c1567d47d11f2e9f3d0890b2f386b80b3e2271135d5d3", "owner": "fractal_delivery::store::unread_mail", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 24, "excerpt": "INSERT INTO unread_mail(subject,sent_time) SELECT ?1,MAX(sent_time) FROM ( SELECT CAST(accepted_at_unix_ms AS INTEGER) AS sent_time FROM claims WHERE subject=?1 AND kind='message.sent' UNION ALL SELEC"}, @@ -2226,6 +2314,7 @@ {"id": "lv-h539605b8dc87", "path": "crates/fractal-seats/src/store/reconcile_work_context/tests.rs", "kind": "sql-template", "fingerprint": "b7093ef52ec236587ad92b3ec6b9bace117767da78b39099d57b71ee47728c18", "owner": "fractal_seats::store::reconcile_work_context::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 736, "excerpt": "UPDATE claims SET accepted_at_unix_ms=?2 WHERE subject=?1 AND kind='work.progress' AND json_extract(body,'$.fields.handoff_acknowledged') IS NOT NULL"}, {"id": "lv-h5397dfc4c7e7", "path": "crates/fractal-store/src/store/person_work.rs", "kind": "sql-template", "fingerprint": "51408d83b4a10d968e9fa11cf571cd379ee9b56c6590ded5502ec9c1f097a11f", "owner": "fractal_store::store::person_work", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 864, "excerpt": "UPDATE mission_definitions SET revision=?2, claim_id=?3 WHERE mission_id=?1"}, {"id": "lv-h53a01c6a0750", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "sql-template", "fingerprint": "87d1a5981f0f202e915e07ebc4ae1b385e116780a56c4c8745c8cc56f69605bc", "owner": "fractal_missions::store::missions", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 6493, "excerpt": "UPDATE step_runs SET status='pending', attempt=?2, goals=?3, worker_reported=0, lease_owner=NULL, lease_incarnation=NULL, lease_expires_at_unix_ms=NULL, blocked_reason=?4, not_before_unix_ms=NULL, act"}, + {"id": "lv-h53b6a1e0835c", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "2a6a2bca6a0f6e6aecadd7690330be1b551a03d1bf80a0a4734e5ccd07a1224e", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 697, "excerpt": "INSERT OR IGNORE INTO assistant_grant_recompute(claim_id) VALUES(?1)"}, {"id": "lv-h53c8fb7ca9fb", "path": "crates/fractal-store/src/store/publication_facts.rs", "kind": "unresolved-sql-sink", "fingerprint": "8edb630b01a1f78d4abc5ee08b714ce7a8578b35d2269aec45684bf19ac1e4fc", "owner": "fractal_store::store::publication_facts", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 240, "excerpt": "& query"}, {"id": "lv-h53cc4b4e8c5e", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "0d946e3360d7776f1595f83a545408ac9800ccd2985bba17242a18ec3e0b35d0", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 7898, "excerpt": "INSERT INTO meta(key,value) VALUES(?1,?2) ON CONFLICT(key) DO UPDATE SET value=excluded.value WHERE meta.value IS NOT excluded.value"}, {"id": "lv-h53f8f1472a60", "path": "crates/fractal-store/src/store/checkpoint_identity_reuse_tests.rs", "kind": "sql-template", "fingerprint": "2127b63e2ba0c0063034a2c5fed0a5c05426207b57aa10673d29283c2bc92112", "owner": "fractal_store::store::checkpoint_identity_reuse_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 343, "excerpt": "UPDATE replica_records SET state=?1 WHERE claim_id=?2"}, @@ -2236,6 +2325,7 @@ {"id": "lv-h5433629a009d", "path": "crates/fractal-store/src/store/run_eta.rs", "kind": "sql-template", "fingerprint": "ae4ac4c3f571e9cca21ffd70f0dcc4c7e78f07619f7533b8a61f3f2fbd226b34", "owner": "fractal_store::store::run_eta", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 209, "excerpt": "DELETE FROM local_run_eta_samples WHERE definition_hash=?1 AND step_path=?2 AND run_id NOT IN( SELECT run_id FROM local_run_eta_terminal WHERE definition_hash=?1 ORDER BY ended DESC,run_id DESC LIMIT "}, {"id": "lv-h544e4622b144", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "4ec7c53222c8a758c722e2111541035ce700d5ae7bd0898c5f1b1a743e6450fd", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 16850, "excerpt": "sql"}, {"id": "lv-h54522921c58d", "path": "crates/fractal-store/src/store/custom.rs", "kind": "unresolved-sql-sink", "fingerprint": "12ad020bc23a2da53bdcc6a3e7223d9b1fe90a2eca765091f1a0071f5a6237f2", "owner": "fractal_store::store::custom", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 280, "excerpt": "\"RELEASE custom_source\""}, + {"id": "lv-h54566dabc8dc", "path": "crates/smallclaims/src/store/assistant_grant_authority_bench.rs", "kind": "sql-template", "fingerprint": "03002bb3fc6e925e5e6dd1a5cbf5c1181fbf0c0d3623324bfdbbbe70d1d2cf17", "owner": "smallclaims::store::assistant_grant_authority_bench", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 381, "excerpt": "DROP TRIGGER IF EXISTS assistant_grant_dirty_insert; DELETE FROM assistant_grant_authority; DELETE FROM assistant_grant_effective; DELETE FROM assistant_grant_pending; DELETE FROM assistant_grant_dirt"}, {"id": "lv-h545c74fd49cf", "path": "crates/smallclaims/src/store/prepared_envelope.rs", "kind": "unresolved-sql-sink", "fingerprint": "7a2ab87159157f74c392aa9789d34d6823d79b91f067ba609c0b89eb32ca2be5", "owner": "smallclaims::store::prepared_envelope", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 549, "excerpt": "params ! [ envelope . writer , envelope . sequence , envelope . hash , if degraded { \"degraded\" } else { \"validated\" } , batch . id , ]"}, {"id": "lv-h5471ad779977", "path": "crates/fractal-store/src/store/ordered_membership.rs", "kind": "sql-template", "fingerprint": "4d781add2bc8675e6395fe47bdc46b2339699d4ba0844de9df077c4b309388d2", "owner": "fractal_store::store::ordered_membership", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 37, "excerpt": " CREATE TABLE IF NOT EXISTS ordered_membership_heads ( container TEXT NOT NULL, member TEXT NOT NULL, position TEXT, revision TEXT NOT NULL, winner BLOB NOT NULL, PRIMARY KEY(container,member) ); CREA"}, {"id": "lv-h54790f2be937", "path": "crates/smallclaims/src/ivm/install.rs", "kind": "unresolved-sql-sink", "fingerprint": "db83a5fa0aa3f80c5671d7d5bcb76fa67ef5274bc27f2349c484eb457d2d7b30", "owner": "smallclaims::ivm::install", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 450, "excerpt": "\"SAVEPOINT ivm_install_live\""}, @@ -2250,19 +2340,22 @@ {"id": "lv-h54dfbec0e2de", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "975de7f6c8f32a51cb05a18a8138dd0c37b63c82df9f197cb0fed20c14c224bf", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 18519, "excerpt": "params ! [ claim . subject , status , fields . get ( \"worker_reported\" ) . and_then ( Value : : as_bool ) . unwrap_or ( false ) , fields . get ( \"claimant\" ) . and_then ( Value : : as_str ) , fields ."}, {"id": "lv-h551e460e7382", "path": "crates/fractal-store/src/store/resources_preparation_tests.rs", "kind": "sql-template", "fingerprint": "da375a6ef935682d924483cbd6c26b9c32a0a576b639560d3ec18290cfd5125b", "owner": "fractal_store::store::resources_preparation_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 1042, "excerpt": "DELETE FROM claims WHERE id=?1"}, {"id": "lv-h5520c75fb611", "path": "crates/fractal-store/src/store/resources_preparation_tests.rs", "kind": "sql-template", "fingerprint": "da375a6ef935682d924483cbd6c26b9c32a0a576b639560d3ec18290cfd5125b", "owner": "fractal_store::store::resources_preparation_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 1404, "excerpt": "DELETE FROM claims WHERE id=?1"}, + {"id": "lv-h5520ddeb5d20", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "unresolved-sql-sink", "fingerprint": "735525e0a58519ab770592beb88cb50d15239ecddb919afbec52304acc2ee89c", "owner": "smallclaims::store::assistant_grant_authority", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 241, "excerpt": "[ id ] , claim_from_row"}, {"id": "lv-h5537ddf8da09", "path": "crates/fractal-store/src/store/resources_preparation_tests.rs", "kind": "sql-template", "fingerprint": "e821840e8d46483d38b7772c3b3dd8d941d38242cfe30aa4fdadebaf8e277b38", "owner": "fractal_store::store::resources_preparation_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 480, "excerpt": "UPDATE batches SET origin='example-common',replica_sequence=CASE WHEN id=(SELECT batch_id FROM claims WHERE id=?1) THEN 100 ELSE 1 END WHERE id IN (SELECT batch_id FROM claims WHERE id IN (?1,?2))"}, {"id": "lv-h554a3f319a10", "path": "crates/smallclaims/src/ivm/install/prepared.rs", "kind": "unresolved-sql-sink", "fingerprint": "2fba33b0cd5a1d1285ab55f8cbeb18658e2833e18dab5d5b1cdfa93bc181470d", "owner": "smallclaims::ivm::install::prepared", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 963, "excerpt": "\"RELEASE ivm_prepared_page\""}, {"id": "lv-h555bfa5aa4b3", "path": "crates/fractal-delivery/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "f651dfbd998ac732797c555666f9759e436f6e14d65a0373c119155eb8faa461", "owner": "fractal_delivery::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 191, "excerpt": "& format ! ( \"SELECT claims.body FROM claims INDEXED BY claims_subject_kind_accepted_index JOIN batches ON batches.id=claims.batch_id WHERE claims.subject=?1 AND claims.kind='runtime.observed' AND cla"}, {"id": "lv-h555d6ec0084c", "path": "crates/fractal-store/src/store/message_outbox.rs", "kind": "sql-template", "fingerprint": "91dc3637a77c85dbcca62657dd2040d88939fc875d701bc2f2ca30639abdf87b", "owner": "fractal_store::store::message_outbox", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 28, "excerpt": " CREATE TABLE IF NOT EXISTS local_message_outbox ( subject TEXT PRIMARY KEY, claim TEXT NOT NULL, queued_at_unix_ms INTEGER NOT NULL, attempts INTEGER NOT NULL DEFAULT 0, last_error TEXT ); CREATE IND"}, {"id": "lv-h5565b4adb53d", "path": "crates/smallclaims/src/store/events.rs", "kind": "sql-template", "fingerprint": "f852f66e72da8c87a5e616403c2447f60d34dfa5167920024b96f99037dc32aa", "owner": "smallclaims::store::events", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 45, "excerpt": "DROP VIEW events; CREATE VIEW events AS SELECT p.store_index,c.kind,p.subject,c.body FROM event_positions p CROSS JOIN claims c ON c.store_index=p.store_index UNION ALL SELECT p.store_index,c.kind,p.s"}, - {"id": "lv-h556b74d6044a", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "9579ec05a5dc2b199e9dbe717739274cad8dad7c65bb2a0360fad919917a01ac", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 8202, "excerpt": "INSERT INTO planning_sessions(id, mission_id, request_ref, workspace, requester, planner, planner_spec_json, status, target_run_id, source_generation_id, created_at_unix_ms, updated_at_unix_ms) VALUES"}, - {"id": "lv-h556d5f52a3a9", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "unresolved-sql-sink", "fingerprint": "7d788c02089938e7c87fdc6553c374064f435a2fbf0b04a56aef360b3e0bf7f0", "owner": "smallclaims::store::checkpoint_trim", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 978, "excerpt": "[ ] , | row | Ok ( ( row . get : : < _ , i64 > ( 0 ) ? , row . get : : < _ , String > ( 1 ) ? ) )"}, + {"id": "lv-h556b74d6044a", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "9579ec05a5dc2b199e9dbe717739274cad8dad7c65bb2a0360fad919917a01ac", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 7119, "excerpt": "INSERT INTO planning_sessions(id, mission_id, request_ref, workspace, requester, planner, planner_spec_json, status, target_run_id, source_generation_id, created_at_unix_ms, updated_at_unix_ms) VALUES"}, + {"id": "lv-h556bdadaf8cd", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "unresolved-sql-sink", "fingerprint": "4a1d7a0df6f881609532183c9937f12f48f2a7697a30524a292e2c4131164d9a", "owner": "smallclaims::store::assistant_grant_authority", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 169, "excerpt": "CANDIDATES_QUERY"}, + {"id": "lv-h556d5f52a3a9", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "unresolved-sql-sink", "fingerprint": "7d788c02089938e7c87fdc6553c374064f435a2fbf0b04a56aef360b3e0bf7f0", "owner": "smallclaims::store::checkpoint_trim", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 620, "excerpt": "[ ] , | row | Ok ( ( row . get : : < _ , i64 > ( 0 ) ? , row . get : : < _ , String > ( 1 ) ? ) )"}, {"id": "lv-h5574f8672a86", "path": "crates/fractal-missions/src/store/operations.rs", "kind": "sql-template", "fingerprint": "a4240e1e69cc045aa71479d5607e94d0ceb68ed08adf51e20a11f8c826275e9a", "owner": "fractal_missions::store::operations", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 65, "excerpt": "INSERT INTO run_generations SELECT ?1,?2,revision,NULL,?3,actor,reason,?4,?4 FROM run_generations WHERE id=?5"}, {"id": "lv-h557fd2adb2ea", "path": "crates/fractal-drivers/src/harness_events.rs", "kind": "sql-template", "fingerprint": "2d8265c85563eeb6058a43315b73eb3a50be80407ccb2d92108379464a3f4aa8", "owner": "fractal_drivers::harness_events", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 327, "excerpt": "UPDATE metadata SET value=?1 WHERE key='pending-bytes'"}, {"id": "lv-h55886ab30a77", "path": "crates/fractal/src/main_tests.rs", "kind": "included-source", "fingerprint": "13cb10534495e09e990241a61c02dd7b78b38a4a45569fcf2f51e955ef40ea52", "owner": "fractal::main_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1105, "excerpt": "include_str ! ( \"../../../fixtures/clients/transcripts/claude.json\" )"}, {"id": "lv-h559613f164ef", "path": "crates/smallclaims/src/ivm/install/prepared.rs", "kind": "sql-template", "fingerprint": "c8d661b5261bd3d0b383515eda13bb8be58a2f4e59a49a51b18d3c4d61cc6baf", "owner": "smallclaims::ivm::install::prepared", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 685, "excerpt": "INSERT INTO ivm_install_deferred(source,row_limit,byte_limit,reference_limit) VALUES(?1,?2,?3,?4)"}, {"id": "lv-h55ab9de796f8", "path": "crates/fractal-store/src/store/mission_capacity.rs", "kind": "unresolved-sql-sink", "fingerprint": "80763cd993a551aed46eaee6efb4eacdc6059e75b8f5e8d4aed0c63963810057", "owner": "fractal_store::store::mission_capacity", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 97, "excerpt": "& writer_seek ( table , column )"}, {"id": "lv-h55b982191075", "path": "crates/smallclaims/src/store/checkpoint_trim/pacing_tests.rs", "kind": "sql-template", "fingerprint": "2a8c02186f0770ea12146438c6cf90067771de2bfc588fc04164691922a69cae", "owner": "smallclaims::store::checkpoint_trim::pacing_tests", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 235, "excerpt": "INSERT INTO checkpoint_claims VALUES(printf('old-%05d', ?1), NULL, 'w', ?1, 'h', 'checkpoint/old')"}, + {"id": "lv-h55ce404e22db", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "56f42516a36acf4b353cebb5a78491d9b9f5306707349b9a7e7613599e8ad34b", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 310, "excerpt": "DELETE FROM replica_envelope_signatures WHERE member_key=?1"}, {"id": "lv-h55d772135256", "path": "crates/fractal-delivery/src/store/conversation_reads.rs", "kind": "unresolved-sql-sink", "fingerprint": "3e19e42eabcf286a498d487dc78ff98fd9454d9df38553338582c5c05d19174a", "owner": "fractal_delivery::store::conversation_reads", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 389, "excerpt": "ASSISTANT_OWNER_IDS_PAGE"}, {"id": "lv-h55e08ce4e425", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "f6904482bb1629bf72aa830970582c37fc53dd9d2ce514599ba98ef615600ac7", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 270, "excerpt": "UPDATE batches SET replica_sequence=4"}, {"id": "lv-h560fff892c9b", "path": "crates/smallclaims/src/sqlite/read_lifetime/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "b9283c516994655464005fe7fa6a76668a5882d422a5e887edfcec25ae8624ae", "owner": "smallclaims::sqlite::read_lifetime::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 121, "excerpt": "\"BEGIN; SELECT * FROM payload\""}, @@ -2270,7 +2363,9 @@ {"id": "lv-h563f317eb739", "path": "crates/fractal-store/src/store/operation_audit.rs", "kind": "unresolved-sql-sink", "fingerprint": "e48d386ca27e6c36fac89a15a4fcda92c97995f249aa5bf31ba0f9ace0dc3961", "owner": "fractal_store::store::operation_audit", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 258, "excerpt": "[ & id ] , | row | row . get ( 0 )"}, {"id": "lv-h5650237ff33b", "path": "crates/fractal-store/src/store/attention_ivm/tests_shared_seats.rs", "kind": "included-source", "fingerprint": "5d604bf3342897bb94342ddbdbe8296d87ee778849bee124dd73f3c81b8f6a26", "owner": "fractal_store::store::attention_ivm::tests_shared_seats", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 51, "excerpt": "include_str ! ( \"../../../../../examples/fractal/custom-review.json\" )"}, {"id": "lv-h5650ece9d11e", "path": "crates/fractal-store/src/store/desired_progress.rs", "kind": "sql-template", "fingerprint": "485c30aac84fe081f32b44b6c400b91e53bb483d019bc463da9338a7a4e1b896", "owner": "fractal_store::store::desired_progress", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 38, "excerpt": "INSERT OR IGNORE INTO local_desired_write_witness(id,generation) VALUES(1,0)"}, + {"id": "lv-h565adf25d451", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "86c59fd12ece5c0b860d1913f64dfee1d977dad0041bd1a6dd5fe75b0380c495", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 753, "excerpt": "query , params ! [ grant . origin , sequence , hash , last ]"}, {"id": "lv-h56821e2a865f", "path": "crates/smallclaims/src/store/principals.rs", "kind": "sql-template", "fingerprint": "b3111e9f9516e1403b057a280375d5c3bf01b2305cf22420b7c18239a0a7fd84", "owner": "smallclaims::store::principals", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 33, "excerpt": " CREATE TABLE IF NOT EXISTS claim_signatures ( claim_id TEXT PRIMARY KEY, signer TEXT NOT NULL, key TEXT NOT NULL, nonce TEXT NOT NULL, signature TEXT NOT NULL ); -- The legacy nonce index remains wit"}, + {"id": "lv-h568eec89a376", "path": "crates/fractal-api-core/src/api/tests.rs", "kind": "sql-template", "fingerprint": "158fcc8a1a488a049383972f27fcd95d3effbd0c37289d0c0833d4a49a6680b0", "owner": "fractal_api_core::api::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1216, "excerpt": "INSERT INTO assistant_grant_pending (claim_id,grant_subject,kind,origin,actor,sequence,authenticated,record) VALUES(?1,?1,?2,?3,'person/operator',1,?4,'{}')"}, {"id": "lv-h56998952aeb4", "path": "crates/fractal-api-client-v0/src/api/client_v0/observer_subscription_detail_tests.rs", "kind": "sql-template", "fingerprint": "51e9bf1b13035d939ef4da081a290a1e2de3ead08d516248b1d634445bbe4b87", "owner": "fractal_api_client_v0::api::client_v0::observer_subscription_detail_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 747, "excerpt": "INSERT INTO desired SELECT 'detail/watch/source',kind,revision,claim_id,?2,NULL,NULL,NULL,NULL FROM desired WHERE subject=?1"}, {"id": "lv-h569a833c55b3", "path": "crates/fractal-seats/src/store/usage_period.rs", "kind": "unresolved-sql-sink", "fingerprint": "acdaf8bd3b815535046858d25ab374d72f65c7e4bea1948f5dcd472c02624e7d", "owner": "fractal_seats::store::usage_period", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 35, "excerpt": "[ & previous ] , | row | row . get : : < _ , String > ( 0 )"}, {"id": "lv-h56a3a258cc3e", "path": "crates/fractal-store/src/store/refresh.rs", "kind": "unresolved-sql-sink", "fingerprint": "c5ebca3e19c90b7416e3ff5dbda229e07470bd237423032c1b1bfd00b9d8ab4e", "owner": "fractal_store::store::refresh", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 120, "excerpt": "& sql , params ! [ seat , incumbent ] , | r | r . get : : < _ , String > ( 0 )"}, @@ -2293,18 +2388,20 @@ {"id": "lv-h57ca7f8e343f", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "c02a8adcef8d49cf050f713126cca2d7018512867e919a0b1a8d6cadf8363cc8", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 4466, "excerpt": "INSERT INTO meta(key, value) VALUES ('fleet_hears_seats', ?1) ON CONFLICT(key) DO UPDATE SET value=excluded.value"}, {"id": "lv-h57caa6e1f61e", "path": "crates/smallclaims/src/store/principals.rs", "kind": "sql-template", "fingerprint": "a067a6492235dd51352180de416eaa60e26e59d1f3e1feed338871ce03f9510e", "owner": "smallclaims::store::principals", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1261, "excerpt": "DELETE FROM expected_claim_signatures WHERE subject=?1 AND kind=?2 AND actor=?3"}, {"id": "lv-h57d4b7e88d2d", "path": "crates/fractal-api-mailbox/src/api/mailbox/replay_proof_tests.rs", "kind": "sql-template", "fingerprint": "4ea80321fb8b0f59644af0b3a3b170851fae201761ccac51a48b832f75a49dec", "owner": "fractal_api_mailbox::api::mailbox::replay_proof_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 230, "excerpt": "UPDATE local_mailbox_leases SET revoked=1 WHERE subject=?1 AND component=?2"}, + {"id": "lv-h57db182d0631", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "unresolved-sql-sink", "fingerprint": "151dc279004633afa04c8cd2c59e02a3bac719edfbed08b280c8c4adab1cd7ae", "owner": "smallclaims::store::assistant_grant_authority", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 214, "excerpt": "\"RELEASE assistant_grant_upgrade\""}, {"id": "lv-h57e18e349b67", "path": "crates/fractal-reconcile/src/reconcile/tests/ownership_guard_tests.rs", "kind": "sql-template", "fingerprint": "5005709ba5f6cabc5fde79f02aad13ab8f39f97edbbad4167c2bbc720a123bfa", "owner": "fractal_reconcile::reconcile::tests::ownership_guard_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 369, "excerpt": "UPDATE claims SET accepted_at_unix_ms='invalid' WHERE id=?1"}, {"id": "lv-h57e9ffb917c9", "path": "crates/fractal-attention/src/store/summary_list.rs", "kind": "unresolved-sql-sink", "fingerprint": "bbfac8f07b9a24bc278443aa0d496ef7bbd0019ed35cee7698f44b358102850e", "owner": "fractal_attention::store::summary_list", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 254, "excerpt": "[ ] , | row | row . get ( 0 )"}, {"id": "lv-h57ee6fe04659", "path": "crates/fractal-store/src/store/run_eta.rs", "kind": "sql-template", "fingerprint": "8677222b6d8ad34a66eb7c9c9136762493e97d542b4cb7826d649ddcd17a84e2", "owner": "fractal_store::store::run_eta", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 216, "excerpt": "DELETE FROM local_run_eta_pending"}, {"id": "lv-h57f7065baf33", "path": "crates/fractal-api-core/src/api/tests.rs", "kind": "sql-template", "fingerprint": "2518538cec97d58c75b44207e845723ca0ce101b4a8ee4a02a853dadcf160618", "owner": "fractal_api_core::api::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 10849, "excerpt": "UPDATE claims SET origin='zz-card-tie' WHERE batch_id=?1"}, {"id": "lv-h57fc663f7b3b", "path": "crates/smallclaims/src/store/retired.rs", "kind": "unresolved-sql-sink", "fingerprint": "b7eafcbb01a79e6feb02839905b41bafc8a5be2f355d21ab6b4b392a34092eac", "owner": "smallclaims::store::retired", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 120, "excerpt": "& QUERY"}, {"id": "lv-h5807a1101987", "path": "crates/fractal-store/src/store/completion_state.rs", "kind": "sql-template", "fingerprint": "6fbf81728b4e78bfb022ed799c80fd7cfdbfe883d04304f7ef9d6cf20ed6f3ab", "owner": "fractal_store::store::completion_state", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 227, "excerpt": "DELETE FROM local_completion_health_v1_claims WHERE claim_id=?1"}, - {"id": "lv-h580eec954622", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "ca00bf71e63d7a44fcc9d8aa75ce4f583d9c760665a19ab32e0ffe0b2945c035", "owner": "fractal_store::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 7726, "excerpt": "UPDATE mission_runs SET status='completed' WHERE id='run-example'"}, - {"id": "lv-h581d2d15b664", "path": "crates/fractal-store/src/store/idle_mail.rs", "kind": "sql-template", "fingerprint": "f04f1cbf586659252f3d0a49923faed45656a176d5e31210a9e3ba31a598ab46", "owner": "fractal_store::store::idle_mail", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 185, "excerpt": "INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) VALUES(?1,?2,?3,?4,'fixture',NULL,?5,'[]',?6)"}, - {"id": "lv-h582a34b5ce55", "path": "crates/fractal-store/src/store/ordered_membership.rs", "kind": "sql-template", "fingerprint": "00588d4f2313b213bcf242af52810c444d9e1479f3b8ff9884fde92ac7118037", "owner": "fractal_store::store::ordered_membership", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 396, "excerpt": "INSERT OR IGNORE INTO declared_resource_edges(owner,relation,name,target) VALUES(?1,'ordered-membership',?2,?2)"}, - {"id": "lv-h582aabe243d0", "path": "crates/fractal-missions/src/store/person_work.rs", "kind": "unresolved-sql-sink", "fingerprint": "8612167e28c162a2fee1c63ec4be5673bd9fd8221b3cf742ed8f17fa613dcd17", "owner": "fractal_missions::store::person_work", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 764, "excerpt": "\"SAVEPOINT tell_ask_ended\""}, - {"id": "lv-h582e5366bbee", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "b9583a3b1a1be6db59892cb754cd0fcfb1ec702b7fe72b60bdd18505b2bab00a", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1030, "excerpt": "[ REQUEUE , REQUEUE_END ] , | row | { Ok ( ( row . get : : < _ , String > ( 0 ) ? , row . get : : < _ , String > ( 1 ) ? ) ) }"}, - {"id": "lv-h5875e9ada089", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "sql-template", "fingerprint": "627eda53cc88d7f63369cbb91ad498d99ecf3efd50f35801b24d13b5746be475", "owner": "smallclaims::store::checkpoint_trim", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 941, "excerpt": "DELETE FROM checkpoint_envelopes"}, + {"id": "lv-h580eec954622", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "ca00bf71e63d7a44fcc9d8aa75ce4f583d9c760665a19ab32e0ffe0b2945c035", "owner": "fractal_store::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 7172, "excerpt": "UPDATE mission_runs SET status='completed' WHERE id='run-example'"}, + {"id": "lv-h581d2d15b664", "path": "crates/fractal-store/src/store/idle_mail.rs", "kind": "sql-template", "fingerprint": "f04f1cbf586659252f3d0a49923faed45656a176d5e31210a9e3ba31a598ab46", "owner": "fractal_store::store::idle_mail", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 171, "excerpt": "INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) VALUES(?1,?2,?3,?4,'fixture',NULL,?5,'[]',?6)"}, + {"id": "lv-h5820156720c0", "path": "crates/smallclaims/src/store/assistant_grant_authority_bench.rs", "kind": "unresolved-sql-sink", "fingerprint": "59b4dbf78175f7e6e792032a53e966a89a0afa9d605487128e54573600011c83", "owner": "smallclaims::store::assistant_grant_authority_bench", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 238, "excerpt": "params ! [ id , format ! ( \"batch/{LOCAL}/{sequence:064x}\" ) , format ! ( \"conversation/synthetic/{:08x}\" , row % 1 0 0 _000 ) , format ! ( \"synthetic.message.kind{}\" , row % 1 6 ) , LOCAL , \"person/perf-operator\""}, + {"id": "lv-h582a34b5ce55", "path": "crates/fractal-store/src/store/ordered_membership.rs", "kind": "sql-template", "fingerprint": "00588d4f2313b213bcf242af52810c444d9e1479f3b8ff9884fde92ac7118037", "owner": "fractal_store::store::ordered_membership", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 265, "excerpt": "INSERT OR IGNORE INTO declared_resource_edges(owner,relation,name,target) VALUES(?1,'ordered-membership',?2,?2)"}, + {"id": "lv-h582aabe243d0", "path": "crates/fractal-missions/src/store/person_work.rs", "kind": "unresolved-sql-sink", "fingerprint": "8612167e28c162a2fee1c63ec4be5673bd9fd8221b3cf742ed8f17fa613dcd17", "owner": "fractal_missions::store::person_work", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 569, "excerpt": "\"SAVEPOINT tell_ask_ended\""}, + {"id": "lv-h582e5366bbee", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "b9583a3b1a1be6db59892cb754cd0fcfb1ec702b7fe72b60bdd18505b2bab00a", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1054, "excerpt": "[ REQUEUE , REQUEUE_END ] , | row | { Ok ( ( row . get : : < _ , String > ( 0 ) ? , row . get : : < _ , String > ( 1 ) ? ) ) }"}, + {"id": "lv-h5875e9ada089", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "sql-template", "fingerprint": "627eda53cc88d7f63369cbb91ad498d99ecf3efd50f35801b24d13b5746be475", "owner": "smallclaims::store::checkpoint_trim", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 583, "excerpt": "DELETE FROM checkpoint_envelopes"}, {"id": "lv-h5880045ca4a3", "path": "crates/fractal-seats/src/store/stop_deferral.rs", "kind": "sql-template", "fingerprint": "c016a9e29e34161afb705f3f6d8b193d611b76ba836bfac5148aaf82e627c9ab", "owner": "fractal_seats::store::stop_deferral", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 106, "excerpt": "UPDATE local_stop_deferral_backfill SET complete=1 WHERE singleton=1"}, {"id": "lv-h58850df68114", "path": "crates/fractal-missions/src/store/operations.rs", "kind": "sql-template", "fingerprint": "60b9537b32e1a110f494ed8cdacd4f700cb1e1cb15fdcf0a7d860f3428d6e3bb", "owner": "fractal_missions::store::operations", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 48, "excerpt": "WITH RECURSIVE seq(n) AS (VALUES(0) UNION ALL SELECT n+1 FROM seq WHERE n<249999) INSERT INTO claims(id,batch_id,subject,kind,origin,body,predecessors,accepted_at_unix_ms) SELECT 'fixture-heartbeat-' "}, {"id": "lv-h588570f9435e", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "086466319522c51cebce6be6b3915dc9f3f246e6bad15787e405512a1dd6d05b", "owner": "fractal_missions::store::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 6766, "excerpt": "UPDATE claims SET body=json_extract(body,'$.fields') WHERE id=?1"}, @@ -2332,6 +2429,7 @@ {"id": "lv-h5a2bf49b2f3f", "path": "crates/smallclaims/src/store/principals/judging.rs", "kind": "unresolved-sql-sink", "fingerprint": "d709c4b53198c61961b802ca03f38a23581d22fd1bf987e8b7f03393be1b2d50", "owner": "smallclaims::store::principals::judging", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 16, "excerpt": "[ claim_id ] , | row | row . get ( 0 )"}, {"id": "lv-h5a3089cd7513", "path": "crates/fractal-store/src/store/message_marks.rs", "kind": "unresolved-sql-sink", "fingerprint": "bbfac8f07b9a24bc278443aa0d496ef7bbd0019ed35cee7698f44b358102850e", "owner": "fractal_store::store::message_marks", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 40, "excerpt": "[ ] , | row | row . get ( 0 )"}, {"id": "lv-h5a3d29781577", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "8c48a6dcfa06487103b62cf1fa6a87f5a79dc91b4660d687cf65cb5ca5679218", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 9337, "excerpt": "& canonical_sql ( \"WITH RECURSIVE pairs(id) AS ( SELECT (SELECT id FROM claims INDEXED BY claims_transport_pair_accepted_index WHERE kind='transport.observed' ORDER BY origin, subject LIMIT 1) UNION A"}, + {"id": "lv-h5a430ec6f457", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "f976829d92148bf8272636fa56bba04a4f9d9e930e4c6ac48b48a3be13a46258", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1124, "excerpt": "DELETE FROM assistant_grant_proof_rechecks WHERE claim_id=?1"}, {"id": "lv-h5a47c2ff7e59", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "unresolved-sql-sink", "fingerprint": "a2fc0ae6abe631f978a0979e040a1aa21894fdadcced4e72c0b5ea24c538ddad", "owner": "fractal_store::store::client_messages", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1458, "excerpt": "& SQL [ flags ]"}, {"id": "lv-h5a7af5d0161f", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "unresolved-sql-sink", "fingerprint": "3b691426c38c73cbdb64b8aca2b74b9dda8dbada750f6e3524d4df22717e0d32", "owner": "smallclaims::store::checkpoint", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 369, "excerpt": "params ! [ claim . id , claim . writer , claim . sequence , claim . envelope_hash , claim . subject , claim . kind , claim . actor , serde_json : : to_string ( & claim . predecessors ) ? , claim . ope"}, {"id": "lv-h5a7c3523223f", "path": "crates/fractal-store/src/store/unread_mail.rs", "kind": "sql-template", "fingerprint": "051d3516e53dac393a02410b69c8b1a1b9faca05199ca2041bbf58331a540b8b", "owner": "fractal_store::store::unread_mail", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 129, "excerpt": "BEGIN IMMEDIATE; INSERT OR IGNORE INTO unread_mail_pending SELECT subject FROM claims WHERE kind='message.expired' AND NOT EXISTS(SELECT 1 FROM meta WHERE key='unread_mail_expiry_v1'); INSERT OR IGNOR"}, @@ -2343,8 +2441,10 @@ {"id": "lv-h5aa1a59c488d", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "unresolved-sql-sink", "fingerprint": "67cf329b80311436016b141759b112fb9d33d964792c288e3797e56929f9d6d1", "owner": "fractal_missions::store::missions", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6867, "excerpt": "& canonical_sql ( \"SELECT subject, body FROM claims WHERE kind='gate.requested' ORDER BY CANONICAL_ASC(claims)\" ) ,"}, {"id": "lv-h5ac6de1e48b8", "path": "crates/smallclaims/src/store/sealed_view_cache_tests.rs", "kind": "sql-template", "fingerprint": "309875e8abb2bc3a99eb38ecee4c711cb76b3289ec093bfbbc7fb20330b57bac", "owner": "smallclaims::store::sealed_view_cache_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 271, "excerpt": "DELETE FROM replica_envelope_signatures"}, {"id": "lv-h5ae1a1555425", "path": "crates/fractal-missions/src/store/mission_deadline_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "c32b884bb11aa9d33ad9fa5b6cbd7b18be6b5eec40e5397aa0319a5e4069ab0d", "owner": "fractal_missions::store::mission_deadline_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 141, "excerpt": "& sql"}, + {"id": "lv-h5ae439b456a4", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "feeec80c30f5e98c34bf8a879c095fbe8dbe58b1793d3d932c4ef9ef1291999d", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1514, "excerpt": "INSERT INTO assistant_grant_auth_cursor(claim_id,position,record_rowid,member_key,membership_start) VALUES(?1,0,0,'',-1) ON CONFLICT(claim_id) DO UPDATE SET position=excluded.position"}, {"id": "lv-h5b19d7ca2c85", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "81aac1fdc169fa86ee4a282c92df78e5deec4a5ff888bac4b24bc67498f23a03", "owner": "fractal_store::store::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 12145, "excerpt": "INSERT INTO claims VALUES ('elsewhere','agent/other','runtime.observed','batch-0',0,'10');"}, {"id": "lv-h5b1deaae5407", "path": "crates/smallclaims/src/store/projection_digest.rs", "kind": "sql-template", "fingerprint": "1e58abafbb3c151d36153319e26d883dcf6426432da7a1553659b825ac4b41bc", "owner": "smallclaims::store::projection_digest", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 169, "excerpt": "INSERT OR IGNORE INTO projection_digest_repaired_claims SELECT claim_id FROM replica_records WHERE state='repaired' AND claim_id IS NOT NULL"}, + {"id": "lv-h5b218f4cabfc", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "10cf05c638722ad015a484ba891ef3d3febce5eefb1f1b8f14825f8269945baf", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1395, "excerpt": "INSERT INTO assistant_grant_auth_cursor(claim_id,position,record_rowid,member_key,membership_start) VALUES(?1,0,0,'',-1)"}, {"id": "lv-h5b27b5de7324", "path": "crates/fractal-store/src/store/completion_state_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "2b1ca20287bcbd4d6d75c4b9dddc74ef035ee17d479873591fecb3effe6dbdd9", "owner": "fractal_store::store::completion_state_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 140, "excerpt": "\"ROLLBACK TO earlier_job; RELEASE earlier_job\""}, {"id": "lv-h5b2db7e3d25f", "path": "crates/smallclaims/src/store/principals/migration.rs", "kind": "unresolved-sql-sink", "fingerprint": "861ae77d8b9421fa21c0de36fb94ae80d2b589f44a1eb28e3ee97f385d319402", "owner": "smallclaims::store::principals::migration", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 455, "excerpt": "[ claim_id ]"}, {"id": "lv-h5b482972265f", "path": "crates/fractal-store/src/store/publication_facts.rs", "kind": "sql-template", "fingerprint": "ae281034c280771a8a9b1608917f1480d250c020a84f2cf9b7b6b279cf9ba9de", "owner": "fractal_store::store::publication_facts", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 256, "excerpt": "DELETE FROM local_publication_claims WHERE claim_id=?1"}, @@ -2386,6 +2486,7 @@ {"id": "lv-h5dd63243d1c3", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "ffdf4552f99f8614d5b7ba5772b8a8412f6a45370fbc2b59e4e4e4436ca9551b", "owner": "fractal_store::store", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 17643, "excerpt": "INSERT OR IGNORE INTO event_positions(store_index, subject) SELECT claims.store_index, claims.subject FROM claims JOIN batches ON batches.id=claims.batch_id WHERE substr(claims.subject,1,6) <> 'glass/"}, {"id": "lv-h5dd7f2a9d8fe", "path": "crates/fractal-store/src/store/terminal_gate_evidence/native_source_shared.rs", "kind": "unresolved-sql-sink", "fingerprint": "c43363e364d5d0e1ee497649c1f1914eca5616ab2cdbd94772221d967ad7770b", "owner": "fractal_store::store::terminal_gate_evidence::native_source_shared", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 185, "excerpt": "& format ! ( \"SELECT EXISTS(SELECT 1 FROM {table} LIMIT 1)\" ) , [ ] , | r | r . get ( 0 ) ,"}, {"id": "lv-h5decb1ae5ee8", "path": "crates/fractal-store/src/store/stream_mirror.rs", "kind": "unresolved-sql-sink", "fingerprint": "b96f0ba5a14a9f8f22d97b7c0ca55a1bd50026c0d0517a887f3d1b7f3970dc5f", "owner": "fractal_store::store::stream_mirror", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 189, "excerpt": "params ! [ subject , kind ]"}, + {"id": "lv-h5df4dd1dd74d", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "dd0c7deb5dada5c5d36e19fd90f3d892ea19520fab905459c1fb22bad04177e9", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 1439, "excerpt": "UPDATE assistant_grant_pending SET auth_member_key='lost-key',auth_sequence=7, auth_envelope_hash='proof' WHERE claim_id=?1"}, {"id": "lv-h5df984645a4b", "path": "crates/fractal-store/src/store/attention_ivm.rs", "kind": "sql-template", "fingerprint": "5f7a93a411aed8059de614d06891d3a6d270ded078a9484cda9868b817773ce4", "owner": "fractal_store::store::attention_ivm", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 172, "excerpt": "INSERT INTO local_attention_open VALUES(?1,?2,?3,?4,?5,?6,?7,?8,?9,?10) ON CONFLICT(family,source) DO UPDATE SET id=excluded.id,person=excluded.person, priority=excluded.priority,requested=excluded.re"}, {"id": "lv-h5e1685ffb0b5", "path": "crates/fractal-seats/src/store/reconcile_work_context/tests.rs", "kind": "sql-template", "fingerprint": "7501569747653ae5c630b4ad8576011b51d2687d91cfb7765a71c42d6c62caf5", "owner": "fractal_seats::store::reconcile_work_context::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 637, "excerpt": "UPDATE mission_revisions SET body=?1"}, {"id": "lv-h5e1e6fd8e43d", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "0d946e3360d7776f1595f83a545408ac9800ccd2985bba17242a18ec3e0b35d0", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 7913, "excerpt": "INSERT INTO meta(key,value) VALUES(?1,?2) ON CONFLICT(key) DO UPDATE SET value=excluded.value WHERE meta.value IS NOT excluded.value"}, @@ -2396,6 +2497,7 @@ {"id": "lv-h5e75fd4c4579", "path": "crates/smallclaims/src/ivm/install/prepared.rs", "kind": "sql-template", "fingerprint": "392acd084b2c65665943da6f49efbde3ae130f7490c71554e86467f1c0ec8b39", "owner": "smallclaims::ivm::install::prepared", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1067, "excerpt": "UPDATE ivm_install_roots SET revision=?2,generation=generation+?3 WHERE view=?1"}, {"id": "lv-h5e7d6e0f3a53", "path": "crates/fractal-store/src/store/deploy.rs", "kind": "unresolved-sql-sink", "fingerprint": "22311012fd18ee17629444104fd9e949c37818f82f7e90c4c6ea5d51c4e66a8a", "owner": "fractal_store::store::deploy", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 166, "excerpt": "& format ! ( \"SELECT id,kind FROM claims WHERE kind IN ('deploy.go-revoked','deploy.go-consumed','deploy.stop','deploy.stop-lifted') AND {UNREPAIRED_CLAIM} AND {UNREPAIRED_REPLICA} ORDER BY store_inde"}, {"id": "lv-h5e880ba8c383", "path": "crates/smallclaims/src/sqlite/writer_queue/tests.rs", "kind": "sql-template", "fingerprint": "be1a79b2b53ab6704f858727b653dba8af64ab748c34c3196ff0993c16ae40f0", "owner": "smallclaims::sqlite::writer_queue::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 351, "excerpt": "INSERT INTO values_ VALUES(2)"}, + {"id": "lv-h5e92793f2a03", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "6df3f8a428f79b7d59f412d962358090ad9f4300d8885961bd1604e4a87bfe8a", "owner": "smallclaims::store::assistant_grant_authority", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 670, "excerpt": "INSERT INTO assistant_grant_pending(claim_id,grant_subject,kind,origin,actor,sequence,authenticated,record,auth_member_key,auth_sequence,auth_envelope_hash,auth_record_position) VALUES(?1,?2,?3,?4,?5,"}, {"id": "lv-h5e9f5342baeb", "path": "crates/fractal-store/src/store/attention_budget.rs", "kind": "unresolved-sql-sink", "fingerprint": "4d9af0aa3b15ccf2041ce9a1015c22ccf0ede53bfe9f6b94c332affecb109dce", "owner": "fractal_store::store::attention_budget", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 61, "excerpt": "SUBJECTS"}, {"id": "lv-h5ec717f01a51", "path": "crates/fractal-missions/src/store/fleet_admission_tests.rs", "kind": "sql-template", "fingerprint": "6a68ff3e0e6e966a770a3e83ea3444926f7171b7b6d16ab41254c18340d05723", "owner": "fractal_missions::store::fleet_admission_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 254, "excerpt": "INSERT INTO projection_digest_repaired_claims VALUES (?1)"}, {"id": "lv-h5ece9b814a1a", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "unresolved-sql-sink", "fingerprint": "748cfd77783503db1528097737215128cac87f05c7c3f6ea7f5173ca69c7585c", "owner": "smallclaims::store::checkpoint_trim", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1348, "excerpt": "params ! [ LOCAL_TRIM_DAY , format ! ( \"{day} {today}\" ) ]"}, @@ -2421,22 +2523,23 @@ {"id": "lv-h5fd641b09aae", "path": "crates/fractal-store/src/store/backup_ledgers.rs", "kind": "sql-template", "fingerprint": "da652757338d5655968896b0175df8dc2eed9692db9ba27a8991e527faacbaeb", "owner": "fractal_store::store::backup_ledgers", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 81, "excerpt": "INSERT OR IGNORE INTO retired_envelope_withdrawals(writer, sequence, envelope_hash, \\ checkpoint) VALUES ({0}, {1}, {2}, {3})"}, {"id": "lv-h5fd695e5b9b0", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "unresolved-sql-sink", "fingerprint": "018842dbda78636acc5fcdc36fd5a67092599daa2359c2d5ad1b38011f3fb01d", "owner": "smallclaims::store::checkpoint_staging", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 871, "excerpt": "[ id ]"}, {"id": "lv-h60004b3e2fdd", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "adab68243721b84b1cb0eaea18117f2df06d61e831e008f985bb6ad17f7d4b3f", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 2666, "excerpt": "INSERT INTO mission_run_deadlines(run_id, timeout_ms, deadline_at_unix_ms) VALUES (?1, ?2, ?3)"}, + {"id": "lv-h6007bc2d61c3", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "097aabaa61c7ce4ea45d958ff5e773a47082373f30f013a910a8183bf88d8307", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 314, "excerpt": "UPDATE batches SET origin=?2,replica_sequence=?3 WHERE id=?1"}, {"id": "lv-h600fa9139184", "path": "crates/fractal/src/onboarding.rs", "kind": "included-source", "fingerprint": "788325d61d7523cc582d8122572cb35ef47c50a6f270be590990b0f9ab5d99f0", "owner": "fractal::onboarding", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 21, "excerpt": "include_str ! ( \"builtins/assistant.kdl\" )"}, {"id": "lv-h601898e1e0ad", "path": "crates/smallclaims/src/store/schema_install_tests.rs", "kind": "sql-template", "fingerprint": "ece12f7f753708a7403da88f922c9be0036b98f0b240cc7ded2c03f6a4813388", "owner": "smallclaims::store::schema_install_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 351, "excerpt": "INSERT INTO meta VALUES('fixture','preserved')"}, {"id": "lv-h602112ce8703", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "unresolved-sql-sink", "fingerprint": "b483328b9c557f0e72710de93cd41c3f2ddf18097b08be732c22f42be133659f", "owner": "smallclaims::store::checkpoint_trim", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 300, "excerpt": "params ! [ envelope . writer , envelope . sequence , envelope . envelope_hash ]"}, {"id": "lv-h602ae8440172", "path": "crates/fractal-store/src/store/terminal_gate_evidence.rs", "kind": "sql-template", "fingerprint": "111e28bb976605e0c9568cb209f5b916822981c6709883f6902b2df8c8ab696d", "owner": "fractal_store::store::terminal_gate_evidence", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 279, "excerpt": "INSERT INTO test_terminal_meta(namespace,members) VALUES(?1,0)"}, {"id": "lv-h60330cf01093", "path": "crates/smallclaims/src/store/sealed_view_cache_tests/mutation_tests.rs", "kind": "sql-template", "fingerprint": "2aad8d453e29bf5117521b91c6ae82765aa5f7a40737faddcda2a5b664ed1a53", "owner": "smallclaims::store::sealed_view_cache_tests::mutation_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 271, "excerpt": "UPDATE claims SET subject='host/different-anchor' WHERE kind='fleet.member-admitted'"}, {"id": "lv-h603ade762e9a", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "d9bfc1ef4aa87a4587ed7ee5c7304a2c9cf550178acee6b0150da8b46002a8e9", "owner": "smallclaims::store::membership_query_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 269, "excerpt": "UPDATE claims SET id='renamed'"}, - {"id": "lv-h60426679c653", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "sql-template", "fingerprint": "b878061375778ef4bcc631bb1a55ae17b19a27651048b32cf98a97aa448e839c", "owner": "smallclaims::store::checkpoint", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 412, "excerpt": "DELETE FROM local_trim_citations WHERE citer=?1"}, - {"id": "lv-h604856482f09", "path": "crates/fractal-reconcile/src/reconcile.rs", "kind": "included-source", "fingerprint": "3616f97100c38f3c2e4c541b6f2c7ec51e906225ef6122a06f50332af7263d36", "owner": "fractal_reconcile::reconcile", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 46446, "excerpt": "include_str ! ( \"../../fractal-drivers/tests/fixtures/blocking-screens/omp-no-key.txt\" )"}, - {"id": "lv-h604afa5bb192", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "b395e768bda4bf52a0313b592bbcc8ba3ad9b6a6e75130bd5a3765af1d4cdd52", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 6919, "excerpt": "INSERT INTO local_blob_uploads(hash, actor, media_type, size, uploaded_ms) VALUES (?1,?2,?3,?4,?5) ON CONFLICT(hash, actor) DO UPDATE SET uploaded_ms=excluded.uploaded_ms"}, - {"id": "lv-h604d12b1d064", "path": "crates/fractal-seats/src/store/limits.rs", "kind": "sql-template", "fingerprint": "221992ea0dc30cf06f7393168e6ee36d595f6dd4e45ad1b2af0e41b02c70a732", "owner": "fractal_seats::store::limits", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 416, "excerpt": "INSERT OR IGNORE INTO local_limit_stops(account, episode, seat, stopped_at_unix_ms) VALUES (?1, ?2, ?3, ?4)"}, + {"id": "lv-h60426679c653", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "sql-template", "fingerprint": "b878061375778ef4bcc631bb1a55ae17b19a27651048b32cf98a97aa448e839c", "owner": "smallclaims::store::checkpoint", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 405, "excerpt": "DELETE FROM local_trim_citations WHERE citer=?1"}, + {"id": "lv-h604856482f09", "path": "crates/fractal-reconcile/src/reconcile.rs", "kind": "included-source", "fingerprint": "3616f97100c38f3c2e4c541b6f2c7ec51e906225ef6122a06f50332af7263d36", "owner": "fractal_reconcile::reconcile", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 41952, "excerpt": "include_str ! ( \"../../fractal-drivers/tests/fixtures/blocking-screens/omp-no-key.txt\" )"}, + {"id": "lv-h604afa5bb192", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "b395e768bda4bf52a0313b592bbcc8ba3ad9b6a6e75130bd5a3765af1d4cdd52", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 6250, "excerpt": "INSERT INTO local_blob_uploads(hash, actor, media_type, size, uploaded_ms) VALUES (?1,?2,?3,?4,?5) ON CONFLICT(hash, actor) DO UPDATE SET uploaded_ms=excluded.uploaded_ms"}, + {"id": "lv-h604d12b1d064", "path": "crates/fractal-seats/src/store/limits.rs", "kind": "sql-template", "fingerprint": "221992ea0dc30cf06f7393168e6ee36d595f6dd4e45ad1b2af0e41b02c70a732", "owner": "fractal_seats::store::limits", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 408, "excerpt": "INSERT OR IGNORE INTO local_limit_stops(account, episode, seat, stopped_at_unix_ms) VALUES (?1, ?2, ?3, ?4)"}, + {"id": "lv-h60572e3ac6a5", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "4057b5ea4425eae5245388f9b99c2e85be224354079f4e476f16d61dccb3fd67", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 190, "excerpt": "INSERT OR IGNORE INTO assistant_grant_authority (claim_id,base_claim_id,grant_subject,kind,origin,actor,principal,profile,expires_at,store_index,credential_hash,record) VALUES(?1,?2,?3,?4,?5,?6,?7,?8,"}, {"id": "lv-h605b32403e38", "path": "crates/fractal/src/projection_contention_retry_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "f10e20728e77f302935d7b4f1031c77dca8743a680305ee8cdf2f818e584bbb5", "owner": "fractal::projection_contention_retry_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 156, "excerpt": "\"ROLLBACK\""}, {"id": "lv-h60604afd746c", "path": "crates/fractal-missions/src/store/tests/huge_part_digest.rs", "kind": "unresolved-sql-sink", "fingerprint": "00ec713fc2be2060bab2be92d80982f4fe4ee4ee5c9689fe6c79bb13ac8bccb2", "owner": "fractal_missions::store::tests::huge_part_digest", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 62, "excerpt": "& format ! ( \"PRAGMA table_info({table})\" )"}, - {"id": "lv-h606a2ea2c17e", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "sql-template", "fingerprint": "0f1f0127b2d374c5972ec8fd2024dc3712927a18c2e69a6f61955de79f712de6", "owner": "smallclaims::store::checkpoint_trim", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 296, "excerpt": "INSERT OR IGNORE INTO temp.adopted_envelopes(writer, sequence, envelope_hash) VALUES (?1, ?2, ?3)"}, - {"id": "lv-h607728b48402", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "3fdbff1254292b0b91b474a6f360f3a7b2d09a96ec1c04a356fb3398724aa0d6", "owner": "fractal_store::store::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 7398, "excerpt": "UPDATE claims SET body=json_remove(body,'$.fields.incarnation_id') WHERE id='legacy-5'"}, + {"id": "lv-h606a2ea2c17e", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "sql-template", "fingerprint": "0f1f0127b2d374c5972ec8fd2024dc3712927a18c2e69a6f61955de79f712de6", "owner": "smallclaims::store::checkpoint_trim", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 114, "excerpt": "INSERT OR IGNORE INTO temp.adopted_envelopes(writer, sequence, envelope_hash) VALUES (?1, ?2, ?3)"}, + {"id": "lv-h607728b48402", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "3fdbff1254292b0b91b474a6f360f3a7b2d09a96ec1c04a356fb3398724aa0d6", "owner": "fractal_store::store::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 6844, "excerpt": "UPDATE claims SET body=json_remove(body,'$.fields.incarnation_id') WHERE id='legacy-5'"}, {"id": "lv-h608592d729cd", "path": "crates/fractal-store/src/store/completion_state_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "dc372daedd324b47f1261987900c1a08eff3ccdf253bfcf666d0ebecf17142ad", "owner": "fractal_store::store::completion_state_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 293, "excerpt": "& store , | _ | ( )"}, - {"id": "lv-h6088551c41aa", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "a7ac3a4506b23c9b89e29e99b8a76dd8604ef8b957bc5c122cb8a785cdc21d89", "owner": "fractal_store::store", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 806, "excerpt": " -- An unmanaged member's staging check needs tagged claims, not its runtime history. CREATE INDEX IF NOT EXISTS claims_owned_set_subject_index ON claims(subject) WHERE json_extract(body,'$.owned_set'"}, {"id": "lv-h608dfaa2b410", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "a5e5da280c1f128be68d7596892f8c29f7da633d92871f0453ed33df5ae60007", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 2572, "excerpt": "ALTER TABLE planning_sessions ADD COLUMN planner_spec_json TEXT NOT NULL DEFAULT '{\"provider\":\"codex\"}';"}, {"id": "lv-h60aa75e03cc5", "path": "crates/fractal-store/src/store/checkpoint_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "35b3b55dc0d41a833a72f4009dfed3434aa87154d6b9b83da24b2d728d42ad32", "owner": "fractal_store::store::checkpoint_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1802, "excerpt": "& format ! ( \"EXPLAIN QUERY PLAN {sql}\" )"}, {"id": "lv-h60b77d512cb4", "path": "crates/smallclaims/src/store/prepared_envelope.rs", "kind": "sql-template", "fingerprint": "b222fff25338db12d6363fc43bb2827abc178387b00e9740a83561e7cc9195bb", "owner": "smallclaims::store::prepared_envelope", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 544, "excerpt": "UPDATE replica_envelopes SET receipt_state=?4, validation_error=NULL, batch_id=?5 WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND (receipt_state IS NOT ?4 OR validation_error IS NOT NULL OR b"}, @@ -2447,6 +2550,7 @@ {"id": "lv-h60e669c72d60", "path": "crates/fractal-store/src/store/schedule_active_run_tests.rs", "kind": "sql-template", "fingerprint": "6258e7b30cb316691726c25d811e65db1910919ad217c6fc023fd30ad2a2ce3c", "owner": "fractal_store::store::schedule_active_run_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 151, "excerpt": "INSERT INTO claims VALUES(?1,'schedule.work-started',?2)"}, {"id": "lv-h610d826d833a", "path": "crates/fractal-api-core/src/api/legacy_handler_guard_tests.rs", "kind": "included-source", "fingerprint": "664d70adeccc63552d83219d6f314b35d4605b9fc9aa834c54c5f078e27e6cdd", "owner": "fractal_api_core::api::legacy_handler_guard_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 18, "excerpt": "include_str ! ( \"runs.rs\" )"}, {"id": "lv-h61152c78e9ef", "path": "crates/smallclaims/src/store/sealed_view_cache_tests/mutation_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "57631b1a4179343162c8e90fe588d3d5894dd5fffcae7871a8894c2eb45ea826", "owner": "smallclaims::store::sealed_view_cache_tests::mutation_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 63, "excerpt": "rusqlite : : params_from_iter ( row . unwrap ( ) )"}, + {"id": "lv-h611b5b2ef9a9", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "00e61e5879bc3ca260fa39bc00b1a5fe489e6d5a1e9a09d06c607f6738388253", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 378, "excerpt": "authority : : TRANSITION_QUERY"}, {"id": "lv-h613b05daf268", "path": "crates/fractal-api-core/src/api/agents_request_slo/ledger.rs", "kind": "sql-template", "fingerprint": "d3e10efe4a41b8aa0bb63debcfc8e3ac0cb94399c0aa6866cf162915783e1c06", "owner": "fractal_api_core::api::agents_request_slo::ledger", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 71, "excerpt": "INSERT INTO minute_receipts VALUES (?1, ?2, ?3)"}, {"id": "lv-h6140c9d34075", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "19986eebe3a9173fa46a9514c6e12ec0a7c0e632b1c4857bb392c9f08ddda0c2", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 3193, "excerpt": "UPDATE fleet_generation SET value=value+1,trigger_version=?1 WHERE id=1"}, {"id": "lv-h616066b27e8c", "path": "crates/fractal-store/src/store/wake_lookup.rs", "kind": "sql-template", "fingerprint": "259fce15c3099ff88b6e0a4a2ae93c3f2ff0f31eb80ae972b6c95bd0f94a12e0", "owner": "fractal_store::store::wake_lookup", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 142, "excerpt": "INSERT OR IGNORE INTO local_work_wake_tags "}, @@ -2464,10 +2568,11 @@ {"id": "lv-h61b124217492", "path": "crates/fractal-store/src/store/coordination.rs", "kind": "sql-template", "fingerprint": "b92829596cb9e6005cb6755639038b1cc71545361405282c8bd3111de9a92eed", "owner": "fractal_store::store::coordination", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 141, "excerpt": "DELETE FROM coordination_sends WHERE subject=?1"}, {"id": "lv-h61b680cabd70", "path": "crates/smallclaims/src/store/canonical.rs", "kind": "sql-template", "fingerprint": "954ae02327c94174cebf9496d22483c658c63840f236f30b9c1302253491803b", "owner": "smallclaims::store::canonical", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 97, "excerpt": "INSERT INTO claim_positions(claim_id, position) SELECT ?1, COUNT(*) FROM claims INDEXED BY claims_batch_index WHERE batch_id=?2 ON CONFLICT(claim_id) DO UPDATE SET position=MIN(position, excluded.posi"}, {"id": "lv-h61ed8d5bde9c", "path": "crates/smallclaims/src/store/saved_inventory_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "9bb555442b5537e23740d40edf8a162823f09cd82bf1e807c446dab79a30406a", "owner": "smallclaims::store::saved_inventory_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 217, "excerpt": "\"VACUUM INTO ?1\" , [ copy . to_str ( ) . unwrap ( ) ]"}, - {"id": "lv-h61f70922c425", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "d2cd292c750cd6f10a1e4aa4bd3f077d1d4719a01037e2408cc099835af35789", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 8463, "excerpt": "INSERT OR REPLACE INTO meta(key, value) VALUES ('legacy_claim_hash_retried', ?1)"}, - {"id": "lv-h61ffbc9870f4", "path": "crates/fractal-store/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "4e5f0a33588c376681d0b144ccfda49f5ff4a557d18a055463eb36161c866110", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 8467, "excerpt": "& format ! ( \"EXPLAIN QUERY PLAN {LOCAL_OBSERVATION_FLOOR_QUERY}\" )"}, - {"id": "lv-h620c9051c434", "path": "crates/fractal-reconcile/src/reconcile/github_plugin_store.rs", "kind": "sql-template", "fingerprint": "3a2e3d68458da89780264afcfb304356d1beb205eb4b8be7dde81c4726f858b1", "owner": "fractal_reconcile::reconcile::github_plugin_store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 471, "excerpt": "UPDATE mirror_repositories SET filled_at_unix_ms=NULL WHERE repository=?1"}, - {"id": "lv-h622ef2d3a8e2", "path": "crates/fractal-reconcile/src/reconcile.rs", "kind": "included-source", "fingerprint": "ecf6272b9f815a5b3373b13b88890cfa4da43ec403c1ec2986ec71c455b81045", "owner": "fractal_reconcile::reconcile", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 46546, "excerpt": "include_str ! ( \"../../fractal-drivers/tests/fixtures/blocking-screens/claude-authenticating.txt\" )"}, + {"id": "lv-h61f70922c425", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "d2cd292c750cd6f10a1e4aa4bd3f077d1d4719a01037e2408cc099835af35789", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 7633, "excerpt": "INSERT OR REPLACE INTO meta(key, value) VALUES ('legacy_claim_hash_retried', ?1)"}, + {"id": "lv-h61ffbc9870f4", "path": "crates/fractal-store/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "4e5f0a33588c376681d0b144ccfda49f5ff4a557d18a055463eb36161c866110", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 7885, "excerpt": "& format ! ( \"EXPLAIN QUERY PLAN {LOCAL_OBSERVATION_FLOOR_QUERY}\" )"}, + {"id": "lv-h620c9051c434", "path": "crates/fractal-reconcile/src/reconcile/github_plugin_store.rs", "kind": "sql-template", "fingerprint": "3a2e3d68458da89780264afcfb304356d1beb205eb4b8be7dde81c4726f858b1", "owner": "fractal_reconcile::reconcile::github_plugin_store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 362, "excerpt": "UPDATE mirror_repositories SET filled_at_unix_ms=NULL WHERE repository=?1"}, + {"id": "lv-h622ef2d3a8e2", "path": "crates/fractal-reconcile/src/reconcile.rs", "kind": "included-source", "fingerprint": "ecf6272b9f815a5b3373b13b88890cfa4da43ec403c1ec2986ec71c455b81045", "owner": "fractal_reconcile::reconcile", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 42051, "excerpt": "include_str ! ( \"../../fractal-drivers/tests/fixtures/blocking-screens/claude-authenticating.txt\" )"}, + {"id": "lv-h622f4fdd0f6d", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "4ec7c53222c8a758c722e2111541035ce700d5ae7bd0898c5f1b1a743e6450fd", "owner": "smallclaims::store::membership_query_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 525, "excerpt": "sql"}, {"id": "lv-h623a73805679", "path": "crates/fractal-store/src/store/checkpoint_capture_epoch_tests_shared_attention_tests.rs", "kind": "sql-template", "fingerprint": "d1edfb36bcc6d04fc9a034bb83ac27c07ffe86cd7fda24b7eb9414df924015e5", "owner": "fractal_store::store::checkpoint_capture_epoch_tests_shared_attention_tests", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 15, "excerpt": "UPDATE checkpoint_capture_epoch SET envelope_frontier=MAX(envelope_frontier,?1),cut_unix_ms=MAX(cut_unix_ms,?2) WHERE id=1 AND (envelope_frontier ( 0 ) ? , row . get : : < _ , String > ( 1 ) ? ) ) ,"}, {"id": "lv-h63c7229392d4", "path": "crates/fractal-store/src/store/person_work.rs", "kind": "unresolved-sql-sink", "fingerprint": "43c3ffe2a9635a055483e66d00dbb0a9fb618e36eb890ea7173a82cebe0732af", "owner": "fractal_store::store::person_work", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 842, "excerpt": "params ! [ mission . id , mission . revision , claim . id ]"}, {"id": "lv-h63c96badd5b1", "path": "crates/fractal-store/src/store/idle_mail.rs", "kind": "sql-template", "fingerprint": "bcd383c442369d86029ee68e6407a8d06a15f47435e0d166585bd1db1254c629", "owner": "fractal_store::store::idle_mail", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 117, "excerpt": "DELETE FROM local_idle_messages WHERE subject=?1"}, + {"id": "lv-h63ca01e24d8b", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "071ea4654ddd3a50866c9a9c7c47979c555f98569075a1c1016b9b8386a96696", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 895, "excerpt": "INSERT INTO assistant_grant_retractions(writer,member_key,lower_sequence,upper_sequence) SELECT ?1,?2,?3,?4 WHERE EXISTS( SELECT 1 FROM assistant_grant_pending INDEXED BY assistant_grant_pending_evide"}, {"id": "lv-h63cb2ef6f8ed", "path": "crates/smallclaims/src/store/prepared_envelope.rs", "kind": "sql-template", "fingerprint": "ffe2d755641de88ef26bc27e816ef9eb68d604ea4957f3632f5977959a11b09c", "owner": "smallclaims::store::prepared_envelope", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 372, "excerpt": "INSERT OR IGNORE INTO batches(id, origin, replica_sequence, previous_hash, hash, accepted_at_unix_ms, rowid) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)"}, {"id": "lv-h63d55e8c184c", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "294d69dca6aba2b5127a1ceb96eaf2b43d526608104c35c40591dd952880851f", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 910, "excerpt": "params ! [ signature . signer , signature . key , signature . nonce , serde_json : : to_string ( signature ) ? , claim_id ]"}, {"id": "lv-h63d654ae8618", "path": "crates/smallclaims/src/ivm/install/prepared.rs", "kind": "sql-template", "fingerprint": "bb12a3c5a0642a606abe4cbc1c2768634d09b8f3d329db268d90b04a687103ac", "owner": "smallclaims::ivm::install::prepared", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 757, "excerpt": "UPDATE ivm_install_deferred SET capturing=0 WHERE source=?1"}, @@ -2511,6 +2617,7 @@ {"id": "lv-h6401138dd575", "path": "crates/fractal-github/src/changes/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "70ce871f8a3d3fb449bc3c3ace6547cef02dfc74ffe48d912532a724bfdbe5b9", "owner": "fractal_github::changes::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 431, "excerpt": "record"}, {"id": "lv-h640f51c3d2c5", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "a26f58e33935b9f53dbf8fc76266eb4de797f6ea370aecfef4a5d81fc53dbf87", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 18408, "excerpt": "UPDATE step_runs SET status=?2, blocked_reason=?3, lease_owner=CASE WHEN ?2 IN ('ready','orphaned','completed','failed','cancelled') THEN NULL ELSE lease_owner END, lease_incarnation=CASE WHEN ?2 IN ("}, {"id": "lv-h642808069a55", "path": "crates/fractal-evidence/src/store/terminal_gate_evidence/native_source/tests.rs", "kind": "sql-template", "fingerprint": "5fa4dc1add2c0256ac02e69c74e93b8697d39501427de6cbdddf312f6d5b50de", "owner": "fractal_evidence::store::terminal_gate_evidence::native_source::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 72, "excerpt": "INSERT INTO claims(id,batch_id,subject,kind,origin,body,predecessors,accepted_at_unix_ms) VALUES('measured-unrelated','foreign','exec/measured-unrelated','runtime.observed','node','{}','[]','1')"}, + {"id": "lv-h642b57ed2c8a", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "1f45671338e89913c18f35e05f9f94bc4da98332cfd3337fb2678ff97621393e", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1198, "excerpt": "INSERT OR IGNORE INTO assistant_grant_proof_rechecks VALUES(?1)"}, {"id": "lv-h642e5d4b0401", "path": "crates/smallclaims/src/sqlite/writer_queue/tests.rs", "kind": "sql-template", "fingerprint": "71f5d5423100ec2c92b15b2e0ab52a4b5fdff952a65c8ae40607bcf2bd19ee10", "owner": "smallclaims::sqlite::writer_queue::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 105, "excerpt": "INSERT INTO values_ VALUES(1)"}, {"id": "lv-h6440938fe6f6", "path": "crates/fractal-store/src/store/runtime_starts.rs", "kind": "sql-template", "fingerprint": "4fec1d1bea510351120dd0649d734372741fffdefc1282b167052a5a42241ad4", "owner": "fractal_store::store::runtime_starts", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 237, "excerpt": "DELETE FROM local_runtime_start_evidence WHERE operation_id=?1 AND EXISTS ( SELECT 1 FROM local_runtime_starts WHERE id=?1 AND finished=1 AND applied=1 AND (revoked_by IS NULL OR cleanup_verified=1) A"}, {"id": "lv-h6442986de9b5", "path": "crates/fractal-api-mailbox/src/api/mailbox/replay_native_tests.rs", "kind": "included-source", "fingerprint": "dd84a078323048071a9d3275c6170de1031199d678f5a69683ced3104859eb39", "owner": "fractal_api_mailbox::api::mailbox::replay_native_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 147, "excerpt": "include_str ! ( \"pty-0.13.0-063ff7f.json\" )"}, @@ -2518,11 +2625,14 @@ {"id": "lv-h6462186c014f", "path": "crates/fractal-store/src/store/person_work.rs", "kind": "sql-template", "fingerprint": "6c576625f9d250435c3a9edb997cc290c33db5606fd8f420deec7d6ef6a7a6c1", "owner": "fractal_store::store::person_work", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 942, "excerpt": "DELETE FROM local_work_lease_renewals WHERE subject=?1"}, {"id": "lv-h6469b5963239", "path": "crates/fractal-evidence/src/store/terminal_gate_evidence/native_source/tests.rs", "kind": "sql-template", "fingerprint": "144fd2809504df03bc19ebb5323c703f11350b2f547cc4cfda4c760cb72f2d3e", "owner": "fractal_evidence::store::terminal_gate_evidence::native_source::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 101, "excerpt": "UPDATE claims SET body=body WHERE id='foreign/1'"}, {"id": "lv-h646d14c3d162", "path": "crates/fractal-delivery/src/store/message_point_qualification/tests.rs", "kind": "sql-template", "fingerprint": "acb4d6a418a62218b71f2ed74ee613224934b9d69a11895fd40a6a60a30cece0", "owner": "fractal_delivery::store::message_point_qualification::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 620, "excerpt": "UPDATE batches SET origin=X'FF' WHERE id='selected'"}, + {"id": "lv-h64769f90bcc0", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "7c2da5418711b4cffd2ce7a160ff2b618c93548b7325dff4d8265816e863e667", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1195, "excerpt": "UPDATE assistant_grant_membership_windows SET start=0,end=0 WHERE writer=?1 AND member_key=?2"}, {"id": "lv-h6487fa5f41ea", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "unresolved-sql-sink", "fingerprint": "5c83fbfc5e3ba9b0e2ce7bfd66a6267d449dbacf9991191659f3faaac592a4b8", "owner": "smallclaims::store::checkpoint", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1499, "excerpt": "& claim_sql"}, {"id": "lv-h64892cb60de4", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "5f950106d1b144217385014d31de6ab915c9bc8f541da620844df77966de2e24", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 10827, "excerpt": "UPDATE documents SET binding_claim_id=?3,binding_key=?4,created_index=?5 WHERE name=?1 AND hash=?2"}, + {"id": "lv-h648b9952e737", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "unresolved-sql-sink", "fingerprint": "c7e272f2f85def39e190243f2e0cfab588663d1ef1fe97e016f938650eb05a44", "owner": "smallclaims::store::assistant_grant_authority", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 426, "excerpt": "SUBJECT_PENDING_QUERY , [ subject ] , | row | row . get ( 0 )"}, {"id": "lv-h649e90500eca", "path": "crates/fractal-store/src/store/notice_authority.rs", "kind": "sql-template", "fingerprint": "760e096c5a9f10c8079e02737b9384ca9edc2f3542be6060f6e74119e383a73a", "owner": "fractal_store::store::notice_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 62, "excerpt": "CREATE TRIGGER {name} BEFORE {action} ON {table} WHEN ({relevant}) AND ({changed}) BEGIN INSERT INTO local_custom_dirty SELECT subject FROM custom_sources WHERE subject LIKE 'custom/attention/%' ON CO"}, {"id": "lv-h64a6eecfdbfe", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "3eabf6a6c6361fe2250d25bd5d23f61c6afbb6fc4a4b1d7c2ede61dfe00641ed", "owner": "fractal_missions::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 884, "excerpt": "UPDATE step_runs SET status='cancelled', blocked_reason='the root mission run is terminal' WHERE generation_id=?1 AND step_path='provisional'"}, {"id": "lv-h64a7d8ba07a0", "path": "crates/smallclaims/src/store/prepared_envelope.rs", "kind": "sql-template", "fingerprint": "687f1c390ce2a168f4a85bd195860bbe431d84e649a3b0c94476255ab39701b4", "owner": "smallclaims::store::prepared_envelope", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 495, "excerpt": "INSERT INTO replica_records( record_ref, writer, sequence, envelope_hash, position, raw, state, claim_id, subject_hint, kind_hint, error_code, error_message, updated_at_unix_ms ) VALUES (?1, ?2, ?3, ?"}, + {"id": "lv-h64bd448a0436", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "92b30391c408861c4027c6271c86818bdcaa46268dda511fa98e3203ccdfadef", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 1482, "excerpt": "CREATE TABLE assistant_grant_membership_dirty ( writer TEXT PRIMARY KEY, sequence INTEGER NOT NULL, claim_id TEXT NOT NULL);"}, {"id": "lv-h64f6ee7bd2a2", "path": "crates/smallclaims/src/ivm.rs", "kind": "unresolved-sql-sink", "fingerprint": "86df57ebceacb5ba3fe3446f8462f70c7b14769b7652091a280a8a34b251bb78", "owner": "smallclaims::ivm", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 908, "excerpt": "\"RELEASE ivm_view_change\""}, {"id": "lv-h65128453d5bc", "path": "crates/fractal-store/src/store/attention_snapshot.rs", "kind": "unresolved-sql-sink", "fingerprint": "6ad3fbb3c4c81b5d7b668dadba89f5dbf6c6102b64832f03204c236d107ecb96", "owner": "fractal_store::store::attention_snapshot", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1849, "excerpt": "[ smallclaims : : store : : operation_id_for_key ( key ) ] , | row | row . get ( 0 )"}, {"id": "lv-h6519e4b72b76", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "93f4b45e03dbec6835905f00055def2d3d37b770d22f2dffe0bf4e5572ea32f2", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 290, "excerpt": "params ! [ claim_id , text , writer ]"}, @@ -2542,6 +2652,7 @@ {"id": "lv-h662f78f2d063", "path": "crates/fractal-store/src/store/resource_references.rs", "kind": "unresolved-sql-sink", "fingerprint": "b98eb52b32df241ec7e8c24bf75fdd706f839521cb5628c7497bb043d5e89245", "owner": "fractal_store::store::resource_references", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 95, "excerpt": "if result . is_ok ( ) { \"RELEASE ordered_membership_reverse_index_upgrade\" } else { \"ROLLBACK TO ordered_membership_reverse_index_upgrade; RELEASE ordered_membership_reverse_index_upgrade\" }"}, {"id": "lv-h662fba43a1a8", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "b1eab4135ae2e260dcde484637bbe28efe7bec333c01b9b7a161d2ec7180cfa6", "owner": "fractal_store::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 6793, "excerpt": "INSERT INTO batches VALUES ('a','writer',1,NULL,'a','1')"}, {"id": "lv-h6647239614f1", "path": "crates/fractal-store/src/store/owned_sets.rs", "kind": "sql-template", "fingerprint": "c4d68773e0494297a7a6f347d2b8567c4fad2da4b4043a730a24e62359bad3ee", "owner": "fractal_store::store::owned_sets", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1154, "excerpt": "INSERT INTO mission_definitions(mission_id,revision,state,claim_id) VALUES (?1,?2,?3,?4) ON CONFLICT(mission_id) DO UPDATE SET revision=excluded.revision,state=excluded.state,claim_id=excluded.claim_i"}, + {"id": "lv-h664aa3828314", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "5746547b9414cefd8ea0e7c0bdc4a50cd94032247d54cd48a3fde00d8f2ceef6", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 1303, "excerpt": "INSERT INTO replica_envelopes SELECT writer,sequence,'decoy-envelope',previous_hash,accepted_at_unix_ms, payload,batch_id,relay,receipt_state,validation_error,received_at_unix_ms FROM replica_envelope"}, {"id": "lv-h6650f69e1632", "path": "crates/fractal-store/src/store/work_list.rs", "kind": "sql-template", "fingerprint": "43e511d1226edf4e7612b693641a360b11498b68982704cf5b091127a368bde6", "owner": "fractal_store::store::work_list", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 444, "excerpt": "INSERT INTO projection_health(aggregate, status, last_good_store_index, updated_at_unix_ms) VALUES ('graph', 'healthy', ?1, '0') ON CONFLICT(aggregate) DO UPDATE SET last_good_store_index=excluded.las"}, {"id": "lv-h6661376b7ab3", "path": "crates/fractal-store/src/store/attention_snapshot.rs", "kind": "unresolved-sql-sink", "fingerprint": "c53da0ea45302d108f7c3c301e1ec77bb9da2cb82f2c548e7e36281889adb3e0", "owner": "fractal_store::store::attention_snapshot", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 2795, "excerpt": "& format ! ( \"{} LIMIT 1\" , newest_claims_of_kind_query ( \"claims.id, claims.accepted_at_unix_ms, claims.body\" , \"harness.observed\" ) )"}, {"id": "lv-h66696d4cc5f8", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "fa430a938a2c821b9295609bf8344aaea35b9e612fd0e33a5ec566aa41eba95d", "owner": "fractal_missions::store::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 6832, "excerpt": "INSERT INTO claims(store_index,id,batch_id,subject,kind,origin,body,predecessors,accepted_at_unix_ms) VALUES (?1,?2,'episode-batch','agent/episode-growth','harness.observed','episode-growth',?3,'[]',?"}, @@ -2556,13 +2667,15 @@ {"id": "lv-h6706f1613b0b", "path": "crates/fractal-evidence/src/store/evidence.rs", "kind": "unresolved-sql-sink", "fingerprint": "c78ea1be1f18e9de24532faffd7555fbe47ef2ec7ba9c683028007fc6d146f37", "owner": "fractal_evidence::store::evidence", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 351, "excerpt": "& canonical_sql ( & format ! ( \"WITH current_request AS MATERIALIZED ( SELECT request.subject, request.batch_id, request.store_index, request_batch.replica_sequence AS sequence, {request_position} AS "}, {"id": "lv-h6726abdbf56a", "path": "crates/fractal-missions/src/store/terminal_step_guard_tests.rs", "kind": "sql-template", "fingerprint": "ab84999a2c3179b1f3d3b1d98490ac05026fec05272d90cd16ffd9b5afd3f7d0", "owner": "fractal_missions::store::terminal_step_guard_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 152, "excerpt": "UPDATE step_runs SET lease_owner='person/test', lease_incarnation='old-worker', lease_expires_at_unix_ms='0' WHERE subject=?1"}, {"id": "lv-h6734845d3e2d", "path": "crates/smallclaims/src/store/retired.rs", "kind": "unresolved-sql-sink", "fingerprint": "b7eafcbb01a79e6feb02839905b41bafc8a5be2f355d21ab6b4b392a34092eac", "owner": "smallclaims::store::retired", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 193, "excerpt": "& QUERY"}, - {"id": "lv-h673570e7b51b", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "c5a0dfd33fdcc5b2350935ffea47d2324f7bc3f67178675cd2dd079fe1ac7014", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 8427, "excerpt": "UPDATE planning_sessions SET status='cancelled', updated_at_unix_ms=?2 WHERE id=?1"}, - {"id": "lv-h675571bb6dcc", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "sql-template", "fingerprint": "5d3baa4cb1a6ebdc4527226258f80f2f07dfd1bd8aa4ff43204d68c70a101ee7", "owner": "fractal_missions::store::missions", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 4194, "excerpt": "INSERT INTO idempotency(operation_id, response) VALUES (?1, ?2)"}, - {"id": "lv-h67888f2c1780", "path": "crates/fractal-seats/src/store/person_work.rs", "kind": "sql-template", "fingerprint": "c49dc475e365797527b8a198411c5ecae5bdb85a1372fc2069f22526cd81cc19", "owner": "fractal_seats::store::person_work", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 505, "excerpt": "UPDATE desired SET owner_generation='run-generation/old' WHERE subject='subscription/intake'"}, + {"id": "lv-h673570e7b51b", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "c5a0dfd33fdcc5b2350935ffea47d2324f7bc3f67178675cd2dd079fe1ac7014", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 7344, "excerpt": "UPDATE planning_sessions SET status='cancelled', updated_at_unix_ms=?2 WHERE id=?1"}, + {"id": "lv-h675571bb6dcc", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "sql-template", "fingerprint": "5d3baa4cb1a6ebdc4527226258f80f2f07dfd1bd8aa4ff43204d68c70a101ee7", "owner": "fractal_missions::store::missions", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 4048, "excerpt": "INSERT INTO idempotency(operation_id, response) VALUES (?1, ?2)"}, + {"id": "lv-h67888f2c1780", "path": "crates/fractal-seats/src/store/person_work.rs", "kind": "sql-template", "fingerprint": "c49dc475e365797527b8a198411c5ecae5bdb85a1372fc2069f22526cd81cc19", "owner": "fractal_seats::store::person_work", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 429, "excerpt": "UPDATE desired SET owner_generation='run-generation/old' WHERE subject='subscription/intake'"}, + {"id": "lv-h67b7b4921e3a", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "667d1dedb50cd8ab07aff83d4c48eece2af6359acc7c1293ff0697abb9299ee5", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 721, "excerpt": "DELETE FROM assistant_grant_authority WHERE claim_id=?1 AND base_claim_id=?2"}, {"id": "lv-h67b994dca42f", "path": "crates/smallclaims/src/store/projection_digest.rs", "kind": "sql-template", "fingerprint": "016cfb67f1f22de644ed92fdea97c2227aab5b540c6815847a0f02252b998811", "owner": "smallclaims::store::projection_digest", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 174, "excerpt": "DELETE FROM projection_digest_operation_rows"}, {"id": "lv-h67cd460ba33d", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "sql-template", "fingerprint": "996753730d02ef5c4350fd87061ee554e215a86673110ceee475e4814dca5f0d", "owner": "smallclaims::store::checkpoint", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 717, "excerpt": "DELETE FROM claims WHERE id NOT IN (SELECT id FROM temp.sealed_claims); DELETE FROM blobs WHERE hash NOT IN (SELECT hash FROM temp.sealed_blobs); DELETE FROM replica_records WHERE NOT EXISTS ( SELECT "}, {"id": "lv-h67d08b9ee5cc", "path": "crates/smallclaims/src/sync/worker_tests.rs", "kind": "sql-template", "fingerprint": "8cb1072302449a5baf37c7c3ca58a673ba8c8d3a0d1f626e613242bceecefc1d", "owner": "smallclaims::sync::worker_tests", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 441, "excerpt": "INSERT INTO checkpoint_envelopes VALUES (?1, ?2, ?3, 0, ?4)"}, {"id": "lv-h67d1621a59a9", "path": "crates/fractal-delivery/src/store/terminal_gate_evidence/native_source/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "e8757b6cd332ec0a602b8a95380f82ada3648793060cc7b170ef6e30d801cce2", "owner": "fractal_delivery::store::terminal_gate_evidence::native_source::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 310, "excerpt": "insertion , [ ]"}, + {"id": "lv-h67e21448c6af", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "a7774ad4d3c3056ba92dff20e94ec04cf75973066d26167a03b663ac39dfc338", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 525, "excerpt": "DELETE FROM assistant_grant_effective WHERE claim_id=?1"}, {"id": "lv-h67e53372c4b6", "path": "crates/fractal-store/src/store/answers_check_tests.rs", "kind": "sql-template", "fingerprint": "da375a6ef935682d924483cbd6c26b9c32a0a576b639560d3ec18290cfd5125b", "owner": "fractal_store::store::answers_check_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 148, "excerpt": "DELETE FROM claims WHERE id=?1"}, {"id": "lv-h67e884873bac", "path": "crates/smallclaims/src/ivm/install/prepared.rs", "kind": "unresolved-sql-sink", "fingerprint": "de18034caac9a1dc3c8c4f01ec2f94afe79e656f252d48202f4cbe1b29bd20aa", "owner": "smallclaims::ivm::install::prepared", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1118, "excerpt": "& write . sql , params_from_iter ( & write . args )"}, {"id": "lv-h67ed73d86ad9", "path": "crates/fractal-store/src/store/checkpoint_rules.rs", "kind": "sql-template", "fingerprint": "5542c3e7a032e3b8b126e4443bd59273c5a4cfc2a55567386e029f3f699f88ec", "owner": "fractal_store::store::checkpoint_rules", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1196, "excerpt": "DELETE FROM {table}"}, @@ -2576,7 +2689,9 @@ {"id": "lv-h683d859bacef", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "77939ed876496cca8eeca1601008faa5d0c7ae1619ca25394af99d720d92116f", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 447, "excerpt": "[ claim_id ] , | row | { Ok ( ClaimRow { id : row . get ( 0 ) ? , subject : row . get ( 1 ) ? , kind : row . get ( 2 ) ? , actor : row . get ( 3 ) ? , body : serde_json : : from_str ( & row . get : : "}, {"id": "lv-h68645a63254c", "path": "crates/fractal-drivers/src/harness_admission.rs", "kind": "included-source", "fingerprint": "742e26e05d15506f44c177f17581cf4f10978f2a2125b2d8e0872bb303d8ea4f", "owner": "fractal_drivers::harness_admission", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 642, "excerpt": "include_str ! ( \"opencode_session/admission.rs\" )"}, {"id": "lv-h688464025ee2", "path": "crates/fractal-store/src/store/resources_preparation.rs", "kind": "sql-template", "fingerprint": "e07a4d28e54787034c419046b1ddb85c71444fb1db1ed57766d5a4bf9a4aee22", "owner": "fractal_store::store::resources_preparation", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 390, "excerpt": "DELETE FROM local_resource_preparation_claims WHERE subject=?1"}, + {"id": "lv-h6891eac9f9c6", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "44e99cc89a2f3968ec6543d3d06e481df45cd8b5607f62cbb3e52067ddfd4a60", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 735, "excerpt": "UPDATE replica_envelopes SET receipt_state=?4 WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3"}, {"id": "lv-h68968259fe58", "path": "crates/smallclaims/src/store/prepared_envelope.rs", "kind": "unresolved-sql-sink", "fingerprint": "6d75de68b1a25127f46a996dc09c10af2fd9ce40486024c578ef9880636d43e4", "owner": "smallclaims::store::prepared_envelope", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 297, "excerpt": "params ! [ hash , bytes , bytes . len ( ) as u64 ]"}, + {"id": "lv-h68996f133d87", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "c19d15d1708e8dda9d38f695e77ee5ab10ccb735970d00bec3d81cdd1ce3cb75", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 971, "excerpt": "DROP TRIGGER reject_duplicate_refresh; DELETE FROM assistant_grant_dirty;"}, {"id": "lv-h689aadac7c87", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "165e93bab6c013a2e851619cb52f33c46952d4119f9b079770f0108e050cf051", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 4790, "excerpt": "& canonical_sql ( \"SELECT id, body FROM claims WHERE subject=?1 AND kind='repair.applied' ORDER BY CANONICAL_DESC(claims) LIMIT 1\" , ) , [ & repair_subject ] , | row | Ok ( ( row . get : : < _ , Strin"}, {"id": "lv-h68ae5eb7509f", "path": "crates/smallclaims/src/sqlite/read_lifetime/tests.rs", "kind": "sql-template", "fingerprint": "69029be48c65949b99471da0adf147accfc0c78d768e7131ce9386c27e664aff", "owner": "smallclaims::sqlite::read_lifetime::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 25, "excerpt": "UPDATE payload SET value=zeroblob(8192)"}, {"id": "lv-h68d7bd968ef1", "path": "crates/fractal-store/src/store/subagents.rs", "kind": "unresolved-sql-sink", "fingerprint": "35327f2e81a35773b017bfc9c2b30fb31610c68626a324cb24e9d3d9ccb9a47e", "owner": "fractal_store::store::subagents", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 243, "excerpt": "& canonical_sql ( \"SELECT body FROM claims WHERE subject=?1 AND kind='runtime.observed' ORDER BY CANONICAL_DESC(claims)\" , )"}, @@ -2640,13 +2755,15 @@ {"id": "lv-h6c2ae5eeea22", "path": "crates/smallclaims/src/ivm.rs", "kind": "sql-template", "fingerprint": "43a2a96ce900b14f48d3932a6f247c6171e534fbc991c429d380e7d66c1f29e8", "owner": "smallclaims::ivm", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 893, "excerpt": "UPDATE ivm_views SET generation=generation+1 WHERE name=?1"}, {"id": "lv-h6c4fd8d7681d", "path": "crates/smallclaims/src/store/saved_inventory_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "9bb555442b5537e23740d40edf8a162823f09cd82bf1e807c446dab79a30406a", "owner": "smallclaims::store::saved_inventory_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 663, "excerpt": "\"VACUUM INTO ?1\" , [ copy . to_str ( ) . unwrap ( ) ]"}, {"id": "lv-h6c68f9b18a32", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "46bb3289136f33655424c761b9aee2d23e582b5e5ccfa27608f7ea3abd3ae48a", "owner": "fractal_store::store", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 2531, "excerpt": "PRAGMA foreign_keys = OFF; PRAGMA legacy_alter_table = ON; BEGIN IMMEDIATE; ALTER TABLE batches RENAME TO batches_schema_11; CREATE TABLE batches ( id TEXT PRIMARY KEY, origin TEXT NOT NULL, replica_s"}, + {"id": "lv-h6c78df838342", "path": "crates/smallclaims/src/store/assistant_grant_receipt_cost_tests.rs", "kind": "sql-template", "fingerprint": "7d5f8b5eeba607781e067b2c4b52eeff3cd7af1889c166210762e0a7a90c54d2", "owner": "smallclaims::store::assistant_grant_receipt_cost_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 157, "excerpt": "INSERT INTO assistant_grant_membership_windows VALUES('obsolete',?1,0,NULL)"}, {"id": "lv-h6c81103a624c", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "2f5a9cce09706f86c9fde129916b62c29aa9716de8d0cac980c1aa6c3eb87b29", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 2032, "excerpt": "& format ! ( \"SELECT claims.subject, claims.id, claims.body FROM claims WHERE claims.kind=?1 ORDER BY {CANONICAL_ORDER}\" )"}, {"id": "lv-h6cab025f7761", "path": "crates/smallclaims/src/store/checkpoint_trim/pacing_tests.rs", "kind": "sql-template", "fingerprint": "1396318360ce20e37f51d8127290541839b786469c37b221c6cf661a99c2ca9e", "owner": "smallclaims::store::checkpoint_trim::pacing_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 158, "excerpt": "INSERT OR REPLACE INTO meta(key,value) VALUES('foreground-during-trim','ok')"}, {"id": "lv-h6cc0bf36e69e", "path": "crates/fractal-store/src/store/local_trim_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "6db7d803e74f1ffa7d8f5adc0bf95b3e15bf4c8373fffadf546227cc6c6742cb", "owner": "fractal_store::store::local_trim_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1304, "excerpt": "before"}, {"id": "lv-h6ccb2c4ee957", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "4a969086f219bf531492854dfbab1821a1c6ea49eebfbb33c542dc9ccad0ef54", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 18185, "excerpt": "INSERT OR IGNORE INTO mission_run_deadlines(run_id, timeout_ms, deadline_at_unix_ms) VALUES (?1, ?2, ?3)"}, {"id": "lv-h6cdba10baed9", "path": "crates/fractal-seats/src/store/resource_preparation/tests.rs", "kind": "sql-template", "fingerprint": "e7bd305ebe23d68540e7b2a5cd9c6c904e26b0f9ad484d32db40fb3134c2f739", "owner": "fractal_seats::store::resource_preparation::tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 274, "excerpt": "CREATE TEMP TABLE heal_replay_base_order(ordinal INTEGER PRIMARY KEY, claim_id TEXT NOT NULL, extra TEXT)"}, {"id": "lv-h6ce4203ee173", "path": "crates/fractal-seats/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "6b867484b9b24354e138cabc57d437b2bf63b5e0f5cd321b60825966efbd2de2", "owner": "fractal_seats::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 244, "excerpt": "ROSTER_LOCAL_FRONTIER , [ at ] , | row | row . get : : < _ , u64 > ( 0 )"}, - {"id": "lv-h6d012e85d16c", "path": "crates/fractal-api-core/src/api/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "59e3e1882232d309144d537c0a9dd0256fca005a0157c6232fd373377eb76bc5", "owner": "fractal_api_core::api::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 2468, "excerpt": "crate : : store : : unread_mail : : OVERDUE_BY_RECIPIENT"}, + {"id": "lv-h6d012e85d16c", "path": "crates/fractal-api-core/src/api/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "59e3e1882232d309144d537c0a9dd0256fca005a0157c6232fd373377eb76bc5", "owner": "fractal_api_core::api::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 2050, "excerpt": "crate : : store : : unread_mail : : OVERDUE_BY_RECIPIENT"}, + {"id": "lv-h6d03218a7182", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "9832c5a9904e935c7d7a9c2554db48b6c0173e6a2776085f9b183724794ffa3e", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 480, "excerpt": "UPDATE replica_envelopes SET receipt_state='degraded'"}, {"id": "lv-h6d196a7fb3b7", "path": "crates/fractal-store/src/store/terminal_gate_evidence/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "4ec7c53222c8a758c722e2111541035ce700d5ae7bd0898c5f1b1a743e6450fd", "owner": "fractal_store::store::terminal_gate_evidence::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 388, "excerpt": "sql"}, {"id": "lv-h6d2867cf81a5", "path": "crates/fractal/src/main_tests.rs", "kind": "included-source", "fingerprint": "90d7c72ee12aefcd4f4e56d21b684119538743a04928b785386b59cd4d9a0c3a", "owner": "fractal::main_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 3393, "excerpt": "include_str ! ( \"replication_cli.rs\" )"}, {"id": "lv-h6d3dfbdfbc9a", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "sql-template", "fingerprint": "8331ee329ed78f50b70e0376616102d8837a229078740c00291ddbfe9d469edb", "owner": "smallclaims::store::repair_operation_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 936, "excerpt": "DELETE FROM claims WHERE json_extract(body,'$._operation.id')='op/target'"}, @@ -2668,6 +2785,7 @@ {"id": "lv-h6e2aa55bdef6", "path": "crates/smallclaims/src/store/saved_inventory_tests.rs", "kind": "sql-template", "fingerprint": "c0bb05e069d39f6c90ce0db307317df0cd80c18fe10ad85546610306260309ed", "owner": "smallclaims::store::saved_inventory_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 533, "excerpt": "DROP TRIGGER {trigger};"}, {"id": "lv-h6e2acde7b749", "path": "crates/fractal-store/src/store/stream_mirror_tests.rs", "kind": "sql-template", "fingerprint": "3e064e3eccd3f71f6ea379e2c583567daf7b1b8195f7c0fbe9ecd569b0c4b55b", "owner": "fractal_store::store::stream_mirror_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 140, "excerpt": "INSERT INTO local_stream_lifecycle(subject, kind) VALUES ('message/mirror-late','message.delivered')"}, {"id": "lv-h6e2c2c6005a2", "path": "crates/fractal-seats/src/store/resource_preparation/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "dc372daedd324b47f1261987900c1a08eff3ccdf253bfcf666d0ebecf17142ad", "owner": "fractal_seats::store::resource_preparation::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 132, "excerpt": "& store , | _ | ( )"}, + {"id": "lv-h6e39e16546c7", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "88fe31c01fd6981c5830861890427c9821dad593f519d78709f9de76277e5e74", "owner": "fractal_store::store", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 812, "excerpt": " -- An unmanaged member's staging check needs tagged claims, not its runtime history. CREATE INDEX IF NOT EXISTS claims_owned_set_subject_index ON claims(subject) WHERE json_extract(body,'$.owned_set'"}, {"id": "lv-h6e4e7d0f987f", "path": "crates/fractal-store/src/store/client_messages_version_benchmark.rs", "kind": "unresolved-sql-sink", "fingerprint": "fec187433c4f392fddb9c0d1400a095648f252e10b441a3cf1058bac6f7d78d9", "owner": "fractal_store::store::client_messages_version_benchmark", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 59, "excerpt": "SCHEMA"}, {"id": "lv-h6e6e0efb62c3", "path": "crates/fractal-store/src/store/document_index_tests.rs", "kind": "sql-template", "fingerprint": "293fd1dbb9509eead7d1fd7d9c08f0b28aaa2338199481d100a0311867139801", "owner": "fractal_store::store::document_index_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 51, "excerpt": "WITH RECURSIVE fixture(n) AS (VALUES(1) UNION ALL SELECT n+1 FROM fixture WHERE n?2) AND ({PENDING}))\" ) , params ! [ operation . subject , superseded . as_deref ( ) ] , | row | "}, {"id": "lv-h6fe4bc0f91de", "path": "crates/fractal-store/src/store/wake_lookup_tests.rs", "kind": "sql-template", "fingerprint": "a6683b91423f5f21f889907962cc14e2b8cdd510b3dc1cf277a2c3319d358af1", "owner": "fractal_store::store::wake_lookup_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 97, "excerpt": "DROP TABLE local_work_wake_tags; DROP TABLE local_work_wake_backfill;"}, - {"id": "lv-h6fff3783c9f8", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "ffaaf2c9a205c4bd96e6a3cddd5517f93fae9b13513ca3e25763b0805fb85971", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 4429, "excerpt": "& format ! ( \"{LOCAL_OBSERVATION_COLUMNS} WHERE id > ?1 AND after_store_index <= ?3 ORDER BY id LIMIT ?2\" )"}, - {"id": "lv-h7007134ff0e4", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "unresolved-sql-sink", "fingerprint": "54b380e36aa2640e0b0ddabb7095f357330c49e571e9567ab8d8c652ff9ec6fe", "owner": "fractal_store::store::client_messages", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1521, "excerpt": "SELECTOR_SCHEMA"}, + {"id": "lv-h6ff49ec4f026", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "77379a14bb57c713620fd58bbdc380648a7d4228bbda0e58474916d971a24bad", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 512, "excerpt": "UPDATE replica_records SET state='invalid'"}, + {"id": "lv-h6fff3783c9f8", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "ffaaf2c9a205c4bd96e6a3cddd5517f93fae9b13513ca3e25763b0805fb85971", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 4019, "excerpt": "& format ! ( \"{LOCAL_OBSERVATION_COLUMNS} WHERE id > ?1 AND after_store_index <= ?3 ORDER BY id LIMIT ?2\" )"}, + {"id": "lv-h7007134ff0e4", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "unresolved-sql-sink", "fingerprint": "54b380e36aa2640e0b0ddabb7095f357330c49e571e9567ab8d8c652ff9ec6fe", "owner": "fractal_store::store::client_messages", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1251, "excerpt": "SELECTOR_SCHEMA"}, {"id": "lv-h700cc5c5f5af", "path": "crates/fractal-store/src/store/schedule_standby.rs", "kind": "unresolved-sql-sink", "fingerprint": "2e342413ae61a2b16e56a88ce924d1e49ccfe7a9373bf142b240202340ac85b0", "owner": "fractal_store::store::schedule_standby", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 75, "excerpt": "& canonical_sql ( \"SELECT claims.id, json_extract(claims.body,'$.fields.features.schedule_standby')=1 FROM claims JOIN batches ON batches.id=claims.batch_id WHERE claims.subject=?1 AND claims.kind='da"}, {"id": "lv-h70209d93e42e", "path": "crates/smallclaims/src/store/prepared_seal_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "8d17110ea10aa2a7e84854a42ce5f418958b479456acd6b44cd226f6213b2760", "owner": "smallclaims::store::prepared_seal_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 882, "excerpt": "& format ! ( \"SELECT id, origin, replica_sequence, previous_hash, hash, accepted_at_unix_ms FROM batches WHERE batches.rowid>=?1 AND batches.rowid<=?2 AND NOT EXISTS ( SELECT 1 FROM replica_envelopes "}, {"id": "lv-h702cace76f72", "path": "crates/fractal-seats/src/store/resource_pending_receive_tests.rs", "kind": "sql-template", "fingerprint": "9de721f39fe6a61c3d60e14a03cd519831b91ded7e5bb53a332fb10f9906b1b0", "owner": "fractal_seats::store::resource_pending_receive_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 84, "excerpt": "INSERT INTO local_resource_projection_pending(subject) VALUES(?1)"}, @@ -2713,6 +2832,7 @@ {"id": "lv-h70beb7474d50", "path": "crates/fractal-store/src/store/retirements.rs", "kind": "unresolved-sql-sink", "fingerprint": "b60d94e82e26712263d579d9db9421cf7c599f7455a8ae9a53df8ca9ee030b5d", "owner": "fractal_store::store::retirements", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 50, "excerpt": "& format ! ( \"SELECT {CLAIM_COLUMNS} FROM claims JOIN batches ON batches.id=claims.batch_id WHERE claims.subject=?1 AND claims.kind='agent.retired' AND (?2 IS NULL OR claims.store_index<=?2) AND NOT E"}, {"id": "lv-h70d2d054ccd8", "path": "crates/fractal-missions/src/store/work_renew_tests.rs", "kind": "sql-template", "fingerprint": "d564ed6ae137d4958c7f0751a4a1e5eac72c732ba498342d49bb3f7f9e06849c", "owner": "fractal_missions::store::work_renew_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 436, "excerpt": "UPDATE step_runs SET status=?2,lease_expires_at_unix_ms=?3 WHERE subject=?1"}, {"id": "lv-h70d93219f92b", "path": "crates/smallclaims/src/store/sealed_view_cache_tests/mutation_tests.rs", "kind": "sql-template", "fingerprint": "92451877771c174b74f7da842c12afc291294782da6c86f150d5af412555fde7", "owner": "smallclaims::store::sealed_view_cache_tests::mutation_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 340, "excerpt": "UPDATE replica_envelope_signatures SET sequence=sequence+1000 WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3"}, + {"id": "lv-h70e364d23629", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "included-source", "fingerprint": "463db7d875e9adbb5dbe922e988ac145e1abb00eb2dca8f0679f4d64937f2b92", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1556, "excerpt": "include ! ( \"assistant_grant_receipt_cost_tests.rs\" )"}, {"id": "lv-h710267011525", "path": "crates/smallclaims/src/sqlite/writer_observer.rs", "kind": "unresolved-sql-sink", "fingerprint": "c32b884bb11aa9d33ad9fa5b6cbd7b18be6b5eec40e5397aa0319a5e4069ab0d", "owner": "smallclaims::sqlite::writer_observer", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 327, "excerpt": "& sql"}, {"id": "lv-h7110184a04c9", "path": "crates/fractal-delivery/src/store/terminal_gate_evidence/native_source/tests.rs", "kind": "sql-template", "fingerprint": "4ce3186f10059fad131edf152293960a4ae51ccb1b2f7391d0ddc95f34c93c85", "owner": "fractal_delivery::store::terminal_gate_evidence::native_source::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 19, "excerpt": "INSERT INTO claims(id,batch_id,subject,kind,origin,body,predecessors,accepted_at_unix_ms) SELECT 'late-old-observation',batch_id,subject,kind,origin,?1,'[]','0' FROM claims WHERE subject='exec/one/pro"}, {"id": "lv-h71413c178150", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "7350c00910310adc0208b841f002127949040ed41d54bf678bd3ec11b1c2405c", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 346, "excerpt": "UPDATE replica_envelope_signatures SET member_key='other-key'"}, @@ -2745,6 +2865,7 @@ {"id": "lv-h72d86d43f224", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "2076c92ab7648083e19f0874b156fbee36adb6774511b383280784ae93c3a198", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 12768, "excerpt": "params ! [ subject , at_index , incarnation ] , | row | { Ok ( ( row . get : : < _ , String > ( 0 ) ? , row . get : : < _ , String > ( 1 ) ? , row . get : : < _ , String > ( 2 ) ? ) ) }"}, {"id": "lv-h72e4ba49a7d3", "path": "crates/smallclaims/src/store/principals.rs", "kind": "sql-template", "fingerprint": "a067a6492235dd51352180de416eaa60e26e59d1f3e1feed338871ce03f9510e", "owner": "smallclaims::store::principals", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 406, "excerpt": "DELETE FROM expected_claim_signatures WHERE subject=?1 AND kind=?2 AND actor=?3"}, {"id": "lv-h72e64e178b66", "path": "crates/fractal-store/src/store/checkpoint_rules.rs", "kind": "sql-template", "fingerprint": "5542c3e7a032e3b8b126e4443bd59273c5a4cfc2a55567386e029f3f699f88ec", "owner": "fractal_store::store::checkpoint_rules", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1526, "excerpt": "DELETE FROM {table}"}, + {"id": "lv-h731a7b88489d", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "5c7285256c9dc235655d1116c96dd31af49062c02389377db5ce9d39ac05e649", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 804, "excerpt": "UPDATE replica_envelopes SET receipt_state='pending' WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3"}, {"id": "lv-h731eff28e6bb", "path": "crates/smallclaims/src/store/checkpoint_space.rs", "kind": "unresolved-sql-sink", "fingerprint": "789b44b9990c7d88da3542aa5c6b25148409a57d64b88f00362513cda78a031f", "owner": "smallclaims::store::checkpoint_space", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 329, "excerpt": "\"COMMIT\""}, {"id": "lv-h732113cfc57a", "path": "crates/fractal-store/src/store/publication_facts.rs", "kind": "unresolved-sql-sink", "fingerprint": "2b86ef06cf9adb398c237f395acdec24b8930ec25fe776801420ce02f13e4afd", "owner": "fractal_store::store::publication_facts", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 215, "excerpt": "[ ] , | row | Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? ) )"}, {"id": "lv-h73268f4f219a", "path": "crates/fractal-reconcile/src/reconcile/tests/github_watch_selection.rs", "kind": "sql-template", "fingerprint": "ef73ddd4d63884400e6f463cac66163125aa178b501ecc537140db9426b1c734", "owner": "fractal_reconcile::reconcile::tests::github_watch_selection", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 115, "excerpt": "DELETE FROM desired WHERE subject='agent/example.planner'"}, @@ -2757,6 +2878,7 @@ {"id": "lv-h736179f9e933", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "765302eb1653067e32e1b2e9e1e1d0d92fc31adac3e655b9ce4f6e9a8b27c8fa", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 10890, "excerpt": "& canonical_sql ( \"SELECT id FROM claims WHERE kind >= 'planning-session.' AND kind < 'planning-session/' ORDER BY CANONICAL_ASC(claims)\" ) ,"}, {"id": "lv-h738ce7626839", "path": "crates/fractal-seats/src/store/seats.rs", "kind": "sql-template", "fingerprint": "4ed744820857cb0a6b51611cb9319d16a5d38b9a9a97ac6a4d50de19385f69ab", "owner": "fractal_seats::store::seats", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1771, "excerpt": "DELETE FROM desired WHERE subject NOT LIKE 'resource/uri/%' AND owner_run IN ( SELECT 'mission-run/' || id FROM mission_runs WHERE root_run_id=?1 )"}, {"id": "lv-h73a30e916d1f", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "bbfbe8e505d8bbea20e16cddbd8d3ea84a25fed526818c8873deb1934c150947", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 2573, "excerpt": "INSERT INTO meta(key, value) VALUES ('writer_floor/' || ?1, ?2) ON CONFLICT(key) DO UPDATE SET value=MAX(CAST(value AS INTEGER), CAST(excluded.value AS INTEGER))"}, + {"id": "lv-h73bc9ba2f84a", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "0dce1a92b3da6994a054e1a9f481161693ef00e2572d0f42af1863483ce6fc81", "owner": "smallclaims::store::assistant_grant_authority", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 1055, "excerpt": "UPDATE assistant_grant_additions SET active_claim=?2,sequence=-1,envelope_hash='',position=-1 WHERE id=?1"}, {"id": "lv-h73c63bdcea91", "path": "crates/fractal-store/src/store/messages_shard/mailbox_reads.rs", "kind": "unresolved-sql-sink", "fingerprint": "50988095aed47ab063c14bbedcbec7e0d7609d8d71fee81e0dc59ab6d760ad43", "owner": "fractal_store::store::messages_shard::mailbox_reads", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 41, "excerpt": "[ ] , | row | { Ok ( StreamPosition { admitted : row . get ( 0 ) ? , lifecycle : row . get ( 1 ) ? } ) }"}, {"id": "lv-h73c967a7b6a2", "path": "crates/fractal-store/src/store/message_marks_tests.rs", "kind": "sql-template", "fingerprint": "174b42c82f6d32234c606dd642a60b8c9788564702e4be54d87aa3fca557eae3", "owner": "fractal_store::store::message_marks_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 321, "excerpt": "DELETE FROM claims WHERE subject='message/marks-0-3'"}, {"id": "lv-h73e9590d9234", "path": "crates/fractal-store/src/store/completion_state.rs", "kind": "unresolved-sql-sink", "fingerprint": "819574280d18c79acb3be81b19cc12c8dab7de685bb1cdd30d90bcb5ea979b6d", "owner": "fractal_store::store::completion_state", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 233, "excerpt": "[ id ] , | row | Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? , row . get ( 2 ) ? ) )"}, @@ -2766,6 +2888,7 @@ {"id": "lv-h7406748c0e4e", "path": "crates/smallclaims/src/store/projection_digest.rs", "kind": "sql-template", "fingerprint": "820b7185c57222d36624f5763027bb7df3e265a47417eb321a829dabca44d424", "owner": "smallclaims::store::projection_digest", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 357, "excerpt": "CREATE TRIGGER projection_digest_operation_{table}_{event}_{prefix} AFTER {event} ON {table} WHEN {when} BEGIN {} END;"}, {"id": "lv-h7406e9dd7c35", "path": "crates/smallclaims/src/store/retired_facts.rs", "kind": "unresolved-sql-sink", "fingerprint": "b7eafcbb01a79e6feb02839905b41bafc8a5be2f355d21ab6b4b392a34092eac", "owner": "smallclaims::store::retired_facts", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 78, "excerpt": "& QUERY"}, {"id": "lv-h740f21cfe211", "path": "crates/fractal-api-client-v0/src/api/alert_action_controls.rs", "kind": "sql-template", "fingerprint": "f7eee9a8920111e3326b09d284281d362715dc916c127be5d139b2a4d2e65433", "owner": "fractal_api_client_v0::api::alert_action_controls", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 512, "excerpt": "UPDATE claims SET body=?1 WHERE id=?2"}, + {"id": "lv-h74200cad8b0c", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "ebb537caf4d0e377d4e6cb718657f1da7f8ac42dc5793e0addd8f54675c21eb4", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1546, "excerpt": "INSERT OR REPLACE INTO meta(key,value) VALUES('assistant_grant_dirty_cursor',?1)"}, {"id": "lv-h742f43e31780", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "51730d814a8838fda272fbc09d397b38fb26c5cc7de1f10b80123e6ca64b4649", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1200, "excerpt": "& retired : : schema ( )"}, {"id": "lv-h74308b58c57a", "path": "crates/fractal-store/src/store/checkpoint_capture_epoch_tests.rs", "kind": "sql-template", "fingerprint": "2128be2825a254d38d1cf4325ab5da0124f3584cdccd7460c8d66cd88f7bac8b", "owner": "fractal_store::store::checkpoint_capture_epoch_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 55, "excerpt": "UPDATE {table} SET claim_id=(SELECT id FROM claims WHERE id<>{table}.claim_id LIMIT 1)"}, {"id": "lv-h74360fa29d0f", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "94dedd5db98c1e80254ce79345f6724cee48d90b3acfe79f248d3adebe5f661a", "owner": "fractal_store::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 2361, "excerpt": "UPDATE projection_health SET status='stale' WHERE aggregate='graph'"}, @@ -2776,6 +2899,7 @@ {"id": "lv-h7470b1085b3a", "path": "crates/smallclaims/src/ivm/asynchronous.rs", "kind": "sql-template", "fingerprint": "63c8f828104f57d606cd32cd17b2124717ab260d0a3ed06fe5e865cba98aad9d", "owner": "smallclaims::ivm::asynchronous", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 493, "excerpt": "UPDATE ivm_async_views SET through=?2 WHERE view=?1"}, {"id": "lv-h7470bc661492", "path": "crates/smallclaims/src/store/checkpoint_agreement.rs", "kind": "sql-template", "fingerprint": "43ed9da246abd3af2826ded4d3c2be0ad2dea074c75102038dd7b45a100de7d0", "owner": "smallclaims::store::checkpoint_agreement", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 761, "excerpt": "INSERT INTO checkpoints(id, cut_unix_ms, state, seal_rowid, sealed_digest, drop_digest, updated_at_unix_ms) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7) ON CONFLICT(id) DO UPDATE SET state=excluded.state, seal"}, {"id": "lv-h7489e0a93949", "path": "crates/fractal-store/src/store/agent_messages.rs", "kind": "sql-template", "fingerprint": "c58e73e5ee686c6624decd3360b143982fa0f623228b9fb9763c62e993c54ce4", "owner": "fractal_store::store::agent_messages", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 254, "excerpt": "INSERT INTO agent_message_sends VALUES(?1,?2,?3)"}, + {"id": "lv-h7494541ec904", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "76c974fbbff4b942b7f7c3ccbeecca6927f4ea15b252083fddd6622385ad1d34", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1393, "excerpt": "DELETE FROM assistant_grant_dirty WHERE claim_id=?1"}, {"id": "lv-h74964d9b8b2a", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "unresolved-sql-sink", "fingerprint": "4e0ea4cf319f317f6c1e1a4907deb9f4be779be8f30105c5eea73f14881f32f5", "owner": "smallclaims::store::checkpoint_trim", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1683, "excerpt": "params ! [ walk . claim , walk . checkpoint ] , | row | { Ok ( ( row . get : : < _ , i64 > ( 0 ) ? , deletable_claim ( row . get ( 1 ) ? , row . get ( 2 ) ? , row . get ( 3 ) ? , row . get ( 4 ) ? ) )"}, {"id": "lv-h749cf1015bd0", "path": "crates/fractal-store/src/store/custom/tests.rs", "kind": "sql-template", "fingerprint": "a4ed327498c7418504ce0f35ae431ea1ad868e8afce21fa419733af7a8d3d950", "owner": "fractal_store::store::custom::tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 125, "excerpt": "CREATE TABLE batches(id TEXT PRIMARY KEY); CREATE TABLE claims(id TEXT PRIMARY KEY,batch_id TEXT,subject TEXT,body TEXT); CREATE INDEX claims_subject ON claims(subject); CREATE TABLE replica_records(c"}, {"id": "lv-h74a6ba4022f5", "path": "crates/fractal-store/src/store/resources_preparation_tests.rs", "kind": "sql-template", "fingerprint": "8805a5a104be9832a4076deb02d89f59cf45feb1296c2ee79f7ff49cd44abebc", "owner": "fractal_store::store::resources_preparation_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 514, "excerpt": "UPDATE replica_records SET state='repaired' WHERE record_ref='record/example-preparation'"}, @@ -2783,6 +2907,7 @@ {"id": "lv-h74b5be50ed01", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "de925b654ff0c1a32b72d4c8d38d7f3241f06cb54172c474113ccb338a20292b", "owner": "fractal_store::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 7702, "excerpt": "INSERT INTO mission_runs(id, mission_id, initial_revision, current_generation_id, root_revision, root_run_id, workspace, requester, inputs, mode, status, phase, created_at_unix_ms, updated_at_unix_ms)"}, {"id": "lv-h74b5d9dca93e", "path": "crates/fractal-seats/src/store/person_work/reconcile_candidates_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "8edb630b01a1f78d4abc5ee08b714ce7a8578b35d2269aec45684bf19ac1e4fc", "owner": "fractal_seats::store::person_work::reconcile_candidates_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 82, "excerpt": "& query"}, {"id": "lv-h74be3b2acae0", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "5b3852d461286654dc6240e77ed7e1f4464ab067c301f26b4c6fc63846cc88b4", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 16113, "excerpt": "UPDATE step_runs SET lease_expires_at_unix_ms=?5, updated_at_unix_ms=?6 WHERE subject=?1 AND attempt=?2 AND lease_owner=?3 AND lease_incarnation=?4 AND status NOT IN ('completed','failed','cancelled')"}, + {"id": "lv-h74c78298f3cf", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "770c8887af3848223aacd4c3d3d6143368341ba91f8434d8173a540034fd2db6", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 1331, "excerpt": "INSERT INTO replica_records (record_ref,writer,sequence,envelope_hash,position,raw,state,claim_id,updated_at_unix_ms) SELECT 'earlier-signed-record',writer,sequence,?2,0,raw,'valid',claim_id,'0' FROM "}, {"id": "lv-h74f21ec21fc9", "path": "crates/fractal-store/src/store/limits.rs", "kind": "unresolved-sql-sink", "fingerprint": "3210a9afddd671e21c69091353cc015e5edbfa0986753e700db538e2cc9c39e7", "owner": "fractal_store::store::limits", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 374, "excerpt": "params ! [ limit . driver , limit . account , account_ref , weekly , limit . measured_at_unix_ms as i64 , subject , * store_index as i64 , origin , projected_body , head_key , window ]"}, {"id": "lv-h74f3ad553af2", "path": "crates/smallclaims/src/ivm/claim_source.rs", "kind": "sql-template", "fingerprint": "513476250637c39a49b0a8a32acfd2217360f0e76d1116de9cd29cddfcf3ef15", "owner": "smallclaims::ivm::claim_source", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 258, "excerpt": "INSERT INTO ivm_install_claim_ranks VALUES(?1,?2,?3) ON CONFLICT(source,claim_id) DO UPDATE SET position=excluded.position"}, {"id": "lv-h74f4f9d6ce77", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "unresolved-sql-sink", "fingerprint": "db6ade3d1b56db07d8298850aa16c2f445feab5b89946013223ab2157ec8d534", "owner": "fractal_missions::store::missions", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 5567, "excerpt": "params ! [ true , actor . as_deref ( ) , subject ] , step_run_from_row"}, @@ -2829,6 +2954,7 @@ {"id": "lv-h771f68bc2561", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "33d725104ba7fcd12b82027e2021bd70d7a1dca95c7dcc91466f8d918778b06e", "owner": "smallclaims::store::membership_query_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 54, "excerpt": "INSERT INTO claims VALUES(?1,?2,?3,?4,?1)"}, {"id": "lv-h77397d572db7", "path": "crates/fractal-delivery/src/store/directive_notes/tests.rs", "kind": "sql-template", "fingerprint": "87a7d75e58fd79768f5337f0885b884a2f8a08989ca7a8470b188205a8545db5", "owner": "fractal_delivery::store::directive_notes::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 231, "excerpt": "UPDATE replica_records SET state='valid',replacement_claim_id=NULL WHERE record_ref=?1"}, {"id": "lv-h773c483c8e52", "path": "crates/fractal-store/src/store/message_versions.rs", "kind": "unresolved-sql-sink", "fingerprint": "d80eef577245eb7c0dc5788e29a4834b05723e8bcf6734f1b172ce3e12e29acd", "owner": "fractal_store::store::message_versions", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 33, "excerpt": "QUERY"}, + {"id": "lv-h773f1bab1a89", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "a1283ec5bf87b372df96534f09c45e898f5571cce47da6cbbcd01e0f6c82c16f", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 809, "excerpt": "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1"}, {"id": "lv-h774c911bd0f7", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "d7884c2e571cd3e6bd0aca90f04cc3f630e00c81e473bc432744ad252550abfe", "owner": "fractal_missions::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 151, "excerpt": "INSERT INTO operations(id, request_digest, canonical_claim_id, state) VALUES ('op/kept', 'digest', 'claim/kept', 'active')"}, {"id": "lv-h776a38ab964c", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "b264fff65d4e828306ecb878244ab64249f5f7ab8876f2060656c9133f5532b2", "owner": "fractal_missions::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 748, "excerpt": "UPDATE mission_runs SET created_at_unix_ms='50' WHERE id=?1"}, {"id": "lv-h777dc35a3cdd", "path": "crates/fractal-store/src/store/run_eta.rs", "kind": "sql-template", "fingerprint": "42859fed448f15def8230cf421b1e0d26182b7771efaf78a363673f79d0c3c04", "owner": "fractal_store::store::run_eta", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 150, "excerpt": "DELETE FROM local_run_eta_samples WHERE definition_hash=?1 AND step_path=?2"}, @@ -2842,6 +2968,7 @@ {"id": "lv-h77cbd3b06e97", "path": "crates/fractal-store/src/store/custom/tests.rs", "kind": "sql-template", "fingerprint": "c5ae523820942792da08b633e1c6356f63412f6fb86676d6881a6cf0c9e1a17b", "owner": "fractal_store::store::custom::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 280, "excerpt": "UPDATE claims SET subject=subject,body=body; UPDATE documents SET name=name,hash=hash; UPDATE batches SET origin=origin,replica_sequence=replica_sequence; UPDATE replica_records SET position=position,"}, {"id": "lv-h77d273449aaf", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "unresolved-sql-sink", "fingerprint": "789b44b9990c7d88da3542aa5c6b25148409a57d64b88f00362513cda78a031f", "owner": "smallclaims::store::checkpoint", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1060, "excerpt": "\"COMMIT\""}, {"id": "lv-h77d7b285efb4", "path": "crates/smallclaims/src/store/prepared_envelope_tests.rs", "kind": "sql-template", "fingerprint": "ffe2d755641de88ef26bc27e816ef9eb68d604ea4957f3632f5977959a11b09c", "owner": "smallclaims::store::prepared_envelope_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 271, "excerpt": "INSERT OR IGNORE INTO batches(id, origin, replica_sequence, previous_hash, hash, accepted_at_unix_ms, rowid) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)"}, + {"id": "lv-h77dca66dd9fc", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "27d232bfdac20ec3e03d278b7ea3fcfa5f244c7ae92b81605409f9246abc04a0", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 1465, "excerpt": "INSERT INTO assistant_grant_proof_invalidations(writer,sequence,envelope_hash,member_key) VALUES(?1,7,'proof','lost-key')"}, {"id": "lv-h77fe1333da4f", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "412a484ee25c41b7fa7d03806e57e7e8ed5188eb6dbe858f0f04a34ed2bc0305", "owner": "smallclaims::store::repair_operation_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1163, "excerpt": "\"COMMIT; PRAGMA wal_checkpoint(TRUNCATE)\""}, {"id": "lv-h7806ccf90921", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "f82679507da94c94c22b4a54bba7980a044b69d741d5c3c5739c215172dc9554", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 18454, "excerpt": "[ & claim . subject ] , | row | row . get : : < _ , bool > ( 0 )"}, {"id": "lv-h781aeff5629d", "path": "crates/fractal-store/src/store/wake_lookup_tests.rs", "kind": "sql-template", "fingerprint": "2ca903064ae8762dcccecdf43224228481d7a04d96e95f2c6281a1c9baf823e8", "owner": "fractal_store::store::wake_lookup_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 171, "excerpt": "UPDATE claims SET body=?1 WHERE id='mutable'"}, @@ -2897,6 +3024,7 @@ {"id": "lv-h7ab00a9247a2", "path": "crates/fractal-seats/src/store/runtime_starts.rs", "kind": "sql-template", "fingerprint": "83f037ab9074ad46a68b393aa8779242089305f4411ffb69034930206d59095b", "owner": "fractal_seats::store::runtime_starts", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 926, "excerpt": "UPDATE local_runtime_starts SET finished=1,result=?2, cleanup_verified=CASE WHEN json_extract(?2,'$.error') IS NOT NULL AND json_extract(?2,'$.producer_closed')=1 THEN 1 ELSE cleanup_verified END WHER"}, {"id": "lv-h7ab21426ccab", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "sql-template", "fingerprint": "5faaf09ba63c776dffd5c2dc829c9c56759d5e22dcd96939cfd9d2423a454808", "owner": "fractal_missions::store::missions", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 2639, "excerpt": "UPDATE planning_sessions SET status='review', updated_at_unix_ms=?2 WHERE id=?1"}, {"id": "lv-h7ab5e25ccad4", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "0cafdab7267f9a1864fff125cdd4e115b680ea889c9d6dd31ffe1a9bb48b97c1", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 8742, "excerpt": "& canonical_sql ( & format ! ( \"SELECT id, body, predecessors FROM claims WHERE subject=?1 AND kind='intent.desired' AND store_index<=?2 AND {UNREPAIRED_CLAIM} AND NOT EXISTS ( SELECT 1 FROM replica_r"}, + {"id": "lv-h7ab907abb853", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "1b216adb52a0fb9733488054a9256c7408c7cf0d300957582e141ac7636abd7b", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 623, "excerpt": "INSERT OR IGNORE INTO assistant_grant_recompute SELECT claim_id FROM assistant_grant_pending WHERE claim_id=?1"}, {"id": "lv-h7abafebbc158", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "f1f1fa59d0794ad81a428da1e110c594c3001847ec15662651c48cbeb53fb7dd", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6712, "excerpt": "& canonical_sql ( & format ! ( \"SELECT origin FROM claims WHERE subject=?1 AND kind!='intent.desired' AND kind NOT LIKE 'harness.%' AND kind!='runtime.readiness-deadline-reached' AND kind!='reconcile."}, {"id": "lv-h7ac19e508214", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "8edb630b01a1f78d4abc5ee08b714ce7a8578b35d2269aec45684bf19ac1e4fc", "owner": "smallclaims::store::repair_operation_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1057, "excerpt": "& query"}, {"id": "lv-h7acb721a77a0", "path": "crates/fractal-store/src/store/person_work.rs", "kind": "unresolved-sql-sink", "fingerprint": "619f9c61110bd7cf570516c24eeeb6099e8827b70566fa5f3e3d17a0d4bb3d6a", "owner": "fractal_store::store::person_work", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 838, "excerpt": "params ! [ mission . id , mission . revision , claim . id ] ,"}, @@ -2908,6 +3036,7 @@ {"id": "lv-h7b32036bdf19", "path": "crates/fractal-store/src/store/custom/tests.rs", "kind": "sql-template", "fingerprint": "8d07708204bdcb36528ea6d28d2348ed8136175dd851c949c0b82cf13d8f1f8e", "owner": "fractal_store::store::custom::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 139, "excerpt": "INSERT INTO replica_records VALUES(?1,'repaired')"}, {"id": "lv-h7b326d121459", "path": "crates/fractal-store/src/store/checkpoint_rules/staged.rs", "kind": "unresolved-sql-sink", "fingerprint": "98c3c3fc04bdbec0b289c0cdce0ab5bc8e46d17e3742054f86adf38ad9f1b5cc", "owner": "fractal_store::store::checkpoint_rules::staged", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 139, "excerpt": "params ! [ slot [ 0 ] , request ] , | row | row . get : : < _ , bool > ( 0 )"}, {"id": "lv-h7b519c3563f1", "path": "crates/fractal-seats/src/store/canonical_audit.rs", "kind": "sql-template", "fingerprint": "c76825515efabf423b4a5968ef19b4c8d1ba322a7f0ab3998f6a336077ae4d22", "owner": "fractal_seats::store::canonical_audit", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 291, "excerpt": "DELETE FROM local_mailbox_leases WHERE subject=?1"}, + {"id": "lv-h7b614d59afc6", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "3cf15bb11a03680637b95a99d9da652fbb44ad93bb568b72f98591fbcb78958c", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 227, "excerpt": "INSERT OR IGNORE INTO assistant_grant_dirty SELECT claim_id FROM assistant_grant_auth_cursor; DELETE FROM assistant_grant_auth_cursor; ALTER TABLE assistant_grant_auth_cursor ADD COLUMN membership_sta"}, {"id": "lv-h7b6d9491384e", "path": "crates/fractal-store/src/store/gate_runners.rs", "kind": "sql-template", "fingerprint": "492c792b9519ba2d6c506167f3c48969c7b542c60f9d4efc1a30710c04a36aed", "owner": "fractal_store::store::gate_runners", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 96, "excerpt": "; END; CREATE TRIGGER IF NOT EXISTS gate_runners_claim_update AFTER UPDATE OF id, subject, kind, origin, body ON claims WHEN OLD.kind IN ('gate.requested','runtime.observed') OR NEW.kind IN ('gate.req"}, {"id": "lv-h7b845cb0a9d6", "path": "crates/fractal-store/src/store/limits.rs", "kind": "sql-template", "fingerprint": "1e51563f53d941ee1e56905580392ffa465e8f2887b6562ba6486fb5ddffd9f4", "owner": "fractal_store::store::limits", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 312, "excerpt": "INSERT OR REPLACE INTO meta(key,value) VALUES(?1, ?2)"}, {"id": "lv-h7b8b2b0cc4ca", "path": "crates/fractal-store/src/store/terminal_gate_evidence/native_source_shared.rs", "kind": "sql-template", "fingerprint": "56dff2f22fc1691976a3dd03233c4f6641f4454bdcf875b5fbd69be4d6a98a89", "owner": "fractal_store::store::terminal_gate_evidence::native_source_shared", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 341, "excerpt": "CREATE TRIGGER test_native_guard_binding AFTER UPDATE OF identity,origin,mission,run_id,generation_id,step,exec ON {GUARD} BEGIN UPDATE {GUARD} SET revision=revision+1,pending=1,gap='native binding re"}, @@ -2916,6 +3045,7 @@ {"id": "lv-h7ba5b1a68d8c", "path": "crates/fractal-store/src/store/person_work.rs", "kind": "unresolved-sql-sink", "fingerprint": "c7b24dc97eea6db6f6f6f2f0561f05f57f78e9256d65c9c0258bb62f0e6e159a", "owner": "fractal_store::store::person_work", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 365, "excerpt": "& QUERY ,"}, {"id": "lv-h7bb07031ba8c", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "d184d21209b5191dc6dc6d0290eb1cf6a3e94747f6c2967d6ba26e0865566b3a", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 273, "excerpt": "UPDATE replica_envelopes SET batch_id=NULL"}, {"id": "lv-h7bd22e8b7f8a", "path": "crates/smallclaims/src/store/prepared_seal.rs", "kind": "sql-template", "fingerprint": "a4d6d82b3d85e4d725b581397140e15e8e498ce1b4478a5f9ccf092998f3dc73", "owner": "smallclaims::store::prepared_seal", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 324, "excerpt": "INSERT OR IGNORE INTO replica_records( record_ref, writer, sequence, envelope_hash, position, raw, state, claim_id, subject_hint, kind_hint, updated_at_unix_ms ) VALUES (?1, ?2, ?3, ?4, ?5, ?6, 'valid"}, + {"id": "lv-h7be65771e125", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "ac7ee72de9f3c9fe89ae90f754e6ce6e1cd7d3f7da04183f3712a219377d7094", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1227, "excerpt": "UPDATE assistant_grant_retractions SET sequence=?2,claim_id=?3 WHERE id=?1"}, {"id": "lv-h7c16e8b65c63", "path": "crates/smallclaims/src/store/claim_ranges.rs", "kind": "sql-template", "fingerprint": "ccb281347982d4b79b82720bdab10771fceb80efa010cc3520a7c713352f012e", "owner": "smallclaims::store::claim_ranges", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 533, "excerpt": "INSERT OR IGNORE INTO retired_claim_ids(id) VALUES ({})"}, {"id": "lv-h7c28fba7c856", "path": "crates/smallclaims/src/store/idempotency.rs", "kind": "sql-template", "fingerprint": "6811bc6e23c717eceb181089b370f6f5ee318ea0fbf3ca178a92c4b200eb3343", "owner": "smallclaims::store::idempotency", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 47, "excerpt": "ALTER TABLE idempotency ADD COLUMN replay_safe INTEGER NOT NULL DEFAULT 0;"}, {"id": "lv-h7c290b785c03", "path": "crates/fractal-store/src/store/run_eta.rs", "kind": "sql-template", "fingerprint": "498c0ede6e1150593a3fd278df15a6871a1d1beecfd458a11619c8531b5c0c50", "owner": "fractal_store::store::run_eta", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 218, "excerpt": "DELETE FROM local_run_eta_terminal_pending"}, @@ -3023,6 +3153,7 @@ {"id": "lv-h80e87fffa918", "path": "crates/fractal-seats/src/store/runtime_starts.rs", "kind": "sql-template", "fingerprint": "9f2d6535131e7215e54df5c384f9df81f409770a0ff328a7c9df9ff06bad607e", "owner": "fractal_seats::store::runtime_starts", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 984, "excerpt": "UPDATE local_runtime_starts SET cleanup_verified=1,result=?2 WHERE id=?1"}, {"id": "lv-h80f54cac496c", "path": "crates/smallclaims/src/ivm.rs", "kind": "sql-template", "fingerprint": "c4a9286f648a6e56ae1dc0e2d4dbbe34367e491fd1c316c2a086bbd9370ad069", "owner": "smallclaims::ivm", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 859, "excerpt": "INSERT INTO ivm_heads VALUES(?1,?2,?3,?4,?5,?6) ON CONFLICT(view,key,register) DO UPDATE SET value=excluded.value,claim_id=excluded.claim_id,rank=excluded.rank"}, {"id": "lv-h80fb3476454f", "path": "crates/fractal-api-client-v0/src/api/client_v0/conversation_blocks/conformance_tests.rs", "kind": "included-source", "fingerprint": "28b8b33224c8fd44f648b926bd65c286c7a6a4b9e64db801836a8c39823b71a3", "owner": "fractal_api_client_v0::api::client_v0::conversation_blocks::conformance_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 35, "excerpt": "include_str ! ( \"../../../../../fractal-daemon/fixtures/native-records/claude.jsonl\" )"}, + {"id": "lv-h80fb9d4725e0", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "unresolved-sql-sink", "fingerprint": "7bac5ebfffac69fd99c3fda6627fe33f1f53d8371f2d4676b31eafe0aed2222d", "owner": "smallclaims::store::assistant_grant_authority", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 149, "excerpt": "TRANSITION_QUERY , params ! [ granted . subject , kind , granted . origin , granted . actor , granted . id ] , | row | row . get ( 0 )"}, {"id": "lv-h810468890407", "path": "crates/fractal-store/src/store/attention_ivm.rs", "kind": "sql-template", "fingerprint": "6b1e1f274ac274db45e76b8ddb5a2b5c2e2f5ec50350f31f172edf3c38a1291a", "owner": "fractal_store::store::attention_ivm", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 125, "excerpt": "CREATE TRIGGER IF NOT EXISTS attention_open_record_{action} AFTER {action} ON replica_records BEGIN INSERT INTO local_attention_open_dirty SELECT family,source FROM local_attention_open_dependencies W"}, {"id": "lv-h810b1410be6a", "path": "crates/fractal-seats/src/store/resource_preparation/tests.rs", "kind": "sql-template", "fingerprint": "238d29ffdf8759d09f6821c6e95f4140738235edeeed9d36863cc4b8c6313423", "owner": "fractal_seats::store::resource_preparation::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 99, "excerpt": "INSERT OR REPLACE INTO meta(key,value) VALUES('invented-unrelated-write',?1)"}, {"id": "lv-h8129930894d4", "path": "crates/fractal-store/src/store/observer_subscription_detail.rs", "kind": "unresolved-sql-sink", "fingerprint": "3742ae7e222e6ca68d223d10fc4c783a1072bf646b9adef513d3053178e1afe1", "owner": "fractal_store::store::observer_subscription_detail", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 113, "excerpt": "DECLARATION_KIND_METADATA_SQL"}, @@ -3048,6 +3179,7 @@ {"id": "lv-h821b199ed4a2", "path": "crates/smallclaims/src/store/checkpoint_space.rs", "kind": "unresolved-sql-sink", "fingerprint": "5b6b40a906a01449b1777c0aa965073d786de369e2f1e74d6af78bfa11963f53", "owner": "smallclaims::store::checkpoint_space", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 303, "excerpt": "\"BEGIN\""}, {"id": "lv-h82251dbdbf0f", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "28b4ca6b53d3ec70e999785ef5f3cad8839915d4d0183c1392fce01351b0ad94", "owner": "fractal_missions::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 6195, "excerpt": "UPDATE mission_runs SET updated_at_unix_ms='0' WHERE id=?1"}, {"id": "lv-h822884cc319d", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "unresolved-sql-sink", "fingerprint": "cbb2e55e11d6de968ed9a8f1e769e366d6131e30707e13884646f167b159163e", "owner": "smallclaims::store::checkpoint", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1938, "excerpt": "\"VACUUM INTO ?1\" , [ copy . to_string_lossy ( ) ]"}, + {"id": "lv-h8247508e87c0", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "unresolved-sql-sink", "fingerprint": "1363222174d97b9fa7a518b72c73675bf24cf9420a181a7bad4dbae4ff208f36", "owner": "smallclaims::store::assistant_grant_authority", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 996, "excerpt": "query , params ! [ writer , sequence , hash , key , cursor ] , | row | row . get ( 0 )"}, {"id": "lv-h825403c36366", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "8252ec56d64551b9a2686294d8ad4ffb5a1e8136ba40291ba507ec123c0ce803", "owner": "fractal_missions::store::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 6817, "excerpt": "INSERT INTO batches(id,origin,replica_sequence,hash,accepted_at_unix_ms) VALUES ('episode-batch','episode-growth',1,'synthetic','1')"}, {"id": "lv-h82740cf815e0", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "2907c0ab7d71ddb015d7f03cc954387d6ee9a1a244d326f8fafe3c4b5c446515", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 16344, "excerpt": "& canonical_sql ( \"SELECT json_extract(body, '$.fields.root_mission_run') FROM claims WHERE subject=?1 AND kind='mission-run.created' ORDER BY CANONICAL_ASC(claims) LIMIT 1\" ) , [ format ! ( \"mission-"}, {"id": "lv-h8281e663498e", "path": "crates/fractal-store/src/store/attention_snapshot.rs", "kind": "unresolved-sql-sink", "fingerprint": "32e2f432182477efea814b8a3d100f06af4a532fc6c0e52d80160d440e9eda2a", "owner": "fractal_store::store::attention_snapshot", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 2334, "excerpt": "params ! [ seat , i64 : : MAX ] , | row | { Ok ( ( row . get : : < _ , i64 > ( 0 ) ? , row . get : : < _ , String > ( 1 ) ? ) ) }"}, @@ -3060,6 +3192,7 @@ {"id": "lv-h82d031aa5230", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "d35dc0a9fd27f6aad25be7c44041c7a08c1a92e5a5939c8e0a81ede50c09d54e", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6324, "excerpt": "& claims_in_order_query ( newest_first ) ,"}, {"id": "lv-h82fa95c68afa", "path": "crates/fractal-store/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "90dbe74bec90013705bd92e02619372a20cb7733a5375be33830ea72c895a370", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 3526, "excerpt": "[ subject ] , | row | row . get ( 0 )"}, {"id": "lv-h830751fcf154", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "82623c2ba0e6f33c8814ebcf2cdbf966914ff63c1a194521eb14fe68e57d581e", "owner": "fractal_store::store::tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 9613, "excerpt": "CREATE TABLE claims(store_index INTEGER PRIMARY KEY,kind TEXT,body TEXT); CREATE TABLE event_positions(store_index INTEGER PRIMARY KEY,subject TEXT); CREATE TABLE local_event_payloads(store_index INTE"}, + {"id": "lv-h830bfc82281f", "path": "crates/fractal-api-core/src/api/client_v0/external_grants/conflict_tests.rs", "kind": "sql-template", "fingerprint": "0fb338ad0acf82cd6d405b987f3373ab7a688e926db8ba4f052c8fdabf0dbdcd", "owner": "fractal_api_core::api::client_v0::external_grants::conflict_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 648, "excerpt": "INSERT INTO assistant_grant_dirty(claim_id) VALUES(?1)"}, {"id": "lv-h832547b61b1f", "path": "crates/fractal-api-core/src/api/published_lists_tests.rs", "kind": "sql-template", "fingerprint": "ee5bc82da6f49b62f613cf8d7a8666426a9b294c94b59fd68c6fe53ad0bbdc82", "owner": "fractal_api_core::api::published_lists_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1956, "excerpt": "DROP TRIGGER run_eta_run_update; CREATE TRIGGER run_eta_run_update AFTER UPDATE ON mission_runs WHEN NEW.phase='terminal' OR OLD.phase='terminal' BEGIN INSERT OR IGNORE INTO local_run_eta_dirty SELECT"}, {"id": "lv-h832768d81f3e", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "unresolved-sql-sink", "fingerprint": "5503f4f258a6a7e647db4a775f085da8af2fc9f9b822e535be7640b0ee6f6a64", "owner": "smallclaims::store::checkpoint_staging", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1086, "excerpt": "& format ! ( \"SELECT COUNT(*) FROM ({claims})\" ) , [ ] , | row | row . get ( 0 )"}, {"id": "lv-h83524721f4da", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "3d783d3c6bdc0223896a8d3c3b77e625f0475adf8ce2766a6d104868241ac7f6", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 10643, "excerpt": "INSERT INTO operations(id, request_digest, canonical_claim_id, state) VALUES (?1, ?2, ?3, ?4)"}, @@ -3075,6 +3208,7 @@ {"id": "lv-h83d11ff37191", "path": "crates/fractal-delivery/src/store/message_point_qualification/tests.rs", "kind": "sql-template", "fingerprint": "8daedc4d95d799327e693c31d0e5f82401f9eefed1c92c51eb9a761efae397d0", "owner": "fractal_delivery::store::message_point_qualification::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 51, "excerpt": "INSERT INTO projection_digest_repaired_claims(id) VALUES('repaired')"}, {"id": "lv-h83dd55ca0487", "path": "crates/fractal-delivery/src/store/conversation_deliveries_tests.rs", "kind": "sql-template", "fingerprint": "9c0f915540d104b0a6ecb7045d06bb19392ea1ebdae55c5606f0d5ec46b0850e", "owner": "fractal_delivery::store::conversation_deliveries_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 164, "excerpt": "DROP TRIGGER reject_fixture_proof;"}, {"id": "lv-h83e8e20c3907", "path": "crates/fractal-store/src/store/run_eta_tests.rs", "kind": "sql-template", "fingerprint": "87deb1086711e040dec53c12be85210cbf8162e46bfd582a7ffda37e2877397b", "owner": "fractal_store::store::run_eta_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 556, "excerpt": "DELETE FROM mission_runs WHERE phase='terminal' AND CAST(substr(id,3) AS INTEGER)%4=1"}, + {"id": "lv-h83f6fdabc1cb", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "79f72f17b3e181dc10b1e23786a451681385fb46af31f8e3c40d4b195d249dad", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1006, "excerpt": "DELETE FROM assistant_grant_proof_invalidations WHERE id=?1"}, {"id": "lv-h840dfae817e7", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "7d1ee8f5a8bab3fc0ec63608dfd381333f176d8a17a3cae08f038e03b2a048fb", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 18832, "excerpt": "INSERT INTO step_runs(subject, run_id, generation_id, step_path, definition_hash, status, attempt, assignee, available_to, agentless, title, goals, worker_reported, blocked_reason, not_before_unix_ms,"}, {"id": "lv-h84213c6880a6", "path": "crates/fractal-store/src/backup.rs", "kind": "unresolved-sql-sink", "fingerprint": "74c74336a36242ea9a930f49a45b8dc1d0830f48bda0d9df245b2cf61e23a967", "owner": "fractal_store::backup", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 495, "excerpt": "\"BEGIN EXCLUSIVE;\""}, {"id": "lv-h8428f7b25b5a", "path": "crates/smallclaims/src/store/projection_digest.rs", "kind": "sql-template", "fingerprint": "d6831fc28b35fb4007f97fe2cb6d9ebdc9da268bd1ee54dcd2c75cb8fdd3fcc5", "owner": "smallclaims::store::projection_digest", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 306, "excerpt": "UPDATE projection_digest_state SET row_count=row_count+({current} IS NOT NULL)-({previous} IS NOT NULL), accumulator=st_projection_change(accumulator,table_name,columns_json,{previous},{current},1) WH"}, @@ -3093,18 +3227,21 @@ {"id": "lv-h84d691feb23a", "path": "crates/fractal-missions/src/store/eta_tests.rs", "kind": "sql-template", "fingerprint": "df10abcd7dd73103954112631290cae1858203bc87d0eba43c18ddbd87d2d513", "owner": "fractal_missions::store::eta_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 155, "excerpt": "INSERT INTO local_run_eta_samples SELECT ?1,'historical',definition_hash,step_path,1,?2 FROM step_runs WHERE subject=?3"}, {"id": "lv-h84df06b98d77", "path": "crates/smallclaims/src/store/principals/legacy.rs", "kind": "sql-template", "fingerprint": "ffcf3ca922facd04e7385900c7401dd5c91af9e55855f45abed34282fadc456e", "owner": "smallclaims::store::principals::legacy", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 383, "excerpt": "UPDATE claim_signature_migration SET legacy_fault=?1 WHERE id=1 AND serving_legacy=1"}, {"id": "lv-h84e38bdda3f0", "path": "crates/fractal-store/src/store/actual_state_sorter_tests.rs", "kind": "sql-template", "fingerprint": "968400bc19303ae0d6d5033d761867974497d2a1031c5280995cc9504734f0b7", "owner": "fractal_store::store::actual_state_sorter_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 35, "excerpt": "INSERT INTO claims(id,batch_id,subject,kind,body,accepted_at_unix_ms) VALUES (?1,?2,?3,?4,?5,?6)"}, + {"id": "lv-h84ea96cecd57", "path": "crates/smallclaims/src/store/assistant_grant_authority_bench.rs", "kind": "sql-template", "fingerprint": "944de795e1c96b5afc4ab4efa4a713c1dedb427ce485b6979f8edef83eedcdc4", "owner": "smallclaims::store::assistant_grant_authority_bench", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 456, "excerpt": "INSERT INTO assistant_grant_local_appends(claim_id) VALUES(?1)"}, {"id": "lv-h850482038bc7", "path": "crates/smallclaims/src/store/sealed_view_cache_tests/migration_tests.rs", "kind": "sql-template", "fingerprint": "2aad8d453e29bf5117521b91c6ae82765aa5f7a40737faddcda2a5b664ed1a53", "owner": "smallclaims::store::sealed_view_cache_tests::migration_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 83, "excerpt": "UPDATE claims SET subject='host/different-anchor' WHERE kind='fleet.member-admitted'"}, {"id": "lv-h85140ee457fa", "path": "crates/smallclaims/src/ivm/installed.rs", "kind": "sql-template", "fingerprint": "385b7d5e51f50d3163d64a9b69ba45abde3a56aecd5e24d2557db457304182c7", "owner": "smallclaims::ivm::installed", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 441, "excerpt": "DELETE FROM ivm_view_errors WHERE view=?1"}, {"id": "lv-h851eb4364e69", "path": "crates/smallclaims/src/sqlite/read_admission_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "5b6b40a906a01449b1777c0aa965073d786de369e2f1e74d6af78bfa11963f53", "owner": "smallclaims::sqlite::read_admission_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 478, "excerpt": "\"BEGIN\""}, {"id": "lv-h852431c8435e", "path": "crates/smallclaims/src/store/sealed_view_cache_tests/mutation_tests.rs", "kind": "sql-template", "fingerprint": "1aa94ce673b4406dd2b10479e4fd77690b74b765d0060543a3eedfd2936b61cb", "owner": "smallclaims::store::sealed_view_cache_tests::mutation_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 276, "excerpt": "UPDATE claims SET subject='host/anchor' WHERE kind='fleet.member-admitted'"}, {"id": "lv-h8534772cd776", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "796005106fefec966aa7790e7846f19aeabbf2cbdbf73fea5be08ef958239d31", "owner": "fractal_missions::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 6912, "excerpt": "DELETE FROM operations"}, {"id": "lv-h85728a5c3b07", "path": "crates/smallclaims/src/store/principals/judging.rs", "kind": "sql-template", "fingerprint": "eda12d95456987a6898c55b6e353b7628b98e45234dcbe596f183e58db005895", "owner": "smallclaims::store::principals::judging", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 101, "excerpt": "INSERT INTO claim_signature_judging(claim_id,candidate_count,roots_digest,content_digest,last_signature,complete,dirty) VALUES (?1,?2,?3,?4,'',0,0) ON CONFLICT(claim_id) DO UPDATE SET candidate_count="}, + {"id": "lv-h8579ec8dafea", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "97e117ac41d144011ca3637f43f993dbcb61651f11f269c0bb593cbeadcc9b19", "owner": "smallclaims::store::assistant_grant_authority", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 256, "excerpt": "DROP TRIGGER IF EXISTS {table}_auth_work_{event}; CREATE TRIGGER {table}_auth_work_{event} AFTER {event} ON {table} BEGIN INSERT INTO assistant_grant_auth_work SELECT COALESCE((SELECT origin FROM assi"}, {"id": "lv-h85885f47ee57", "path": "crates/fractal-store/src/store/run_eta_tests.rs", "kind": "sql-template", "fingerprint": "2d1b290a26adf9140f8cd4cda68d4ea93a89c1276893bdb52bd29ba437ad72ed", "owner": "fractal_store::store::run_eta_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 139, "excerpt": "DELETE FROM mission_runs WHERE id='r-998'"}, {"id": "lv-h8588b56bee1f", "path": "crates/smallclaims/src/store/schema_install_tests.rs", "kind": "sql-template", "fingerprint": "2a414f09b6138564b5de45d504a8be7125de84ad034dadc33d209a4aa5316abe", "owner": "smallclaims::store::schema_install_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 60, "excerpt": "PRAGMA journal_mode=WAL; CREATE TABLE claims(id TEXT PRIMARY KEY); INSERT INTO claims VALUES('existing'); PRAGMA user_version=18;"}, {"id": "lv-h85ba6985cde2", "path": "crates/fractal-api-core/src/api/replication_guard_tests.rs", "kind": "sql-template", "fingerprint": "fb53f45f34c425e53a75b2047afe076b5d4aedb8092b2c1db6e21644723c63f7", "owner": "fractal_api_core::api::replication_guard_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 187, "excerpt": "INSERT INTO replica_envelopes(writer,sequence,envelope_hash,accepted_at_unix_ms,payload,relay,receipt_state,received_at_unix_ms) VALUES('fixture',1,?1,'0',X'','fixture','pending','0')"}, {"id": "lv-h85bbaa862d7c", "path": "crates/smallclaims/src/store/principals/judging.rs", "kind": "sql-template", "fingerprint": "f71930b3a171cf2382a44b39167e6df87bcf88e189dd7a51d72730d2b0fd474c", "owner": "smallclaims::store::principals::judging", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 117, "excerpt": "INSERT OR IGNORE INTO claim_verdict_links(link,claim_id) VALUES (?1,?2)"}, {"id": "lv-h85cea2f5ebf5", "path": "crates/fractal-store/src/store/checkpoint_capture_epoch_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "faa2abd3b66637ce500311e846d011960f3ffa5d74867e5a0cb0940c0f065944", "owner": "fractal_store::store::checkpoint_capture_epoch_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 141, "excerpt": "insert , [ & newer . id ]"}, - {"id": "lv-h85e4d7c741b2", "path": "crates/fractal/src/main_tests.rs", "kind": "included-source", "fingerprint": "ec0fa810263574be541717738b96975251c63f1d8a77b8ca9655743932b3dcaf", "owner": "fractal::main_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 3388, "excerpt": "include_str ! ( \"doctor_cli.rs\" )"}, + {"id": "lv-h85da58ff0363", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "701329c99c19076f8b477e2f84c40f1a2ece7974203ef799364c1f2382fd1875", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 632, "excerpt": "UPDATE replica_envelope_signatures SET signature='invalid'"}, + {"id": "lv-h85e4d7c741b2", "path": "crates/fractal/src/main_tests.rs", "kind": "included-source", "fingerprint": "ec0fa810263574be541717738b96975251c63f1d8a77b8ca9655743932b3dcaf", "owner": "fractal::main_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 3027, "excerpt": "include_str ! ( \"doctor_cli.rs\" )"}, {"id": "lv-h860a5db13f30", "path": "crates/fractal-api-client-v0/src/api/client_v0/observer_subscription_detail_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "bd2df656dd9fecb1cfcf855790dfc22f057702e1a32474b68cd827f651a2bb34", "owner": "fractal_api_client_v0::api::client_v0::observer_subscription_detail_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 613, "excerpt": "& format ! ( \"SELECT {column} FROM desired WHERE subject=?1\" ) , [ OBSERVER ] , | row | row . get ( 0 ) ,"}, {"id": "lv-h8610ddeb875c", "path": "crates/fractal-store/src/store/notice_authority_tests.rs", "kind": "sql-template", "fingerprint": "2f09062974e3af83b900069bf9d5f1a76653ccc3b734c67d2da9b54653fbdd42", "owner": "fractal_store::store::notice_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 369, "excerpt": "UPDATE desired SET owner_run='mission-run/owner', owner_generation='run-generation/owner' WHERE subject=?1"}, {"id": "lv-h86161607bbb6", "path": "crates/smallclaims/src/store/principals/judging.rs", "kind": "unresolved-sql-sink", "fingerprint": "b763655cd5c420194840c5ff68673ac95cc2adad17e40dec73e322f1195ed700", "owner": "smallclaims::store::principals::judging", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 101, "excerpt": "params ! [ claim_id , count , roots_digest , content_digest ( & row . subject , & row . kind , row . actor . as_deref ( ) , & row . body ) ]"}, @@ -3115,6 +3252,7 @@ {"id": "lv-h86a60c947619", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "3660315a9af3df255d8f19ab077e4797822b41488a0e2a04bc6af71213c23274", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1008, "excerpt": "page"}, {"id": "lv-h86a6d29b4dfb", "path": "crates/fractal-store/src/store/resources_preparation.rs", "kind": "unresolved-sql-sink", "fingerprint": "3c41de7be30a32ef9fd47559d01b20728311318a75f27abeff1f1322c5571bb7", "owner": "fractal_store::store::resources_preparation", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 820, "excerpt": "[ id ] , | row | Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? , row . get ( 2 ) ? , row . get ( 3 ) ? ) )"}, {"id": "lv-h86a884b5d8d7", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "d59da6c17e83a428f10f737beae15b402ba624181e588da077b2ebdac8054845", "owner": "fractal_missions::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 2905, "excerpt": "DELETE FROM meta WHERE key='work_extended_projection_rules'"}, + {"id": "lv-h86c509920fc9", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "3e4e5b793d88ee37521d1c23ca67308212b227a4f3208044d40ffbbf1ef903c2", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 959, "excerpt": "UPDATE assistant_grant_membership_state SET applied_generation=?1 WHERE id=1"}, {"id": "lv-h86ec96290046", "path": "crates/smallclaims/src/store/retired.rs", "kind": "unresolved-sql-sink", "fingerprint": "aa56c8075c4247abb9552ab67acdc0aa148e31bafa47647665a0f2c142515d9c", "owner": "smallclaims::store::retired", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 148, "excerpt": "[ AUTHORITY ] , | row | row . get ( 0 )"}, {"id": "lv-h86ed99698958", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "f1042dc03445963d24ef3b77accc805afd85f800f931b22a01d76dfc762e1ac6", "owner": "fractal_store::store::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 5073, "excerpt": "UPDATE replica_envelopes SET receipt_state='degraded' WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3"}, {"id": "lv-h8718b4f6a573", "path": "crates/fractal-reconcile/src/reconcile/tests/incremental_deadlines.rs", "kind": "sql-template", "fingerprint": "573b5024ca41e1e809d835ddff30d48a4dd9a02815562f9009c306e44a1ac246", "owner": "fractal_reconcile::reconcile::tests::incremental_deadlines", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 883, "excerpt": "UPDATE claims SET actor=NULL WHERE id=?1"}, @@ -3129,6 +3267,7 @@ {"id": "lv-h87aff5859f70", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "sql-template", "fingerprint": "5d3baa4cb1a6ebdc4527226258f80f2f07dfd1bd8aa4ff43204d68c70a101ee7", "owner": "fractal_missions::store::missions", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 4292, "excerpt": "INSERT INTO idempotency(operation_id, response) VALUES (?1, ?2)"}, {"id": "lv-h87b7d863902e", "path": "crates/fractal-api-core/src/api/exec_only.rs", "kind": "unresolved-sql-sink", "fingerprint": "cb722b1a8ee3b9814414aa14893e4f2adf072219a595753a59f595df94e2d4c4", "owner": "fractal_api_core::api::exec_only", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 77, "excerpt": "[ actual , desired ] , | row | row . get : : < _ , bool > ( 0 )"}, {"id": "lv-h87bbf137f13b", "path": "crates/fractal-store/src/store/status_summary_tests.rs", "kind": "sql-template", "fingerprint": "1b8b1b6029e43a1336fdf9d9e5bae289cf1ee70997dbaf6985975c1ded0ffe51", "owner": "fractal_store::store::status_summary_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 169, "excerpt": "INSERT INTO claims(id,batch_id,subject,kind,origin,body,predecessors,accepted_at_unix_ms) VALUES (?1,?1,?2,?3,?4,?5,'[]',?6)"}, + {"id": "lv-h87d2d3e94117", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "d6b8d0f9d6eaa695a08d114d6e2e958673e95a9ee2567afe781ee9e7ae3a1459", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 830, "excerpt": "INSERT INTO assistant_grant_auth_cursor(claim_id,position,record_rowid,member_key,membership_start) VALUES(?1,?2,?3,?4,?5) ON CONFLICT(claim_id) DO UPDATE SET position=excluded.position, record_rowid="}, {"id": "lv-h87e4d4e1e4b7", "path": "crates/fractal-missions/src/store/person_work.rs", "kind": "unresolved-sql-sink", "fingerprint": "178cc0ba54d0811f560be951ba7ae8db0a096e9db363f49659dce9c1588aa1bc", "owner": "fractal_missions::store::person_work", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 466, "excerpt": "& canonical_sql ( \"SELECT id,store_index,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms FROM claims WHERE subject=?1 AND kind='work.claimed' ORDER BY CANONICAL_DESC(claims)\" "}, {"id": "lv-h87f8b2df6443", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "7d0385ae325457595f3b25180ff791a17d7355ec6fadd538fbd82e80282a7a5f", "owner": "fractal_missions::store::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 6751, "excerpt": "UPDATE claims SET body=json_remove(body,'$.fields.state') WHERE id=?1"}, {"id": "lv-h87f96f1da890", "path": "crates/fractal-store/src/store/stream_mirror.rs", "kind": "sql-template", "fingerprint": "8677f0218cae0516af1ae8f68954e6843064a1e8c78330e6853353439ef1b58d", "owner": "fractal_store::store::stream_mirror", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 51, "excerpt": " -- A mirrored send folds as the graph's idle fold folds a `message.sent` claim, and queues the -- unread and usage work that claim's triggers queue. A subject the graph holds is folded there. CREATE "}, @@ -3154,7 +3293,9 @@ {"id": "lv-h892f95ddc81a", "path": "crates/smallclaims/src/store/document_pages/tests.rs", "kind": "sql-template", "fingerprint": "e31683e7f0a79f4904731c3f6d2e10fbac417404c59007dd3c50cf8dc415e541", "owner": "smallclaims::store::document_pages::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 469, "excerpt": "UPDATE claims SET accepted_at_unix_ms='bad-time' WHERE id=?1"}, {"id": "lv-h893fd22ec1cb", "path": "crates/fractal-reconcile/src/reconcile.rs", "kind": "included-source", "fingerprint": "bd1d74b23eacc2dfccbf14c663aad78e3a572cbb68d1880f6706064400616786", "owner": "fractal_reconcile::reconcile", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 46441, "excerpt": "include_str ! ( \"../../fractal-drivers/tests/fixtures/blocking-screens/pi-no-key.txt\" )"}, {"id": "lv-h89584a033329", "path": "crates/fractal-store/src/store/terminal_gate_evidence/native_source/transaction_hooks/tests.rs", "kind": "sql-template", "fingerprint": "0ed94e7e0c8f333d05f3961f378e168f160d2fa91dbb65b98f7863a2ac75eab2", "owner": "fractal_store::store::terminal_gate_evidence::native_source::transaction_hooks::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 263, "excerpt": "DROP TRIGGER test_managed_storage_failure"}, + {"id": "lv-h896ccf48254e", "path": "crates/smallclaims/src/store/assistant_grant_receipt_cost_tests.rs", "kind": "sql-template", "fingerprint": "5b7f32c54f23f083b7e1320677a4cf999f24bc656ff018305dbe16c2ab0897e1", "owner": "smallclaims::store::assistant_grant_receipt_cost_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 162, "excerpt": "UPDATE meta SET value=value WHERE key='fleet_anchor_key'"}, {"id": "lv-h89818111bcfb", "path": "crates/fractal-store/src/store/observer_subscription_detail.rs", "kind": "unresolved-sql-sink", "fingerprint": "9b853187ddc33b819ed80c841f34d59bb665296885fd7d7e1f992016f7de816e", "owner": "fractal_store::store::observer_subscription_detail", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 95, "excerpt": "[ position ] , | row | decode_time ( row . get ( 0 ) ? , 0 )"}, + {"id": "lv-h89976b37066a", "path": "crates/fractal/src/assistant_grant_authority_wake_tests.rs", "kind": "sql-template", "fingerprint": "07b6e9980b94aef234a9a9266b80cc998e834399582cca9089b7e98d4eb10445", "owner": "fractal::assistant_grant_authority_wake_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 21, "excerpt": "INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) VALUES(?1,'batch/old-writer','custom/client/assistant-v1-invalid', 'custom.client.assistant.v1.granted',"}, {"id": "lv-h8999e0d929e5", "path": "crates/smallclaims/src/store/principals/legacy.rs", "kind": "sql-template", "fingerprint": "4ae2b8fc1873964284dba89520f032fe1cd3f97d7a2aa621803b55a1607ce6d7", "owner": "smallclaims::store::principals::legacy", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 314, "excerpt": "DELETE FROM legacy_claim_verdict_links WHERE claim_id=?1"}, {"id": "lv-h899ee994aebb", "path": "crates/fractal-store/src/store/completion_state_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "be9e7d52e985734b54e03b59eeb355a8e17842a775328253bb328e4fc3061726", "owner": "fractal_store::store::completion_state_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 269, "excerpt": "& store , | _ | panic ! ( \"pending work must reject before inputs\" )"}, {"id": "lv-h89aaca1d9e95", "path": "crates/fractal-store/src/store/observer_subscription_detail.rs", "kind": "unresolved-sql-sink", "fingerprint": "d85898b0306a710af1eb0530acf35b57c0feab7fd7ec85e2159a819028ef96dc", "owner": "fractal_store::store::observer_subscription_detail", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 210, "excerpt": "& STATE_METADATA_SQL"}, @@ -3172,9 +3313,11 @@ {"id": "lv-h8a61dd44326a", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "21a3bfb85afd3e918850f6c38beae4379fd651bf70211d760044b4f39d712eba", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 16311, "excerpt": "& canonical_sql ( \"SELECT json_extract(body, '$.fields.run') FROM claims WHERE subject=?1 AND kind='revision-proposal.created' ORDER BY CANONICAL_ASC(claims) LIMIT 1\" , ) , [ subject ] , | row | row ."}, {"id": "lv-h8a7db1487ff7", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "7c360c3cdfac70efd0742d3f6b502e63a5730fa175101efb0513d519d1198802", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 15232, "excerpt": "UPDATE step_runs SET updated_at_unix_ms=?3 WHERE subject=?1 AND step_path=?2 AND EXISTS(SELECT 1 FROM mission_run_after WHERE run_id=step_runs.run_id)"}, {"id": "lv-h8a863346e8fa", "path": "crates/fractal-store/src/store/directive_notes.rs", "kind": "unresolved-sql-sink", "fingerprint": "3779fa5a5a5c4608de6ef183df5af59bb0ffceb5f4c8d15a23c3cd963c81086c", "owner": "fractal_store::store::directive_notes", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 250, "excerpt": "& format ! ( \"SELECT {column} FROM {table} WHERE {column}>?1 ORDER BY {column} LIMIT 1\" )"}, + {"id": "lv-h8a99bdf3afc3", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "8650823a23cb7c45c4b2850c544d82efcebf1371421c979268affa192e22eeb9", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 302, "excerpt": "UPDATE batches SET origin=?2 WHERE id=?1"}, {"id": "lv-h8ad263293309", "path": "crates/smallclaims/src/ivm/events.rs", "kind": "sql-template", "fingerprint": "68829fc0054a6288ce6d38a0e01f6d5fd018f6b19838c36696fc6ea8df7e33c4", "owner": "smallclaims::ivm::events", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 22, "excerpt": " CREATE TABLE IF NOT EXISTS ivm_event_state ( singleton INTEGER PRIMARY KEY CHECK(singleton=1), format TEXT NOT NULL, database_id TEXT NOT NULL, capacity INTEGER NOT NULL CHECK(capacity BETWEEN 1 AND "}, {"id": "lv-h8ad3192acc9b", "path": "crates/fractal-reconcile/src/reconcile/github_plugin_store.rs", "kind": "sql-template", "fingerprint": "767c7d29e02a7dd18f7214de6990c9feb6aa7ac1f310618bb5fce6048ddb9d17", "owner": "fractal_reconcile::reconcile::github_plugin_store", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 147, "excerpt": "CREATE TABLE IF NOT EXISTS observer_cursors( observer TEXT PRIMARY KEY, resource TEXT NOT NULL, cursor TEXT, updated_at_unix_ms INTEGER NOT NULL ) WITHOUT ROWID; PRAGMA user_version = 1;"}, {"id": "lv-h8ad8dccf5b8a", "path": "crates/fractal-store/src/store/schedule_standby.rs", "kind": "unresolved-sql-sink", "fingerprint": "d683b92381aa08d241432597ecae84002bcca5b25eaa5c3b6c2d760d88ad6511", "owner": "fractal_store::store::schedule_standby", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 61, "excerpt": "& format ! ( \"SELECT EXISTS(SELECT 1 FROM claims c JOIN batches b ON b.id=c.batch_id LEFT JOIN replica_envelopes e ON e.batch_id=b.id WHERE c.origin=?1 AND c.kind IN ({}) AND NOT EXISTS(SELECT 1 FROM "}, + {"id": "lv-h8ae28328b54c", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "8d1665f47174bdeb488c0301356f8775620cd4c4c6bc05273c81dfc64344b011", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1486, "excerpt": "INSERT INTO assistant_grant_membership_dirty VALUES(?1,-1,'')"}, {"id": "lv-h8af984feac27", "path": "crates/smallclaims/src/store/saved_inventory_tests.rs", "kind": "sql-template", "fingerprint": "4f9649ae2e9be6d051460d4973e3931ebab743819f09f72a6b931b1dc217af39", "owner": "smallclaims::store::saved_inventory_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 365, "excerpt": "INSERT INTO meta(key,value) VALUES(?1, CASE WHEN EXISTS(SELECT 1 FROM meta WHERE key=?1 AND value='1') THEN '0' ELSE '1' END) ON CONFLICT(key) DO UPDATE SET value=excluded.value"}, {"id": "lv-h8b0bfb0402e4", "path": "crates/fractal-delivery/src/store/message_point_qualification/tests.rs", "kind": "sql-template", "fingerprint": "bb1ebc6914a6bd02d66d97d6b7db6137567f84e6679adf64e99fb6f2c744b5e3", "owner": "fractal_delivery::store::message_point_qualification::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 592, "excerpt": "UPDATE claims SET body=?1 WHERE id='sent'"}, {"id": "lv-h8b1d8ca0d39f", "path": "crates/smallclaims/src/store/principals.rs", "kind": "sql-template", "fingerprint": "a2aa16da4f54ec7f84a405497cc662da07c001002030ee8df125a2e2382d978a", "owner": "smallclaims::store::principals", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 289, "excerpt": "INSERT OR IGNORE INTO claim_signature_sources(claim_id,signature,writer) VALUES (?1,?2,?3)"}, @@ -3207,6 +3350,7 @@ {"id": "lv-h8d0cb791bb5d", "path": "crates/smallclaims/src/store/saved_inventory_tests.rs", "kind": "sql-template", "fingerprint": "9d844808085be2a2fc5bf06713616c587f02e1ded35b223d8fe115457c0e203b", "owner": "smallclaims::store::saved_inventory_tests", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 342, "excerpt": "DELETE FROM checkpoint_envelopes WHERE rowid=(SELECT rowid FROM checkpoint_envelopes ORDER BY rowid LIMIT 1)"}, {"id": "lv-h8d2f36182a08", "path": "crates/fractal-store/src/store/checkpoint_tests.rs", "kind": "sql-template", "fingerprint": "7aff3581b9b348c646ca0c5fb6fff9b78fd51e8abcd4059453ff5ee60ab96cf0", "owner": "fractal_store::store::checkpoint_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 678, "excerpt": "UPDATE capture_registration_count SET value=0"}, {"id": "lv-h8d36210a9cc0", "path": "crates/smallclaims/src/store/claim_ranges.rs", "kind": "unresolved-sql-sink", "fingerprint": "6e5d7e8691065ec58f7663cf87e8a148427a73d7ff942aa9ec21506d369ee531", "owner": "smallclaims::store::claim_ranges", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 182, "excerpt": "params ! [ namespace , level , range ]"}, + {"id": "lv-h8d3c6e9a6220", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "ed182713856bb593c0c0818258006df610745bc19aa9ad84fa2a6f5ca7c4618b", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 1205, "excerpt": "CREATE TEMP TABLE addition_work (unit INTEGER); CREATE TEMP TRIGGER count_addition_updates AFTER UPDATE ON assistant_grant_additions BEGIN INSERT INTO addition_work VALUES(1); END; CREATE TEMP TRIGGER"}, {"id": "lv-h8d3cdf97e396", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "sql-template", "fingerprint": "ffc2273421ea474f214c682baa8ca250484090168b2126d9d828bc5cf6f6e703", "owner": "fractal_missions::store::missions", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 6266, "excerpt": "UPDATE step_runs SET lease_expires_at_unix_ms=?2, updated_at_unix_ms=?3 WHERE subject=?1"}, {"id": "lv-h8d3d16dd0a2e", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "213cec2e91e4c3178d12187013806b91a5557b7cc08e46780ec767bbcb655dd2", "owner": "fractal_store::store::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 5885, "excerpt": "UPDATE replica_records SET state='invalid' WHERE record_ref=?1"}, {"id": "lv-h8d47cd9402ea", "path": "crates/smallclaims/src/store/prepared_envelope_tests.rs", "kind": "sql-template", "fingerprint": "28ebd3963f64fcfd2d9b5a708ae4bad35dc28e2851890f84fa1d5a2b94737e64", "owner": "smallclaims::store::prepared_envelope_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 830, "excerpt": "UPDATE replica_records SET state='repaired',error_code='original-error', error_message='repaired by hand',updated_at_unix_ms='0';"}, @@ -3261,6 +3405,7 @@ {"id": "lv-h904644aeeedb", "path": "crates/fractal-store/src/store/checkpoint_tests.rs", "kind": "sql-template", "fingerprint": "a466c1bb6842b49c1d34a00a24fdcb27190d6711850fee20c555c3c6c8bfc672", "owner": "fractal_store::store::checkpoint_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 25, "excerpt": "UPDATE claims SET accepted_at_unix_ms=?1 WHERE id=?2"}, {"id": "lv-h90834f2dfb3a", "path": "crates/fractal-store/src/store/resources.rs", "kind": "sql-template", "fingerprint": "e2e736632198694bb8f8593b1baf54164014b7198604bcd07eb6627c1aeb79e5", "owner": "fractal_store::store::resources", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 139, "excerpt": "DELETE FROM resource_observations"}, {"id": "lv-h9086b54616bf", "path": "crates/smallclaims/src/ivm/install/prepared.rs", "kind": "unresolved-sql-sink", "fingerprint": "7f0639d8e46df2acd17baa8498c1aa7835cd013a13182eaf9aabc52d6bc9f6d8", "owner": "smallclaims::ivm::install::prepared", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 620, "excerpt": "& sql , params_from_iter ( & args ) , | r | { bounded_values ( r , columns . len ( ) ) }"}, + {"id": "lv-h908d794ad3e8", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "5facd844161e6200be26cba65f6ea644e1238917f9a484d28577aa6deb8e905d", "owner": "smallclaims::store::membership_query_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 510, "excerpt": "UPDATE claims SET origin='forged-origin'"}, {"id": "lv-h9094840a3d43", "path": "crates/smallclaims/src/store/prepared_envelope.rs", "kind": "unresolved-sql-sink", "fingerprint": "1424217bd25e74c83789413d7fe6f066873c08f493405d9a84ee0dff5d0f768a", "owner": "smallclaims::store::prepared_envelope", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 376, "excerpt": "params ! [ batch . id , batch . origin , batch . replica_sequence , batch . previous_hash , batch . hash , batch . accepted_at_unix_ms . to_string ( ) , batch_rowid , ]"}, {"id": "lv-h9096d721fa4e", "path": "crates/smallclaims/src/store/projection_busy_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "b2cbbe76784ce7e1e5c37479f1d38c960c8035dd74974ae04e0aad4649d0dc87", "owner": "smallclaims::store::projection_busy_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 281, "excerpt": "\"BEGIN IMMEDIATE\""}, {"id": "lv-h909faf4e26de", "path": "crates/smallclaims/src/store/prepared_seal_tests.rs", "kind": "sql-template", "fingerprint": "3e11008df79805afd16e05ff749581162af571b7ab5b2b8cfe4f60fbc5baaac0", "owner": "smallclaims::store::prepared_seal_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 377, "excerpt": "DELETE FROM blobs WHERE hash=?1"}, @@ -3283,6 +3428,7 @@ {"id": "lv-h91f0e4d2cdf1", "path": "crates/fractal-api-core/src/api/client_messages_selector_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "35b3b55dc0d41a833a72f4009dfed3434aa87154d6b9b83da24b2d728d42ad32", "owner": "fractal_api_core::api::client_messages_selector_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 779, "excerpt": "& format ! ( \"EXPLAIN QUERY PLAN {sql}\" )"}, {"id": "lv-h91f945a071e9", "path": "crates/fractal-seats/src/store/canonical_audit.rs", "kind": "sql-template", "fingerprint": "9e07251c4965ad961ba0d5ed1040b13432111c5592b2458aa79498fe5ec024e0", "owner": "fractal_seats::store::canonical_audit", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1283, "excerpt": "UPDATE desired SET member=json_set(COALESCE(member,'{}'), '$.host', 'birch') WHERE subject='agent/alder.worker'"}, {"id": "lv-h92152d990a9e", "path": "crates/fractal-seats/src/store/canonical_audit.rs", "kind": "sql-template", "fingerprint": "12b265c929f9d38efedc000797c0c4750f180237d426c3711d3df5f1aa7d4398", "owner": "fractal_seats::store::canonical_audit", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1299, "excerpt": "UPDATE meta SET value=?1 WHERE key='projection_digest_registry'"}, + {"id": "lv-h921f15324dcd", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "a1283ec5bf87b372df96534f09c45e898f5571cce47da6cbbcd01e0f6c82c16f", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 999, "excerpt": "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1"}, {"id": "lv-h9270afe17ad4", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "06e99d94d688f220f06b990ed3646c0054fa214642821419f485b6d3b81a6b76", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 19250, "excerpt": "& seat_queue_joins_query ( )"}, {"id": "lv-h9281496b2550", "path": "crates/fractal-store/src/store/resource_references.rs", "kind": "sql-template", "fingerprint": "6ba8e237f385b05c5138899471c18adfb365cf9ebfeb21b531753619edd1720f", "owner": "fractal_store::store::resource_references", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 247, "excerpt": "UPDATE meta SET value=?1 WHERE key='{CURSOR_KEY}'"}, {"id": "lv-h9298464e4fb9", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "3d783d3c6bdc0223896a8d3c3b77e625f0475adf8ce2766a6d104868241ac7f6", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 10668, "excerpt": "INSERT INTO operations(id, request_digest, canonical_claim_id, state) VALUES (?1, ?2, ?3, ?4)"}, @@ -3306,6 +3452,7 @@ {"id": "lv-h93965131ebb0", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "a16e5945d7fa064295f614ddb53122056b7e43c27a0fec16a9bf2ea48c7df2bd", "owner": "smallclaims::store", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 531, "excerpt": " CREATE TABLE IF NOT EXISTS meta ( key TEXT PRIMARY KEY, value TEXT NOT NULL ); CREATE TABLE IF NOT EXISTS batches ( id TEXT PRIMARY KEY, origin TEXT NOT NULL, replica_sequence INTEGER NOT NULL, previ"}, {"id": "lv-h93b8a672018f", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "c423148f97fde1da7cd065c1ee40e5dfe19d31562d482b5b49918403441f1e44", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 9937, "excerpt": "& format ! ( \"SELECT {CLAIM_COLUMNS} FROM claims{indexed} JOIN batches ON batches.id=claims.batch_id WHERE claims.subject=?1 AND {INCARNATION_OF_CLAIM}{comparison} AND claims.kind='harness.observed' O"}, {"id": "lv-h93bee458435b", "path": "crates/smallclaims/src/ivm/install/prepared.rs", "kind": "sql-template", "fingerprint": "01599e1af2b825c72eb864526a15c7841cbffe38a6dbf79f840c2be6dad3e568", "owner": "smallclaims::ivm::install::prepared", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 749, "excerpt": "UPDATE ivm_install_deferred SET capturing=1 WHERE source=?1"}, + {"id": "lv-h93f4bed1c2b4", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "309875e8abb2bc3a99eb38ecee4c711cb76b3289ec093bfbbc7fb20330b57bac", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 518, "excerpt": "DELETE FROM replica_envelope_signatures"}, {"id": "lv-h94183eda703e", "path": "crates/smallclaims/src/store/saved_inventory_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "4ec7c53222c8a758c722e2111541035ce700d5ae7bd0898c5f1b1a743e6450fd", "owner": "smallclaims::store::saved_inventory_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 684, "excerpt": "sql"}, {"id": "lv-h9431d68673d3", "path": "crates/fractal-delivery/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "f4fb232065dde224faabc22505c9d7c105fb0b70be4e031606b284f36fb39e32", "owner": "fractal_delivery::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 186, "excerpt": "& format ! ( \"{} LIMIT 1\" , newest_claims_of_kind_query ( \"claims.body\" , \"runtime.observed\" ) , )"}, {"id": "lv-h944f37082927", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "sql-template", "fingerprint": "b00efd86cc227528fbfa988943c50c7bc8f88c73ef6908072ddf7ed7cac1bc74", "owner": "fractal_store::store::client_messages", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 777, "excerpt": "DELETE FROM meta WHERE key=?1"}, @@ -3374,6 +3521,7 @@ {"id": "lv-h97dc82980e2a", "path": "crates/fractal-reconcile/src/reconcile/github_plugin_store.rs", "kind": "sql-template", "fingerprint": "ab934d1fd5395628b30be3539c55f5f994955eb33d515fb483cbc3c938789904", "owner": "fractal_reconcile::reconcile::github_plugin_store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 726, "excerpt": "INSERT INTO mirror_heads(repository, number, head_sha, first_seen_unix_ms, last_seen_unix_ms, checks_state, checks, required_checks) VALUES (?1, ?2, ?3, ?4, ?4, ?5, ?6, ?7) ON CONFLICT(repository, num"}, {"id": "lv-h97e1b46dc727", "path": "crates/smallclaims/src/store/sealed_view_cache_tests/index_cost_tests.rs", "kind": "sql-template", "fingerprint": "5c65c9f6ebdccfa54bc7fe2ad3780f4ed2319f4dd2d2da2d521e7b7bf4fe7240", "owner": "smallclaims::store::sealed_view_cache_tests::index_cost_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 28, "excerpt": "DROP INDEX IF EXISTS claims_batch_kind;"}, {"id": "lv-h97f308cbe046", "path": "crates/fractal/src/projection_contention_retry_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "f10e20728e77f302935d7b4f1031c77dca8743a680305ee8cdf2f818e584bbb5", "owner": "fractal::projection_contention_retry_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 105, "excerpt": "\"ROLLBACK\""}, + {"id": "lv-h981cb88354da", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "42c346a4130a13bb26d38cd2138982678fb8fb2be9df302f73e51923f87c35a6", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 725, "excerpt": "DELETE FROM assistant_grant_recompute WHERE claim_id=?1"}, {"id": "lv-h98200b009b04", "path": "crates/fractal-store/src/store/ordered_membership.rs", "kind": "unresolved-sql-sink", "fingerprint": "1f70b43611de71406c506fdd0d4b34678283203fb2401df5e341f326fd0a1d77", "owner": "fractal_store::store::ordered_membership", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 102, "excerpt": "& definition"}, {"id": "lv-h9837292e813d", "path": "crates/fractal/src/main_tests.rs", "kind": "sql-template", "fingerprint": "d3bb33c8054ded84a399131eff710d179e8040908ebd37d420fce308681c2e0c", "owner": "fractal::main_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 9432, "excerpt": "INSERT INTO claim_verdict_links(link,claim_id) VALUES ('root',?1)"}, {"id": "lv-h9843ae4c1661", "path": "crates/fractal-store/src/store/resources_preparation.rs", "kind": "sql-template", "fingerprint": "2eeb7333323ed277558ca9e58cd562bec4f8134004db3898163aef3bb648d81e", "owner": "fractal_store::store::resources_preparation", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 355, "excerpt": "INSERT INTO meta(key,value) VALUES('resource_preparation_version',?1) ON CONFLICT(key) DO UPDATE SET value=excluded.value"}, @@ -3395,6 +3543,7 @@ {"id": "lv-h98e4919fbef1", "path": "crates/fractal/src/main_tests.rs", "kind": "included-source", "fingerprint": "fd463b0625a8f078823dd201481252e80ef44e433b0904cf3baadab687de48c7", "owner": "fractal::main_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 3383, "excerpt": "include_str ! ( \"agents_cli.rs\" )"}, {"id": "lv-h98e5236bc06a", "path": "crates/fractal-store/src/store/status_summary_tests.rs", "kind": "sql-template", "fingerprint": "943200faae9d766f1ed785b06b2d7ae3aa80f49f8cad7d2faef5e72696618c9e", "owner": "fractal_store::store::status_summary_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 375, "excerpt": "INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) VALUES (?1,?2,?3,?4,?5,?3,?6,'[]',?7)"}, {"id": "lv-h98f08799e7b0", "path": "crates/fractal-delivery/src/store/terminal_gate_evidence/native_source/tests.rs", "kind": "sql-template", "fingerprint": "c6bc8a2f994bd09e4fe94d6e5122474a44d1e6113378fc78e98d5ec5ca07282a", "owner": "fractal_delivery::store::terminal_gate_evidence::native_source::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 299, "excerpt": "INSERT INTO replica_records(record_ref,writer,sequence,envelope_hash,position,raw,state,updated_at_unix_ms) VALUES('private-record','node',1,'private-envelope',0,x'00','repaired','1')"}, + {"id": "lv-h98f2eff88ab2", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "a425d1008a65ca301d0a04b451621d9b1641c6739d812d23fe0c37819f712672", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 514, "excerpt": "UPDATE replica_records SET state='pending'"}, {"id": "lv-h99012a678132", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "935b2b4f9612964f17176135a88961d2a036ab45a8eec0b94ef73648645aed81", "owner": "smallclaims::store::membership_query_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 208, "excerpt": "& fleet_claims_with_signers_query ( )"}, {"id": "lv-h990276e7632d", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "sql-template", "fingerprint": "bf421e536a025c4429f2e82a776cf7dcac9f4e011938897708053deba5e61ee3", "owner": "fractal_store::store::client_messages", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 240, "excerpt": "INSERT INTO meta(key,value) VALUES(?1,'2') ON CONFLICT(key) DO UPDATE SET value=excluded.value"}, {"id": "lv-h9904e5cee507", "path": "crates/fractal-store/src/store/terminal_gate_evidence/native_source_transaction_hooks_shared_seats.rs", "kind": "sql-template", "fingerprint": "6b3823f2f143ab2244075588dbaf9e8bf386ed8250474992d6adfbee5ca02c07", "owner": "fractal_store::store::terminal_gate_evidence::native_source_transaction_hooks_shared_seats", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 88, "excerpt": "UPDATE test_native_terminal_guard SET gap=?1,pending=1 WHERE id=1"}, @@ -3419,7 +3568,7 @@ {"id": "lv-h99cdb0609387", "path": "crates/fractal-drivers/src/harness_events.rs", "kind": "sql-template", "fingerprint": "988bd052d249f242a23b7db334804b83925f10fbfbd24eb9b0280c4da3403da3", "owner": "fractal_drivers::harness_events", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 743, "excerpt": "INSERT INTO timeline(incarnation,source,body) VALUES (?1,?2,?3)"}, {"id": "lv-h99cfa91245f0", "path": "crates/fractal-store/src/store/glass_heads.rs", "kind": "sql-template", "fingerprint": "0d901e2260b3a5b2220f797fd4ccdbf91a90b3ff8d568c90c4ab47152472bcb8", "owner": "fractal_store::store::glass_heads", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 207, "excerpt": "DELETE FROM local_glass_head_pending; DELETE FROM local_glass_head_dirty;"}, {"id": "lv-h99da4f16cb38", "path": "crates/fractal-store/src/store/notice_authority_tests.rs", "kind": "included-source", "fingerprint": "95a31f82b0f71a9ff221695a923d435abdd83140e106d53b60be481e59e6b390", "owner": "fractal_store::store::notice_authority_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 21, "excerpt": "include_str ! ( \"../../../../docs/st3/client-v0/fixtures/notice-conformance.json\" )"}, - {"id": "lv-h99f1a302c7b1", "path": "crates/fractal-api-core/src/api/client_v0/external_grants.rs", "kind": "unresolved-sql-sink", "fingerprint": "e43321ad215ad6548370e6aa528d88374c2734277a245c0589a162c3666a7909", "owner": "fractal_api_core::api::client_v0::external_grants", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 95, "excerpt": "ADMISSION_QUERY"}, + {"id": "lv-h99e2f6069dc7", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "3d9b2ae6776333f7dde490dba0d57f4ce5a31954202b031dba0fe894012325ff", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 744, "excerpt": "INSERT INTO batches(id,origin,replica_sequence,previous_hash,hash,accepted_at_unix_ms) VALUES(?1,?2,?3,?4,?5,?6)"}, {"id": "lv-h99f662904dfd", "path": "crates/fractal-store/src/store/message_outbox.rs", "kind": "unresolved-sql-sink", "fingerprint": "bbfac8f07b9a24bc278443aa0d496ef7bbd0019ed35cee7698f44b358102850e", "owner": "fractal_store::store::message_outbox", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 100, "excerpt": "[ ] , | row | row . get ( 0 )"}, {"id": "lv-h9a3345441df1", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "unresolved-sql-sink", "fingerprint": "f9786d4d7a7cedb786437a545587c7fd01fb992e9a63d5fd9038e2b4a2675ba9", "owner": "fractal_store::store::client_messages", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1288, "excerpt": "& SQL"}, {"id": "lv-h9a36429f6e42", "path": "crates/fractal-api-client-v0/src/api/client_v0/observer_subscription_detail_tests.rs", "kind": "sql-template", "fingerprint": "f7959ed8a40b13376107d62febed621e9cfb0032dcced1eaa16a1ab0ecede037", "owner": "fractal_api_client_v0::api::client_v0::observer_subscription_detail_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 752, "excerpt": "UPDATE desired SET body=?2 WHERE subject=?1"}, @@ -3429,6 +3578,7 @@ {"id": "lv-h9a7e9e7da128", "path": "crates/fractal-api-client-v0/src/api/client_v0/observer_subscription_detail_tests.rs", "kind": "sql-template", "fingerprint": "7d35449a23b1813314db3132870e983f0aa1b079124680392cabda8bf15c2f39", "owner": "fractal_api_client_v0::api::client_v0::observer_subscription_detail_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 799, "excerpt": "UPDATE claims SET body=?2, predecessors=?3 WHERE store_index=?1"}, {"id": "lv-h9a9dc65c6b0e", "path": "crates/fractal-store/src/store/attention_history.rs", "kind": "unresolved-sql-sink", "fingerprint": "c32b884bb11aa9d33ad9fa5b6cbd7b18be6b5eec40e5397aa0319a5e4069ab0d", "owner": "fractal_store::store::attention_history", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 257, "excerpt": "& sql"}, {"id": "lv-h9aa3d8e72240", "path": "crates/fractal-delivery/src/store/terminal_gate_evidence/native_source/tests.rs", "kind": "sql-template", "fingerprint": "d0c4044ab37af85034fc6799aef5e2c2983ca644fea3fb6a3090902c94fa1ed8", "owner": "fractal_delivery::store::terminal_gate_evidence::native_source::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 314, "excerpt": "INSERT OR REPLACE INTO {table} SELECT * FROM {table}"}, + {"id": "lv-h9ab29a0fbe52", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "eac1e1e6282fd2babc8bb5f6056cc84a49f2b9c4a2fac6f4538906af46f89597", "owner": "smallclaims::store::assistant_grant_authority", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 727, "excerpt": "DELETE FROM assistant_grant_pending WHERE claim_id=?1 AND NOT EXISTS(SELECT 1 FROM claims WHERE id=?1)"}, {"id": "lv-h9ac1754027a8", "path": "crates/smallclaims/src/store/events.rs", "kind": "sql-template", "fingerprint": "cadd0b125415a8068dec5578890a8f63b35b13eeff0be25398df15c3a81fee9e", "owner": "smallclaims::store::events", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 154, "excerpt": "DELETE FROM local_event_payloads WHERE store_index=?1"}, {"id": "lv-h9ad20aad18c6", "path": "crates/smallclaims/src/ivm/install.rs", "kind": "sql-template", "fingerprint": "040c5c788c24279aa646f413560f47696e8af8cf9174005ba2a10ba3c14782f5", "owner": "smallclaims::ivm::install", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 323, "excerpt": "UPDATE ivm_install_roots SET ready=0,status_revision=status_revision+1,error=?2 WHERE source=?1 AND (ready<>0 OR error IS NOT ?2)"}, {"id": "lv-h9adce74dc7c8", "path": "crates/smallclaims/src/store/saved_inventory.rs", "kind": "unresolved-sql-sink", "fingerprint": "613aa558f750d5e463dac1886e9efdd80aa316c31e405e95831abbdff1038c23", "owner": "smallclaims::store::saved_inventory", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 67, "excerpt": "[ CHANGES ] , | row | row . get ( 0 )"}, @@ -3444,7 +3594,10 @@ {"id": "lv-h9b3b2893e731", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "8edb630b01a1f78d4abc5ee08b714ce7a8578b35d2269aec45684bf19ac1e4fc", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6783, "excerpt": "& query"}, {"id": "lv-h9b4924d4a878", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "unresolved-sql-sink", "fingerprint": "f72cc7aca17eb71574b8e970455c1013b67d78da66a206519950483606343b19", "owner": "fractal_missions::store::missions", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6898, "excerpt": "& canonical_sql ( \"SELECT json_extract(request.body, '$.fields.attempt') FROM claims request WHERE request.subject=?1 AND request.kind='observer.refresh-requested' AND ( json_extract(request.body, '$."}, {"id": "lv-h9b594f38a048", "path": "crates/smallclaims/src/store/schema_install_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "9ff21cc7560331f62097a428335acc6ef7c7c1320dc75b2e3399b991e9c6fceb", "owner": "smallclaims::store::schema_install_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 65, "excerpt": "FRESH_SCHEMA"}, + {"id": "lv-h9b70e51e754e", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "a317ff0bd03a3e2d0c8c1820543b2bbb2e98c7bc46d2b1b238ed9ab39aa11d2b", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 381, "excerpt": "INSERT OR REPLACE INTO meta(key,value) VALUES('assistant_grant_authority_version',?1)"}, + {"id": "lv-h9b903d60d4d6", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "953988cccc51e8ed294960e6a8501953b4853763b37e865e21ea5703796d06e9", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 634, "excerpt": "DELETE FROM replica_envelope_signatures WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=?4"}, {"id": "lv-h9b93bbbdbb39", "path": "crates/fractal-missions/src/store/lanes.rs", "kind": "unresolved-sql-sink", "fingerprint": "ff9e4ca5b7a4370a3a2d73456bca304f1badd8e2dfe36651c8e8ecadce0e00eb", "owner": "fractal_missions::store::lanes", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 36, "excerpt": "if run . is_some ( ) { \"SELECT subject, kind, body, member, owner_run, owner_generation, owner_step FROM desired WHERE owner_run=?1 AND kind='lane' ORDER BY subject\" } else { \"SELECT subject, kind, bo"}, + {"id": "lv-h9bbb6621cf95", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "ea2580cd2566815679286711948ea38f0b930bb3adc5954139cb9ffee2f27be0", "owner": "smallclaims::store::assistant_grant_authority", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 1108, "excerpt": "UPDATE assistant_grant_additions SET sequence=?2,envelope_hash=?3,position=?4 WHERE id=?1"}, {"id": "lv-h9bc0d44f925c", "path": "crates/smallclaims/src/store/saved_inventory_tests.rs", "kind": "sql-template", "fingerprint": "b3146e6453d128849b29448d71f9ae9c7fdd07692029bee76e7de8983a3056ac", "owner": "smallclaims::store::saved_inventory_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 488, "excerpt": "UPDATE retired_envelopes SET sequence=sequence+1000000"}, {"id": "lv-h9bdfd18f2c1e", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "unresolved-sql-sink", "fingerprint": "b483328b9c557f0e72710de93cd41c3f2ddf18097b08be732c22f42be133659f", "owner": "smallclaims::store::checkpoint", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 465, "excerpt": "params ! [ envelope . writer , envelope . sequence , envelope . envelope_hash ]"}, {"id": "lv-h9be0a7a129f5", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "208dc18a93cfed4f2f6f6bec66c9a3062e3c3647721fda7c4ebc42d68c841eae", "owner": "smallclaims::store::membership_query_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 140, "excerpt": "UPDATE claims SET body='malformed'"}, @@ -3459,6 +3612,7 @@ {"id": "lv-h9c5234022862", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "ca7aee1d0fe822330ed55566247456cde27286c8a565768e32f5f2e442859e85", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 18222, "excerpt": "params ! [ run_id , after ] ,"}, {"id": "lv-h9c52ebff18d6", "path": "crates/smallclaims/src/store/checkpoint_trim/pacing_tests.rs", "kind": "sql-template", "fingerprint": "0cb749f188b2ae267d692d5147b6fa5a830396a20ef9e40e2f96f055b28f3696", "owner": "smallclaims::store::checkpoint_trim::pacing_tests", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 24, "excerpt": "INSERT INTO checkpoint_envelopes VALUES('writer',?1,'hash',0)"}, {"id": "lv-h9c61de9daf69", "path": "crates/fractal-store/src/store/message_canonical_sort_tests.rs", "kind": "sql-template", "fingerprint": "d3e72ea32954da6aca1b042e52e939938df65879ec8cf9bd39fa3b0cc25428ea", "owner": "fractal_store::store::message_canonical_sort_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 39, "excerpt": "CREATE TABLE batches(id TEXT PRIMARY KEY, origin TEXT, replica_sequence INTEGER); CREATE TABLE claims(store_index INTEGER PRIMARY KEY, id TEXT UNIQUE, batch_id TEXT, subject TEXT, kind TEXT, accepted_"}, + {"id": "lv-h9c6f8e69acbb", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "1a8713c7b7463d4de20e5ad175b139fd519d1e617607b066cc5ee719101558c5", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 960, "excerpt": "CREATE TEMP TRIGGER reject_duplicate_refresh BEFORE DELETE ON assistant_grant_dirty BEGIN SELECT RAISE(ABORT,'duplicate refreshed authority'); END;"}, {"id": "lv-h9c7061fa194c", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "c02c1878d4a94aee9e11fb31bb0e4a07bdce9269c5431aaca51ac7bf9a2c7963", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 9826, "excerpt": "INSERT INTO local_usage_provenance(subject, slot, pricing) VALUES (?1, ?2, ?3) ON CONFLICT(subject, slot) DO UPDATE SET pricing=excluded.pricing"}, {"id": "lv-h9c7467d5ba88", "path": "crates/fractal-store/src/store/checkpoint_capture_epoch_tests.rs", "kind": "sql-template", "fingerprint": "c3b33a3c9169c3603f614b2aef6f34acbfffb77f087f73fb640bb56504c4f706", "owner": "fractal_store::store::checkpoint_capture_epoch_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 136, "excerpt": "INSERT INTO mission_revisions(mission_id,revision,state,body,claim_id,created_index) VALUES('newer','newer','ready','{}',?1,1)"}, {"id": "lv-h9c77f2f5e4fc", "path": "crates/fractal-delivery/src/store/message_point_qualification/tests.rs", "kind": "sql-template", "fingerprint": "b2222d290d5f7b09c6d23080ccb13f23c8f5b11a4439ee257e8006a5b8f5e56e", "owner": "fractal_delivery::store::message_point_qualification::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 540, "excerpt": "UPDATE claims SET predecessors=CAST(X'FF' AS TEXT) WHERE id='sent'"}, @@ -3467,10 +3621,11 @@ {"id": "lv-h9c7916f4c08f", "path": "crates/fractal-missions-base/src/provenance.rs", "kind": "unresolved-sql-sink", "fingerprint": "e0531ec0f656912bf69c400c874a0988788e750e5c2d595dbd50c4dc5e4a7445", "owner": "fractal_missions_base::provenance", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 149, "excerpt": "& smallclaims : : store : : canonical_sql ( \"SELECT body FROM claims WHERE subject=?1 AND kind='mission.provenance' ORDER BY CANONICAL_ASC(claims) LIMIT 1\" ) , [ subject ( mission , revision ) ] , | r"}, {"id": "lv-h9c7ea890a098", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "861ae77d8b9421fa21c0de36fb94ae80d2b589f44a1eb28e3ee97f385d319402", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1769, "excerpt": "[ claim_id ]"}, {"id": "lv-h9c902113b98b", "path": "crates/fractal-seats/src/store/usage_period.rs", "kind": "unresolved-sql-sink", "fingerprint": "99f76cda8d4996572deb083883433cde4864250355b2486665f6bd0a15e623f2", "owner": "fractal_seats::store::usage_period", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 16, "excerpt": "& format ! ( \"SELECT {series} FROM claims INDEXED BY {INDEX} WHERE {PREDICATE} AND {series}>?1 ORDER BY {series} LIMIT 1\" )"}, + {"id": "lv-h9cad1e7a0461", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "d354c63cbfc808e641c5ed6a62c884eece25b7dc214cf99609d3f5b77478d629", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 303, "excerpt": "UPDATE batches SET replica_sequence=?2 WHERE id=?1"}, {"id": "lv-h9cbdd26decdc", "path": "crates/fractal-api-client-v0/src/api/client_v0/conversation_blocks/conformance_tests.rs", "kind": "included-source", "fingerprint": "fe88de8f46687b50e243d2e7e13b5c690aa570c6142aa58c41dbdbcef8f69847", "owner": "fractal_api_client_v0::api::client_v0::conversation_blocks::conformance_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 37, "excerpt": "include_str ! ( \"../../../../../fractal-daemon/fixtures/native-records/schema-conformance.jsonl\" )"}, {"id": "lv-h9cd53cdb5da9", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "65448d6cbf3f3282e441c3ed5663a33e6dedfc7d7347c35f2016ca0e8a0cf668", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 14, "excerpt": "CREATE TABLE meta(key TEXT PRIMARY KEY, value TEXT NOT NULL); INSERT INTO meta VALUES('fleet_anchor_key','anchor-key'); CREATE TABLE batches(id TEXT PRIMARY KEY, origin TEXT, replica_sequence INTEGER)"}, - {"id": "lv-h9ce147382461", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "c32b884bb11aa9d33ad9fa5b6cbd7b18be6b5eec40e5397aa0319a5e4069ab0d", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 12894, "excerpt": "& sql"}, - {"id": "lv-h9d136cca4c72", "path": "crates/fractal/src/main_tests.rs", "kind": "included-source", "fingerprint": "47a1c6e69e148602c4a8f0d331296839c8cf0aa744437194592e848049a957ef", "owner": "fractal::main_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 4365, "excerpt": "include_str ! ( \"../../../docs/st3/operational-state/cli-commands.json\" )"}, + {"id": "lv-h9ce147382461", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "c32b884bb11aa9d33ad9fa5b6cbd7b18be6b5eec40e5397aa0319a5e4069ab0d", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 11241, "excerpt": "& sql"}, + {"id": "lv-h9d136cca4c72", "path": "crates/fractal/src/main_tests.rs", "kind": "included-source", "fingerprint": "47a1c6e69e148602c4a8f0d331296839c8cf0aa744437194592e848049a957ef", "owner": "fractal::main_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 4011, "excerpt": "include_str ! ( \"../../../docs/st3/operational-state/cli-commands.json\" )"}, {"id": "lv-h9d16fe54e51a", "path": "crates/fractal-store/src/store/glass_heads.rs", "kind": "sql-template", "fingerprint": "af5fd00605052aa91a01eedd712edaba7b8fd95e6a7fca6c06430515af8946d0", "owner": "fractal_store::store::glass_heads", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 194, "excerpt": "INSERT INTO glass_heads(subject,person,created_key,head_key,claim_id,deleted) VALUES(?1,?2,?3,?3,?4,0) ON CONFLICT(subject) DO UPDATE SET created_key=CASE WHEN created_key IS NULL OR excluded.created_"}, {"id": "lv-h9d1a4529329e", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "6d61bea5a65b90a987f743b4c9f0213339c5f2cbd9bacc5fe59f068d39962839", "owner": "fractal_missions::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 5854, "excerpt": "UPDATE mission_runs SET status='running', phase='normal' WHERE id='{}'; UPDATE run_generations SET status='running' WHERE id='{}'; UPDATE step_runs SET status='ready', blocked_reason=NULL WHERE subjec"}, {"id": "lv-h9d1a487a758c", "path": "crates/fractal-store/src/store/notice_authority.rs", "kind": "sql-template", "fingerprint": "38988c4cc485927ca8dc00fe2ea0a84944a4dc488ddb899ab5277cf9657558a0", "owner": "fractal_store::store::notice_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 143, "excerpt": "INSERT OR REPLACE INTO meta(key,value) VALUES('notice_runtime_binding',?1)"}, @@ -3501,7 +3656,8 @@ {"id": "lv-h9e58fda6723a", "path": "crates/fractal-missions/src/store/resource_preparation/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "dc372daedd324b47f1261987900c1a08eff3ccdf253bfcf666d0ebecf17142ad", "owner": "fractal_missions::store::resource_preparation::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 171, "excerpt": "& store , | _ | ( )"}, {"id": "lv-h9e61ab648fdc", "path": "crates/fractal-api-client-v0/src/api/client_v0/observer_subscription_detail_tests.rs", "kind": "sql-template", "fingerprint": "e39f94d30d5c31f954a82fd7cde5b4e273e840eb52c0f9cf6cdbc9f1c6458138", "owner": "fractal_api_client_v0::api::client_v0::observer_subscription_detail_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 497, "excerpt": "DROP TRIGGER \"{}\""}, {"id": "lv-h9e78aaf35467", "path": "crates/fractal-store/src/store/message_send_tests.rs", "kind": "sql-template", "fingerprint": "da375a6ef935682d924483cbd6c26b9c32a0a576b639560d3ec18290cfd5125b", "owner": "fractal_store::store::message_send_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 38, "excerpt": "DELETE FROM claims WHERE id=?1"}, - {"id": "lv-h9e891d694006", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "ed193c6bfb3909b335a629c7cd74ccee7b864216574d19765b15f806f256f551", "owner": "smallclaims::store", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 9240, "excerpt": "INSERT INTO replication_refusals(peer, reason, updated_at_unix_ms) VALUES (?1, ?2, ?3) ON CONFLICT(peer) DO UPDATE SET reason=excluded.reason, updated_at_unix_ms=excluded.updated_at_unix_ms"}, + {"id": "lv-h9e7e7a841384", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "701329c99c19076f8b477e2f84c40f1a2ece7974203ef799364c1f2382fd1875", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 486, "excerpt": "UPDATE replica_envelope_signatures SET signature='invalid'"}, + {"id": "lv-h9e891d694006", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "ed193c6bfb3909b335a629c7cd74ccee7b864216574d19765b15f806f256f551", "owner": "smallclaims::store", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 8325, "excerpt": "INSERT INTO replication_refusals(peer, reason, updated_at_unix_ms) VALUES (?1, ?2, ?3) ON CONFLICT(peer) DO UPDATE SET reason=excluded.reason, updated_at_unix_ms=excluded.updated_at_unix_ms"}, {"id": "lv-h9e933dacf5e8", "path": "crates/fractal-missions/src/store/schedule_active_run_tests.rs", "kind": "sql-template", "fingerprint": "fcedc2a34045671e856dc2e205d170a836c509307940a1a843c75035bf30223d", "owner": "fractal_missions::store::schedule_active_run_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 284, "excerpt": "UPDATE mission_runs SET status='failed' WHERE id='cut-new'"}, {"id": "lv-h9e9e37dcf663", "path": "crates/fractal-seats/src/store/tests.rs", "kind": "sql-template", "fingerprint": "e846c20eb3e898f19682ca10d28077acad1a8755eac4c271436a5d7ec8ad731d", "owner": "fractal_seats::store::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 1194, "excerpt": "UPDATE claims SET kind='custom.attention.notice-created' WHERE id=?1"}, {"id": "lv-h9eb319f5de00", "path": "crates/fractal-store/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "4ec7c53222c8a758c722e2111541035ce700d5ae7bd0898c5f1b1a743e6450fd", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6454, "excerpt": "sql"}, @@ -3546,6 +3702,7 @@ {"id": "lv-ha1358f6db412", "path": "crates/fractal-store/src/store/seats.rs", "kind": "unresolved-sql-sink", "fingerprint": "293e064325d0ba33755c39a24e45995485b87aa0ed01c76d07035290e8b1cd4c", "owner": "fractal_store::store::seats", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 155, "excerpt": "params ! [ agent , snapshot_index ] , | row | row . get ( 0 )"}, {"id": "lv-ha13d8dc7b51f", "path": "crates/fractal-seats/src/store/runtime_starts.rs", "kind": "sql-template", "fingerprint": "4a45978cde4f683e0fdcb5308930ea6938a04a66f039e3a1a0ffcc3eddf92e84", "owner": "fractal_seats::store::runtime_starts", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 596, "excerpt": "UPDATE local_runtime_starts SET receipted=1,result=?2 WHERE id=?1"}, {"id": "lv-ha1440c494a1a", "path": "crates/smallclaims/src/store/fleet_residue_page_tests.rs", "kind": "sql-template", "fingerprint": "76cad149e9b1d0b9bbfea871682966e89877b3cf04b700314233de08d894541f", "owner": "smallclaims::store::fleet_residue_page_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 35, "excerpt": "INSERT INTO replica_envelope_signatures(writer, sequence, envelope_hash, member_key, signature, stored_at_unix_ms) VALUES (?1, ?2, ?3, ?4, 'invented-signature', '0')"}, + {"id": "lv-ha14d9df71ca8", "path": "crates/fractal-api-core/src/api/client_v0/external_grants/conflict_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "c21c486aaa244d81e150531b070c9489f8f2cbc0d3cf66a1cdf9e427de233205", "owner": "fractal_api_core::api::client_v0::external_grants::conflict_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 497, "excerpt": "& format ! ( \"EXPLAIN QUERY PLAN {}\" , authority : : CANDIDATES_QUERY )"}, {"id": "lv-ha155c7e6fbf3", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "fdcddd3ff848134f97b3e804f62f5a4700b4e994a63656585665f15dc1f635a5", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 16845, "excerpt": "DELETE FROM mission_run_deadlines WHERE run_id=?1"}, {"id": "lv-ha160f037c55f", "path": "crates/smallclaims/src/ivm/install/capture.rs", "kind": "sql-template", "fingerprint": "d4dd943ea549c2f400559f9a810680397025d94d44a4d5aabde93aa942ceacd3", "owner": "smallclaims::ivm::install::capture", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 249, "excerpt": "UPDATE ivm_install_sources SET available=0 WHERE name={source}; \\ UPDATE ivm_install_roots SET ready=0,status_revision=status_revision+1,error='{reason}' \\ WHERE source={source} AND (ready<>0 OR error"}, {"id": "lv-ha175ed71501d", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "8b44a9e15237b4de2b3c2a997349101e17eacf47a1cf262d6f0d9928dc1466e2", "owner": "fractal_store::store::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 7338, "excerpt": "INSERT INTO batches(id,origin,replica_sequence,hash,accepted_at_unix_ms) VALUES ('legacy-batch','legacy-seek',1,'synthetic','1')"}, @@ -3555,6 +3712,7 @@ {"id": "lv-ha1e51b756141", "path": "crates/fractal-store/src/store/terminal_gate_evidence/native_source/transaction_hooks/tests.rs", "kind": "sql-template", "fingerprint": "9e8eba37de2d60f0e40c6f574825a169a7b78b36de74f2b597f39d3cc7a5e46f", "owner": "fractal_store::store::terminal_gate_evidence::native_source::transaction_hooks::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 271, "excerpt": "INSERT INTO test_managed_child VALUES(404)"}, {"id": "lv-ha1f81bed509d", "path": "crates/smallclaims/src/store/schema_install_tests.rs", "kind": "sql-template", "fingerprint": "e1d752f8d6c73c3b7393bc9c1d998b92521a1d1294c69b1dc1db309cdd606be9", "owner": "smallclaims::store::schema_install_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 268, "excerpt": "PRAGMA writable_schema=ON; INSERT INTO sqlite_schema(type,name,tbl_name,rootpage,sql) VALUES('table','sqlite_x','sqlite_x',0,NULL);"}, {"id": "lv-ha1fd9fcb88f3", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "9df84ac916fc64eb550530b3ea428bb5c5649e2c95600c78f29814305f5a2b7a", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 21174, "excerpt": "params ! [ view . run . strip_prefix ( \"mission-run/\" ) . unwrap_or ( & view . run ) , generation_id_from_subject ( & view . generation ) , ] , | row | { Ok ( ( row . get : : < _ , String > ( 0 ) ? , "}, + {"id": "lv-ha2046fcea9c3", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "c5ff3fd2b5e21c5142ebfcf28e9bb7a375c77dd3681fcce71e986f7242033982", "owner": "smallclaims::store::assistant_grant_authority", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 331, "excerpt": "CREATE TRIGGER IF NOT EXISTS assistant_grant_proof_{stem}_{event} AFTER {event} ON {table} WHEN {changed}EXISTS({dependent}) BEGIN INSERT INTO assistant_grant_proof_invalidations(writer,sequence,envel"}, {"id": "lv-ha2066549b853", "path": "crates/fractal-api-core/src/api/replication_guard_tests.rs", "kind": "sql-template", "fingerprint": "b708aad00db6c660b8c6f80f82ae68463637e72d7e50d6504ed42598315f087b", "owner": "fractal_api_core::api::replication_guard_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 63, "excerpt": "DROP TABLE replica_envelopes"}, {"id": "lv-ha20793f9147b", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "sql-template", "fingerprint": "a759ba052b25dfc1ec76fb438f512b58b123916ea3db48e5b540e9590a41dc67", "owner": "smallclaims::store::repair_operation_tests", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 564, "excerpt": "DELETE FROM operations WHERE id IN ('op/live','op/checkpoint-only')"}, {"id": "lv-ha20c4a9bdfe5", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "8019bb730f034032c09c31577e29b16e0a39faaeda944096c2d927c4c4eff97b", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 23111, "excerpt": "params ! [ subject , i64 : : MAX ] , | r | r . get ( 0 )"}, @@ -3587,13 +3745,15 @@ {"id": "lv-ha3756d1815b0", "path": "crates/smallclaims/src/store/sealed_view_cache_tests/mutation_tests.rs", "kind": "sql-template", "fingerprint": "2aad8d453e29bf5117521b91c6ae82765aa5f7a40737faddcda2a5b664ed1a53", "owner": "smallclaims::store::sealed_view_cache_tests::mutation_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 17, "excerpt": "UPDATE claims SET subject='host/different-anchor' WHERE kind='fleet.member-admitted'"}, {"id": "lv-ha3852b2f0b38", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "sql-template", "fingerprint": "90b631baef508343b3076cf8af28c119a17a2cc60ac302ca15c1dc2717cdd3a3", "owner": "smallclaims::store::checkpoint", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 791, "excerpt": "INSERT OR IGNORE INTO temp.sealed_claims(id) VALUES (?1)"}, {"id": "lv-ha38a30fcc59a", "path": "crates/smallclaims/src/ivm/install.rs", "kind": "unresolved-sql-sink", "fingerprint": "861d5974580a840a5a96bfa881a38c78cf2944a3477babaafde04aa36e35ebbb", "owner": "smallclaims::ivm::install", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 915, "excerpt": "\"ROLLBACK TO ivm_install_page; RELEASE ivm_install_page\""}, - {"id": "lv-ha38a74be9319", "path": "crates/fractal-store/src/store/message_outbox.rs", "kind": "unresolved-sql-sink", "fingerprint": "2b86ef06cf9adb398c237f395acdec24b8930ec25fe776801420ce02f13e4afd", "owner": "fractal_store::store::message_outbox", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 112, "excerpt": "[ ] , | row | Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? ) )"}, - {"id": "lv-ha39be727e750", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "1ba4fdc8a1dd62bd2c17727a28457739c7e5ece1cdea20fcb2f65af8bd592bf3", "owner": "fractal_missions::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 2958, "excerpt": "DELETE FROM operations WHERE id='op/unrelated-upgrade'"}, - {"id": "lv-ha3b0673506b4", "path": "crates/smallclaims/src/store/claim_ranges.rs", "kind": "sql-template", "fingerprint": "82eb9025577e1eed06a310c640b88462364d1b4eaf4cdbfffa34a5ab77b0e25f", "owner": "smallclaims::store::claim_ranges", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 369, "excerpt": "DELETE FROM retired_range_import"}, - {"id": "lv-ha3c5feea65a0", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "d709c4b53198c61961b802ca03f38a23581d22fd1bf987e8b7f03393be1b2d50", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 225, "excerpt": "[ claim_id ] , | row | row . get ( 0 )"}, + {"id": "lv-ha38a74be9319", "path": "crates/fractal-store/src/store/message_outbox.rs", "kind": "unresolved-sql-sink", "fingerprint": "2b86ef06cf9adb398c237f395acdec24b8930ec25fe776801420ce02f13e4afd", "owner": "fractal_store::store::message_outbox", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 84, "excerpt": "[ ] , | row | Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? ) )"}, + {"id": "lv-ha39be727e750", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "1ba4fdc8a1dd62bd2c17727a28457739c7e5ece1cdea20fcb2f65af8bd592bf3", "owner": "fractal_missions::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 2792, "excerpt": "DELETE FROM operations WHERE id='op/unrelated-upgrade'"}, + {"id": "lv-ha3b0673506b4", "path": "crates/smallclaims/src/store/claim_ranges.rs", "kind": "sql-template", "fingerprint": "82eb9025577e1eed06a310c640b88462364d1b4eaf4cdbfffa34a5ab77b0e25f", "owner": "smallclaims::store::claim_ranges", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 358, "excerpt": "DELETE FROM retired_range_import"}, + {"id": "lv-ha3bce0201694", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "3720b2c9c1d102e26014cd421ffc58cc6d8653b01c59abb3fc1865a04e90586a", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 327, "excerpt": "DELETE FROM meta WHERE key='assistant_grant_authority_fleet_id'"}, + {"id": "lv-ha3c5feea65a0", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "d709c4b53198c61961b802ca03f38a23581d22fd1bf987e8b7f03393be1b2d50", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 220, "excerpt": "[ claim_id ] , | row | row . get ( 0 )"}, {"id": "lv-ha3d4449c40cb", "path": "crates/smallclaims/src/store/saved_inventory_tests.rs", "kind": "sql-template", "fingerprint": "cacab32515e03b567c70397405b17c7a16e0a55e7c353cd8aa28c83e35587eba", "owner": "smallclaims::store::saved_inventory_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 445, "excerpt": "DELETE FROM replica_envelopes WHERE rowid=(SELECT MIN(rowid)+1 FROM replica_envelopes)"}, {"id": "lv-ha3ee7bbe9a8e", "path": "crates/fractal-store/src/store/resources_preparation_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "f10e20728e77f302935d7b4f1031c77dca8743a680305ee8cdf2f818e584bbb5", "owner": "fractal_store::store::resources_preparation_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 447, "excerpt": "\"ROLLBACK\""}, - {"id": "lv-ha403ff5011e7", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "sql-template", "fingerprint": "8255c7a9cc81788259500988d00f303a9d5e3bbbb53d97886559b194161cfc21", "owner": "smallclaims::store::repair_operation_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 792, "excerpt": "CREATE TEMP TRIGGER cache_stable_delete BEFORE DELETE ON operations WHEN OLD.id='unrelated/stable' BEGIN SELECT RAISE(ABORT,'stable cache row deleted'); END; CREATE TEMP TRIGGER cache_stable_insert BE"}, + {"id": "lv-ha403ff5011e7", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "sql-template", "fingerprint": "8255c7a9cc81788259500988d00f303a9d5e3bbbb53d97886559b194161cfc21", "owner": "smallclaims::store::repair_operation_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 742, "excerpt": "CREATE TEMP TRIGGER cache_stable_delete BEFORE DELETE ON operations WHEN OLD.id='unrelated/stable' BEGIN SELECT RAISE(ABORT,'stable cache row deleted'); END; CREATE TEMP TRIGGER cache_stable_insert BE"}, + {"id": "lv-ha41272fe6b10", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "5427c45f190aa6981cd95fcddb43cdb335d88c69516ecb47c398627fc59c2f71", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 516, "excerpt": "UPDATE replica_envelopes SET receipt_state='pending'"}, {"id": "lv-ha42a6825a9d8", "path": "crates/fractal-seats/src/store/resource_preparation/tests.rs", "kind": "sql-template", "fingerprint": "dff8a4c482de80cf442d5acc562f34e7bc06139920578d4fa4cddb85a871472a", "owner": "fractal_seats::store::resource_preparation::tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 273, "excerpt": "CREATE TEMP TABLE heal_replay_base_order(ordinal TEXT PRIMARY KEY, claim_id TEXT NOT NULL)"}, {"id": "lv-ha42ff9ed4552", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "a79ae7eaf013bd8caf99a373cd0e66c87e3e791bb351b00cebffb30169f04eef", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 23005, "excerpt": "& format ! ( \"SELECT claims.id FROM claims JOIN batches ON batches.id=claims.batch_id WHERE claims.subject=?1 AND claims.kind='runtime.observed' AND claims.origin=?2 ORDER BY {CANONICAL_ORDER_DESC} LI"}, {"id": "lv-ha43c88827ede", "path": "crates/fractal-seats/src/store/tests.rs", "kind": "sql-template", "fingerprint": "8592ccd245fbc41cfded1314364b25028eac374d1a08ab4cc1317e45b4352519", "owner": "fractal_seats::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 2328, "excerpt": "INSERT OR REPLACE INTO desired(subject, kind, revision, claim_id, body, owner_run, owner_generation, owner_step) VALUES (?1, 'agent', 'revision', ?2, '{}', 'mission-run/example', 'run-generation/examp"}, @@ -3615,6 +3775,7 @@ {"id": "lv-ha5591425e84e", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "a78ca18f271fb674e24ce5a774cd76774c1fd2d048427245599f03fe026e595b", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 17773, "excerpt": "INSERT INTO projection_health(aggregate, status, error_code, error_message, updated_at_unix_ms) VALUES (?1, 'stale', ?2, ?3, ?4) ON CONFLICT(aggregate) DO UPDATE SET status='stale', error_code=exclude"}, {"id": "lv-ha5602c71c283", "path": "crates/fractal-api-client-v0/src/api/client_v0/observer_subscription_detail_tests.rs", "kind": "sql-template", "fingerprint": "475a3013706687dd6407ae86b74aa4e6a5f6059c69c19bdd574f49d18b943420", "owner": "fractal_api_client_v0::api::client_v0::observer_subscription_detail_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 684, "excerpt": "DELETE FROM desired WHERE subject='detail/watch/source'"}, {"id": "lv-ha579e98adb61", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "760d4f618831df45f267995bcc9fefdbea03ca4c67729f3df415f219b942bc13", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 20783, "excerpt": "& canonical_sql ( & format ! ( \"SELECT claims.kind, claims.body, claims.accepted_at_unix_ms FROM claims JOIN batches ON batches.id=claims.batch_id WHERE claims.subject=?1 AND claims.kind IN ({STEP_TIM"}, + {"id": "lv-ha57a171023e8", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "f976829d92148bf8272636fa56bba04a4f9d9e930e4c6ac48b48a3be13a46258", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1532, "excerpt": "DELETE FROM assistant_grant_proof_rechecks WHERE claim_id=?1"}, {"id": "lv-ha5b0b3825013", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "0e47866aeddce50797221175c074d6bbd6651a01f505914a1ed3ead59463ffc0", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 18215, "excerpt": "params ! [ run_id , mission_id , revision , generation_id , root_revision , root_run_id , parent_step_run , workspace , requester , serde_json : : to_string ( & inputs ) . map_err ( internal ) ? , mod"}, {"id": "lv-ha5bb9a6450df", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "unresolved-sql-sink", "fingerprint": "d4a2e52a9158cd5573935d2222690a70c9ecc8d502b20cf5593f4635fbd86519", "owner": "smallclaims::store::checkpoint_trim", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 309, "excerpt": "[ & claim . id ]"}, {"id": "lv-ha5cedcee2955", "path": "crates/fractal-api-core/src/api/agents_request_slo/ledger.rs", "kind": "sql-template", "fingerprint": "7e83a89f196e6db4b7b172dbfc52decf871718e5cd50811763b494a034631cf1", "owner": "fractal_api_core::api::agents_request_slo::ledger", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 236, "excerpt": "DELETE FROM fault_quarantine WHERE id <= ( SELECT id FROM fault_quarantine ORDER BY id DESC LIMIT 1 OFFSET ?1 )"}, @@ -3647,7 +3808,9 @@ {"id": "lv-ha73927e89741", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "03c2e54839bcf12f9327fa41375119a7032edbf089563926fcb92a1f983ba6d2", "owner": "fractal_store::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 7738, "excerpt": "DELETE FROM mission_runs WHERE id='run-example'"}, {"id": "lv-ha748fd9c1480", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "e58378a4db0115b1acd19e19285bba79f589ad1eea30e58a4c757affe5a986d5", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6342, "excerpt": "& claims_for_subject_query ( true )"}, {"id": "lv-ha7632dfa1023", "path": "crates/fractal-store/src/store/attention_snapshot.rs", "kind": "unresolved-sql-sink", "fingerprint": "32e2f432182477efea814b8a3d100f06af4a532fc6c0e52d80160d440e9eda2a", "owner": "fractal_store::store::attention_snapshot", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 2307, "excerpt": "params ! [ seat , i64 : : MAX ] , | row | { Ok ( ( row . get : : < _ , i64 > ( 0 ) ? , row . get : : < _ , String > ( 1 ) ? ) ) }"}, + {"id": "lv-ha76427048a9d", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "31b6218b479548387c2e61968a64220e15f2659d5b7f72992f6017073aec8399", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 147, "excerpt": "DELETE FROM assistant_grant_local_appends WHERE claim_id=?1"}, {"id": "lv-ha7682bdb8606", "path": "crates/fractal-store/src/store/completion_state.rs", "kind": "sql-template", "fingerprint": "09cf0bb160d2f0dbce52167fa085ca0245d2995315eb7465e57baa82eec1b28c", "owner": "fractal_store::store::completion_state", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 250, "excerpt": "INSERT INTO local_completion_health_v1_fields(claim_id,subject,field,sort_key,value) VALUES(?1,?2,?3,?4,?5)"}, + {"id": "lv-ha76a98dcc427", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "22bc30ef987b5510951fca50cb03aac71f90648bc3d3328746ec49bed4bb1e60", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 732, "excerpt": "DELETE FROM replica_records WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND position=?4"}, {"id": "lv-ha76b0c3b2d8f", "path": "crates/smallclaims/src/store/principals.rs", "kind": "unresolved-sql-sink", "fingerprint": "bbfac8f07b9a24bc278443aa0d496ef7bbd0019ed35cee7698f44b358102850e", "owner": "smallclaims::store::principals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1632, "excerpt": "[ ] , | row | row . get ( 0 )"}, {"id": "lv-ha77ce21369d5", "path": "crates/smallclaims/src/store/receive_writer_tests.rs", "kind": "sql-template", "fingerprint": "da375a6ef935682d924483cbd6c26b9c32a0a576b639560d3ec18290cfd5125b", "owner": "smallclaims::store::receive_writer_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 1120, "excerpt": "DELETE FROM claims WHERE id=?1"}, {"id": "lv-ha785421a488b", "path": "crates/smallclaims/src/store/checkpoint_staging/scoped.rs", "kind": "unresolved-sql-sink", "fingerprint": "5a902dbfc6c3ee93e1497ff1a07471ff6d6a62172215ae2b4029a358d0726e34", "owner": "smallclaims::store::checkpoint_staging::scoped", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 103, "excerpt": "params ! [ key . writer , key . sequence , key . envelope_hash , accepted ( accepted_at ) ? , records ]"}, @@ -3676,6 +3839,8 @@ {"id": "lv-ha8f290219962", "path": "crates/fractal-store/src/store/ordered_membership.rs", "kind": "sql-template", "fingerprint": "ef1529b31ddf4c4e2612d27ad794bea5a25b5ba85af764bd3d0208e97d59b66d", "owner": "fractal_store::store::ordered_membership", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 143, "excerpt": "INSERT INTO ordered_membership_lifecycle(subject,visible,revision) VALUES(?1,?2,?3) ON CONFLICT(subject) DO UPDATE SET visible=excluded.visible,revision=excluded.revision WHERE visible!=excluded.visib"}, {"id": "lv-ha90b8b085026", "path": "crates/smallclaims/src/sqlite/writer_budget.rs", "kind": "unresolved-sql-sink", "fingerprint": "f10e20728e77f302935d7b4f1031c77dca8743a680305ee8cdf2f818e584bbb5", "owner": "smallclaims::sqlite::writer_budget", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 265, "excerpt": "\"ROLLBACK\""}, {"id": "lv-ha9356a96ddd9", "path": "crates/fractal-store/src/store/run_eta_tests.rs", "kind": "sql-template", "fingerprint": "a521c5dad40bb69aa774c45feb4115e928e9636649863fd2f9284a6b6dd95c5c", "owner": "fractal_store::store::run_eta_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 268, "excerpt": "DELETE FROM mission_runs WHERE id=?1"}, + {"id": "lv-ha93665c85209", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "c8378ff72ba90e9db3fbde60234a780c7c9e60450721af288d35874c8915ed91", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 599, "excerpt": "DELETE FROM assistant_grant_effective; DELETE FROM assistant_grant_authority; DELETE FROM assistant_grant_pending; DELETE FROM assistant_grant_membership_windows; DELETE FROM assistant_grant_dirty; DE"}, + {"id": "lv-ha9371a8fef8c", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "98f28c787b8f22f1eebdd1823d893e3f88ea9329d81023cdfe1fcdd553f445db", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1118, "excerpt": "INSERT INTO assistant_grant_auth_cursor VALUES(?1,9223372036854775807,9223372036854775807,'~stale')"}, {"id": "lv-ha962eb0285cf", "path": "crates/smallclaims/src/store/canonical.rs", "kind": "sql-template", "fingerprint": "1a399cc808702bdb0ba2e2ddbab243ae72f985e465a0ab5490443acfe96cc228", "owner": "smallclaims::store::canonical", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 13, "excerpt": " CREATE TABLE IF NOT EXISTS claim_positions ( claim_id TEXT PRIMARY KEY, position INTEGER NOT NULL ) WITHOUT ROWID; CREATE TRIGGER IF NOT EXISTS claim_positions_record_insert_v1 AFTER INSERT ON replic"}, {"id": "lv-ha96ba11ea383", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "d857c61275e1f0c7fb49cffdbe76fa3a76c33e900003e132c71651bbbd0c83a8", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 14367, "excerpt": "& canonical_sql ( \"SELECT id, subject, body, accepted_at_unix_ms FROM claims WHERE kind='harness.diagnostic' AND json_extract(body, '$.fields.code')='work-wake-exhausted' AND accepted_at_unix_ms<=?1 O"}, {"id": "lv-ha96ddb40942a", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "789b44b9990c7d88da3542aa5c6b25148409a57d64b88f00362513cda78a031f", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6362, "excerpt": "\"COMMIT\""}, @@ -3721,6 +3886,7 @@ {"id": "lv-hac292d5d4ef7", "path": "crates/fractal-seats/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "3edada985fa7f0ed998965d239aab79abb45b29ef59bbe850c29f4bb5ebee977", "owner": "fractal_seats::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 722, "excerpt": "& format ! ( \"SELECT COUNT(*) FROM {table}\" ) , [ ] , | row | row . get : : < _ , u64 > ( 0 )"}, {"id": "lv-hac330e1ef0a3", "path": "crates/fractal-missions/src/store/work_renew_tests.rs", "kind": "sql-template", "fingerprint": "23d384584d619edc1b8135734fe4536e80b585db990943fa67e8dc9b10b08fa9", "owner": "fractal_missions::store::work_renew_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 666, "excerpt": "UPDATE step_runs SET assignee='agent/node/other', available_to='[]', status='ready', lease_owner=NULL, lease_incarnation=NULL, lease_expires_at_unix_ms=NULL WHERE subject=?1"}, {"id": "lv-hac42e9bbbb24", "path": "crates/fractal-store/src/store/message_canonical_sort_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "2ffd897d72bda85ddc6e414124c591f9804a4c42e2ad7a174c09ec7618be40e5", "owner": "fractal_store::store::message_canonical_sort_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 116, "excerpt": "& query , [ & message . subject ] , | row | row . get ( 0 )"}, + {"id": "lv-hac4604f86ba0", "path": "crates/fractal-api-core/src/api/tests.rs", "kind": "sql-template", "fingerprint": "b626ad967b3f4d254f70113d40102ae863b855fe32d4bbc645afd95276098064", "owner": "fractal_api_core::api::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1223, "excerpt": "INSERT INTO assistant_grant_local_appends(claim_id) VALUES('claim/marked')"}, {"id": "lv-hac6412f7b9a9", "path": "crates/fractal-store/src/store/run_eta_tests.rs", "kind": "sql-template", "fingerprint": "b3f2615139e7e6c555490b22cd2f59d6ed21382583e42d59f05b430c103dddc3", "owner": "fractal_store::store::run_eta_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 167, "excerpt": "UPDATE claims SET accepted_at_unix_ms='100' WHERE subject IN('s-0','mission-run/r-0') AND kind IN('step-run.state','mission-run.state')"}, {"id": "lv-hac726e7443c2", "path": "crates/fractal-store/src/store/attention_ivm.rs", "kind": "sql-template", "fingerprint": "107c51545db6e1c417e98c05ec8e5449ea093a898afdccbf59123b972a3eae13", "owner": "fractal_store::store::attention_ivm", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 14, "excerpt": " CREATE INDEX IF NOT EXISTS attention_open_person_sources_v3 ON step_runs(subject) WHERE assignee>='person/' AND assignee<'person0'; CREATE TABLE IF NOT EXISTS local_attention_open ( family TEXT NOT N"}, {"id": "lv-hacd9a1509ee5", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "a5e162a8713376add8f4d5f265ea1d5ac92b6e102fb1531f326fac1619d6f43b", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 6949, "excerpt": "DELETE FROM local_blob_uploads WHERE uploaded_ms ( 0 )"}, @@ -3788,7 +3956,8 @@ {"id": "lv-hb13d6650b12c", "path": "crates/fractal-reconcile/src/reconcile.rs", "kind": "included-source", "fingerprint": "3dc6dd19c4638912994179eec402fb22e15b1ebe8ace98e9f80e164e418f2efd", "owner": "fractal_reconcile::reconcile", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 46549, "excerpt": "include_str ! ( \"../../fractal-drivers/tests/fixtures/blocking-screens/claude-code-prompt.txt\" )"}, {"id": "lv-hb13e43c5dd77", "path": "crates/smallclaims/src/store/checkpoint.rs", "kind": "unresolved-sql-sink", "fingerprint": "b2cbbe76784ce7e1e5c37479f1d38c960c8035dd74974ae04e0aad4649d0dc87", "owner": "smallclaims::store::checkpoint", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1058, "excerpt": "\"BEGIN IMMEDIATE\""}, {"id": "lv-hb1556feaa1e5", "path": "crates/fractal-secrets/src/sekrets/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "1f955dfa59b790d855c4591bb24f78d51a668cb0b16f48b7fa6e56011f3e3fa7", "owner": "fractal_secrets::sekrets::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 385, "excerpt": "& format ! ( \"SELECT id, profile, grantee, policy, until_ms, granted_by, created_at FROM grants WHERE {condition} ORDER BY created_at\" )"}, - {"id": "lv-hb16ae5c869ea", "path": "crates/fractal-missions/src/store/work_list.rs", "kind": "unresolved-sql-sink", "fingerprint": "43e32be2fa928193cbeb175d2a9abb1d55f1a8848755a28b58c8ed362456aa58", "owner": "fractal_missions::store::work_list", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 232, "excerpt": "params ! [ subject , time . min ( i64 : : MAX as u128 ) as i64 ] , | row | row . get : : < _ , Option < i64 > > ( 0 )"}, + {"id": "lv-hb16ae5c869ea", "path": "crates/fractal-missions/src/store/work_list.rs", "kind": "unresolved-sql-sink", "fingerprint": "43e32be2fa928193cbeb175d2a9abb1d55f1a8848755a28b58c8ed362456aa58", "owner": "fractal_missions::store::work_list", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 229, "excerpt": "params ! [ subject , time . min ( i64 : : MAX as u128 ) as i64 ] , | row | row . get : : < _ , Option < i64 > > ( 0 )"}, + {"id": "lv-hb16dbad8dff5", "path": "crates/smallclaims/src/store/assistant_grant_authority_bench.rs", "kind": "unresolved-sql-sink", "fingerprint": "4e7cdbc299b188ecd16a440f84f10784cb0c142287d57bf1d90db18be28c27d8", "owner": "smallclaims::store::assistant_grant_authority_bench", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 231, "excerpt": "params ! [ id , format ! ( \"batch/{writer}/{sequence:064x}\" ) , format ! ( \"custom/client/assistant-v1-{group:024x}\" ) , kind , writer , \"person/perf-operator\" , body ]"}, {"id": "lv-hb1717289cd89", "path": "crates/fractal-missions/src/store/authored_pull_requests_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "8edb630b01a1f78d4abc5ee08b714ce7a8578b35d2269aec45684bf19ac1e4fc", "owner": "fractal_missions::store::authored_pull_requests_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 232, "excerpt": "& query"}, {"id": "lv-hb17751306672", "path": "crates/fractal-daemon/src/store_tests/attention_ivm.rs", "kind": "sql-template", "fingerprint": "701c72a8841369cec4d767840eb848e6f3a33f442b4485c19a405fb0f5b49af3", "owner": "fractal_daemon::store_tests::attention_ivm", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 371, "excerpt": "UPDATE mission_runs SET status=?1 WHERE id=?2"}, {"id": "lv-hb17e92309d45", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "14b883e4cfc79305d3b6eb6756468eb767f78986e417bccebc61a53343aae959", "owner": "fractal_missions::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 3057, "excerpt": "UPDATE step_runs SET blocked_reason=?2, updated_at_unix_ms=?3 WHERE subject=?1"}, @@ -3817,6 +3986,7 @@ {"id": "lv-hb2c328f26519", "path": "crates/fractal-github/src/changes/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "768e363f1481b7df38544ec1eafcf60d5c6310e292ddd768a4afa76d0d0ba534", "owner": "fractal_github::changes::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 593, "excerpt": "claimed_draft"}, {"id": "lv-hb2db0d1b6b32", "path": "crates/smallclaims/src/store/prepared_envelope_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "4eab2cec60d71137c5b06061614c34146fea2f1f273af463efdfd35f15bdb6fe", "owner": "smallclaims::store::prepared_envelope_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 319, "excerpt": "params ! [ claim . id , claim . batch_id , claim . subject , claim . kind , claim . origin , claim . actor , canonical_json_text ( & claim . body ) . map_err ( internal ) ? , serde_json : : to_string "}, {"id": "lv-hb2ebcd610ef5", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "9579ec05a5dc2b199e9dbe717739274cad8dad7c65bb2a0360fad919917a01ac", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 10941, "excerpt": "INSERT INTO planning_sessions(id, mission_id, request_ref, workspace, requester, planner, planner_spec_json, status, target_run_id, source_generation_id, created_at_unix_ms, updated_at_unix_ms) VALUES"}, + {"id": "lv-hb30e13c4dc6f", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "552940a93bc1c47bd9cdf9f5206fe767856942374a71615983dfc0e5e5665503", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1447, "excerpt": "authority : : SUBJECT_PENDING_QUERY"}, {"id": "lv-hb314496e1bb9", "path": "crates/smallclaims/src/ivm/install/prepared.rs", "kind": "unresolved-sql-sink", "fingerprint": "d5ee1604fcb72d5172d38f7d9a8b057130bfd01865774ad0f26e96a6fca8a2af", "owner": "smallclaims::ivm::install::prepared", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 959, "excerpt": "\"SAVEPOINT ivm_prepared_page\""}, {"id": "lv-hb3189ce91402", "path": "crates/fractal-missions/src/store/mission_list.rs", "kind": "unresolved-sql-sink", "fingerprint": "e3ddbe94dfddfcbd2f1ebd0aaf646ca5c1260c28110d5383c8841bd575e8833c", "owner": "fractal_missions::store::mission_list", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 332, "excerpt": "[ step ] , | row | row . get : : < _ , String > ( 0 )"}, {"id": "lv-hb318b98ee6cc", "path": "crates/fractal-drivers/src/harness_events.rs", "kind": "sql-template", "fingerprint": "15f0b0e3b2a418fb14d7f03f2786e760d7fe40a364ca8f8dd41892ca5df90afb", "owner": "fractal_drivers::harness_events", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 429, "excerpt": "DELETE FROM metadata WHERE key LIKE 'provider-runtime:%' OR key LIKE 'timeline-next:%'"}, @@ -3830,6 +4000,7 @@ {"id": "lv-hb359d984f1b4", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "750fafddd1d7b43ca64f452b8b50d5f2c68d28a7e0063ce2ab7f99129fc745ef", "owner": "fractal_store::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 178, "excerpt": "UPDATE local_runtime_starts SET receipted=0"}, {"id": "lv-hb35a797d1f6e", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "sql-template", "fingerprint": "37e6f2dc993dee77d54e101b6ee4d15d7eaf2e1d65bf08700654ca9d7a9b71d7", "owner": "smallclaims::store::checkpoint_staging", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 1334, "excerpt": "INSERT OR IGNORE INTO temp.sealed_claims(id) SELECT id FROM staged.claims; INSERT OR IGNORE INTO temp.sealed_blobs(hash) SELECT hash FROM staged.blobs; INSERT OR IGNORE INTO temp.sealed_envelopes(writ"}, {"id": "lv-hb3647d01a418", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "affa4140a5425541ea4e2fb77da2a7be04534161ccb348a4a5392a2190491ebb", "owner": "fractal_store::store::tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 11895, "excerpt": "CREATE TABLE batches(id TEXT PRIMARY KEY, origin TEXT, replica_sequence INTEGER); CREATE TABLE claims(id TEXT PRIMARY KEY, subject TEXT, kind TEXT, batch_id TEXT, store_index INTEGER, accepted_at_unix"}, + {"id": "lv-hb39485ba125b", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "e00de575fe9cabd2c7c6aa3c1e917b2885c886dcd3d5054e4e38a6a4f155e884", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1074, "excerpt": "UPDATE assistant_grant_additions SET claim_id=active_claim,active_claim='' WHERE id=?1"}, {"id": "lv-hb3cc9adf2362", "path": "crates/fractal-store/src/store/tests.rs", "kind": "included-source", "fingerprint": "9b7ff6c2ed4f3a56f70911adfcff5375d99f01cb880fdca7b10aea67818f8c9c", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 300, "excerpt": "include ! ( \"stopped_seat_declaration_controls.rs\" )"}, {"id": "lv-hb3cca75d21d1", "path": "crates/fractal-api-core/src/api/legacy_handler_guard_tests.rs", "kind": "included-source", "fingerprint": "af90ccc963add4e878eb1a6ce4a8737679fb1e6278b2ad7baaeff6f32f740c74", "owner": "fractal_api_core::api::legacy_handler_guard_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 13, "excerpt": "include_str ! ( \"launches.rs\" )"}, {"id": "lv-hb3dfbeff57db", "path": "crates/fractal-store/src/store/runtime.rs", "kind": "unresolved-sql-sink", "fingerprint": "e609f0f92b0159df66612fc94a1590cbf5b9ae2afb3099f09957f492a435a92a", "owner": "fractal_store::store::runtime", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 757, "excerpt": "identities : : SCHEMA"}, @@ -3872,6 +4043,7 @@ {"id": "lv-hb59357c7152a", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "sql-template", "fingerprint": "d97d980f5b347ed4a16ab8dd0af3c04363eac83c0ae0810175858d77bd9c1992", "owner": "fractal_store::store::client_messages", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1526, "excerpt": "DROP TABLE IF EXISTS local_client_message_fold_batches;DROP TABLE IF EXISTS local_client_message_publications;"}, {"id": "lv-hb59720c737d2", "path": "crates/fractal-store/src/store/checkpoint_identity_reuse_tests.rs", "kind": "sql-template", "fingerprint": "a466c1bb6842b49c1d34a00a24fdcb27190d6711850fee20c555c3c6c8bfc672", "owner": "fractal_store::store::checkpoint_identity_reuse_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 193, "excerpt": "UPDATE claims SET accepted_at_unix_ms=?1 WHERE id=?2"}, {"id": "lv-hb5d0c6d8b7ed", "path": "crates/smallclaims/src/store/principals/legacy.rs", "kind": "unresolved-sql-sink", "fingerprint": "861ae77d8b9421fa21c0de36fb94ae80d2b589f44a1eb28e3ee97f385d319402", "owner": "smallclaims::store::principals::legacy", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 85, "excerpt": "[ claim_id ]"}, + {"id": "lv-hb5e52f377f02", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "087fbc78cff93ffd74f078fca1b000a22c099b870ff4f330db38f048e0b5b0f6", "owner": "smallclaims::store::membership_query_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 616, "excerpt": "UPDATE claims SET origin='birch' WHERE id=?1"}, {"id": "lv-hb5f027ea8580", "path": "crates/fractal-store/src/store/terminal_gate_evidence/native_source_transaction_hooks_shared_seats.rs", "kind": "sql-template", "fingerprint": "6b3823f2f143ab2244075588dbaf9e8bf386ed8250474992d6adfbee5ca02c07", "owner": "fractal_store::store::terminal_gate_evidence::native_source_transaction_hooks_shared_seats", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 125, "excerpt": "UPDATE test_native_terminal_guard SET gap=?1,pending=1 WHERE id=1"}, {"id": "lv-hb5f4a6691287", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "5b6b40a906a01449b1777c0aa965073d786de369e2f1e74d6af78bfa11963f53", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6319, "excerpt": "\"BEGIN\""}, {"id": "lv-hb60936b2dafb", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "e355841dda64010916db6237966232dd46893ba85fdcdda63c13fb4b1d5fda6b", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 6144, "excerpt": "INSERT OR IGNORE INTO blobs(hash,bytes,size) SELECT hash,bytes,size FROM local_blobs WHERE hash=?1"}, @@ -3906,6 +4078,7 @@ {"id": "lv-hb78dff66c1f1", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "sql-template", "fingerprint": "251b6a02e2932be1f049a3ce7eb20905efcf81fa4e147706098c666cd1e506ba", "owner": "smallclaims::store::checkpoint_staging", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 389, "excerpt": "UPDATE claims SET dropped=0, status_keep=0 WHERE dropped<>0 OR status_keep<>0;"}, {"id": "lv-hb78dff70f153", "path": "crates/fractal-store/src/store/answers_check_tests.rs", "kind": "sql-template", "fingerprint": "da375a6ef935682d924483cbd6c26b9c32a0a576b639560d3ec18290cfd5125b", "owner": "fractal_store::store::answers_check_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 213, "excerpt": "DELETE FROM claims WHERE id=?1"}, {"id": "lv-hb7a9cac23074", "path": "crates/fractal/src/main_tests.rs", "kind": "included-source", "fingerprint": "926e34a2700d3794a1a0112cc5934179ede5153d539f437d844ada16841054de", "owner": "fractal::main_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 3392, "excerpt": "include_str ! ( \"migrate_cli.rs\" )"}, + {"id": "lv-hb7abee1d3c34", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "ccbdb4ad2b0e9e2d65c7429708b5ebf324a43876f080303e18def587249485e6", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1549, "excerpt": "INSERT INTO assistant_grant_dirty VALUES(?1)"}, {"id": "lv-hb7ae4ee26670", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "unresolved-sql-sink", "fingerprint": "11aefa02d08fff762d53fabc5cb17d28670a8a309aaf9d095872aeed43ca1a49", "owner": "fractal_missions::store::missions", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 5177, "excerpt": "[ view . run . strip_prefix ( \"mission-run/\" ) . unwrap_or ( & view . run ) ] , | row | row . get : : < _ , String > ( 0 ) ,"}, {"id": "lv-hb7b64cc10c51", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "7a41ee06927a48e907a8b303d67368f1f76113a73b7efcaf20c658e641deaac8", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 2069, "excerpt": "params ! [ subject , at_index . unwrap_or ( i64 : : MAX as u64 ) ] , | row | row . get : : < _ , String > ( 0 ) ,"}, {"id": "lv-hb7bee44be324", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "af5beb3369f127015aa1f89c22e5b4abfb98318601a8b0482ff3fbced8deafe2", "owner": "fractal_store::store::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 6902, "excerpt": "INSERT OR IGNORE INTO batches(id,origin,replica_sequence,hash,accepted_at_unix_ms) VALUES(?1,?2,?3,?1,?4)"}, @@ -3926,19 +4099,24 @@ {"id": "lv-hb864ed6dba28", "path": "crates/fractal-store/src/store/custom.rs", "kind": "sql-template", "fingerprint": "15931c0b65dc90a80f62faf5eb066ca93a765e8054b503072dfbe8f0b331cce6", "owner": "fractal_store::store::custom", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 632, "excerpt": "DELETE FROM custom_sources WHERE subject=?1"}, {"id": "lv-hb8663de1499d", "path": "crates/fractal-store/src/store/message_sent.rs", "kind": "unresolved-sql-sink", "fingerprint": "599859e250706d3b4ee475adc11033bc4061b5cc97a47784a8690cb4c1e5c24f", "owner": "fractal_store::store::message_sent", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 118, "excerpt": "STREAM_ITEM"}, {"id": "lv-hb86ee6eef76c", "path": "crates/fractal-evidence/src/store/owned_sets_tests/empty_authority_guard.rs", "kind": "sql-template", "fingerprint": "d9881f4a56e94f802dfdddaf17cdf55dfff7e88649c5d23572a0f155169dc6f9", "owner": "fractal_evidence::store::owned_sets_tests::empty_authority_guard", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 98, "excerpt": "INSERT INTO batches(id,origin,replica_sequence,hash,accepted_at_unix_ms) VALUES(?1,'amber',1,?1,'1')"}, + {"id": "lv-hb8891f8aff3c", "path": "crates/fractal-delivery/src/store/message_send_tests.rs", "kind": "sql-template", "fingerprint": "969740a8330cdf8f68af6815afe83201c681dd9cf8976b862820598ba4de2447", "owner": "fractal_delivery::store::message_send_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 533, "excerpt": "INSERT INTO assistant_grant_dirty(claim_id) VALUES('unrelated-claim')"}, {"id": "lv-hb88f0e6eb898", "path": "crates/smallclaims/src/store/principals/legacy.rs", "kind": "sql-template", "fingerprint": "2a9febb5283e716eab9dc4b8aa9177566e9d3bc3fa82482575753db62918a64c", "owner": "smallclaims::store::principals::legacy", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 70, "excerpt": "INSERT OR IGNORE INTO legacy_claim_signatures(claim_id, signer, key, nonce, signature) VALUES (?1, ?2, ?3, ?4, ?5)"}, {"id": "lv-hb895da732cc2", "path": "crates/fractal-delivery/src/store/mailbox_wakes.rs", "kind": "unresolved-sql-sink", "fingerprint": "77c4de10a8a1013855978eee1c6ed5708b4b325598604b7edbfbd3e7755627af", "owner": "fractal_delivery::store::mailbox_wakes", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 172, "excerpt": "[ ] , | r | Ok ( ( r . get ( 0 ) ? , r . get ( 1 ) ? ) )"}, {"id": "lv-hb8994accebf5", "path": "crates/smallclaims/src/store/checkpoint_agreement.rs", "kind": "sql-template", "fingerprint": "4a955a4e507468bb1a80ac764e7f52c3a34ccde7f9a0faec656aaf84ae84d902", "owner": "smallclaims::store::checkpoint_agreement", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 899, "excerpt": "INSERT INTO checkpoints(id, cut_unix_ms, state, seal_rowid, sealed_digest, drop_digest, detail, updated_at_unix_ms) VALUES (?1, ?2, 'sealed', ?3, ?4, ?5, ?6, ?7) ON CONFLICT(id) DO UPDATE SET detail=e"}, {"id": "lv-hb8a89b7c6bc6", "path": "crates/fractal-github/src/changes/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "ac1b5c0961a7269b6a053ee64276ed0e20a7f48aefb9f67519539d23aaf10149", "owner": "fractal_github::changes::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 492, "excerpt": "initial"}, {"id": "lv-hb8afecd653a5", "path": "crates/fractal-missions/src/store/tests/huge_part_digest.rs", "kind": "unresolved-sql-sink", "fingerprint": "3eed0c1ff57c957544cbb5ebfb75976caa07c2e32deb78312fd8cdb66a664c15", "owner": "fractal_missions::store::tests::huge_part_digest", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 139, "excerpt": "& format ! ( \"PRAGMA table_info({quoted})\" )"}, + {"id": "lv-hb8b3d12c32f5", "path": "crates/fractal-api-core/src/api/client_v0/external_grants/conflict_tests.rs", "kind": "sql-template", "fingerprint": "0fb338ad0acf82cd6d405b987f3373ab7a688e926db8ba4f052c8fdabf0dbdcd", "owner": "fractal_api_core::api::client_v0::external_grants::conflict_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 675, "excerpt": "INSERT INTO assistant_grant_dirty(claim_id) VALUES(?1)"}, + {"id": "lv-hb8b541534641", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "a824f096f1486d9b0b5e62ba87eae4e481e5368e8b3fd7783bc865db160bed2d", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1461, "excerpt": "INSERT INTO assistant_grant_retractions(writer,member_key,lower_sequence,upper_sequence) VALUES(?1,'lost-key',0,100)"}, {"id": "lv-hb8b7436cf276", "path": "crates/fractal-store/src/store/directive_notes.rs", "kind": "unresolved-sql-sink", "fingerprint": "445a4a2592bf9662d7d90a064b8d01a5c187fc8ef1d36f91a48f3f06da6745ae", "owner": "fractal_store::store::directive_notes", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 176, "excerpt": "& canonical_sql ( \"SELECT id FROM claims WHERE subject=?1 AND kind='person.directive-note-set' AND NOT EXISTS (SELECT 1 FROM replica_records repaired WHERE repaired.claim_id=claims.id AND repaired.sta"}, {"id": "lv-hb8bce774ae12", "path": "crates/fractal-daemon/src/store_tests/client_message_reminder_deletion.rs", "kind": "unresolved-sql-sink", "fingerprint": "c32b884bb11aa9d33ad9fa5b6cbd7b18be6b5eec40e5397aa0319a5e4069ab0d", "owner": "fractal_daemon::store_tests::client_message_reminder_deletion", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 145, "excerpt": "& sql"}, + {"id": "lv-hb8c82682a9d0", "path": "crates/fractal/src/assistant_grant_authority_wake_tests.rs", "kind": "sql-template", "fingerprint": "f9c383342e6c293be73c7672bce1763e3b6b0887cc901fd5142d6e6f77a40249", "owner": "fractal::assistant_grant_authority_wake_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 82, "excerpt": "INSERT INTO meta(key,value) VALUES('authority-after-shutdown','1')"}, {"id": "lv-hb8eae595c5f6", "path": "crates/smallclaims/src/store/principals/legacy.rs", "kind": "unresolved-sql-sink", "fingerprint": "b188279bf279696ba173381a2435fb8c38f4467f508d6e8cfe1dacbb43a5ee6e", "owner": "smallclaims::store::principals::legacy", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 321, "excerpt": "params ! [ link , claim_id ]"}, {"id": "lv-hb90d9adc1d7c", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "bc153cb4fdda0d766accefe6a6a04f6a49d258119c37b614e215757a17307659", "owner": "fractal_store::store::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 7133, "excerpt": "INSERT INTO batches(id,origin,replica_sequence,hash,accepted_at_unix_ms) VALUES(?1,'alder',1,?1,?2)"}, {"id": "lv-hb914ffd15eec", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "included-source", "fingerprint": "c4dbd99be0f58403c8509db62a388458ab56f843c2b5f7aea3fefbeb9c4ce2e3", "owner": "fractal_missions::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 11188, "excerpt": "include ! ( \"seat_queue_purity_tests.rs\" )"}, {"id": "lv-hb91b1f8c3812", "path": "crates/smallclaims/src/store/projection_digest.rs", "kind": "sql-template", "fingerprint": "709a5f62f800b4471ecefbc09fce7a8621e7640a56e5a4857e9203b2b76983c3", "owner": "smallclaims::store::projection_digest", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 250, "excerpt": "CREATE TRIGGER projection_digest_{table}_time_update AFTER UPDATE OF accepted_at_unix_ms ON {table} WHEN {visible} AND OLD.accepted_at_unix_ms IS NOT NEW.accepted_at_unix_ms AND NOT EXISTS(SELECT 1 FR"}, {"id": "lv-hb91cbaef2bf2", "path": "crates/smallclaims/src/store/checkpoint/tombstones.rs", "kind": "unresolved-sql-sink", "fingerprint": "9725b0e2e59f41044b9df400b17e17b3c5292947807e66968ed11831a78ebab0", "owner": "smallclaims::store::checkpoint::tombstones", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 161, "excerpt": "[ id ] , | row | row . get ( 0 )"}, {"id": "lv-hb922e5825674", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "a521c5dad40bb69aa774c45feb4115e928e9636649863fd2f9284a6b6dd95c5c", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 16819, "excerpt": "DELETE FROM mission_runs WHERE id=?1"}, + {"id": "lv-hb93a7253f42d", "path": "crates/smallclaims/src/store/assistant_grant_authority_bench.rs", "kind": "sql-template", "fingerprint": "3b8525320ff8942039b36f4b2c4190dc3c8c99df23ad5bd44535bb9974d544cf", "owner": "smallclaims::store::assistant_grant_authority_bench", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 397, "excerpt": "DELETE FROM meta WHERE key='assistant_grant_authority_version'"}, {"id": "lv-hb94b9de39b63", "path": "crates/fractal-store/src/store/attention_snapshot.rs", "kind": "unresolved-sql-sink", "fingerprint": "b2ced5825ddb6c9ff5e9e7762a4c391488c6a1a03a8dae6f0d04957ef2a2e203", "owner": "fractal_store::store::attention_snapshot", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 2843, "excerpt": "& format ! ( \"{} LIMIT 16\" , newest_claims_of_kind_query ( \"claims.id, claims.body\" , \"harness.observed\" ) )"}, {"id": "lv-hb94c80746170", "path": "crates/smallclaims/src/store/checkpoint_space.rs", "kind": "sql-template", "fingerprint": "8d18eb601ecf7a38b3b411af11120d3d0ad9ae265d81ea72ecfcc6dbebe33128", "owner": "smallclaims::store::checkpoint_space", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 43, "excerpt": " CREATE TABLE sealed_claims(id TEXT PRIMARY KEY); CREATE TABLE sealed_blobs(hash TEXT PRIMARY KEY); CREATE TABLE sealed_envelopes(writer TEXT, sequence INTEGER, envelope_hash TEXT, PRIMARY KEY(writer,"}, {"id": "lv-hb9508ca00e30", "path": "crates/fractal-store/src/store/fleet_admission_tests.rs", "kind": "sql-template", "fingerprint": "922a8ff6905cc79d9d9ed59d7120c5a43a54d07fb306d7719dd0ddb9dd19f31a", "owner": "fractal_store::store::fleet_admission_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 854, "excerpt": "DELETE FROM meta WHERE key='staged_blob_scope'"}, @@ -3965,6 +4143,7 @@ {"id": "lv-hba6a871032cc", "path": "crates/fractal-store/src/store/answers_check.rs", "kind": "unresolved-sql-sink", "fingerprint": "6a046ff7bdaac68af188c1968d58446bf7950f5876e23f328888cc40fedcbeaa", "owner": "fractal_store::store::answers_check", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 79, "excerpt": "& ACTUAL_MOVED"}, {"id": "lv-hba6f8075196e", "path": "crates/smallclaims/src/store/events.rs", "kind": "sql-template", "fingerprint": "cadd0b125415a8068dec5578890a8f63b35b13eeff0be25398df15c3a81fee9e", "owner": "smallclaims::store::events", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 92, "excerpt": "DELETE FROM local_event_payloads WHERE store_index=?1"}, {"id": "lv-hba707764f720", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "746038271c3a30a5efca3979d788db5d87a588acb47362b3cb27a9a3d4c1d0ce", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 20106, "excerpt": "& canonical_sql ( \"SELECT kind, body, accepted_at_unix_ms FROM claims WHERE subject=?1 AND kind IN ('work.progress','work.submitted','step-run.carried') ORDER BY CANONICAL_DESC(claims)\" , )"}, + {"id": "lv-hba715e11f267", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "77bade8a973ecd9c2fa6e61a4a69dd858d48c4c9ba24c8158a6207bd3ec81785", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 1129, "excerpt": "INSERT INTO assistant_grant_auth_cursor VALUES(?1,7,9,'new-checkpoint',3)"}, {"id": "lv-hba80f02be5e7", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "f0cf159db9d7e30d00dd58f281267eb75687e6eaea2c416eddf5df095accc440", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 9314, "excerpt": "& canonical_sql ( \"SELECT body FROM claims WHERE subject=?1 AND kind='resource.observed' ORDER BY CANONICAL_DESC(claims)\" ) ,"}, {"id": "lv-hba917bc3669d", "path": "crates/fractal-delivery/src/store/delivery.rs", "kind": "unresolved-sql-sink", "fingerprint": "e7f50e84b3e0bc437d0510d283cb059b4e8a230cdfbb695c7392703b9ca7b1f9", "owner": "fractal_delivery::store::delivery", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 723, "excerpt": "params ! [ recipient , message_bare_recipient ( recipient ) , & resource ] , | row | row . get ( 0 ) ,"}, {"id": "lv-hba991f76526b", "path": "crates/fractal-store/src/store/message_canonical_sort_tests.rs", "kind": "sql-template", "fingerprint": "6c9d3fc6fae30b998b98a5ac1be7454bca71721eedd9654dff07195e59d69296", "owner": "fractal_store::store::message_canonical_sort_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 220, "excerpt": "UPDATE claims SET batch_id='absent' WHERE id='claim-2'"}, @@ -3976,8 +4155,10 @@ {"id": "lv-hbaf11ae2e68b", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "sql-template", "fingerprint": "5d3baa4cb1a6ebdc4527226258f80f2f07dfd1bd8aa4ff43204d68c70a101ee7", "owner": "fractal_missions::store::missions", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 4048, "excerpt": "INSERT INTO idempotency(operation_id, response) VALUES (?1, ?2)"}, {"id": "lv-hbaf37261e5a0", "path": "crates/smallclaims/src/store/sealed_view_cache_tests/mutation_tests.rs", "kind": "sql-template", "fingerprint": "1db7f40539728faad5dd9e8915b9946096ae8fbfc4e69aca3d89e5c92efc0e9e", "owner": "smallclaims::store::sealed_view_cache_tests::mutation_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 99, "excerpt": "UPDATE batches SET id='temporary-batch' WHERE id=?1"}, {"id": "lv-hbb02f708c2c5", "path": "crates/fractal-delivery/src/store/mailbox_lease.rs", "kind": "unresolved-sql-sink", "fingerprint": "e8e0bb8a64c8c7cc2ff1889442a2e07a1d22347b0860b43855afef790e981dba", "owner": "fractal_delivery::store::mailbox_lease", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 240, "excerpt": "params ! [ fence . subject , episode ] , | row | { Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? ) ) }"}, + {"id": "lv-hbb32eb74d7c6", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "37884675cab94d5e057afbe972c4528663cbaea2edcfdd26be736a93e68f3b1b", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 189, "excerpt": "INSERT INTO assistant_grant_membership_windows VALUES(?1,?2,?3,?4)"}, {"id": "lv-hbb373c1f9535", "path": "crates/fractal-store/src/store/declared_objectives.rs", "kind": "unresolved-sql-sink", "fingerprint": "4aa7af888f0eb091e0fd5cc90601a0b7752fdd23d3b1a05045615f7bb1fc305e", "owner": "fractal_store::store::declared_objectives", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 66, "excerpt": "[ agent ] , | row | row . get : : < _ , Option < String > > ( 0 )"}, {"id": "lv-hbb4d7ef8a2a5", "path": "crates/fractal-store/src/store/messages_shard.rs", "kind": "unresolved-sql-sink", "fingerprint": "8ffaf16307b0b778471946170f039ab55a6c4a8e018436c074afbec06e2ebf6b", "owner": "fractal_store::store::messages_shard", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 248, "excerpt": "& format ! ( \"SELECT item.subject, item.store_index FROM stream_messages AS item WHERE {} ORDER BY item.store_index LIMIT :limit\" , filter . sql ( ) )"}, + {"id": "lv-hbb5e6b92e1b0", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "95264ca41020dc3296e2c357db7feb540bccd0aa91dfbb912af41ecdf198689c", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 720, "excerpt": "DELETE FROM replica_envelope_signatures WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=?4"}, {"id": "lv-hbb840ed5c2a8", "path": "crates/smallclaims/src/store/checkpoint_staging/scoped.rs", "kind": "unresolved-sql-sink", "fingerprint": "c32b884bb11aa9d33ad9fa5b6cbd7b18be6b5eec40e5397aa0319a5e4069ab0d", "owner": "smallclaims::store::checkpoint_staging::scoped", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 134, "excerpt": "& sql"}, {"id": "lv-hbb8f1fc66365", "path": "crates/fractal-delivery/src/store/delivery.rs", "kind": "unresolved-sql-sink", "fingerprint": "05d1fca38c802b1f8682dc8dd0b15fed8fbff745fec02413bdf5de12122b884e", "owner": "fractal_delivery::store::delivery", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 436, "excerpt": "& canonical_sql ( \"WITH candidates AS ( SELECT id FROM claims INDEXED BY claims_message_to_index WHERE kind='message.sent' AND json_extract(body,'$.fields.to')=?1 AND store_index<=?2 UNION SELECT id F"}, {"id": "lv-hbbb29f6a8f86", "path": "crates/fractal-store/src/store/resources.rs", "kind": "unresolved-sql-sink", "fingerprint": "fec187433c4f392fddb9c0d1400a095648f252e10b441a3cf1058bac6f7d78d9", "owner": "fractal_store::store::resources", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 77, "excerpt": "SCHEMA"}, @@ -3992,19 +4173,21 @@ {"id": "lv-hbc1a6d086702", "path": "crates/fractal-store/src/store/attention_snapshot.rs", "kind": "unresolved-sql-sink", "fingerprint": "49c0482208481a552808bbd240742900c428101e25037b14f88beff9c129cd53", "owner": "fractal_store::store::attention_snapshot", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 2366, "excerpt": "& format ! ( \"{} LIMIT 8\" , newest_claims_of_kind_query ( \"claims.id, claims.store_index, claims.accepted_at_unix_ms, claims.body\" , \"harness.diagnostic\" ) . replace ( \" ORDER BY\" , \" AND json_extract"}, {"id": "lv-hbc1c39e02c9b", "path": "crates/fractal-github/src/idle_holds.rs", "kind": "unresolved-sql-sink", "fingerprint": "9b8d2602d08d544b43fe695eb42dab6db910b7c3dc705f4fb0277e423425da7b", "owner": "fractal_github::idle_holds", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 182, "excerpt": "QUEUE_EXIT_STATE_SQL"}, {"id": "lv-hbc223dd1ddcc", "path": "crates/fractal-drivers/src/harness_events.rs", "kind": "sql-template", "fingerprint": "7d2bb03d7293f9429ef9c1714d1f76769e953ed37061895935ac2ce560ead043", "owner": "fractal_drivers::harness_events", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 762, "excerpt": "DELETE FROM timeline WHERE id IN ( SELECT id FROM (SELECT id, SUM(length(CAST(body AS BLOB))) OVER (ORDER BY id DESC) AS retained FROM timeline) WHERE retained > 2097152)"}, + {"id": "lv-hbc290dd6ae0d", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "1f45671338e89913c18f35e05f9f94bc4da98332cfd3337fb2678ff97621393e", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1225, "excerpt": "INSERT OR IGNORE INTO assistant_grant_proof_rechecks VALUES(?1)"}, {"id": "lv-hbc2d40ff7313", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "dfbeb59f0d999b99adf7ffd4a0b076babbd08d3184298520164a8bf1d854aa83", "owner": "smallclaims::store::repair_operation_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 787, "excerpt": "\"SAVEPOINT known_key_cache_oracle\""}, {"id": "lv-hbc44e4318e38", "path": "crates/fractal/src/response_expiry_tests.rs", "kind": "sql-template", "fingerprint": "dd2b5f9f07e0760d8d29d36a0234e46940679161a2bccaeec3851ef4253997eb", "owner": "fractal::response_expiry_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 201, "excerpt": "UPDATE idempotency SET expires_at_unix_ms=0"}, {"id": "lv-hbc46e8c53f31", "path": "crates/fractal-store/src/store/person_work.rs", "kind": "unresolved-sql-sink", "fingerprint": "a6dffb6000847523ee6489db378ac686db44c34b176611c76743922444126b0e", "owner": "fractal_store::store::person_work", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 579, "excerpt": "& canonical_sql ( \"SELECT id,store_index,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms FROM claims WHERE subject=?1 AND kind='intent.desired' ORDER BY CANONICAL_ASC(claims)\""}, {"id": "lv-hbc4d43337482", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "5723cc8c36ddfbf186008a574133b5b4f730d8e85c5af0a8f6658e563f18880f", "owner": "fractal_store::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 12878, "excerpt": "DROP TRIGGER claims_stored_insert"}, {"id": "lv-hbc61d180f03e", "path": "crates/fractal-reconcile/src/reconcile.rs", "kind": "included-source", "fingerprint": "a5026d70c52a674ec10d5ebe3a850f4903db961ebe41d6fab7674e2c879a82c3", "owner": "fractal_reconcile::reconcile", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 21539, "excerpt": "include_str ! ( \"../../fractal-daemon/tests/fixtures/harness-access-previous-build.json\" )"}, + {"id": "lv-hbc780a1c9dac", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "5879b5ae9aacb2b1c0cb8e669215a14596a77b343bcb6baeedcd73f1b28ae314", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 723, "excerpt": "UPDATE replica_envelope_signatures SET signature='invalid' WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=?4"}, {"id": "lv-hbc878ec34d4d", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "e0f9eff7705c4c78538aa3b8463a8d73aec086d1af94cf151f6e7cb13c4b6e8b", "owner": "fractal_store::store::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 1808, "excerpt": "UPDATE claims SET accepted_at_unix_ms='1'"}, {"id": "lv-hbca5dd938ce3", "path": "crates/fractal-store/src/store/terminal_gate_evidence/tests.rs", "kind": "sql-template", "fingerprint": "fda5de8026a976c64034b4821d266cdc56720f747a3894e68ece47b1dd1cbee1", "owner": "fractal_store::store::terminal_gate_evidence::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 201, "excerpt": "DROP TABLE test_terminal_members"}, {"id": "lv-hbcbe231993d3", "path": "crates/smallclaims/src/store/retired_facts.rs", "kind": "sql-template", "fingerprint": "3f0cf8b4c243047ec3d7514a06739a5cac9277bfa1db435a4d69b43f02b9f11e", "owner": "smallclaims::store::retired_facts", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 26, "excerpt": "INSERT OR IGNORE INTO retired_claim_ancestry(claim_id, subject, kind, predecessors) VALUES ({id}, {row}.subject, {row}.kind, {row}.predecessors); INSERT OR IGNORE INTO retired_operation_receipts(opera"}, {"id": "lv-hbcc16bdc817e", "path": "crates/fractal-seats/src/store/reconcile_work_context/tests.rs", "kind": "sql-template", "fingerprint": "7501569747653ae5c630b4ad8576011b51d2687d91cfb7765a71c42d6c62caf5", "owner": "fractal_seats::store::reconcile_work_context::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 200, "excerpt": "UPDATE mission_revisions SET body=?1"}, {"id": "lv-hbccafe49f0c6", "path": "crates/smallclaims/src/store/document_pages/tests.rs", "kind": "sql-template", "fingerprint": "cdd3366bff427d7d30bd4c90a4ebfb14fe5b958d0f651945f2e42b4fb7e182aa", "owner": "smallclaims::store::document_pages::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 580, "excerpt": "DELETE FROM blobs WHERE hash=(SELECT hash FROM documents WHERE name='doc/b')"}, - {"id": "lv-hbcd207df08b2", "path": "crates/fractal-api-client-v0/src/api/client_v0/collection_refresh_tests.rs", "kind": "included-source", "fingerprint": "5d604bf3342897bb94342ddbdbe8296d87ee778849bee124dd73f3c81b8f6a26", "owner": "fractal_api_client_v0::api::client_v0::collection_refresh_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 483, "excerpt": "include_str ! ( \"../../../../../examples/fractal/custom-review.json\" )"}, - {"id": "lv-hbcda5cda38a1", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "2076c92ab7648083e19f0874b156fbee36adb6774511b383280784ae93c3a198", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 12829, "excerpt": "params ! [ subject , at_index , incarnation ] , | row | { Ok ( ( row . get : : < _ , String > ( 0 ) ? , row . get : : < _ , String > ( 1 ) ? , row . get : : < _ , String > ( 2 ) ? ) ) }"}, - {"id": "lv-hbcf472355ed4", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "7ba5fc50258bff63918434640c5d3c0e6932c4c11c5e8d7694ea7e332adfab42", "owner": "fractal_store::store::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 11952, "excerpt": "UPDATE replica_records SET position=0 WHERE claim_id='record-a'"}, + {"id": "lv-hbcd207df08b2", "path": "crates/fractal-api-client-v0/src/api/client_v0/collection_refresh_tests.rs", "kind": "included-source", "fingerprint": "5d604bf3342897bb94342ddbdbe8296d87ee778849bee124dd73f3c81b8f6a26", "owner": "fractal_api_client_v0::api::client_v0::collection_refresh_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 475, "excerpt": "include_str ! ( \"../../../../../examples/fractal/custom-review.json\" )"}, + {"id": "lv-hbcda5cda38a1", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "2076c92ab7648083e19f0874b156fbee36adb6774511b383280784ae93c3a198", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 11176, "excerpt": "params ! [ subject , at_index , incarnation ] , | row | { Ok ( ( row . get : : < _ , String > ( 0 ) ? , row . get : : < _ , String > ( 1 ) ? , row . get : : < _ , String > ( 2 ) ? ) ) }"}, + {"id": "lv-hbcf472355ed4", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "7ba5fc50258bff63918434640c5d3c0e6932c4c11c5e8d7694ea7e332adfab42", "owner": "fractal_store::store::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 10593, "excerpt": "UPDATE replica_records SET position=0 WHERE claim_id='record-a'"}, {"id": "lv-hbd02e2691590", "path": "crates/fractal-store/src/store/directive_notes.rs", "kind": "sql-template", "fingerprint": "f439a6bb27016c148358ff8c7764258adfa714a95ed1433b1c23be72742801b6", "owner": "fractal_store::store::directive_notes", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 175, "excerpt": "DELETE FROM person_directive_notes WHERE person=?1"}, {"id": "lv-hbd09a1c36932", "path": "crates/fractal-store/src/store/backup.rs", "kind": "sql-template", "fingerprint": "b6bfc1df536126466dd5634f1d548532b4b7ac16da8cb9a1377e77dccdf2040a", "owner": "fractal_store::store::backup", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 514, "excerpt": "INSERT OR IGNORE INTO replica_restore_quarantine(writer,sequence,envelope_hash) SELECT writer,sequence,envelope_hash FROM replica_envelopes WHERE batch_id IS NULL"}, {"id": "lv-hbd0b2188b3ea", "path": "crates/fractal-reconcile/src/reconcile/github_plugin_store.rs", "kind": "sql-template", "fingerprint": "2eada3eaa3c29a27e41049c1b8315fac6bec56c56c61df05f8bf57322b34c8ea", "owner": "fractal_reconcile::reconcile::github_plugin_store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 252, "excerpt": "UPDATE plugin_meta SET value=?2 WHERE key=?1"}, @@ -4043,6 +4226,7 @@ {"id": "lv-hbe8f20e0537d", "path": "crates/fractal-missions/src/store/person_work.rs", "kind": "unresolved-sql-sink", "fingerprint": "2c505192192abd9caafd3595d090d3c04eeaed6af8cf8c68baccebff57a6b0e6", "owner": "fractal_missions::store::person_work", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 571, "excerpt": "& canonical_sql ( \"SELECT id, store_index, batch_id, subject, kind, origin, actor, body, predecessors, accepted_at_unix_ms FROM claims WHERE subject=?1 AND kind=?2 ORDER BY CANONICAL_DESC(claims) LIMI"}, {"id": "lv-hbe95e8c25ae0", "path": "crates/fractal-store/src/store/database_size.rs", "kind": "unresolved-sql-sink", "fingerprint": "739277eecbb8d9e71d5fc81cf9dc7541e03c3b68c40eb52e59e0a6194b8d0274", "owner": "fractal_store::store::database_size", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 127, "excerpt": "& format ! ( \"PRAGMA {name}\" ) , [ ] , | row | row . get ( 0 )"}, {"id": "lv-hbe9ab32f43d1", "path": "crates/fractal-store/src/store/custom/tests.rs", "kind": "sql-template", "fingerprint": "312c623079b440c8ed74533c88d167d2bfa28e6abf746367894219a8345bd762", "owner": "fractal_store::store::custom::tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 510, "excerpt": "UPDATE replica_records SET state='repaired' WHERE claim_id=?1"}, + {"id": "lv-hbea4b67b6a13", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "309875e8abb2bc3a99eb38ecee4c711cb76b3289ec093bfbbc7fb20330b57bac", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 385, "excerpt": "DELETE FROM replica_envelope_signatures"}, {"id": "lv-hbebd5a08d184", "path": "crates/smallclaims/src/store/known_writers_tests.rs", "kind": "sql-template", "fingerprint": "b2f92b5105d1308aea367fb00ea97ac906357b94ea33e0663dad4f702d8e31a3", "owner": "smallclaims::store::known_writers_tests", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 31, "excerpt": "WITH RECURSIVE n(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM n WHERE i ( 0 ) ? , row . get : : < _ , String > ( 1 ) ? , row . get : : < _ , String > ( 2 ) ? , row . get : : < _ , String > ( 3 ) ? , row . get : :"}, {"id": "lv-hc8217a1ab7fc", "path": "crates/fractal-store/src/store/attention_ivm.rs", "kind": "sql-template", "fingerprint": "8cf1a933d7aea78d656913cf133dfc1caee667f8a0fec270b99d4c0392c5c065", "owner": "fractal_store::store::attention_ivm", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 152, "excerpt": "DELETE FROM local_attention_open_dependencies WHERE family=?1 AND source=?2"}, - {"id": "lv-hc82bee90048c", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "sql-template", "fingerprint": "2137cb6f3de4b5cffc94261eeea0ecdfb004880d51e9940b49d516973258435a", "owner": "smallclaims::store::repair_operation_tests", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 969, "excerpt": "DELETE FROM checkpoint_claims WHERE id='cp/bad'"}, + {"id": "lv-hc82bee90048c", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "sql-template", "fingerprint": "2137cb6f3de4b5cffc94261eeea0ecdfb004880d51e9940b49d516973258435a", "owner": "smallclaims::store::repair_operation_tests", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 919, "excerpt": "DELETE FROM checkpoint_claims WHERE id='cp/bad'"}, + {"id": "lv-hc8361ab9b858", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "e55b2d5107f04e028d035bbb48904b58e786391c869a4b3a77d380d2543beb0c", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 522, "excerpt": "UPDATE replica_envelope_signatures SET envelope_hash='other-envelope'"}, {"id": "lv-hc8589cb9e4fb", "path": "crates/fractal-store/src/store/message_canonical_sort_tests.rs", "kind": "sql-template", "fingerprint": "98e648994115b2c5883d41dad5114e92d1d05fa0c8e1e42d231df4ed7506b3d0", "owner": "fractal_store::store::message_canonical_sort_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 56, "excerpt": "INSERT INTO claims VALUES(?1,?2,?3,?4,?5,?6)"}, {"id": "lv-hc864b9983a4c", "path": "crates/fractal-store/src/store/message_point_qualification_tests_shared_delivery.rs", "kind": "sql-template", "fingerprint": "4f1f4779971e754e2dac2441222f6c530a179dd19d2f4bf73a16d856f151752e", "owner": "fractal_store::store::message_point_qualification_tests_shared_delivery", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 59, "excerpt": "INSERT INTO replica_records(record_ref,writer,sequence,envelope_hash,position,raw,state,claim_id,updated_at_unix_ms) VALUES(?1,'host/writer',1,?2,?3,X'00','valid',?4,'1')"}, {"id": "lv-hc871bb91f4f5", "path": "crates/smallclaims/src/sqlite/read_lifetime/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "b9283c516994655464005fe7fa6a76668a5882d422a5e887edfcec25ae8624ae", "owner": "smallclaims::sqlite::read_lifetime::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 78, "excerpt": "\"BEGIN; SELECT * FROM payload\""}, @@ -4215,6 +4404,7 @@ {"id": "lv-hc8cf34d194ca", "path": "crates/smallclaims/src/store/saved_inventory_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "ce18196812ec0ab75683b21ca6fec4399412d8fe24255dd34a4df7fde5c0ce95", "owner": "smallclaims::store::saved_inventory_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 572, "excerpt": "\"VACUUM INTO ?1\" , [ saved_state . to_str ( ) . unwrap ( ) ]"}, {"id": "lv-hc8fbf8a65fc9", "path": "crates/smallclaims/src/store/operation_claim_digests.rs", "kind": "sql-template", "fingerprint": "d645ccc0e9492c88420c78b15bb7c323b9b78f58f32243988588d153a451955b", "owner": "smallclaims::store::operation_claim_digests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 214, "excerpt": "UPDATE operation_claim_digests_backfill SET operation=?1, claim_rowid=?2, ready=?3 WHERE singleton=1"}, {"id": "lv-hc901cd51dd6c", "path": "crates/smallclaims/src/store/sealed_view_cache_tests.rs", "kind": "sql-template", "fingerprint": "8d5a4d5d8f9bd69cfa35171e15bf47ab9d47ef439db16d0fded39d4848a63f83", "owner": "smallclaims::store::sealed_view_cache_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 278, "excerpt": "INSERT INTO replica_envelope_signatures(writer,sequence,envelope_hash,member_key,signature,stored_at_unix_ms) VALUES(?1,?2,?3,?4,?5,?6)"}, + {"id": "lv-hc91d2f57cab1", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "0d53af024409d201f02cfc0ac947e58cc5dc8096c29fc2e61c227caaa11046fe", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1443, "excerpt": "INSERT INTO assistant_grant_retractions(writer,member_key,lower_sequence,upper_sequence) VALUES(?1,'lost-key',7,7)"}, {"id": "lv-hc9439392b3a3", "path": "crates/fractal-reconcile/src/reconcile/tests/terminal_step_guard.rs", "kind": "unresolved-sql-sink", "fingerprint": "160e804026917a32ca102da71a10bda54195713cc6916ddac581bee13ee81333", "owner": "fractal_reconcile::reconcile::tests::terminal_step_guard", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 50, "excerpt": "[ subject ] , | row | { ( 0 . . columns ) . map ( | column | row . get ( column ) ) . collect : : < rusqlite : : Result < Vec < _ > > > ( ) }"}, {"id": "lv-hc96730cc68a9", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "4ec7c53222c8a758c722e2111541035ce700d5ae7bd0898c5f1b1a743e6450fd", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 16377, "excerpt": "sql"}, {"id": "lv-hc96b6a3952ad", "path": "crates/fractal-store/src/store/arrangements.rs", "kind": "sql-template", "fingerprint": "7ddc6493d7f051021ccdbc0c6c276b4b7037d6b0f52bceb592a381f003ebe580", "owner": "fractal_store::store::arrangements", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 117, "excerpt": "INSERT INTO arrangement_registers(subject,register,value,revision,winner) VALUES(?1,?2,?3,?4,?5) ON CONFLICT(subject,register) DO UPDATE SET value=excluded.value,revision=excluded.revision,winner=excl"}, @@ -4287,6 +4477,7 @@ {"id": "lv-hccf58a22a817", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "92a15551640534e5e4becf7d2af8ee3e4895ad7ce11a35316c6e36f675dac611", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 18923, "excerpt": "INSERT OR IGNORE INTO mission_revisions(mission_id, revision, state, body, claim_id, created_index) VALUES (?1, ?2, ?3, ?4, ?5, ?6)"}, {"id": "lv-hcd0514339847", "path": "crates/fractal-store/src/store/observer_subscription_detail.rs", "kind": "unresolved-sql-sink", "fingerprint": "4890c2d9accd93322e3636ee25c6f91c16f010b3528d66c75db6ac33e882f60f", "owner": "fractal_store::store::observer_subscription_detail", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 85, "excerpt": "SNAPSHOT_METADATA_SQL"}, {"id": "lv-hcd1c481d5eb2", "path": "crates/fractal-store/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "1924b74c66af1ba3f77dbc4f9f1aaddb03cacb13e4ddf1e1360fb244fe15021c", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 6921, "excerpt": "& format ! ( \"EXPLAIN QUERY PLAN {}\" , canonical_sql ( LATEST_CLAIM_QUERY ) )"}, + {"id": "lv-hcd2447942ecb", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "95e8e633cf9b10cbf2350d442c4e2d17323229225566b6311a5ee0e304ad0039", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1316, "excerpt": "INSERT OR IGNORE INTO assistant_grant_dirty VALUES(?1)"}, {"id": "lv-hcd263a451d78", "path": "crates/fractal-store/src/store/person_work.rs", "kind": "unresolved-sql-sink", "fingerprint": "dbd2ad1936b01c5cc3176758ea21ade2f03ba0e14f67eac2710d4be39f166d4e", "owner": "fractal_store::store::person_work", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 935, "excerpt": "params ! [ claim . subject , run , generation , claim . subject . rsplit ( '/' ) . next ( ) , claim . id , fields [ \"person\" ] . as_str ( ) , fields [ \"title\" ] . as_str ( ) , serde_json : : to_string"}, {"id": "lv-hcd2673f57bfc", "path": "crates/fractal-store/src/store/arrangements.rs", "kind": "sql-template", "fingerprint": "99b47d3a97f42a8a655b91f751497d78400319cf7876073faff51a3488d66d2d", "owner": "fractal_store::store::arrangements", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 109, "excerpt": "UPDATE arrangements SET retired=1 WHERE subject=?1"}, {"id": "lv-hcd371697cf7d", "path": "crates/fractal-store/src/store/attention_ivm.rs", "kind": "sql-template", "fingerprint": "547afc1fd833f56e2d5622a9bcaf57412880255c809a103bebfb1e9352ab17a2", "owner": "fractal_store::store::attention_ivm", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 129, "excerpt": "CREATE TRIGGER IF NOT EXISTS attention_open_batch_update AFTER UPDATE OF origin,replica_sequence ON batches BEGIN INSERT INTO local_attention_open_dirty SELECT family,source FROM local_attention_open_"}, @@ -4299,6 +4490,7 @@ {"id": "lv-hcd72a844028d", "path": "crates/fractal-attention/src/store/legacy_uri_resource_cleanup_tests.rs", "kind": "sql-template", "fingerprint": "4e05cae82c10ef780db252cc5a6db8697dbd140889945061216cfa6063d99480", "owner": "fractal_attention::store::legacy_uri_resource_cleanup_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 54, "excerpt": "UPDATE desired SET owner_run=?1, owner_generation=?2, owner_step=?3, revision=?4 WHERE subject=?5"}, {"id": "lv-hcd7ca9d12c78", "path": "crates/fractal-store/src/store/checkpoint_rules.rs", "kind": "sql-template", "fingerprint": "f55426432b5a43a23ba67899ade24191105e4aa9a3c58a2d5d5462007d4b6235", "owner": "fractal_store::store::checkpoint_rules", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1187, "excerpt": "DELETE FROM local_event_payloads"}, {"id": "lv-hcd8430ba4161", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "078fdcb2b58e313c5b9454c55dd6cadc4f640939999545a16271fc04f5c58350", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 17925, "excerpt": "INSERT INTO desired(subject, kind, revision, claim_id, body, member, owner_run, owner_generation, owner_step) VALUES (?1, ?2, ?3, ?4, ?5, ?6, CASE WHEN ?1 LIKE 'resource/uri/%' THEN NULL ELSE ?7 END, "}, + {"id": "lv-hcd8ada722bbd", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "5e4225fb75a573d7e66f6e4e20e21332dd258ba5c03ade48294ed91f922c0fa4", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1002, "excerpt": "UPDATE assistant_grant_proof_invalidations SET claim_id=?2 WHERE id=?1"}, {"id": "lv-hcd95eed6317e", "path": "crates/fractal-store/src/store/resources.rs", "kind": "sql-template", "fingerprint": "c8b598974e26d51ebbd5b5fb9e27ca04da06fd4d6245cbc68641cbf6f469ab04", "owner": "fractal_store::store::resources", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 114, "excerpt": "INSERT OR REPLACE INTO meta(key,value) VALUES('resource_pending_trigger_version',?1)"}, {"id": "lv-hcda036dc4a29", "path": "crates/fractal-store/src/store/notice_authority_tests.rs", "kind": "sql-template", "fingerprint": "293ffe8784fd0e81f4152618d065d72b54dabfa09c9dacec3ddf7a56721c1070", "owner": "fractal_store::store::notice_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 390, "excerpt": "UPDATE run_generations SET id='unrelated' WHERE id='unrelated-next'"}, {"id": "lv-hcdaaf2c5696b", "path": "crates/fractal-store/src/store/completion_state_tests.rs", "kind": "sql-template", "fingerprint": "e5d99f7ce7ddcbe743b82ac0e0753fe30088b068932305055f55ad50ca648958", "owner": "fractal_store::store::completion_state_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 231, "excerpt": "UPDATE claims SET body=json_set(body,'$.fields.state','degraded') WHERE id=?1"}, @@ -4400,12 +4592,12 @@ {"id": "lv-hd38e7477ff17", "path": "crates/fractal-store/src/store/glass_heads.rs", "kind": "sql-template", "fingerprint": "2bab0f99fb8330ed98b3fb0b31a378077390bea2f9888bc170b4271886f67d69", "owner": "fractal_store::store::glass_heads", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 253, "excerpt": "INSERT INTO glass_heads(subject,person,created_key,head_key,claim_id,deleted) VALUES(?1,?2,?3,?4,?5,?6) ON CONFLICT(subject) DO UPDATE SET person=excluded.person,created_key=excluded.created_key,head_"}, {"id": "lv-hd38e77dd6432", "path": "crates/fractal-missions/src/store/work_renew_tests.rs", "kind": "sql-template", "fingerprint": "b1e759a7ebb5f7e3e03740e267ed59c93c71a7a6a044bf4224a57aa77dba92c2", "owner": "fractal_missions::store::work_renew_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 811, "excerpt": "UPDATE step_runs SET assignee='agent/node/worker' WHERE subject=?1"}, {"id": "lv-hd38e7cfc3d89", "path": "crates/fractal-store/src/store/limits_purity_tests.rs", "kind": "sql-template", "fingerprint": "f8c4c93563c0c8238178ec4a9d4d1bd0f7326a6fd3c15cf50bcd871385ed6f44", "owner": "fractal_store::store::limits_purity_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 171, "excerpt": "INSERT INTO account_limit_seats (subject, driver, account, account_ref, accepted_at_unix_ms, store_index) VALUES (?1,'claude','claude/one','',1,1) ON CONFLICT(subject) DO UPDATE SET driver=excluded.dr"}, - {"id": "lv-hd3906354fc71", "path": "crates/fractal-store/src/store/notice_authority_tests.rs", "kind": "sql-template", "fingerprint": "e994daae338c29fa43d6e8fbac011091d151437326784277140db7af7ffbeb5b", "owner": "fractal_store::store::notice_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 388, "excerpt": "UPDATE run_generations SET id='unrelated-next' WHERE id='unrelated'"}, - {"id": "lv-hd395e63608d9", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "unresolved-sql-sink", "fingerprint": "bc824287c54f7dcf052acfea5e28d5d9080619e3bebb48ded44da68e332ced27", "owner": "smallclaims::store::checkpoint_staging", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 706, "excerpt": "params ! [ row . 0 , row . 1 , row . 2 , row . 3 , row . 4 , row . 5 , row . 6 , row . 7 , row . 8 , row . 9 , row . 1 1 , row . 1 0 = = \"valid\" ]"}, - {"id": "lv-hd3ac74197c28", "path": "crates/fractal-drivers/src/harness_events.rs", "kind": "sql-template", "fingerprint": "6cb1833d39ccb254569b63b3c9cdd3524f0fb299ded50ccbd947707e6e56e2e0", "owner": "fractal_drivers::harness_events", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 505, "excerpt": "INSERT OR IGNORE INTO metadata(key,value) VALUES (?1,?2)"}, - {"id": "lv-hd3bc6cc6cb80", "path": "crates/smallclaims/src/sync/worker.rs", "kind": "unresolved-sql-sink", "fingerprint": "1f58b9145b24d108d7ac38887338b3ea3229833b9c1e418250343f907bfd1047", "owner": "smallclaims::sync::worker", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 2390, "excerpt": "request"}, - {"id": "lv-hd3c38661fdf1", "path": "crates/fractal-store/src/store/gate_runners.rs", "kind": "sql-template", "fingerprint": "847f8e19ab04cf92777df8292b4f9365378f96832c2a119526caf6e136ce5b31", "owner": "fractal_store::store::gate_runners", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 196, "excerpt": "INSERT OR IGNORE INTO local_gate_runners {FROM_CLAIMS} AND request.id=?1"}, - {"id": "lv-hd3c47451793e", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "sql-template", "fingerprint": "f693948f475717b76f002971be13b759fa28f414a0cac94114534848af02dea7", "owner": "fractal_missions::store::missions", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 4499, "excerpt": "INSERT INTO step_runs(subject, run_id, generation_id, step_path, definition_hash, status, attempt, assignee, available_to, agentless, title, goals, worker_reported, blocked_reason, not_before_unix_ms,"}, + {"id": "lv-hd3906354fc71", "path": "crates/fractal-store/src/store/notice_authority_tests.rs", "kind": "sql-template", "fingerprint": "e994daae338c29fa43d6e8fbac011091d151437326784277140db7af7ffbeb5b", "owner": "fractal_store::store::notice_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 276, "excerpt": "UPDATE run_generations SET id='unrelated-next' WHERE id='unrelated'"}, + {"id": "lv-hd395e63608d9", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "unresolved-sql-sink", "fingerprint": "bc824287c54f7dcf052acfea5e28d5d9080619e3bebb48ded44da68e332ced27", "owner": "smallclaims::store::checkpoint_staging", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 632, "excerpt": "params ! [ row . 0 , row . 1 , row . 2 , row . 3 , row . 4 , row . 5 , row . 6 , row . 7 , row . 8 , row . 9 , row . 1 1 , row . 1 0 = = \"valid\" ]"}, + {"id": "lv-hd3ac74197c28", "path": "crates/fractal-drivers/src/harness_events.rs", "kind": "sql-template", "fingerprint": "6cb1833d39ccb254569b63b3c9cdd3524f0fb299ded50ccbd947707e6e56e2e0", "owner": "fractal_drivers::harness_events", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 466, "excerpt": "INSERT OR IGNORE INTO metadata(key,value) VALUES (?1,?2)"}, + {"id": "lv-hd3bc6cc6cb80", "path": "crates/smallclaims/src/sync/worker.rs", "kind": "unresolved-sql-sink", "fingerprint": "1f58b9145b24d108d7ac38887338b3ea3229833b9c1e418250343f907bfd1047", "owner": "smallclaims::sync::worker", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 2271, "excerpt": "request"}, + {"id": "lv-hd3c38661fdf1", "path": "crates/fractal-store/src/store/gate_runners.rs", "kind": "sql-template", "fingerprint": "847f8e19ab04cf92777df8292b4f9365378f96832c2a119526caf6e136ce5b31", "owner": "fractal_store::store::gate_runners", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 178, "excerpt": "INSERT OR IGNORE INTO local_gate_runners {FROM_CLAIMS} AND request.id=?1"}, + {"id": "lv-hd3c47451793e", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "sql-template", "fingerprint": "f693948f475717b76f002971be13b759fa28f414a0cac94114534848af02dea7", "owner": "fractal_missions::store::missions", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 4352, "excerpt": "INSERT INTO step_runs(subject, run_id, generation_id, step_path, definition_hash, status, attempt, assignee, available_to, agentless, title, goals, worker_reported, blocked_reason, not_before_unix_ms,"}, {"id": "lv-hd3c9344b8d41", "path": "crates/smallclaims/src/store/saved_inventory_tests.rs", "kind": "sql-template", "fingerprint": "6831fcf41f4944d0b466a24ea907179425d4fc26080803f1fffb72e4f60b954a", "owner": "smallclaims::store::saved_inventory_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 374, "excerpt": "UPDATE replica_envelopes SET payload=x'00' WHERE rowid=?1"}, {"id": "lv-hd3cb6ce1aa41", "path": "crates/fractal-api-core/src/api/exec_only.rs", "kind": "unresolved-sql-sink", "fingerprint": "37891a3cb5756b8a8eaf3c8687515e3670a00f88dd8ead95d0f89ea63c85c45e", "owner": "fractal_api_core::api::exec_only", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 44, "excerpt": "& FRESH_RECEIPT"}, {"id": "lv-hd3dd3521b2b8", "path": "crates/fractal-store/src/store/completion_state_tests.rs", "kind": "sql-template", "fingerprint": "9037286a5b6106ecafc2ad66431fabfad399a650ab8a1de17fda0a5241f04d42", "owner": "fractal_store::store::completion_state_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 103, "excerpt": "UPDATE claims SET accepted_at_unix_ms='25' WHERE id=?1"}, @@ -4436,6 +4628,7 @@ {"id": "lv-hd52843b6d50d", "path": "crates/fractal-store/src/store/subscription_state_full_value_tests.rs", "kind": "sql-template", "fingerprint": "da375a6ef935682d924483cbd6c26b9c32a0a576b639560d3ec18290cfd5125b", "owner": "fractal_store::store::subscription_state_full_value_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 85, "excerpt": "DELETE FROM claims WHERE id=?1"}, {"id": "lv-hd538d26334ac", "path": "crates/fractal-store/src/store/checkpoint_status.rs", "kind": "unresolved-sql-sink", "fingerprint": "bd570488aa8ddf0e0955954f82c946c49d68a54234f72c1bf8c850d9ffdd4cd3", "owner": "fractal_store::store::checkpoint_status", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 22, "excerpt": "params ! [ format ! ( \"daemon/{member}\" ) , member ] , | row | { row . get ( 0 ) }"}, {"id": "lv-hd53c86987f8a", "path": "crates/fractal-github/src/changes/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "70ce871f8a3d3fb449bc3c3ace6547cef02dfc74ffe48d912532a724bfdbe5b9", "owner": "fractal_github::changes::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 333, "excerpt": "record"}, + {"id": "lv-hd5498a2a9ed1", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "5e984befaec735466d9ee97ba8b966f6e2b0cc5e1c18c27465854b091e180a7c", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 539, "excerpt": "DELETE FROM assistant_grant_authority WHERE claim_id=?1 AND base_claim_id=?1"}, {"id": "lv-hd5502dd7ccde", "path": "crates/fractal-store/src/store/message_marks_tests.rs", "kind": "sql-template", "fingerprint": "021bb2b53ec008b80d7dc915f0cb4e9deded13d0e166f7980da1e6956c3453fb", "owner": "fractal_store::store::message_marks_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 236, "excerpt": "UPDATE meta SET value='0' WHERE key='staged_switched'"}, {"id": "lv-hd5547c558e17", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "cb9a675fdc698d99c90eda4d5b00fece6b27ca281cb568fc19df66f3fca76a89", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 3175, "excerpt": "DROP TRIGGER IF EXISTS fleet_generation_{table}_{event};"}, {"id": "lv-hd56f14b025f4", "path": "crates/fractal-drivers/src/codex_app_server/tests.rs", "kind": "included-source", "fingerprint": "1c165cce7bef85d4bcee1e041a72eecf697570ab86caf12dd84c1774b60a97b3", "owner": "fractal_drivers::codex_app_server::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1114, "excerpt": "include_str ! ( \"../../tests/fixtures/codex_usage_limit_inbound.jsonl\" )"}, @@ -4467,6 +4660,7 @@ {"id": "lv-hd729ec9593f5", "path": "crates/fractal-store/src/store/tests.rs", "kind": "included-source", "fingerprint": "6a05cbb4717caa2a60a7abeba00f522c7d6804fbd77fa845016f39ac3ba984e9", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 287, "excerpt": "include ! ( \"subject_reference_readmission_tests.rs\" )"}, {"id": "lv-hd73001c86492", "path": "crates/fractal-store/src/store/message_versions/tests.rs", "kind": "sql-template", "fingerprint": "adb298a39c460d3f1386e3f2b728e052df41640248e83608ac6c2ffeb0b3083e", "owner": "fractal_store::store::message_versions::tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 27, "excerpt": "CREATE TABLE claims(store_index INTEGER PRIMARY KEY,subject TEXT,kind TEXT); CREATE INDEX claims_subject_kind_index ON claims(subject,kind,store_index); CREATE TABLE desired(subject TEXT PRIMARY KEY,c"}, {"id": "lv-hd7411ed7cf55", "path": "crates/fractal-store/src/store/idle_mail.rs", "kind": "sql-template", "fingerprint": "1e0070690c3617f7a052c0d4fa6ab852800048c3816ddaa635e27e59805d277f", "owner": "fractal_store::store::idle_mail", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 64, "excerpt": "CREATE TRIGGER IF NOT EXISTS local_idle_messages_{name} {event} ON claims WHEN {reference}.kind IN ({kinds}) BEGIN DELETE FROM local_idle_messages WHERE subject={subject}; {} END;"}, + {"id": "lv-hd746bcc76346", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "fceadc6271112325a25e0b705158ba0afa28aafbb2a1ffc1401a3adb9605a2de", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1030, "excerpt": "INSERT INTO assistant_grant_retractions (writer,member_key,lower_sequence,upper_sequence,sequence,claim_id) VALUES(?1,?2,?3,?4,?5,?6)"}, {"id": "lv-hd75c03a93ef3", "path": "crates/fractal-daemon/src/store_tests/attention_ivm.rs", "kind": "sql-template", "fingerprint": "49ff1f2e15d7c134ffb14dc495072ed21c40fe139d8799f2e997a75ced4186c0", "owner": "fractal_daemon::store_tests::attention_ivm", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 442, "excerpt": "UPDATE step_runs SET assignee='person/robin' WHERE subject=?1"}, {"id": "lv-hd770c22e3911", "path": "crates/fractal-seats/src/store/reconcile_work_context/tests.rs", "kind": "sql-template", "fingerprint": "48f1b7c24add202c1cf9e35ef1961992661db84a55e1219d962b59c8479c51cd", "owner": "fractal_seats::store::reconcile_work_context::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 717, "excerpt": "UPDATE claims SET accepted_at_unix_ms=?2 WHERE id=?1"}, {"id": "lv-hd77214424e20", "path": "crates/smallclaims/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "4a5a59774ca6dc0c261ef5e9e21c8ea5f29ed6cee0dffbb0e6a94ecdbf8e0d7b", "owner": "smallclaims::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 8879, "excerpt": "\"ROLLBACK TO project_incremental; RELEASE project_incremental\" ,"}, @@ -4480,8 +4674,7 @@ {"id": "lv-hd7cd14b1d0a5", "path": "crates/fractal-store/src/store/message_send_tests.rs", "kind": "sql-template", "fingerprint": "5f2be0ab50a9c7514f427efb36cc8f4cab6feabfe7dc0f4ad8664f1ce605e815", "owner": "fractal_store::store::message_send_tests", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 31, "excerpt": "INSERT INTO checkpoint_claims(id,writer,sequence,envelope_hash,subject,kind, actor,predecessors,operation_id,request_digest,accepted_at_unix_ms,checkpoint) VALUES (?1,'invented-peer',1,'invented-envel"}, {"id": "lv-hd7d92523e785", "path": "crates/smallclaims/src/store/saved_inventory_tests.rs", "kind": "sql-template", "fingerprint": "c7ccec23366bfe885531ec8fdde089ce526c3d76ef218b6d0afc93adef29effd", "owner": "smallclaims::store::saved_inventory_tests", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 332, "excerpt": "INSERT OR IGNORE INTO checkpoint_envelopes(writer, sequence, envelope_hash, accepted_at_unix_ms, checkpoint) SELECT writer, sequence, envelope_hash, 0, 'invented-checkpoint' FROM replica_envelopes WHE"}, {"id": "lv-hd7dc4a36d272", "path": "crates/fractal-store/src/store/observer_actuals_tests.rs", "kind": "sql-template", "fingerprint": "7919957e727355f6fb0d09b92990cdf4ea28b80a15928f645c46e77cfb73c16f", "owner": "fractal_store::store::observer_actuals_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 149, "excerpt": "DROP TABLE projection_digest_repaired_claims; CREATE TABLE projection_digest_repaired_claims(id TEXT PRIMARY KEY) WITHOUT ROWID;"}, - {"id": "lv-hd81a35b60f28", "path": "crates/fractal-api-core/src/api/client_messages_selector_tests.rs", "kind": "sql-template", "fingerprint": "9c1fd01759a0c066cfad05fc874a449588b618537e42c1dea36b70408ae95d56", "owner": "fractal_api_core::api::client_messages_selector_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 694, "excerpt": "UPDATE claims SET accepted_at_unix_ms=?2 WHERE subject=?1"}, - {"id": "lv-hd82c937baff5", "path": "crates/fractal-store/src/store/assistant_write.rs", "kind": "unresolved-sql-sink", "fingerprint": "874d4bf9cc46459a8b33435bb94abd6e2ae2362af60e84eacd179a1e2df2e8c6", "owner": "fractal_store::store::assistant_write", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 36, "excerpt": "& latest_claim_of_kind_query ( ) , params ! [ authorization . grant_subject , kind ] , claim_from_row"}, + {"id": "lv-hd81a35b60f28", "path": "crates/fractal-api-core/src/api/client_messages_selector_tests.rs", "kind": "sql-template", "fingerprint": "9c1fd01759a0c066cfad05fc874a449588b618537e42c1dea36b70408ae95d56", "owner": "fractal_api_core::api::client_messages_selector_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 661, "excerpt": "UPDATE claims SET accepted_at_unix_ms=?2 WHERE subject=?1"}, {"id": "lv-hd82cb2e4adf3", "path": "crates/fractal-api-core/src/api/legacy_handler_guard_tests.rs", "kind": "included-source", "fingerprint": "4e162be3f4be5a1bddabf31677419af51c1d5244c05521c685b551bcc21c0f36", "owner": "fractal_api_core::api::legacy_handler_guard_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 12, "excerpt": "include_str ! ( \"fleet.rs\" )"}, {"id": "lv-hd836545d0082", "path": "crates/fractal-delivery/src/store/tests.rs", "kind": "included-source", "fingerprint": "cd041a3f61b0baccaae454bd37e1d75fb0baddc785bc2992956f46a2b7d36015", "owner": "fractal_delivery::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 721, "excerpt": "include ! ( \"projection_divergence_tests.rs\" )"}, {"id": "lv-hd8377ae3baea", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "505b9c4be459d6167de2e61b0d907f0fa29386577c5b21d8fc7f763faf0a4b28", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 4369, "excerpt": "DELETE FROM client_diagnostic_receipts WHERE accepted_at_unix_ms < ?1"}, @@ -4501,8 +4694,10 @@ {"id": "lv-hd90aa6430548", "path": "crates/fractal-store/src/store/slo_breaches.rs", "kind": "sql-template", "fingerprint": "70fe1777cd6c7e0e27218378e26f3923783edaa8c769e19186fd8903f1ddabc1", "owner": "fractal_store::store::slo_breaches", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 102, "excerpt": "UPDATE slo_episode_events SET conflict=1 WHERE episode=?1"}, {"id": "lv-hd90c689f2276", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "unresolved-sql-sink", "fingerprint": "574e33e6e7a9f3f14e511a5a31923f3e698938a9319f9c06b0b6433cc603bec0", "owner": "fractal_missions::store::missions", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 2202, "excerpt": "& mission_step_history_sql ( )"}, {"id": "lv-hd90d9bade9c2", "path": "crates/fractal-store/src/store/runtime_starts.rs", "kind": "sql-template", "fingerprint": "22605d1e8cf77972d57b472c576fdb06dbcadb71c45d7187e03ed889def646a4", "owner": "fractal_store::store::runtime_starts", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 18, "excerpt": "DROP TRIGGER IF EXISTS local_runtime_starts_observation_insert; DROP TRIGGER IF EXISTS local_runtime_starts_observation_update; DROP TRIGGER IF EXISTS local_runtime_starts_observation_delete;"}, - {"id": "lv-hd925b5785834", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "49a38fe3d64b04fd70ffc23d73e15302912dc466a2598a132eb8872d6db08c08", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 17965, "excerpt": "& canonical_sql ( & format ! ( \"SELECT claims.id FROM claims JOIN batches ON batches.id=claims.batch_id WHERE {filter} ORDER BY CANONICAL_ASC(claims)\" ) )"}, - {"id": "lv-hd92c67f5da38", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "unresolved-sql-sink", "fingerprint": "c32b884bb11aa9d33ad9fa5b6cbd7b18be6b5eec40e5397aa0319a5e4069ab0d", "owner": "smallclaims::store::checkpoint_staging", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 766, "excerpt": "& sql"}, + {"id": "lv-hd9109fd4002d", "path": "crates/smallclaims/src/store/assistant_grant_authority_bench.rs", "kind": "unresolved-sql-sink", "fingerprint": "395bfb5a8f4b7e48b3264e9f2dbbbe08e012ecbb87f071f3a6bd3789ca644ac2", "owner": "smallclaims::store::assistant_grant_authority_bench", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 275, "excerpt": "sql , [ ] , | row | row . get ( 0 )"}, + {"id": "lv-hd91341d01a91", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "76c974fbbff4b942b7f7c3ccbeecca6927f4ea15b252083fddd6622385ad1d34", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 376, "excerpt": "DELETE FROM assistant_grant_dirty WHERE claim_id=?1"}, + {"id": "lv-hd925b5785834", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "49a38fe3d64b04fd70ffc23d73e15302912dc466a2598a132eb8872d6db08c08", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 16236, "excerpt": "& canonical_sql ( & format ! ( \"SELECT claims.id FROM claims JOIN batches ON batches.id=claims.batch_id WHERE {filter} ORDER BY CANONICAL_ASC(claims)\" ) )"}, + {"id": "lv-hd92c67f5da38", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "unresolved-sql-sink", "fingerprint": "c32b884bb11aa9d33ad9fa5b6cbd7b18be6b5eec40e5397aa0319a5e4069ab0d", "owner": "smallclaims::store::checkpoint_staging", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 694, "excerpt": "& sql"}, {"id": "lv-hd930b07a6e79", "path": "crates/fractal-reconcile/src/reconcile/tests/incremental_deadlines.rs", "kind": "sql-template", "fingerprint": "048587c14ce8e3a7ab847e1da009c98675c1f0808dde80d4d3c80c75c76375d6", "owner": "fractal_reconcile::reconcile::tests::incremental_deadlines", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 802, "excerpt": "UPDATE claims SET origin='other' WHERE id=?1"}, {"id": "lv-hd93555ea76b3", "path": "crates/fractal-store/src/store/message_versions/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "c32b884bb11aa9d33ad9fa5b6cbd7b18be6b5eec40e5397aa0319a5e4069ab0d", "owner": "fractal_store::store::message_versions::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 109, "excerpt": "& sql"}, {"id": "lv-hd93d6e4e7551", "path": "crates/smallclaims/src/ivm/install/prepared.rs", "kind": "unresolved-sql-sink", "fingerprint": "da2328da81465164b0d76bf03422edae19684e9bf0cf9b4b98f6e5a67d64118d", "owner": "smallclaims::ivm::install::prepared", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 967, "excerpt": "\"ROLLBACK TO ivm_prepared_page; RELEASE ivm_prepared_page\""}, @@ -4518,6 +4713,9 @@ {"id": "lv-hda16d158eed7", "path": "crates/fractal-delivery/src/store/message_point_qualification.rs", "kind": "unresolved-sql-sink", "fingerprint": "8edb630b01a1f78d4abc5ee08b714ce7a8578b35d2269aec45684bf19ac1e4fc", "owner": "fractal_delivery::store::message_point_qualification", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 61, "excerpt": "& query"}, {"id": "lv-hda34b1a9d465", "path": "crates/fractal-delivery/src/store/message_point_qualification/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "7f278b69cec646287b3aade63b955b9f70fb9971553ab08b7d204585f1d0ef51", "owner": "fractal_delivery::store::message_point_qualification::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 564, "excerpt": "sql , [ ]"}, {"id": "lv-hda4118777e70", "path": "crates/smallclaims/src/sqlite/writer_queue/tests.rs", "kind": "sql-template", "fingerprint": "71f5d5423100ec2c92b15b2e0ab52a4b5fdff952a65c8ae40607bcf2bd19ee10", "owner": "smallclaims::sqlite::writer_queue::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 288, "excerpt": "INSERT INTO values_ VALUES(1)"}, + {"id": "lv-hda4b15518ef0", "path": "crates/fractal-api-core/src/api/client_v0/external_grants/conflict_tests.rs", "kind": "sql-template", "fingerprint": "0fb338ad0acf82cd6d405b987f3373ab7a688e926db8ba4f052c8fdabf0dbdcd", "owner": "fractal_api_core::api::client_v0::external_grants::conflict_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 615, "excerpt": "INSERT INTO assistant_grant_dirty(claim_id) VALUES(?1)"}, + {"id": "lv-hda7f8f715d53", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "9ff275884efc00f14f840069934d4fa97fbe135fec8474af1da88b72b35ffa9e", "owner": "smallclaims::store::assistant_grant_authority", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 281, "excerpt": "INSERT OR IGNORE INTO assistant_grant_auth_work SELECT origin,claim_id FROM assistant_grant_pending INDEXED BY assistant_grant_pending_unauthenticated_index WHERE authenticated=0; INSERT OR IGNORE INT"}, + {"id": "lv-hda9098901f71", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "6b7f30c8dde5c74eb132e9b87d829a2dcd7407b1388de308c0ca9bfd828beb38", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 299, "excerpt": "INSERT OR IGNORE INTO assistant_grant_proof_rechecks SELECT pending.claim_id FROM assistant_grant_membership_dirty AS work JOIN assistant_grant_pending AS pending INDEXED BY assistant_grant_pending_wr"}, {"id": "lv-hdaafb8e69f1c", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "sql-template", "fingerprint": "32341188f85d60d9096f994a222ebfb32b9d57bf459b421111239cc1a0ee05fc", "owner": "fractal_missions::store::missions", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 596, "excerpt": "UPDATE step_runs SET lease_expires_at_unix_ms=?1, updated_at_unix_ms=?2 WHERE generation_id=?3 AND substr(?4, 1, length(step_path) + 1)=step_path || '/' AND status IN ('claimed','working','verifying')"}, {"id": "lv-hdab4da12bdd0", "path": "crates/fractal-store/src/store/backup_ledgers.rs", "kind": "unresolved-sql-sink", "fingerprint": "faa8085f1d6cc4397f9aca72ee2a5f42c6ed01d7fd0e0541367d188cdfbe3bc3", "owner": "fractal_store::store::backup_ledgers", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 236, "excerpt": "& page_query ( ledger , after . is_none ( ) )"}, {"id": "lv-hdacaab2c061c", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "73e9726766615edb1d3ffd4ae267633878f2752cea488a98caa6a111454943be", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 5610, "excerpt": "status_query"}, @@ -4527,6 +4725,7 @@ {"id": "lv-hdae0d65c679a", "path": "crates/smallclaims/src/ivm/asynchronous.rs", "kind": "sql-template", "fingerprint": "fd047af90bba6f886f65e9b5dc860a15e3beec046cc2397270df306c47524f5c", "owner": "smallclaims::ivm::asynchronous", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 499, "excerpt": "UPDATE ivm_async_state SET draining=1 WHERE singleton=1"}, {"id": "lv-hdb01cf278fac", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "unresolved-sql-sink", "fingerprint": "50bc01727856c4ae5fb3afbcded23137bcfeb651f7e80ec6a3cfa2d89d734313", "owner": "fractal_store::store::client_messages", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 596, "excerpt": "params ! [ reminder , recipient ] , | row | row . get ( 0 )"}, {"id": "lv-hdb08eca764a7", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "38baa6ef434cbfcc49a47cbdfe50bdca7acbd2ce204542eaa5f1b598234a990f", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 13743, "excerpt": "& canonical_sql ( \"SELECT json_extract(claims.body, '$.fields.items') FROM claims WHERE claims.subject=?1 AND claims.kind='loop.state' AND json_extract(claims.body, '$.fields.items') IS NOT NULL ORDER"}, + {"id": "lv-hdb10afe3ddca", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "a1283ec5bf87b372df96534f09c45e898f5571cce47da6cbbcd01e0f6c82c16f", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 787, "excerpt": "DELETE FROM assistant_grant_auth_cursor WHERE claim_id=?1"}, {"id": "lv-hdb152501a3ff", "path": "crates/fractal-store/src/store/resources.rs", "kind": "unresolved-sql-sink", "fingerprint": "5063127b5b6e20193af52e10520ef270649ff7b3f46d6e07ac6ed128210866ae", "owner": "fractal_store::store::resources", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 80, "excerpt": "PENDING_TRIGGERS"}, {"id": "lv-hdb2e592f95e7", "path": "crates/fractal-store/src/store/seat_status.rs", "kind": "unresolved-sql-sink", "fingerprint": "8edb630b01a1f78d4abc5ee08b714ce7a8578b35d2269aec45684bf19ac1e4fc", "owner": "fractal_store::store::seat_status", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 342, "excerpt": "& query"}, {"id": "lv-hdb2fa41c50c9", "path": "crates/smallclaims/src/store/idempotency.rs", "kind": "sql-template", "fingerprint": "61e7c9f53ccbcf2534e5455b48257703907caf12ef4d5104c38857f8419ed402", "owner": "smallclaims::store::idempotency", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 51, "excerpt": "CREATE TRIGGER IF NOT EXISTS idempotency_completed_expiry AFTER INSERT ON idempotency BEGIN UPDATE idempotency SET expires_at_unix_ms= CAST(unixepoch('subsec') * 1000 AS INTEGER) + {RETENTION_MS} WHER"}, @@ -4569,6 +4768,7 @@ {"id": "lv-hdd3bcd12b2b5", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "sql-template", "fingerprint": "530c76206f5d262d754eaa48c11ba0eb62d499194792b62f3c425fe6b8ddd089", "owner": "fractal_store::store::client_messages", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 906, "excerpt": "DELETE FROM local_client_message_selectors_v1 WHERE (subject,born_index) IN ( SELECT subject,born_index FROM local_client_message_selectors_v1 ORDER BY subject,born_index LIMIT ?1)"}, {"id": "lv-hdd4952d8046f", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "sql-template", "fingerprint": "385803a829f61d043a037a2774dc3df634f054212ce309329947d70d284a1382", "owner": "fractal_store::store::client_messages", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 776, "excerpt": "UPDATE local_client_message_cut_epoch SET epoch=epoch+1 WHERE id=1"}, {"id": "lv-hdd535e1fd134", "path": "crates/fractal-store/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "a8b771920b8319e47251d1360f5e880bc18e8d329b0f0d003ea3c7e615558947", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 7178, "excerpt": "query"}, + {"id": "lv-hdd61bb7dd3ca", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "6c2fae2c0e7731db888f4f4b9adc7835780d6fc52462d8286a596dac6181c77c", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 362, "excerpt": "INSERT OR IGNORE INTO replica_envelope_signatures (writer,sequence,envelope_hash,member_key,signature,stored_at_unix_ms) VALUES(?1,?2,?3,?4,?5,'0')"}, {"id": "lv-hdd7330128d54", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "sql-template", "fingerprint": "a41af2b07f74e774813b4161a27403eb8ecc801b9fd69bf5692e7498d7bef296", "owner": "smallclaims::store::checkpoint_staging", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 858, "excerpt": "UPDATE claims SET protected=1 WHERE id IN (SELECT id FROM protected);"}, {"id": "lv-hdd795cce48ab", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "unresolved-sql-sink", "fingerprint": "bbfac8f07b9a24bc278443aa0d496ef7bbd0019ed35cee7698f44b358102850e", "owner": "fractal_store::store::client_messages", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 791, "excerpt": "[ ] , | row | row . get ( 0 )"}, {"id": "lv-hddab9f013595", "path": "crates/fractal-store/src/store/resources_preparation.rs", "kind": "sql-template", "fingerprint": "d7417e506ad2e427dc5a84f3109b5ee4207e44bf71ac0a94d16beb3b1bca0505", "owner": "fractal_store::store::resources_preparation", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 826, "excerpt": "UPDATE local_resource_preparation SET kind=?2,kind_key=?3 WHERE subject=?1 AND (kind_key IS NULL OR kind_key ( 0 ) ,"}, {"id": "lv-he1c4046f31f1", "path": "crates/fractal-evidence/src/store/evidence.rs", "kind": "unresolved-sql-sink", "fingerprint": "d8d6e97dd09e58071a4a5ce2236219d0418dbf377b3d48af03a53adc58540ca0", "owner": "fractal_evidence::store::evidence", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 547, "excerpt": "& canonical_sql ( \"SELECT body FROM claims INDEXED BY claims_harness_auth_incarnation_index WHERE subject=?1 AND kind='harness.observed' AND json_extract(body, '$.fields.incarnation_id')=?2 AND json_t"}, + {"id": "lv-he1ce05c0581f", "path": "crates/fractal-api-core/src/api/tests.rs", "kind": "sql-template", "fingerprint": "6ccf5b9e9839c655f8eb66d645609515103549d3cdea1e75cb8041908902ad33", "owner": "fractal_api_core::api::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1252, "excerpt": "INSERT INTO assistant_grant_pending (claim_id,grant_subject,kind,origin,actor,sequence,authenticated,record,auth_member_key,auth_sequence) VALUES(?1,?2,?3,?4,'person/operator',?5,?6,'{}','key/birch',?"}, {"id": "lv-he1d3df5f7b95", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "b1ba36043540dac2c2704562244f85385a4e8cf2647806fe4ade9fadcf524de2", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 11155, "excerpt": "SUBJECT_KINDS_AT_QUERY"}, {"id": "lv-he1dd083f1969", "path": "crates/fractal-daemon/src/peer_tests/timeline_relay.rs", "kind": "included-source", "fingerprint": "5cab677238f1733d84ed5d9f76a59e1f37a17beba4a58070e500846e7bd68061", "owner": "fractal_daemon::peer_tests::timeline_relay", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 77, "excerpt": "include_str ! ( \"../../../../docs/st3/client-v0/fixtures/timeline-relay-omission.json\" )"}, {"id": "lv-he1de637574d4", "path": "crates/smallclaims/src/store/checkpoint_capture_epoch.rs", "kind": "sql-template", "fingerprint": "c0e0a218b4b8d77f5182e855f903956b6d9079d0d0c9349acddfd5323a138394", "owner": "smallclaims::store::checkpoint_capture_epoch", "todo": "stage-generation-and-keyed-reclamation", "disposition": "allow-for-now", "line_hint": 47, "excerpt": "DROP TRIGGER IF EXISTS {table}_checkpoint_capture_{event};"}, @@ -4675,6 +4876,7 @@ {"id": "lv-he3af63a63e79", "path": "crates/smallclaims/src/store/sealed_view_cache_tests/mutation_tests.rs", "kind": "sql-template", "fingerprint": "4837024517e786775c4a9267665c3bc6f44c512864245f09440a254257712bc8", "owner": "smallclaims::store::sealed_view_cache_tests::mutation_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 317, "excerpt": "UPDATE replica_envelope_signatures SET writer='renamed-anchor' WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3"}, {"id": "lv-he3ce29256ad4", "path": "crates/fractal-delivery/src/store/delivery.rs", "kind": "sql-template", "fingerprint": "91927057c2ca7e64e9dd2ae4bfc3484e19df3b976018d67c02472234622813c7", "owner": "fractal_delivery::store::delivery", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1301, "excerpt": "INSERT INTO local_mailbox_bindings VALUES (?1,?2,?3,?4,?5)"}, {"id": "lv-he3f0bc408925", "path": "crates/smallclaims/src/store/projection_digest.rs", "kind": "sql-template", "fingerprint": "807a13c12b6180f8c12dea2e0083b70a46e227586f6bf2fc31cb54a9c7efbbe7", "owner": "smallclaims::store::projection_digest", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 392, "excerpt": "CREATE TRIGGER projection_digest_repaired_claims_{event} AFTER {event} ON projection_digest_repaired_claims WHEN {row} IS NOT NULL BEGIN {} {} END;"}, + {"id": "lv-he3fa452add20", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "95e8e633cf9b10cbf2350d442c4e2d17323229225566b6311a5ee0e304ad0039", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 683, "excerpt": "INSERT OR IGNORE INTO assistant_grant_dirty VALUES(?1)"}, {"id": "lv-he3fa6b5c879c", "path": "crates/fractal-store/src/store/marks_switch.rs", "kind": "unresolved-sql-sink", "fingerprint": "acdaf8bd3b815535046858d25ab374d72f65c7e4bea1948f5dcd472c02624e7d", "owner": "fractal_store::store::marks_switch", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 91, "excerpt": "[ & previous ] , | row | row . get : : < _ , String > ( 0 )"}, {"id": "lv-he41924f3834b", "path": "crates/fractal-store/src/store/run_eta_tests.rs", "kind": "sql-template", "fingerprint": "29e3324d169ab72b424f6a61633466148d5831666b714595db4c28c7ebfca622", "owner": "fractal_store::store::run_eta_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 209, "excerpt": "UPDATE step_runs SET definition_hash='a' WHERE subject='s-0'"}, {"id": "lv-he41d7d662db4", "path": "crates/fractal-store/src/store/local_trim_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "fea7ac6e6dd950e2c82473fbb7db467f0ddd977c2e1366072121c53eb9194da7", "owner": "fractal_store::store::local_trim_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1373, "excerpt": "& sql , [ ] , | row | row . get ( 0 )"}, @@ -4696,6 +4898,7 @@ {"id": "lv-he4d379218d03", "path": "crates/fractal-store/src/store/deploy.rs", "kind": "unresolved-sql-sink", "fingerprint": "4dccbde698f807e9baafe4e221d966b021aea19f98ce7c40c822f729e94b9e46", "owner": "fractal_store::store::deploy", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 92, "excerpt": "& format ! ( \"SELECT id,origin FROM claims WHERE origin IN (?1,?2) AND {UNREPAIRED_CLAIM} AND {UNREPAIRED_REPLICA}\" )"}, {"id": "lv-he4d3e44fce0b", "path": "crates/fractal-store/src/store/notice_authority_tests.rs", "kind": "sql-template", "fingerprint": "2b488fc9813acb94842bf608c1e81a55eb825f93f94a6628a3d755ab0310e919", "owner": "fractal_store::store::notice_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 371, "excerpt": "INSERT INTO desired(subject,kind,revision,claim_id,body) SELECT 'agent/example/unrelated',kind,revision,claim_id,'{}' FROM desired WHERE subject=?1"}, {"id": "lv-he4d5898ca522", "path": "crates/fractal-kernel/src/conversation_search.rs", "kind": "sql-template", "fingerprint": "d20aaff613238b45131e064c8fecdec7afe54a2d2fb9531eccdf3f708b8629a3", "owner": "fractal_kernel::conversation_search", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 56, "excerpt": "INSERT INTO entries VALUES (?1,?2,?3,?4,?5,?6,?7)"}, + {"id": "lv-he4d6e9e7421e", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "95e8e633cf9b10cbf2350d442c4e2d17323229225566b6311a5ee0e304ad0039", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 434, "excerpt": "INSERT OR IGNORE INTO assistant_grant_dirty VALUES(?1)"}, {"id": "lv-he4e04bd23262", "path": "crates/fractal-store/src/store/limits.rs", "kind": "sql-template", "fingerprint": "116a8cdb8f735a0c50912475d3645ddfab4b4dd0395e1d44e875233819722c54", "owner": "fractal_store::store::limits", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 456, "excerpt": "DELETE FROM account_limit_readings"}, {"id": "lv-he4fdf3cc8fea", "path": "crates/fractal-store/src/store/agent_messages.rs", "kind": "unresolved-sql-sink", "fingerprint": "a83115e95b22496567a5823cd5322e95e6dab77f6ba50f57853baadeaba5e6e8", "owner": "fractal_store::store::agent_messages", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 69, "excerpt": "\"SAVEPOINT coordination_startup\""}, {"id": "lv-he501efb4d29a", "path": "crates/fractal-store/src/store/usage_credits.rs", "kind": "sql-template", "fingerprint": "83efc58aec49737fe466785b936322c7f78edc4dafbe2905a7f99f0070d91b9e", "owner": "fractal_store::store::usage_credits", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 100, "excerpt": "CREATE TABLE IF NOT EXISTS local_usage_credit_heads ( provider TEXT NOT NULL, account TEXT NOT NULL, credit_id TEXT NOT NULL, actor TEXT NOT NULL, measured_seconds INTEGER NOT NULL, measured_nanos INT"}, @@ -4728,10 +4931,12 @@ {"id": "lv-he69938b2fc65", "path": "crates/fractal-store/src/store/ordered_membership.rs", "kind": "sql-template", "fingerprint": "f03addec467af6f507720744f7babd7c11eb2d0dbabd30eb14bf820b37da9a5c", "owner": "fractal_store::store::ordered_membership", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 294, "excerpt": "INSERT INTO meta(key,value) VALUES('local_ordered_membership_repair_index',?1) ON CONFLICT(key) DO UPDATE SET value=CAST(MAX(CAST(meta.value AS INTEGER),CAST(excluded.value AS INTEGER)) AS TEXT)"}, {"id": "lv-he69a7f7121fc", "path": "crates/smallclaims/src/store/principals/legacy.rs", "kind": "sql-template", "fingerprint": "d3364edb2859c67f3776bcd181ec6a7384bf937cf701731a101d3375434b0062", "owner": "smallclaims::store::principals::legacy", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 430, "excerpt": "INSERT OR IGNORE INTO legacy_claim_verdict_queue(claim_id) VALUES (?1)"}, {"id": "lv-he6c79429ef0c", "path": "crates/fractal-store/src/store/person_work.rs", "kind": "unresolved-sql-sink", "fingerprint": "a5738e79d9f4663aec04a1916820592f240d16086a1fea75b49acd20a56bccd8", "owner": "fractal_store::store::person_work", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 945, "excerpt": "params ! [ origin , fields [ \"origin_attempt\" ] . as_u64 ( ) , claim . subject , claim . accepted_at_unix_ms . to_string ( ) ]"}, + {"id": "lv-he6cdb35f9041", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "87cb097907853e192c0d5392447f3b60ee89edaea405979c0cfcf2a91c50d557", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 619, "excerpt": "INSERT INTO replica_records( record_ref, writer, sequence, envelope_hash, position, raw, state, claim_id, updated_at_unix_ms ) SELECT record_ref || '-sibling', writer, sequence, envelope_hash, positio"}, {"id": "lv-he6d1d9f14a2c", "path": "crates/fractal-seats/src/store/accounts.rs", "kind": "unresolved-sql-sink", "fingerprint": "01abbe3220198f67387ec701743f0127f772e11d373e372c2baf50c1392dc034", "owner": "fractal_seats::store::accounts", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 61, "excerpt": "& canonical_sql ( \"SELECT claims.id, claims.store_index, claims.batch_id, claims.subject, claims.kind, claims.origin, claims.actor, claims.body, claims.predecessors, claims.accepted_at_unix_ms FROM cl"}, {"id": "lv-he6dafe2f904c", "path": "crates/smallclaims/src/ivm.rs", "kind": "sql-template", "fingerprint": "43a2a96ce900b14f48d3932a6f247c6171e534fbc991c429d380e7d66c1f29e8", "owner": "smallclaims::ivm", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 984, "excerpt": "UPDATE ivm_views SET generation=generation+1 WHERE name=?1"}, {"id": "lv-he6e3040252e3", "path": "crates/fractal-api-client-v0/src/api/client_v0/observer_subscription_detail_tests.rs", "kind": "sql-template", "fingerprint": "b41394c6c4f6b2c1747aeaa99b81f93fb2a537c86162ddb3d360dab2d95dd496", "owner": "fractal_api_client_v0::api::client_v0::observer_subscription_detail_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 668, "excerpt": "UPDATE desired SET kind={value} WHERE subject=?1"}, - {"id": "lv-he7052689cff7", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "sql-template", "fingerprint": "3821719cd9da9c7336b0bc4df86f909befb861c0beebc5f63ddb5497dd3a5579", "owner": "smallclaims::store::checkpoint_staging", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1201, "excerpt": "UPDATE meta SET plan=NULL WHERE id=1"}, + {"id": "lv-he7052689cff7", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "sql-template", "fingerprint": "3821719cd9da9c7336b0bc4df86f909befb861c0beebc5f63ddb5497dd3a5579", "owner": "smallclaims::store::checkpoint_staging", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1119, "excerpt": "UPDATE meta SET plan=NULL WHERE id=1"}, + {"id": "lv-he7097c5f9f00", "path": "crates/smallclaims/src/store/assistant_grant_authority_bench.rs", "kind": "unresolved-sql-sink", "fingerprint": "8f1648973b28ab5e33a7254240167db3677700efe789c003da0e7c71932e4dab", "owner": "smallclaims::store::assistant_grant_authority_bench", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 203, "excerpt": "params ! [ format ! ( \"batch/{writer}/{sequence:064x}\" ) , writer , sequence , format ! ( \"{sequence:064x}\" ) ]"}, {"id": "lv-he71c6d4b5146", "path": "crates/fractal-store/src/store/publication.rs", "kind": "unresolved-sql-sink", "fingerprint": "3f8cb55af03d968c76e4e14012a507b40064cf016cc1c8cf24e587130b4a566a", "owner": "fractal_store::store::publication", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 59, "excerpt": "params ! [ subject , incarnation , at . min ( i64 : : MAX as u64 ) ] , | row | Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? ) ) ,"}, {"id": "lv-he72846cf8338", "path": "crates/fractal-store/src/store/client_messages_version_benchmark.rs", "kind": "sql-template", "fingerprint": "c1764ab7a9266fda9025a5f79f04b789a5656be1d484ab50ab1550523ea467fc", "owner": "fractal_store::store::client_messages_version_benchmark", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 71, "excerpt": "INSERT OR IGNORE INTO meta VALUES('client_message_versions_v1','1')"}, {"id": "lv-he73f474f2f5d", "path": "crates/fractal-missions/src/store/mission_list.rs", "kind": "unresolved-sql-sink", "fingerprint": "297dc9bb78c36c199b4f862e8ebe262a51188b956f146a24aca3866d0fd445d3", "owner": "fractal_missions::store::mission_list", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 318, "excerpt": "[ now . min ( i64 : : MAX as u128 ) as i64 ] , | row | row . get : : < _ , Option < i64 > > ( 0 )"}, @@ -4753,6 +4958,7 @@ {"id": "lv-he8255d18268b", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "5a6e84acf42c8e2587b1dbe755c70dd8098c4932036a2df97165feaef576dd3c", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 15262, "excerpt": "UPDATE mission_run_deadlines SET deadline_at_unix_ms=?2 WHERE run_id=?1 AND deadline_at_unix_ms IS NULL"}, {"id": "lv-he830e5bf3588", "path": "crates/fractal-api-core/src/api/message_reads.rs", "kind": "unresolved-sql-sink", "fingerprint": "4e49a931b39a60214de90775142d3b4e3ed67d6a15c71239636d86d2dd64c082", "owner": "fractal_api_core::api::message_reads", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 163, "excerpt": "& format ! ( \"SELECT EXISTS(SELECT 1 FROM claims WHERE kind='daemon.started' AND json_extract(body,'$.fields.features.{MESSAGE_OFFSETS_FEATURE}')=1)\" )"}, {"id": "lv-he8657293c8f5", "path": "crates/fractal/src/response_expiry_tests.rs", "kind": "sql-template", "fingerprint": "f9d6179a1a0ea30a6791512870aee969ff46d3bd2717b6d5a8d616add7bbd4ee", "owner": "fractal::response_expiry_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 238, "excerpt": "INSERT INTO idempotency(operation_id,response,replay_safe) VALUES (?1,'{}',1)"}, + {"id": "lv-he87b7a8b6b00", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "c7530f326023f53723029e84cb2ddffcca815af393c4e1c660b0bcfd169c94e5", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 714, "excerpt": "INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) VALUES(?1,?2,?3,?4,?5,?6,?7,?8,?9)"}, {"id": "lv-he88d879cc9a0", "path": "crates/smallclaims/src/ivm/install.rs", "kind": "unresolved-sql-sink", "fingerprint": "a603b9f1d0363710543f03851640a0fd9619060a7a766c2b862ebce2e1c98873", "owner": "smallclaims::ivm::install", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 471, "excerpt": "\"ROLLBACK TO ivm_install_live; RELEASE ivm_install_live\""}, {"id": "lv-he88ecac26d82", "path": "crates/smallclaims/src/store/principals/migration.rs", "kind": "sql-template", "fingerprint": "37472ea50aff5b61296d54eab823a7f8f2d9b9b423e0abc41fd181e817efb584", "owner": "smallclaims::store::principals::migration", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 258, "excerpt": "UPDATE claim_signature_migration SET phase='done',serving_legacy=0 WHERE id=1 AND phase='judging' AND cursor=0 AND envelope_row=0 AND claim_offset=0 AND fault IS NULL AND NOT EXISTS(SELECT 1 FROM clai"}, {"id": "lv-he893baab2fb0", "path": "crates/fractal-store/src/store/person_work.rs", "kind": "sql-template", "fingerprint": "3c373737de34378a2523da0b7c106b247dceeb1ccc0aa2fd250443050c581559", "owner": "fractal_store::store::person_work", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 873, "excerpt": "INSERT OR IGNORE INTO run_generations(id,run_id,revision,status,actor,reason,created_at_unix_ms,updated_at_unix_ms) VALUES(?1,?2,?3,'running',?4,?6,?5,?5)"}, @@ -4763,15 +4969,19 @@ {"id": "lv-he8f446dbd57e", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "65524094a59cb7a1c4ae1beaaae891e548ec6915a3226bc3b869af0ea5773577", "owner": "fractal_missions::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 720, "excerpt": "UPDATE step_runs SET generation_id=?2 WHERE run_id=?1"}, {"id": "lv-he8f7682c718f", "path": "crates/fractal-missions/src/store/person_work.rs", "kind": "unresolved-sql-sink", "fingerprint": "b3f3bc05a4f8e591a3d7e066772802213a7e30827fdb82c5901d2828e977f6ab", "owner": "fractal_missions::store::person_work", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 768, "excerpt": "\"ROLLBACK TO tell_ask_ended; RELEASE tell_ask_ended\""}, {"id": "lv-he8f98f77d11c", "path": "crates/fractal-seats/src/store/runtime_starts.rs", "kind": "sql-template", "fingerprint": "1ea729eeac4d716b34e09cf4fef195ff91e57f2c134557cba1657e8b87bbbc2c", "owner": "fractal_seats::store::runtime_starts", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 802, "excerpt": "UPDATE local_runtime_starts SET revoked_by=COALESCE(revoked_by,'restart-intent-superseded') WHERE id=?1"}, + {"id": "lv-he8ff1a0f8ec1", "path": "crates/fractal-delivery/src/store/message_send_tests.rs", "kind": "sql-template", "fingerprint": "0fb338ad0acf82cd6d405b987f3373ab7a688e926db8ba4f052c8fdabf0dbdcd", "owner": "fractal_delivery::store::message_send_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 539, "excerpt": "INSERT INTO assistant_grant_dirty(claim_id) VALUES(?1)"}, {"id": "lv-he916625b0ffb", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "unresolved-sql-sink", "fingerprint": "4bfe213ff4d47a4c18cc7e89048bf8c092e3dbe240f02c8af07b4fb23e5289e5", "owner": "fractal_missions::store::missions", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 4792, "excerpt": "& format ! ( \"SELECT claims.subject, claims.accepted_at_unix_ms, claims.actor, json_extract(claims.body, '$.fields.status'), json_extract(claims.body, '$.fields.phase'), json_extract(claims.body, '$.f"}, {"id": "lv-he92456f7fb9b", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "095404c9aa3104444df074e76e6f493fd60c92add95aa316e405bde7695a75ef", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 274, "excerpt": "UPDATE replica_envelopes SET batch_id='anchor'"}, {"id": "lv-he933d1015ed6", "path": "crates/fractal-missions/src/store/missions/run_review/tests.rs", "kind": "sql-template", "fingerprint": "e37580267b45f8df79351e279e784bc1e04da162268f994bc5825a455ad2c24a", "owner": "fractal_missions::store::missions::run_review::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 275, "excerpt": "DELETE FROM step_runs WHERE subject=?1"}, {"id": "lv-he936125b06a0", "path": "crates/fractal-store/src/store/agent_view/ordered.rs", "kind": "sql-template", "fingerprint": "9ead373a072d3d6a7e797520fb64c9deba492c669f43afc7bdd6f6e6163c02db", "owner": "fractal_store::store::agent_view::ordered", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 220, "excerpt": "DELETE FROM local_agent_ordered_nodes WHERE claim=?1"}, {"id": "lv-he95f427e59df", "path": "crates/fractal-delivery/src/store/terminal_gate_evidence/native_source/tests.rs", "kind": "sql-template", "fingerprint": "43b7104c3fdf85b29db7eb915877f3b04581b27e8370d802ea49662cabdf524e", "owner": "fractal_delivery::store::terminal_gate_evidence::native_source::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 350, "excerpt": "UPDATE step_runs SET status='cancelled' WHERE subject='step-run/one/prepare'"}, + {"id": "lv-he965ae9e187f", "path": "crates/fractal-api-core/src/api/tests.rs", "kind": "sql-template", "fingerprint": "a2c10efe873193c1a9aa209f567c8262407e04d10281afe5d82794ee7ff5cde5", "owner": "fractal_api_core::api::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1237, "excerpt": "UPDATE assistant_grant_pending SET authenticated=1"}, {"id": "lv-he971517b6456", "path": "crates/fractal-seats/src/store/resource_preparation/tests.rs", "kind": "sql-template", "fingerprint": "7e53d4e6c6feeda8ad76e8845caf105faef898a062d3cfadd100195493502042", "owner": "fractal_seats::store::resource_preparation::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 245, "excerpt": "DROP VIEW temp.claims; CREATE TEMP TRIGGER invented_replay_trigger AFTER INSERT ON heal_replay_base_order BEGIN SELECT 1; END;"}, {"id": "lv-he9754fb25c5a", "path": "crates/fractal-attention/src/store/alert_action_controls.rs", "kind": "sql-template", "fingerprint": "f7eee9a8920111e3326b09d284281d362715dc916c127be5d139b2a4d2e65433", "owner": "fractal_attention::store::alert_action_controls", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 125, "excerpt": "UPDATE claims SET body=?1 WHERE id=?2"}, - {"id": "lv-he97b2ef96bf2", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "8a75efb30a29d6d965390a9710b9293ecbf73f5b42e853194b830da1fd893cc3", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 21908, "excerpt": "UPDATE run_generations SET status='cancelled', updated_at_unix_ms=?2 WHERE id=?1"}, - {"id": "lv-he9952e40d06d", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "c7dfdc3363384623a8282c520234206912bac531669ec4c535c72628eaa50d12", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 12620, "excerpt": "& canonical_sql ( \"SELECT id FROM claims WHERE actor=?1 AND kind IN ('work.claimed','work.progress') AND json_extract(body, '$.fields.claim_incarnation')=?2 ORDER BY CANONICAL_DESC(claims) LIMIT 1\" , "}, + {"id": "lv-he97b2ef96bf2", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "8a75efb30a29d6d965390a9710b9293ecbf73f5b42e853194b830da1fd893cc3", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 19963, "excerpt": "UPDATE run_generations SET status='cancelled', updated_at_unix_ms=?2 WHERE id=?1"}, + {"id": "lv-he990aaffd4df", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "31b6218b479548387c2e61968a64220e15f2659d5b7f72992f6017073aec8399", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 786, "excerpt": "DELETE FROM assistant_grant_local_appends WHERE claim_id=?1"}, + {"id": "lv-he990dace4c7d", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "c4079dd19e8cdd2eee55384e6338bacdceca260b06f63e10f9236d2d584f9b55", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 391, "excerpt": "authority : : CANDIDATES_QUERY"}, + {"id": "lv-he9952e40d06d", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "c7dfdc3363384623a8282c520234206912bac531669ec4c535c72628eaa50d12", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 10984, "excerpt": "& canonical_sql ( \"SELECT id FROM claims WHERE actor=?1 AND kind IN ('work.claimed','work.progress') AND json_extract(body, '$.fields.claim_incarnation')=?2 ORDER BY CANONICAL_DESC(claims) LIMIT 1\" , "}, {"id": "lv-he996de9029f4", "path": "crates/smallclaims/src/ivm/asynchronous.rs", "kind": "sql-template", "fingerprint": "56eada200b8be71674b5473350faea1367170c05f744f19743f8a9d9343480bb", "owner": "smallclaims::ivm::asynchronous", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 217, "excerpt": "INSERT INTO ivm_async_views(view,fingerprint,epoch,through) VALUES(?1,?2,?3,0)"}, {"id": "lv-he9a920ead8a9", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "sql-template", "fingerprint": "ad698369cc3b79c3e7633a3b21b63ac7fb277e328a1207caf2dc4c4f8a963291", "owner": "fractal_missions::store::missions", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 4005, "excerpt": "UPDATE mission_runs SET status=?2, updated_at_unix_ms=?3 WHERE id=?1"}, {"id": "lv-he9aaed126f62", "path": "crates/fractal-store/src/store/push_registrations.rs", "kind": "sql-template", "fingerprint": "f0e33f418018ef8e581f3e4baa7a25e223cf39322988b11b081474eba2556050", "owner": "fractal_store::store::push_registrations", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 117, "excerpt": "DELETE FROM local_push_registrations WHERE pairing_grant=?1 AND pairing_index=?2 AND person=?3 AND device_id=?4"}, @@ -4807,6 +5017,7 @@ {"id": "lv-heb8e3b3fcc14", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "bc491fbb9456cc10399adf3d07b73b77bdea5da0451f06f3091ba96c48b5c693", "owner": "smallclaims::store", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 3480, "excerpt": "INSERT INTO replica_envelope_holds(writer, sequence, envelope_hash, reason, updated_at_unix_ms) VALUES (?1, ?2, ?3, ?4, ?5) ON CONFLICT(writer, sequence, envelope_hash) DO UPDATE SET reason=excluded.r"}, {"id": "lv-heba199b96e68", "path": "crates/fractal-store/src/store/checkpoint_capture_epoch_tests.rs", "kind": "sql-template", "fingerprint": "ddab78c586c53163a86151d09d0215ef83864521edf986106be8b7ad19713382", "owner": "fractal_store::store::checkpoint_capture_epoch_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 126, "excerpt": "UPDATE batches SET accepted_at_unix_ms=?2 WHERE id=?1"}, {"id": "lv-heba738187fcd", "path": "crates/fractal-store/src/store/usage_period_tests_shared_seats.rs", "kind": "sql-template", "fingerprint": "c15d36573bf7e9a9fa5aa5902c8c36c0c8cbc699c075750c518d1a26abcfe9c6", "owner": "fractal_store::store::usage_period_tests_shared_seats", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 38, "excerpt": "INSERT INTO claims(id,batch_id,subject,kind,origin,body,predecessors,accepted_at_unix_ms) VALUES (?1,?2,?3,'harness.usage','fixture',?4,'[]',?5)"}, + {"id": "lv-hebabcaf7fd3f", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "3d9b2ae6776333f7dde490dba0d57f4ce5a31954202b031dba0fe894012325ff", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 709, "excerpt": "INSERT INTO batches(id,origin,replica_sequence,previous_hash,hash,accepted_at_unix_ms) VALUES(?1,?2,?3,?4,?5,?6)"}, {"id": "lv-hebaee54249d0", "path": "crates/fractal/src/main_tests.rs", "kind": "included-source", "fingerprint": "bd1d3e54caa6d25689ed9c803f61beacfa095721ee8b5d878d0b018f790f88cc", "owner": "fractal::main_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 3391, "excerpt": "include_str ! ( \"launch_cli.rs\" )"}, {"id": "lv-hebc8bd0672dc", "path": "crates/smallclaims/src/store/projection_stage_tests.rs", "kind": "sql-template", "fingerprint": "042116a8a93766e1d9891db1293759ba22379821e57ae2a3156e7585a3daeec2", "owner": "smallclaims::store::projection_stage_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 318, "excerpt": "CREATE TEMP TRIGGER stage_test_health BEFORE UPDATE ON projection_health BEGIN SELECT stage_test_pause(); END"}, {"id": "lv-hebccae97eca4", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "275c4c4da97210df1e7bfe33129bee3db036859980da47101d33c19e6caa7b4a", "owner": "smallclaims::store::membership_query_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 245, "excerpt": "& fleet_generation_schema ( )"}, @@ -4817,6 +5028,7 @@ {"id": "lv-hec19c18c98e2", "path": "crates/fractal-seats/src/store/runtime_starts.rs", "kind": "sql-template", "fingerprint": "9f2d6535131e7215e54df5c384f9df81f409770a0ff328a7c9df9ff06bad607e", "owner": "fractal_seats::store::runtime_starts", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1111, "excerpt": "UPDATE local_runtime_starts SET cleanup_verified=1,result=?2 WHERE id=?1"}, {"id": "lv-hec3b6de01146", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "a6ee9dd89cc36cb0ac010053a0bd0f8599bc144a2de3ecc58bada4e3bda1e340", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 12429, "excerpt": "& format ! ( \"{} LIMIT 1\" , newest_claims_of_kind_query ( \"claims.body\" , \"harness.observed\" ) )"}, {"id": "lv-hec41a4e102c4", "path": "crates/fractal-drivers/src/harness_events.rs", "kind": "sql-template", "fingerprint": "cd67bad9af9a6fef38465867c0d9d061f9cd1a86e0e23cfea7eee42c44b6af8f", "owner": "fractal_drivers::harness_events", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 284, "excerpt": "INSERT INTO metadata VALUES ('runtime',?1) ON CONFLICT(key) DO UPDATE SET value=excluded.value"}, + {"id": "lv-hec4dd1196f81", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "90a32b667f57143498b6c06f99ed0dec896650b5be465ae4be4202064c147669", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1313, "excerpt": "INSERT INTO assistant_grant_membership_windows VALUES(?1,?2,0,NULL)"}, {"id": "lv-hec4e1414873d", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "9001cf27ef915c256ff8c81efc7b1b01399635f72ccfdac0d869310c0ea058ad", "owner": "fractal_store::store::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 7023, "excerpt": "INSERT INTO claims(id,batch_id,subject,kind,origin,actor,body,predecessors,accepted_at_unix_ms) VALUES(?1,?1,?2,?3,'alder',?2,?4,'[]',?5)"}, {"id": "lv-hec77560637a4", "path": "crates/fractal-store/src/store/database_size.rs", "kind": "sql-template", "fingerprint": "dea7c7fed8a98d909e5f0dffeb0e881ec0bccfbf8cedf73bb2b7032622a3953c", "owner": "fractal_store::store::database_size", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 168, "excerpt": "INSERT INTO meta(key, value) VALUES (?1, ?2) ON CONFLICT(key) DO UPDATE SET value=excluded.value"}, {"id": "lv-hec805028307d", "path": "crates/smallclaims/src/store/principals/judging.rs", "kind": "sql-template", "fingerprint": "dd2c90facb76e4684f1c4957e7ed6ad3e06e6405f2661cc228d087b96d44c11e", "owner": "smallclaims::store::principals::judging", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 141, "excerpt": "UPDATE claim_signature_judging SET last_signature=?1,best_signature=?2,best_verdict=?3,best_reason=?4,complete=?5,blocked=?6 WHERE claim_id=?7"}, @@ -4829,6 +5041,7 @@ {"id": "lv-hece070718e6e", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "2a9e2ee16aaf3850f6ca3f34b6551d6cbb9da0ea4f357e2a3a722b2e69e6be08", "owner": "smallclaims::store", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 3578, "excerpt": "INSERT OR IGNORE INTO replica_envelope_signatures( writer, sequence, envelope_hash, member_key, signature, stored_at_unix_ms ) VALUES (?1, ?2, ?3, ?4, ?5, ?6)"}, {"id": "lv-hece51d8edfe6", "path": "crates/fractal-missions/src/store/work_renew_tests.rs", "kind": "sql-template", "fingerprint": "814ab2a3cd084839306d0a64185834c1925e530ec0a6b011591a7ee49f119288", "owner": "fractal_missions::store::work_renew_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 211, "excerpt": "UPDATE mission_runs SET status='cancelled',phase='terminal' WHERE id=( SELECT run_id FROM step_runs WHERE subject=?1)"}, {"id": "lv-hecef533f0966", "path": "crates/fractal-store/src/store/terminal_gate_evidence/native_source_shared.rs", "kind": "unresolved-sql-sink", "fingerprint": "b169105d15f2cf72afad82c316069f965cb93edcac648d2190e66c371cf21369", "owner": "fractal_store::store::terminal_gate_evidence::native_source_shared", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 76, "excerpt": "& sql , [ rowid ] , | row | { columns . iter ( ) . enumerate ( ) . map ( | ( n , _ ) | { Ok ( ( row . get : : < _ , String > ( 2 * n ) ? , row . get : : < _ , Option < usize > > ( 2 * n + 1 ) ? , ) ) "}, + {"id": "lv-hed00daccc56e", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "29fb5b637761cab9249fed224e84c2700ce3d1c47815ec69633f44984fb030db", "owner": "smallclaims::store::assistant_grant_authority", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 244, "excerpt": "ALTER TABLE assistant_grant_additions ADD COLUMN claim_id TEXT NOT NULL DEFAULT ''; ALTER TABLE assistant_grant_additions ADD COLUMN active_claim TEXT NOT NULL DEFAULT ''; UPDATE assistant_grant_addit"}, {"id": "lv-hed0fec49251f", "path": "crates/fractal/src/response_expiry_tests.rs", "kind": "sql-template", "fingerprint": "04784a5ffc0d5e8cc204ce6fe2f3a03d0fb6633c1cbdba70293fd7c5dbf0e244", "owner": "fractal::response_expiry_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 161, "excerpt": "UPDATE idempotency SET expires_at_unix_ms=0 WHERE operation_id='future'"}, {"id": "lv-hed1f38ebe50a", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "unresolved-sql-sink", "fingerprint": "0c8d7cd36f9e0d0f53b4f26fc2b59d0444bdd3b11acb4fdf1b41b3551e84316e", "owner": "smallclaims::store::checkpoint_trim", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1488, "excerpt": "[ & after ] , | row | row . get : : < _ , String > ( 0 )"}, {"id": "lv-hed2cfd353eb6", "path": "crates/fractal-seats/src/store/tests.rs", "kind": "sql-template", "fingerprint": "7ba3cdf32bf8b01b137753bab16b38b059548d9dbd0a051ca410e3d3d58d349f", "owner": "fractal_seats::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1316, "excerpt": "DELETE FROM desired WHERE subject='exec/work'"}, @@ -4863,8 +5076,10 @@ {"id": "lv-heea4f88a3d41", "path": "crates/smallclaims/src/sqlite/managed_commit_counter_tests.rs", "kind": "sql-template", "fingerprint": "464046a5c42ef474fd59991817f6b68ca5f44f05fbe053e2a66f7616d84e87e1", "owner": "smallclaims::sqlite::managed_commit_counter_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 46, "excerpt": "INSERT INTO parent VALUES(1)"}, {"id": "lv-heecc52686f3d", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "e43768f0965819025e44f47094493c3ef13b9443f27216301dc9927449bf31ef", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 75, "excerpt": "INSERT INTO replica_envelope_signatures VALUES(?1,?2,?3,?4)"}, {"id": "lv-heed36338c56e", "path": "crates/fractal-store/src/store/resources_preparation_tests.rs", "kind": "sql-template", "fingerprint": "cb38c898cec3b14bce43b8bf47c7542985d1ff9eb881fdd6c785e1cabc42cecf", "owner": "fractal_store::store::resources_preparation_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 174, "excerpt": "UPDATE claims SET body=?2 WHERE id=?1"}, - {"id": "lv-hef0985e2aacf", "path": "crates/fractal-store/src/store/custom.rs", "kind": "unresolved-sql-sink", "fingerprint": "a8b771920b8319e47251d1360f5e880bc18e8d329b0f0d003ea3c7e615558947", "owner": "fractal_store::store::custom", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 925, "excerpt": "query"}, - {"id": "lv-hef1ca5e8b2ef", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "9c328854313763122be0eab82207bdcddc4676deda0f6ac59cad2fb5aa414ec0", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 7009, "excerpt": "INSERT INTO meta(key, value) VALUES ('shard_id', ?1)"}, + {"id": "lv-hef0985e2aacf", "path": "crates/fractal-store/src/store/custom.rs", "kind": "unresolved-sql-sink", "fingerprint": "a8b771920b8319e47251d1360f5e880bc18e8d329b0f0d003ea3c7e615558947", "owner": "fractal_store::store::custom", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 840, "excerpt": "query"}, + {"id": "lv-hef1ca5e8b2ef", "path": "crates/smallclaims/src/store.rs", "kind": "sql-template", "fingerprint": "9c328854313763122be0eab82207bdcddc4676deda0f6ac59cad2fb5aa414ec0", "owner": "smallclaims::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 6340, "excerpt": "INSERT INTO meta(key, value) VALUES ('shard_id', ?1)"}, + {"id": "lv-hef28dd74e68f", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "112e4c9f0297f565a39caeb58f8e58ced46a719665c4e419f19d5c53c4e89d26", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 101, "excerpt": "& format ! ( \"SELECT {CLAIM_COLUMNS} FROM claims ORDER BY store_index\" )"}, + {"id": "lv-hef325d41f3b7", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "410f4379b20e33bf87b82adc81d285016076a36c977576f429d2256ec970bcd7", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1519, "excerpt": "INSERT INTO assistant_grant_proof_rechecks VALUES(?1) ON CONFLICT(claim_id) DO UPDATE SET claim_id=excluded.claim_id"}, {"id": "lv-hef32a1c268dd", "path": "crates/fractal-store/src/store/actual_state_sorter_tests.rs", "kind": "sql-template", "fingerprint": "991c69e9f205f5b48c60cf3231678ac04e9a4e0dc8c97c3e4bc3ca0509917727", "owner": "fractal_store::store::actual_state_sorter_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 322, "excerpt": "INSERT INTO batches(id,origin,replica_sequence,previous_hash,hash,accepted_at_unix_ms) VALUES ('batch/alder/sorter','alder',1,NULL,'sorter','1')"}, {"id": "lv-hef3380e725e2", "path": "crates/fractal-store/src/store/observation_trim_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "ee866b77fcb9d08f8feb50959f83986d62bb9ee9d66a71f884e33517f9f86d89", "owner": "fractal_store::store::observation_trim_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 160, "excerpt": "DELETE_BEFORE , params ! [ cutoff , 5 _000 ]"}, {"id": "lv-hef35bc5b6b76", "path": "crates/fractal-drivers/src/harness_events.rs", "kind": "sql-template", "fingerprint": "fcfda00e5be3718e3eeab3867141a16142b75f49bf2c7ca7ec8034a111cdca3e", "owner": "fractal_drivers::harness_events", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 549, "excerpt": "INSERT INTO metadata VALUES ('expired-state',?1) ON CONFLICT(key) DO UPDATE SET value=excluded.value"}, @@ -4904,6 +5119,7 @@ {"id": "lv-hf14e4bdaf54f", "path": "crates/fractal-seats/src/store/resource_preparation/tests.rs", "kind": "sql-template", "fingerprint": "d4fa25e85cdafc5077a7b04f05062e491d3c5b9f562eb5dc89c98bc882464059", "owner": "fractal_seats::store::resource_preparation::tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 228, "excerpt": "CREATE TEMP TABLE invented_shadow(value TEXT)"}, {"id": "lv-hf150403979fb", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "sql-template", "fingerprint": "a682cf42be4e6ae946ac0c368f1adbe6dae0ca9fae1b8d3d3f6acaaeece42c8a", "owner": "smallclaims::store::checkpoint_staging", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 1249, "excerpt": "UPDATE claims SET dropped=1 WHERE pos=(SELECT MAX(pos) FROM claims WHERE first=1)"}, {"id": "lv-hf155f0a6aecc", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "5c0b1dd1b1be3a78997b62a411f93290149f2d5c0cfb33b376fbf5aa316cf4f8", "owner": "fractal_store::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 172, "excerpt": "UPDATE local_runtime_starts SET revoked_by='another-stop'"}, + {"id": "lv-hf168a0847ffd", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "6f34510081d86bdddd0e400a08cfababbe419ddf939182f5c36b0945bc178e14", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 738, "excerpt": "DELETE FROM replica_envelopes WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND ?4 IS NOT NULL"}, {"id": "lv-hf177f99d95aa", "path": "crates/smallclaims/src/store/schema_install_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "8fb6d5f37e8055ce720bd0b1d56587f88c0071f285966ba17e72b2b12672aa73", "owner": "smallclaims::store::schema_install_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 233, "excerpt": "setup"}, {"id": "lv-hf18af68df655", "path": "crates/fractal-store/src/store/resource_preparation/tests.rs", "kind": "sql-template", "fingerprint": "1fc5f9dfcbc407a7e124caf59d0be289d2cc363952f8192c7ffe119dd9538bd8", "owner": "fractal_store::store::resource_preparation::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 48, "excerpt": "DROP TRIGGER temp.{name}; CREATE TEMP TRIGGER {name} AFTER INSERT ON main.local_resource_preparation_dirty BEGIN SELECT 1; END;"}, {"id": "lv-hf1a64465123e", "path": "crates/fractal-store/src/store/completion_state.rs", "kind": "sql-template", "fingerprint": "aa741318bca3fa3e52d05841cfe034ab0852df0d8dca1d38aae1bd25b117bddc", "owner": "fractal_store::store::completion_state", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 164, "excerpt": "CREATE TRIGGER IF NOT EXISTS completion_health_v1_{table}_{event}_{row} AFTER {event} ON {table} BEGIN INSERT INTO local_completion_health_v1_pending(claim_id) SELECT {row}.{identity} WHERE {row}.{ide"}, @@ -4916,8 +5132,10 @@ {"id": "lv-hf22585109b10", "path": "crates/smallclaims/src/store/prepared_envelope_tests.rs", "kind": "sql-template", "fingerprint": "008ea0ab9a0597f8904ec9f1ba8f14fb77cff0588dd600255f108e155210eef7", "owner": "smallclaims::store::prepared_envelope_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 773, "excerpt": "CREATE TEMP TABLE admission_writes(table_name TEXT); CREATE TEMP TRIGGER record_admission_write AFTER UPDATE ON main.replica_records BEGIN INSERT INTO admission_writes VALUES ('record'); END; CREATE T"}, {"id": "lv-hf22a2e666443", "path": "crates/fractal-seats/src/store/reconcile_work_context/tests.rs", "kind": "sql-template", "fingerprint": "499bedc665f1a0f350a5ce7a23484dfb05ab7335c0d082ac9bac8804a4fffe09", "owner": "fractal_seats::store::reconcile_work_context::tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 764, "excerpt": "UPDATE claims SET body=json_set(body,'$.fields.attempt',?2) WHERE id=?1"}, {"id": "lv-hf2325bea4421", "path": "crates/fractal-evidence/src/store/owned_sets_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "670380e6c1568143746eefd5717d30685a73d61436c5663c11ede8fb9d9aec6f", "owner": "fractal_evidence::store::owned_sets_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 634, "excerpt": "& format ! ( \"EXPLAIN QUERY PLAN {query}\" )"}, + {"id": "lv-hf26931e7ebc2", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "95e8e633cf9b10cbf2350d442c4e2d17323229225566b6311a5ee0e304ad0039", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 758, "excerpt": "INSERT OR IGNORE INTO assistant_grant_dirty VALUES(?1)"}, {"id": "lv-hf26ab9520d69", "path": "crates/smallclaims/src/store/prepared_seal.rs", "kind": "sql-template", "fingerprint": "606bd2bf3114bcbd284825325c939f9e28ab154e648b7fc8f699f20cbfac8a80", "owner": "smallclaims::store::prepared_seal", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 604, "excerpt": "INSERT OR IGNORE INTO replica_envelope_signatures( writer, sequence, envelope_hash, member_key, signature, stored_at_unix_ms ) VALUES (?1, ?2, ?3, ?4, ?5, ?6)"}, {"id": "lv-hf26ee56ee42a", "path": "crates/fractal-store/src/store/usage_credits.rs", "kind": "sql-template", "fingerprint": "73ead720cdaec6fd8e9df7e5b98c3b63e662e5380ca7f239f9ea418d36562e45", "owner": "fractal_store::store::usage_credits", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 132, "excerpt": "UPDATE local_usage_credit_progress SET through_index=0,target_index=?1 WHERE id=1"}, + {"id": "lv-hf280419e5a4a", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "d535df3c3d4d28bfe84aaf747981e97f3afcbe176915fcabb94fb3a68ec04e16", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1177, "excerpt": "DELETE FROM meta WHERE key='assistant_grant_dirty_cursor'"}, {"id": "lv-hf28d7623dae3", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "0aa447af667138061874405d20bfcdaa9cb706defe5546186e433b44d1a5c829", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 3080, "excerpt": "& canonical_sql ( \"SELECT subject, body FROM claims WHERE kind='reconcile.fault' AND origin=?1 ORDER BY CANONICAL_ASC(claims)\" , )"}, {"id": "lv-hf29494a9e339", "path": "crates/fractal-store/src/store.rs", "kind": "sql-template", "fingerprint": "5d3baa4cb1a6ebdc4527226258f80f2f07dfd1bd8aa4ff43204d68c70a101ee7", "owner": "fractal_store::store", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 3775, "excerpt": "INSERT INTO idempotency(operation_id, response) VALUES (?1, ?2)"}, {"id": "lv-hf298074f5d98", "path": "crates/fractal-store/src/store/resource_references.rs", "kind": "sql-template", "fingerprint": "9385971e24bb3f3996e110de95e80d0b74c072a5e10324877c77409d7a62d848", "owner": "fractal_store::store::resource_references", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 4, "excerpt": " CREATE TABLE IF NOT EXISTS declared_resource_edges ( owner TEXT NOT NULL, relation TEXT NOT NULL DEFAULT 'declared-resource', name TEXT NOT NULL, target TEXT NOT NULL, reason TEXT, PRIMARY KEY(owner,"}, @@ -4929,6 +5147,7 @@ {"id": "lv-hf31184c6716d", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "cadd3e51bb75381158babeb5d606ef6bd8db9952ee079f287f16339fa82c5c39", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 281, "excerpt": "INSERT INTO replica_envelopes VALUES('birch',3,'changed','anchor')"}, {"id": "lv-hf33fcb46317c", "path": "crates/smallclaims/src/store/checkpoint_staging/scoped.rs", "kind": "unresolved-sql-sink", "fingerprint": "4ec7c53222c8a758c722e2111541035ce700d5ae7bd0898c5f1b1a743e6450fd", "owner": "smallclaims::store::checkpoint_staging::scoped", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 200, "excerpt": "sql"}, {"id": "lv-hf343ed6a9b5d", "path": "crates/fractal-api-core/src/api/legacy_handler_guard_tests.rs", "kind": "included-source", "fingerprint": "c57b8f6d9b7bc692e6b73f85510ef239f4055b381cf99dba2e94ce2f81c4a34f", "owner": "fractal_api_core::api::legacy_handler_guard_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 10, "excerpt": "include_str ! ( \"agents.rs\" )"}, + {"id": "lv-hf348da4e378d", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "275c4c4da97210df1e7bfe33129bee3db036859980da47101d33c19e6caa7b4a", "owner": "smallclaims::store::membership_query_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 363, "excerpt": "& fleet_generation_schema ( )"}, {"id": "lv-hf34b402ef773", "path": "crates/smallclaims/src/store/receive_writer_tests.rs", "kind": "sql-template", "fingerprint": "90b7695d1f748b876dca6a75e6ac165c3450322fcd7f23c3dca15d6b3baa070b", "owner": "smallclaims::store::receive_writer_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 725, "excerpt": "CREATE TEMP TRIGGER refuse_frontier BEFORE INSERT ON main.meta WHEN NEW.key='seeded_batch_rowid' BEGIN SELECT RAISE(ABORT, 'invented failure'); END;"}, {"id": "lv-hf34e72f47ea5", "path": "crates/fractal-store/src/store/publication_facts.rs", "kind": "unresolved-sql-sink", "fingerprint": "2b86ef06cf9adb398c237f395acdec24b8930ec25fe776801420ce02f13e4afd", "owner": "fractal_store::store::publication_facts", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 292, "excerpt": "[ ] , | row | Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? ) )"}, {"id": "lv-hf3508dcc87e3", "path": "crates/fractal-store/src/store/observer_actuals.rs", "kind": "unresolved-sql-sink", "fingerprint": "4ec7c53222c8a758c722e2111541035ce700d5ae7bd0898c5f1b1a743e6450fd", "owner": "fractal_store::store::observer_actuals", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 279, "excerpt": "sql"}, @@ -4937,9 +5156,10 @@ {"id": "lv-hf3b6b997731a", "path": "crates/fractal-store/src/store/coordination.rs", "kind": "unresolved-sql-sink", "fingerprint": "fec187433c4f392fddb9c0d1400a095648f252e10b441a3cf1058bac6f7d78d9", "owner": "fractal_store::store::coordination", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 23, "excerpt": "SCHEMA"}, {"id": "lv-hf3bdff08c789", "path": "crates/fractal-store/src/store/agent_review_transaction.rs", "kind": "unresolved-sql-sink", "fingerprint": "b22a7eeae052e6cca32041050ef46ab4cceecbe1cfe3ea82c1e9eecf60b02580", "owner": "fractal_store::store::agent_review_transaction", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 108, "excerpt": "\"ROLLBACK TO agent_review_answer; RELEASE agent_review_answer\""}, {"id": "lv-hf3c68163766a", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "bd744e3edde4d014a38ab2126117a3cdfe35419879cb98120c33ca1c7bdb6c4b", "owner": "fractal_missions::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 780, "excerpt": "UPDATE mission_runs SET created_at_unix_ms='12'"}, - {"id": "lv-hf3d82e91a912", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "unresolved-sql-sink", "fingerprint": "54b380e36aa2640e0b0ddabb7095f357330c49e571e9567ab8d8c652ff9ec6fe", "owner": "fractal_store::store::client_messages", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 237, "excerpt": "SELECTOR_SCHEMA"}, - {"id": "lv-hf3e109a8e0a6", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "b07fc0b4f216b74c6a7cc5f274a714524976787091ece3062bf460b4445dec48", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 12958, "excerpt": "& canonical_sql ( \"SELECT id, accepted_at_unix_ms, json_extract(body, '$.fields.reason') FROM claims WHERE subject=?1 AND kind='harness.diagnostic' AND store_index<=?2 AND json_extract(body, '$.fields"}, - {"id": "lv-hf3f3b02320eb", "path": "crates/fractal-store/src/backup.rs", "kind": "unresolved-sql-sink", "fingerprint": "fb88bb4f0bd19b6716ed8006652a22ec3d28df1fc40ad46268a0e7469b390886", "owner": "fractal_store::backup", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 582, "excerpt": "& format ! ( \"SELECT EXISTS(SELECT 1 FROM {table})\" ) , [ ] , | r | r . get ( 0 ) ,"}, + {"id": "lv-hf3d82e91a912", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "unresolved-sql-sink", "fingerprint": "54b380e36aa2640e0b0ddabb7095f357330c49e571e9567ab8d8c652ff9ec6fe", "owner": "fractal_store::store::client_messages", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 216, "excerpt": "SELECTOR_SCHEMA"}, + {"id": "lv-hf3e109a8e0a6", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "b07fc0b4f216b74c6a7cc5f274a714524976787091ece3062bf460b4445dec48", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 11305, "excerpt": "& canonical_sql ( \"SELECT id, accepted_at_unix_ms, json_extract(body, '$.fields.reason') FROM claims WHERE subject=?1 AND kind='harness.diagnostic' AND store_index<=?2 AND json_extract(body, '$.fields"}, + {"id": "lv-hf3e2d678372b", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "a650ee653ab427324395872e5e14688cc5d5b4a85d2c17aaafcdc2177d7f40c5", "owner": "smallclaims::store::membership_query_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 551, "excerpt": "UPDATE replica_envelope_signatures SET signature=?1"}, + {"id": "lv-hf3f3b02320eb", "path": "crates/fractal-store/src/backup.rs", "kind": "unresolved-sql-sink", "fingerprint": "fb88bb4f0bd19b6716ed8006652a22ec3d28df1fc40ad46268a0e7469b390886", "owner": "fractal_store::backup", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 403, "excerpt": "& format ! ( \"SELECT EXISTS(SELECT 1 FROM {table})\" ) , [ ] , | r | r . get ( 0 ) ,"}, {"id": "lv-hf3fb4eeb2031", "path": "crates/fractal-store/src/store/reconcile_work_context.rs", "kind": "unresolved-sql-sink", "fingerprint": "4b39b2329c698b4987e15023a3bbd523e95d4058dbbeb479d074f26ff0ac694f", "owner": "fractal_store::store::reconcile_work_context", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 227, "excerpt": "DEFINITIONS"}, {"id": "lv-hf3fd5d1f383c", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "fec187433c4f392fddb9c0d1400a095648f252e10b441a3cf1058bac6f7d78d9", "owner": "smallclaims::store::repair_operation_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1146, "excerpt": "SCHEMA"}, {"id": "lv-hf41fabef76b6", "path": "crates/smallclaims/src/store/checkpoint_agreement.rs", "kind": "sql-template", "fingerprint": "0ffd6f6cf65077624de24ce755a746fb82c2b9795a1ab03ab03a0d385e43add2", "owner": "smallclaims::store::checkpoint_agreement", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1416, "excerpt": "INSERT INTO temp.write_clock(offset_ms, at_ms) VALUES (0, ?1)"}, @@ -4962,6 +5182,7 @@ {"id": "lv-hf5140af438b4", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "97f16a02a6f85cd9381a87bec37a3d6721e0e531245dc3635845d6ce5c4116e2", "owner": "fractal_missions::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 542, "excerpt": "DELETE FROM run_generations WHERE run_id=?1"}, {"id": "lv-hf51505e88cb4", "path": "crates/fractal-missions/src/store/run_capacity_tests.rs", "kind": "sql-template", "fingerprint": "970c9d9d72872f851714bf89124afc4f27748f165b6b4c44620d2811e014b84d", "owner": "fractal_missions::store::run_capacity_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 136, "excerpt": "INSERT INTO replica_records(record_ref,writer,sequence,envelope_hash,position,raw,state,subject_hint,kind_hint,updated_at_unix_ms) VALUES('record/pending','example-peer',1,'pending',0,'{}',?1,'mission"}, {"id": "lv-hf5382e62c0d3", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "sql-template", "fingerprint": "c262a6ad0439b144711b380234bbe5ac82964e68a58c0648dfc482e5b8f5216b", "owner": "fractal_store::store::client_messages", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1264, "excerpt": "DELETE FROM local_client_message_selectors_v1 WHERE (subject,born_index) IN ({EXPIRED_RETIREMENTS})"}, + {"id": "lv-hf53f8e0e2462", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "unresolved-sql-sink", "fingerprint": "39802ce5717d6bfa9db80a1d5f34fcc7e3be92eb7707d7b6a9e2e0c468748c5d", "owner": "smallclaims::store::assistant_grant_authority", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 795, "excerpt": "AUTHENTICATION_KEYS_QUERY"}, {"id": "lv-hf54eaf6da9df", "path": "crates/fractal/src/projection_contention_retry_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "b2cbbe76784ce7e1e5c37479f1d38c960c8035dd74974ae04e0aad4649d0dc87", "owner": "fractal::projection_contention_retry_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 154, "excerpt": "\"BEGIN IMMEDIATE\""}, {"id": "lv-hf567cc96b71e", "path": "crates/fractal-store/src/store/runtime_starts.rs", "kind": "sql-template", "fingerprint": "9f2d6535131e7215e54df5c384f9df81f409770a0ff328a7c9df9ff06bad607e", "owner": "fractal_store::store::runtime_starts", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 274, "excerpt": "UPDATE local_runtime_starts SET cleanup_verified=1,result=?2 WHERE id=?1"}, {"id": "lv-hf56d2d99513a", "path": "crates/smallclaims/src/store/checkpoint_trim.rs", "kind": "sql-template", "fingerprint": "50005dc33018e27d52f5ce2306c28123a87906d4c674e4c7efcf8e99b11c5b97", "owner": "smallclaims::store::checkpoint_trim", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 307, "excerpt": "INSERT OR IGNORE INTO temp.adopted_claims(id) VALUES (?1)"}, @@ -4980,18 +5201,21 @@ {"id": "lv-hf602200a7b0c", "path": "crates/fractal-store/src/store/agent_messages_tests_shared_delivery.rs", "kind": "sql-template", "fingerprint": "a466c1bb6842b49c1d34a00a24fdcb27190d6711850fee20c555c3c6c8bfc672", "owner": "fractal_store::store::agent_messages_tests_shared_delivery", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 21, "excerpt": "UPDATE claims SET accepted_at_unix_ms=?1 WHERE id=?2"}, {"id": "lv-hf608c5e3b8c9", "path": "crates/fractal-store/src/store/runtime.rs", "kind": "unresolved-sql-sink", "fingerprint": "0e622d77b314d855b1c76a7a05d73421b0166ca85fc162079d28cd7673fcefa5", "owner": "fractal_store::store::runtime", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 754, "excerpt": "& RUNTIME_ID_INDEX"}, {"id": "lv-hf6107b65de89", "path": "crates/smallclaims/src/store/checkpoint_staging/scoped.rs", "kind": "sql-template", "fingerprint": "773e60c5c971aca9fba1a24e45049e65f6c0271c8144818a9c063ad09b13d2ec", "owner": "smallclaims::store::checkpoint_staging::scoped", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 265, "excerpt": "INSERT OR IGNORE INTO envelopes VALUES (?1, ?2, ?3, ?4, ?5, 1)"}, + {"id": "lv-hf625193e6fe4", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "953988cccc51e8ed294960e6a8501953b4853763b37e865e21ea5703796d06e9", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 540, "excerpt": "DELETE FROM replica_envelope_signatures WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=?4"}, {"id": "lv-hf6481bee96f5", "path": "crates/fractal-missions/src/store/fault_history_tests.rs", "kind": "sql-template", "fingerprint": "0b06221e79801ddce4ea8febe9e73d4675e5d5c86f5fcf49392ca4be3116dfd8", "owner": "fractal_missions::store::fault_history_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 212, "excerpt": "UPDATE claims SET actor=x'00' WHERE id=?1"}, {"id": "lv-hf6676f3ba393", "path": "crates/smallclaims/src/store/principals.rs", "kind": "sql-template", "fingerprint": "431a20a22ee8a0624ebf8b79b6734d2e676818196679a825dfb6e14db7d32f95", "owner": "smallclaims::store::principals", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 980, "excerpt": "DELETE FROM {table} WHERE claim_id=?1"}, {"id": "lv-hf687fbbd30ec", "path": "crates/fractal-store/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "c82173d3f027536ecae5ea31b9f95e9718406c75c8aec8f449e035e78fdc763b", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 7309, "excerpt": "& claude_attachment_query ( )"}, {"id": "lv-hf6937c1b98cb", "path": "crates/fractal-missions/src/store/tests.rs", "kind": "sql-template", "fingerprint": "fc7fe741c5186fc0753f7fd2f4456cae3ede92d7f9951cbf68bdeea72c486afd", "owner": "fractal_missions::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 7415, "excerpt": "UPDATE idempotency SET expires_at_unix_ms=0 WHERE operation_id=?1"}, {"id": "lv-hf6cfc7e120e3", "path": "crates/fractal-store/src/store/messages_shard.rs", "kind": "unresolved-sql-sink", "fingerprint": "52fed2c3cf7490cdda1265d74a154f57cfe99375debff11ed4322ab5e0b985b7", "owner": "fractal_store::store::messages_shard", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 556, "excerpt": "rusqlite : : params ! [ format ! ( \"daemon/{host}\" ) , host , start , feature ] , | row | row . get ( 0 )"}, {"id": "lv-hf6d306088ec8", "path": "crates/smallclaims/src/store/repair_operation_tests.rs", "kind": "sql-template", "fingerprint": "c6a4fa899bedbfb198bf1938f83264c106696fc54b29253ccb692a2824882eda", "owner": "smallclaims::store::repair_operation_tests", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 651, "excerpt": "CREATE TABLE operation_commit_parent(id INTEGER PRIMARY KEY); CREATE TABLE operation_commit_child(id INTEGER REFERENCES operation_commit_parent(id) DEFERRABLE INITIALLY DEFERRED);"}, + {"id": "lv-hf6ea61b38c5c", "path": "crates/smallclaims/src/store/assistant_grant_authority_tests.rs", "kind": "sql-template", "fingerprint": "ccbdb4ad2b0e9e2d65c7429708b5ebf324a43876f080303e18def587249485e6", "owner": "smallclaims::store::assistant_grant_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1390, "excerpt": "INSERT INTO assistant_grant_dirty VALUES(?1)"}, {"id": "lv-hf6f5b79d7be9", "path": "crates/fractal-store/src/store/person_work.rs", "kind": "sql-template", "fingerprint": "6d5a43d378dbc66e99f6d601bc4459713e2424f3f891a431bd4a51970edb7a78", "owner": "fractal_store::store::person_work", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 903, "excerpt": "UPDATE step_runs SET assignee=?2,updated_at_unix_ms=?3 WHERE subject=?1 AND assignee=?4 AND status IN ('ready','pending')"}, {"id": "lv-hf6ff4e4e5676", "path": "crates/fractal-store/src/store/terminal_gate_evidence.rs", "kind": "sql-template", "fingerprint": "d439165dad80af80f69e0861b8c14b7aaf37a143c656dc4f656bd93d866483de", "owner": "fractal_store::store::terminal_gate_evidence", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 327, "excerpt": "UPDATE test_terminal_meta SET members=?2 WHERE namespace=?1"}, {"id": "lv-hf702016170fa", "path": "crates/smallclaims/src/ivm/install/prepared.rs", "kind": "unresolved-sql-sink", "fingerprint": "10faaf2210a84e8a0eef2583f70161f7808e92ba31a4e6df8cf35246b832d316", "owner": "smallclaims::ivm::install::prepared", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 1123, "excerpt": "& check . sql , params_from_iter ( & check . args ) , | r | { bounded_values ( r , check . columns ) }"}, {"id": "lv-hf7027d3cb134", "path": "crates/smallclaims/src/store/checkpoint_agreement.rs", "kind": "sql-template", "fingerprint": "129e70002e1c14be6c33cac7fbfcaee9a429b2fbb9caeb35f61445fb067f6de0", "owner": "smallclaims::store::checkpoint_agreement", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1401, "excerpt": "DELETE FROM temp.write_clock"}, {"id": "lv-hf704096aaaec", "path": "crates/smallclaims/src/store/checkpoint_staging.rs", "kind": "sql-template", "fingerprint": "13025d549524ea9431e90fa2aec180622f0fccfd6b3ab9b3ddeebc5afc788681", "owner": "smallclaims::store::checkpoint_staging", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 783, "excerpt": "INSERT OR IGNORE INTO closed(subject, request) VALUES (?1, ?2)"}, {"id": "lv-hf70c653a5061", "path": "crates/fractal-store/src/store/checkpoint_capture_epoch_tests.rs", "kind": "sql-template", "fingerprint": "9a60cec716324dc49cc7fa43d7921c3b5f6652271ae6cdc3cc405a0097e122e1", "owner": "fractal_store::store::checkpoint_capture_epoch_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 148, "excerpt": "UPDATE {table} SET {reference}=?1 WHERE {reference}=?2"}, + {"id": "lv-hf715aec3d234", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "7a868d282b664ad63a5937a5954a31a7ce13a4cf898e2535aa296daae166dc1e", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 300, "excerpt": "UPDATE replica_envelope_signatures SET member_key=?5 WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=?4"}, {"id": "lv-hf715f4927637", "path": "crates/fractal-store/src/store/resources_preparation_tests.rs", "kind": "sql-template", "fingerprint": "d863cfae4f786afd350e940f7fcdb5dccaa0418c9730e73261180a52a425b8db", "owner": "fractal_store::store::resources_preparation_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1102, "excerpt": "DELETE FROM local_resource_preparation WHERE subject=?1"}, {"id": "lv-hf734678b3d0a", "path": "crates/fractal-delivery/src/store/directive_notes/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "514de2fbc21ec616fd6194f67f2d3cec7fce304acb0111227c1c8938bdf47eb0", "owner": "fractal_delivery::store::directive_notes::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 289, "excerpt": "CURRENT_QUERY"}, {"id": "lv-hf74fb346c795", "path": "crates/fractal-seats/src/store/canonical_audit.rs", "kind": "sql-template", "fingerprint": "c8f5414df32911fa08b98eb0740825de265a4031574e79156ee8b36a585ffcd3", "owner": "fractal_seats::store::canonical_audit", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 285, "excerpt": "DELETE FROM local_mailbox_argv_bindings WHERE token=?1"}, @@ -5053,6 +5277,7 @@ {"id": "lv-hfb2e85b9a602", "path": "crates/fractal-store/src/private_notes.rs", "kind": "sql-template", "fingerprint": "4189452ea447d98f46078de5556158b6ead5422ed3c53e114d6a07a527f4e3bb", "owner": "fractal_store::private_notes", "todo": "chunk-or-reference-variable-columns", "disposition": "allow-for-now", "line_hint": 254, "excerpt": "PRAGMA journal_mode=DELETE; PRAGMA synchronous=FULL; CREATE TABLE IF NOT EXISTS notes_operations(operation TEXT PRIMARY KEY, uri TEXT NOT NULL, request_digest TEXT NOT NULL, generation TEXT NOT NULL, "}, {"id": "lv-hfb3818e1a39a", "path": "crates/fractal-store/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "c9330a3d8ecfe1e3ced12c5027cb882c4fea2777f9d56d4924648022d50a7a47", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 9627, "excerpt": "event_tail_sql ( migrating )"}, {"id": "lv-hfb38d7e99fac", "path": "crates/fractal-missions/src/store/missions.rs", "kind": "sql-template", "fingerprint": "e4aa783702c08adcdaf13c1d5e1f7adfd619cf68133234487152e5bbb94446e1", "owner": "fractal_missions::store::missions", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 3914, "excerpt": "INSERT INTO idempotency(operation_id,response) VALUES(?1,?2)"}, + {"id": "lv-hfb3ab4e9ffc0", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "sql-template", "fingerprint": "c16f7d5c70a895a9e320212a88301512d6f2eff12ed4763390aba6643ccc5cb9", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 298, "excerpt": "DELETE FROM replica_envelope_signatures WHERE writer=?1 AND sequence=?2 AND envelope_hash=?3 AND member_key=?4"}, {"id": "lv-hfb5739c87232", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "ce33aa5a176a18845d88f753dfc7e003040b9fd3982a677bc16a905e00a4a64d", "owner": "fractal_store::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 7766, "excerpt": "UPDATE operations SET state='conflict'"}, {"id": "lv-hfb5ceff5d8a1", "path": "crates/fractal-reconcile/src/reconcile/tests/ownership_guard_tests.rs", "kind": "sql-template", "fingerprint": "5005709ba5f6cabc5fde79f02aad13ab8f39f97edbbad4167c2bbc720a123bfa", "owner": "fractal_reconcile::reconcile::tests::ownership_guard_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 479, "excerpt": "UPDATE claims SET accepted_at_unix_ms='invalid' WHERE id=?1"}, {"id": "lv-hfb64123b34c3", "path": "crates/fractal-reconcile/src/reconcile.rs", "kind": "sql-template", "fingerprint": "400236f13df7316e04adb677dc16166ab3b1b2701277721ec220cc75aec69529", "owner": "fractal_reconcile::reconcile", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 25745, "excerpt": "INSERT INTO projection_digest_repaired_claims(id) VALUES(?1)"}, @@ -5071,6 +5296,7 @@ {"id": "lv-hfbf930ba4e9f", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "343318fd06f36d2efad83260d0697986af208252335a2d3ae3e232089ff3fba6", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 13197, "excerpt": "& canonical_sql ( \"SELECT id, store_index, accepted_at_unix_ms FROM claims WHERE actor=?1 AND store_index<=?2 AND kind IN ('work.claimed','work.progress') AND json_extract(body, '$.fields.claim_incarn"}, {"id": "lv-hfc15e69df525", "path": "crates/fractal-store/src/store/message_versions/tests.rs", "kind": "sql-template", "fingerprint": "c352cbf4ebc54fa257e4ced3d89045f4fb953404facdd1ccf311ef6c653fc7f2", "owner": "fractal_store::store::message_versions::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 58, "excerpt": "INSERT INTO desired VALUES('message/a',X'ff')"}, {"id": "lv-hfc3f88eaf9a9", "path": "crates/smallclaims/src/store/prepared_envelope_tests.rs", "kind": "sql-template", "fingerprint": "40edd6f4f70b268947c72a9032cdd1820845a687b9cef2b395583a75d98dce67", "owner": "smallclaims::store::prepared_envelope_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 686, "excerpt": "INSERT INTO replica_records( record_ref, writer, sequence, envelope_hash, position, raw, state, error_code, error_message, updated_at_unix_ms ) VALUES (?1, ?2, ?3, ?4, 0, x'', 'repaired', 'claim-hash-"}, + {"id": "lv-hfc49ec7f7720", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "sql-template", "fingerprint": "1f45671338e89913c18f35e05f9f94bc4da98332cfd3337fb2678ff97621393e", "owner": "smallclaims::store::assistant_grant_authority", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 1000, "excerpt": "INSERT OR IGNORE INTO assistant_grant_proof_rechecks VALUES(?1)"}, {"id": "lv-hfc4e350112f9", "path": "crates/fractal-store/src/store/checkpoint_tests.rs", "kind": "sql-template", "fingerprint": "99e956e8ed33756972d20fbd3f0160b2c734fb2d2bc4bd75fc48555de936baa8", "owner": "fractal_store::store::checkpoint_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 528, "excerpt": "UPDATE replica_envelopes SET accepted_at_unix_ms=?1"}, {"id": "lv-hfc667e6ac72f", "path": "crates/fractal-store/src/store/mission_capacity.rs", "kind": "unresolved-sql-sink", "fingerprint": "acdaf8bd3b815535046858d25ab374d72f65c7e4bea1948f5dcd472c02624e7d", "owner": "fractal_store::store::mission_capacity", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 99, "excerpt": "[ & previous ] , | row | row . get : : < _ , String > ( 0 )"}, {"id": "lv-hfc7b7df88745", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "d8b7c26452e38a7fa33e185d689c2efb96290d8e628622e0b14abe6c613d75f9", "owner": "fractal_store::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 8398, "excerpt": "UPDATE local_observations SET observed_at_unix_ms=1000 WHERE id <= 12"}, @@ -5110,6 +5336,7 @@ {"id": "lv-hfe5b780e197e", "path": "crates/fractal-store/src/store/person_work.rs", "kind": "unresolved-sql-sink", "fingerprint": "719253e22c4624c2b2df09fe06e49ce392ba2a3f95ec7c35799e9672e5792b91", "owner": "fractal_store::store::person_work", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 980, "excerpt": "params ! [ origin , ask . body [ \"fields\" ] [ \"origin_attempt\" ] . as_u64 ( ) , claim . accepted_at_unix_ms . to_string ( ) , ask . subject ]"}, {"id": "lv-hfe69cd49bb6b", "path": "crates/fractal-store/src/store/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "b222971dc31aa3f39d4103a53b37c4ea51fa15a23094c2670de78eb928fd7e57", "owner": "fractal_store::store::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 3524, "excerpt": "& ACTUAL_STATE_NEWEST"}, {"id": "lv-hfe7bc53ccf35", "path": "crates/smallclaims/src/store/membership_query_tests.rs", "kind": "sql-template", "fingerprint": "7ce9294cb9dbe16b83a5d5e092c17ced1efc4b2f4ab7a89e7cb6e2b7557e62dc", "owner": "smallclaims::store::membership_query_tests", "todo": "prepare-body-and-predecessor-values", "disposition": "allow-for-now", "line_hint": 267, "excerpt": "UPDATE claims SET body=json_set(body,'$.fields.mode','dial-out')"}, + {"id": "lv-hfe820094f334", "path": "crates/smallclaims/src/store/assistant_grant_receipt_cost_tests.rs", "kind": "sql-template", "fingerprint": "d2be52fceb5efdef101dc4c32829acde32549e8f18a8b97545cd3919ef99fefe", "owner": "smallclaims::store::assistant_grant_receipt_cost_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 74, "excerpt": "INSERT INTO assistant_grant_auth_cursor(claim_id,position,record_rowid,member_key,membership_start) SELECT claim_id,position,rowid,?2,0 FROM replica_records WHERE claim_id=?1 LIMIT 1"}, {"id": "lv-hfe84a7d32f14", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "8edb630b01a1f78d4abc5ee08b714ce7a8578b35d2269aec45684bf19ac1e4fc", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 7155, "excerpt": "& query"}, {"id": "lv-hfe8fa93ac1c9", "path": "crates/fractal-store/src/store/notice_authority_tests.rs", "kind": "sql-template", "fingerprint": "646b21a77207d2b14f778e66bdcf0d2862f75e00168e81a6aa6fb218629fd654", "owner": "fractal_store::store::notice_authority_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 386, "excerpt": "UPDATE step_runs SET status='completed' WHERE subject='step-run/unrelated'"}, {"id": "lv-hfe9c6bf35233", "path": "crates/fractal-missions/src/store/resource_preparation/tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "dc372daedd324b47f1261987900c1a08eff3ccdf253bfcf666d0ebecf17142ad", "owner": "fractal_missions::store::resource_preparation::tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 130, "excerpt": "& store , | _ | ( )"}, @@ -5125,6 +5352,7 @@ {"id": "lv-hff01ab86b211", "path": "crates/fractal-store/src/store/tests.rs", "kind": "sql-template", "fingerprint": "88eaecdff558397c9aa26a1a4ecac69bb9a57ef657ee1436ad7ac6b6849cd6f8", "owner": "fractal_store::store::tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 182, "excerpt": "UPDATE local_runtime_starts SET body=json_set(body,'$.desired_token','changed')"}, {"id": "lv-hff222df9d90f", "path": "crates/fractal-store/src/store/glass_heads.rs", "kind": "sql-template", "fingerprint": "72f8cb7dc1eb83007a9530b3b7a5153256d6692e9d9e9952b7b5ff5ac7d54356", "owner": "fractal_store::store::glass_heads", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 187, "excerpt": "INSERT INTO glass_heads(subject,person,deleted) VALUES(?1,?2,1) ON CONFLICT(subject) DO UPDATE SET deleted=1"}, {"id": "lv-hff2c7d840c05", "path": "crates/fractal-store/src/store/resources.rs", "kind": "unresolved-sql-sink", "fingerprint": "982eb36d7cae2acfcb79e884416a545c64b431d3d4f080fcd74460cb8494de97", "owner": "fractal_store::store::resources", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 339, "excerpt": "TRIMMED_LEAVES_PROJECTION"}, + {"id": "lv-hff2d1c2b03b3", "path": "crates/smallclaims/src/store/assistant_grant_authority.rs", "kind": "unresolved-sql-sink", "fingerprint": "2dc69837f6adf7e4d4f117b70dbc52cd8a281c314f3cd72ae1730c5f3e609bd8", "owner": "smallclaims::store::assistant_grant_authority", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 209, "excerpt": "\"SAVEPOINT assistant_grant_upgrade\""}, {"id": "lv-hff2fb7cc707f", "path": "crates/smallclaims/src/store/projection_digest.rs", "kind": "unresolved-sql-sink", "fingerprint": "a8b771920b8319e47251d1360f5e880bc18e8d329b0f0d003ea3c7e615558947", "owner": "smallclaims::store::projection_digest", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 408, "excerpt": "query"}, {"id": "lv-hff3ad7af7c33", "path": "crates/fractal-store/src/store/schedule_active_run_tests.rs", "kind": "sql-template", "fingerprint": "137428052840c479a6762bd6ed705c5151a75edc835e9f304f37cdef72867db5", "owner": "fractal_store::store::schedule_active_run_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 146, "excerpt": "INSERT INTO mission_runs VALUES('blob','failed')"}, {"id": "lv-hff5351235ff3", "path": "crates/fractal-store/src/store/client_messages.rs", "kind": "unresolved-sql-sink", "fingerprint": "f9786d4d7a7cedb786437a545587c7fd01fb992e9a63d5fd9038e2b4a2675ba9", "owner": "fractal_store::store::client_messages", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 434, "excerpt": "& SQL"}, @@ -5135,6 +5363,7 @@ {"id": "lv-hffa489fdc3a4", "path": "crates/fractal-delivery/src/store/actual_purity_tests.rs", "kind": "sql-template", "fingerprint": "956c1937e6f1df2654443d7d1cf94a2205155878520a58271ba7c75ec53ffcc9", "owner": "fractal_delivery::store::actual_purity_tests", "todo": "chunk-or-reference-exact-wire-values", "disposition": "allow-for-now", "line_hint": 189, "excerpt": "DELETE FROM replica_records WHERE claim_id=?1"}, {"id": "lv-hffada0345e64", "path": "crates/fractal-evidence/src/store/owned_sets_tests.rs", "kind": "sql-template", "fingerprint": "6a82fc24d210dca694a92da0f80f60f336c03f7d8d7cfc7df49eab02a783e55a", "owner": "fractal_evidence::store::owned_sets_tests", "todo": "bound-or-reference-values-and-reclamation", "disposition": "allow-for-now", "line_hint": 169, "excerpt": "DROP INDEX claims_owned_set_subject_index"}, {"id": "lv-hffd9a012f0b4", "path": "crates/fractal-store/src/store/publication.rs", "kind": "unresolved-sql-sink", "fingerprint": "b083d66261bfa22f874abd9ac071b20ad1a2e4943fd23f512f9c04f3abdc94c7", "owner": "fractal_store::store::publication", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 137, "excerpt": "params ! [ proposed . subject , origin , at . min ( i64 : : MAX as u64 ) ] , | row | row . get ( 0 ) ,"}, - {"id": "lv-hffefd094582d", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "083207b3eb2fe222def918c823d087f768ee4f1c42845263e9ba3465b9bbd2a7", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 12405, "excerpt": "params ! [ fence . subject , i64 : : MAX ] , | row | { Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? ) ) }"} + {"id": "lv-hffefd094582d", "path": "crates/fractal-store/src/store.rs", "kind": "unresolved-sql-sink", "fingerprint": "083207b3eb2fe222def918c823d087f768ee4f1c42845263e9ba3465b9bbd2a7", "owner": "fractal_store::store", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 12405, "excerpt": "params ! [ fence . subject , i64 : : MAX ] , | row | { Ok ( ( row . get ( 0 ) ? , row . get ( 1 ) ? ) ) }"}, + {"id": "lv-hfff109a32004", "path": "crates/smallclaims/src/store/assistant_grant_membership_property_tests.rs", "kind": "unresolved-sql-sink", "fingerprint": "a8b771920b8319e47251d1360f5e880bc18e8d329b0f0d003ea3c7e615558947", "owner": "smallclaims::store::assistant_grant_membership_property_tests", "todo": "trace-statement-and-value-representation", "disposition": "allow-for-now", "line_hint": 19, "excerpt": "query"} ] } diff --git a/docs/st3/large-values.md b/docs/st3/large-values.md index b8c33e81cd3..e65da8bd5ff 100644 --- a/docs/st3/large-values.md +++ b/docs/st3/large-values.md @@ -532,25 +532,84 @@ and revision TEXT values; no production writer changes. The maintainer must preserve this historical regression through referenced storage/reclamation work. Inline storage here proves neither encoded size nor execution-cost bounds. -## Assistant principal admission index review - -`fractal_store::store` owns schema site `lv-hb9696ca837f7`, replacing -`lv-h22c8c670811c`. The added principal admission index retains claim-kind TEXT -and the effective principal JSON field inline; absent principals use the fixed -`assistant/chatgpt` key. The composite seek changes neither claim bodies nor -admission semantics. These keys remain variable-size, and SQLite maintains them -on insertion and deletion; indexed lookup is not a byte-size or startup-cost -proof. The producer maintainer retains `chunk-or-reference-variable-columns` -responsibility while preserving effective-principal matching and claim authority. - -`fractal_api_core::api::client_v0::external_grants` owns the conservative -read-only sink `lv-h99f1a302c7b1`. Its prepared admission query binds fixed claim -kinds, an assistant principal and an optional expiry cutoff, then returns claim -IDs after revocation and latest-policy filtering. It adds no writer or body copy; -principal, subject and claim-ID TEXT keys remain variable-size. The producer -maintainer retains `trace-statement-and-value-representation` responsibility for -these bindings and returned identifiers; fewer candidates and indexed seeks do -not establish encoded-size or execution-cost bounds. +## Assistant principal admission and authenticated authority inventory + +The admission-index review established the need for effective-principal matching +(including the legacy `assistant/chatgpt` default), live-grant expiry range seeks, +and subject/kind/origin/actor transition seeks that exclude another issuer's +overlays. The authenticated authority projection in PR #5993 preserves those +requirements without treating raw claim rows as authority. + +`smallclaims::store::assistant_grant_authority` owns schema site +`lv-hbfff283c1bdb`. Its authority transition index includes the exact base claim +and canonical store order; its effective-grant active index keys principal, +owner, revocation, expiry and profile. Authenticated records, grant subjects, +principal/actor keys and proof identities remain inline variable-size values. +The producer retains `chunk-or-reference-variable-columns` responsibility: +representation changes must preserve authentication, effective-principal +matching, latest-policy/revocation selection and proof invalidation/reclamation. +Indexed lookup and bounded catch-up batches prove neither encoded byte size nor +total startup cost. + +The former raw-claim principal, principal/expiry and transition indexes and the +raw transition-reader exception `lv-h1cad9af7ef23` are superseded, not a second +production admission path. Raw claims remain evidence; projection readers must +not restore authority to unauthenticated overlays. + +`fractal_api_core::api::client_v0::external_grants` no longer owns a raw SQL +candidate sink: `lv-h99f1a302c7b1` and its intermediate batch-provenance +replacement `lv-hc1c46de6a890` are superseded by the authenticated projection +API. Candidate selection retains principal, owner, expiry, ignored-profile and +excluded-claim filtering without rehydrating raw claim history as authority. +The projection's record copies and variable index keys remain transitional debt, +not an encoded-size or execution-cost guarantee. + +Owner management, audit and conflict-witness projection preserve historical +Service-on-assistant identities through the broader projection-principal parser, +so the authoritative owner can inspect and revoke that retained conflict evidence. +Representation changes must preserve this recovery path without turning those +historical identities into Service bearer credentials. Issuance and bearer +authentication retain the strict profile-specific principal parser; Service +credentials require a `plugin//` principal. + +The merged `fractal_store::store` schema is `lv-h6e39e16546c7`, replacing +`lv-h22c8c670811c` and `lv-h6088551c41aa`. It retains the desired-kind/subject +index and local desired-write witness while removing the obsolete raw principal +index. Variable columns and index keys still require reference/chunk conversion. + +The merged inventory additionally reviews the authority producer's pending proof +identities, membership-window additions/retractions, resumable authentication +cursors, dirty/recompute work, invalidation triggers, local-append witnesses and +upgrade metadata. These retain inline claim/subject/writer/member-key strings, +signed-record identities and record JSON so proof invalidation and catch-up +remain exact. The owning producer must preserve those identities, atomic +visibility and keyed reclamation when changing representation; batch counts do +not bound individual values. Savepoint/release and composed read sinks remain +conservative `trace-statement-and-value-representation` exceptions. + +The corresponding API, delivery, wake, authority, membership-property, +receipt-cost and benchmark fixtures mutate isolated proof/cursor/claim state or +count work to exercise those invariants. Their module owners retain the listed +body/predecessor, exact-wire, generation/reclamation and reference TODOs; test +coverage establishes no production value-size exemption. + +Reviewed manual flows `smallclaims::store::insert_claim`, +`smallclaims::store::put_document_as` and +`smallclaims::store::receive_replication_exchange_via` retain their existing +representation TODOs. Local inserts now stamp the authority local-append witness; +document writes preserve blob, idempotency and writer-admission semantics; exchange +receipt preserves exact envelopes/signatures, carrier evidence and pending +admission. Their refreshed fingerprints do not generalize document or transport +limits into universal stored-value bounds. + +The `smallclaims::store::membership_query_tests` maintainer owns test-only sites +`lv-hb5e52f377f02`, `lv-he6cdb35f9041` and `lv-h85da58ff0363`. These change a +fixture claim's origin, copy an admitted record's inline raw bytes and identity +into a sibling record, and replace a fixture signature with fixed invalid text. +They exercise batch/scalar parity and shared-signature verification deduplication +in an in-memory store; they add no production writer. The maintainer retains the +listed body/predecessor and exact-wire representation TODOs for these fixture +copies; this exception is not a byte-size or execution-cost proof. ## Incremental observed credit heads diff --git a/docs/st3/principals-and-grants.md b/docs/st3/principals-and-grants.md index 56acd079599..418e7917543 100644 --- a/docs/st3/principals-and-grants.md +++ b/docs/st3/principals-and-grants.md @@ -113,9 +113,52 @@ The claim-backed external-grant core is `crates/fractal-api-core/src/api/client_v0/external_grants.rs`. Its closed profiles keep `assistant/chatgpt` and `assistant/mcp` in the same assistant profile; service issuance is disabled and service has no assistant route or disclosure rights. -Several active grants of a principal's own profile are allowed, but a different -active profile is refused. Historical `custom.client.assistant.v1.*` claim kinds -and absent-principal legacy ChatGPT grants retain their existing meaning. +Several active grants of a principal's own profile are allowed. Admission refuses +a known opposite-profile grant, including one replicated from another issuer. +If disconnected issuers create opposite-profile grants, authentication suspends +every conflicting grant with HTTP 409 `grant-profile-conflict`; there is no winner. +Bearer authentication and pairing return only that code and the fixed message +`principal has active grants of opposite profiles; revoke one to clear the conflict`, +without witness details. Only the daemon-configured owner can inspect with +`?witness=1` to expose a `conflict.grants` witness with both grant IDs, origins and +profiles. Once an owner's revoke replicates (or the opposite grant expires), +the remaining grant works again on its authoritative issuer; replication never +makes foreign credentials authenticate on another member. +While opposite-profile records remain visible, inspect also computes +`cleared_conflicts` witnesses naming the `revoked` or `expired` clearing cause. +Conflict state is never persisted. Admission and authentication use the same +millisecond clock and strict `expires_at_unix_ms > now` active boundary; a newly +issued opposite-profile grant reintroduces the conflict by computation. + +Only well-formed foreign grants attributed to the configured concrete owner +count as witnesses. Their grant and effective policy must have matching immutable +identity/profile, and each must have authenticated envelope provenance signed by a +key in its writer's admitted fleet membership window. Legacy unsigned, +unverifiable and malformed custom claims do not gain suspension authority merely +by naming an owner or origin. This intentionally favors verifiable issuer claims +over allowing arbitrary replicated custom fields to deny service. A valid record +in a degraded envelope still counts when its signature and writer window verify; +an unrelated rejected record cannot hide the grant. + +Only transitions from the grant's own origin, by its owner, with consistent +immutable identity can revoke it or change its effective policy. Foreign +transitions additionally require authenticated provenance. Invalid overlays are +ignored; the last valid policy (or original grant) stays in force. This applies to +local grants too: an unauthorized newer overlay no longer replaces their policy. +The principal expression index prunes expired base grants without issuer policy +candidates, and matching local revocations, before the authenticated Rust fold. +The SQL unions indexed live-expiry ranges, legacy records, and matching-principal +issuer-policy subjects. The additive principal/expiry index avoids parsing expired +grant bodies on authentication; the original principal index remains in use for +policy candidates. Revocations use the existing subject/kind index, avoiding a +quadratic principal-wide revocation plan as completion/revocation history grows. +Foreign revocations and policy candidates reach Rust because SQL cannot verify +signatures. The sealed membership fold has a separate generation-keyed cache: +request-side cold folds populate it without populating the sealing-path cache. +Every admission/authentication/witness read recomputes conflict, including after +replication catches up. Default grant responses preserve their pre-witness shape +for old strict clients. Historical `custom.client.assistant.v1.*` claim kinds and +absent-principal legacy ChatGPT grants retain their existing meaning. Claims persist credential/code digests, never bearer tokens or pairing codes; grant projections expose neither credential material nor its digests. diff --git a/release-notes/external-grant-profile-conflict.json b/release-notes/external-grant-profile-conflict.json new file mode 100644 index 00000000000..4fb4fbba047 --- /dev/null +++ b/release-notes/external-grant-profile-conflict.json @@ -0,0 +1,33 @@ +{ + "version": 1, + "summary": "Suspend external-grant authentication when replicated grants assign opposite profiles to one principal", + "replay": { + "status": "changed", + "detail": "Existing append-only grant, policy and revocation claims are preserved without rewriting history. Additive external-grant authority projection version 1 is populated by a resumable background backfill. Active opposite-profile grants conflict regardless of replication arrival order; revoked and expired grants do not contribute to the conflict." + }, + "schema": { + "status": "changed", + "detail": "Adds external-grant authority projection version 1 as additive store state; older builds can still open an upgraded store. The durable assistant_grant_local_appends(claim_id PRIMARY KEY) table records only new local insert_claim appends, never inferred historical or replicated provenance. Projection version remains 1 (unreleased). Adds typed client error assistant-grant-authority-not-ready with retryable=true (HTTP 503) while assistant authorization fails closed during background backfill. Also adds grant-profile-conflict (HTTP 409). Bearer authentication and pairing disclose only the conflict code and fixed message principal has active grants of opposite profiles; revoke one to clear the conflict, without witness details. Only daemon-configured-owner inspection with ?witness=1 exposes conflict and cleared_conflicts witnesses with typed assistant/service profiles and revoked/expired causes. Default grant responses retain their previous shape for old strict clients." + }, + "rules": { + "status": "changed", + "detail": "Assistant authorization fails closed until the local authority projection backfill is ready. After initial backfill, dirty or pending authentication, including a pending revoke, fences only its grant subject; unrelated established credentials remain usable. Fresh signatures from keys outside the writer's admitted window do not reset authentication cursors or queue projection work. Membership invalidation reuses the inherited fleet generation for changes to projected writer/key/start/end windows, including delayed bootstrap evidence; there is no separate projection revision or copied trigger set. Folding and comparison run on readers outside receipt transactions; an unchanged window snapshot advances only an in-memory observation, without writer admission or cursor resets. Pure additions retry unauthenticated rows only. Each authenticated remote row records its complete proof identity: writer, sequence, envelope hash, record position and member key; local-append provenance remains a separate durable fact. Signature DELETE/UPDATE, record invalidation/deletion and envelope invalidation/deletion enqueue exact proof dependencies in the mutating transaction, independently of membership changes. Indexed maintenance authenticates one dependent claim per unit. Retractions revisit only recorded key/sequence dependencies that lost coverage and fence only those subjects; restored coverage exempts covered dependencies immediately and queued ranges are trimmed or cancelled within the budget. Legitimate authenticated-member key removal still costs O(rows authenticated by that key) across bounded transactions, with affected subjects fenced until rechecked. Per-base authority deletion and indexed latest-transition recomputation share the 64-unit budget with changed windows and authentication. The resulting projection equals a fresh backfill of current evidence, including removal of revoked authority; unauthenticated transitions still fence bearer use. Inherited reader-side signature aggregation remains a pre-existing cost tracked by #6124. Writer-time pending-subject checks retain generic authorization denials; clean-grant inspection omits optional explanations for other pending subjects while preserving established authenticated conflict witnesses. If a principal has active grants in both assistant and service profiles, all of that principal's external grants are suspended, not just the losing or newest profile. Multiple same-profile grants remain allowed. Authentication resumes after replicated append-only revocations or expiry remove the opposite-profile conflict from the local view. The configured owner can revoke existing service-profile history through trusted-local Unix without changing its immutable profile; service issuance, policy updates and requests remain disabled. Owner inspection reports active witnesses and cleared_conflicts witnesses with revoked or expired causes from the authority projection and retained evidence." + }, + "compatibility": { + "status": "changed", + "detail": "Conflict admission counts only well-formed owner grants. New local appends require durable local-append provenance; unmarked historical claims, including claims naming this local origin, require a verified member envelope signature and matching admitted membership window. Unsigned or unsealed Legacy history is not grandfathered into authority. Grants issued before upgrade without a verifiable member signature stay unusable and must be reissued by the configured owner. Logical backup restore assigns a new writer and does not carry local-append markers; unsigned pre-restore grants fail closed and require the same configured-owner reissue procedure. Policies and revocations count only from the grant's own origin and owner with consistent immutable identity. A newer unauthenticated transition cannot hide an older authenticated renewal. Invalid overlays are ignored, retaining the last valid policy. Projection version 1 is additive and raw append-only evidence remains authoritative and intact. Tokens remain issuer-local. Rollback to an older build is supported, but older members do not enforce these provenance checks, the new projection readiness gate or conflict suspension, so upgrade all serving members before relying on them." + }, + "downtime": { + "status": "changed", + "detail": "No offline migration window is planned: startup backfill has an approximately two-second budget, then continues in bounded background slices. A synthetic 3.73 GB store with one million claims and 1% grant-kind rows measured a 1.892-second startup slice and 1.919-second total backfill, with 54,940 KiB process peak RSS; linear same-mix throughput extrapolation to 50 GB is 25.750 seconds, not a production or cold-cache guarantee. The startup slice excludes Store::open and does not predict total daemon startup time. Assistant authorization is temporarily unavailable with retryable assistant-grant-authority-not-ready until the local projection is ready; this is an authorization interruption, not a requirement to stop the daemon for the entire backfill. Affected people also cannot authenticate with any external grant while a profile conflict remains visible; a partition can extend that interruption until revocations replicate." + }, + "manual": { + "status": "changed", + "detail": "Allow the resumable background backfill to finish before retrying assistant authorization after assistant-grant-authority-not-ready. Run fractal doctor: the claim-store section lists each unauthenticated unmarked local grant claim ID with reason grant predates local-append provenance; re-issue. Remote unmarked grants are separately reported as lacking verified provenance with issuance age unknown, not definitively pre-upgrade. The same private provenance check lists subject-maintenance causes: dirty claims awaiting projection, signature authentication cursors, unauthenticated grant/policy/revocation evidence, and writer membership revalidation queued beyond its durable cursor. During a transient subject fence, bearer clients intentionally receive generic credential rejection rather than the maintenance cause, avoiding an authentication oracle. Detailed subjects, causes, grant IDs, origin and actor remain trusted-local doctor diagnostics and are excluded from paired-client operations collection and detail reads, including read.projections clients. For unusable pre-upgrade or unsigned pre-restore grants, the configured owner reissues through trusted-local Unix with fractal devices --as person/OWNER pair --assistant assistant/mcp --scope read.assistant.summary --disclose-to-openai --consent-evidence '' (select the original principal and explicitly approved scopes), then completes the new challenge with fractal devices complete MEMBER_URL PAIRING_ID --assistant --profile /absolute/path/to/new-profile.json and replaces the protected adapter credential. There is no in-place reissue command or SQL provenance repair. Service issuance remains disabled. For a conflicted principal, choose the intended profile and append revocations for every active grant in the opposite profile. Let those revocations replicate to each serving issuer. Do not delete raw claims, clear append-only evidence, or replace tokens to resolve a conflict or restart the backfill." + }, + "recovery": { + "status": "changed", + "detail": "Restarting resumes the background backfill idempotently from retained progress; no raw claim deletion or manual data rewrite is required. Rollback to an older build is supported because projection version 1 is additive and preserves raw evidence, but the older build does not provide the new authorization guarantees. The configured owner can retire retained legacy Service-profile/assistant-principal conflict evidence through the normal assistant grant revoke route on its authoritative issuer; owner inspection, response projection and audit recognize that historical identity without admitting it for issuance or bearer authentication. After revocations replicate, remaining otherwise-valid grants in the intended profile can authenticate again without reissuance. Expiry of every remaining active opposite-profile grant also clears the conflict; expired and revoked grants remain unusable. If a ready issuer still reports a conflict after revocation, restore replication so it receives the revocations; restarting or changing claim arrival order does not resolve the conflict." + }, + "commits": [] +} diff --git a/scripts/ci-linux b/scripts/ci-linux index 168d0432bd8..c26601b8bb9 100755 --- a/scripts/ci-linux +++ b/scripts/ci-linux @@ -45,8 +45,10 @@ fleet_compat() { fleet::previous_release_and_this_build_restore_each_others_archives_until_the_shard_holds_items \ fleet::service_grants::previous_release_refuses_service_grants_from_a_candidate_issuer \ fleet::service_grants::previous_release_refuses_offline_seeded_service_grants_with_its_own_origin \ - fleet::service_grants::previous_release_refuses_plugin_service_grants_on_same_database_rollback 2>&1 | tee "$logs/compat-result.log" || return - grep -q "test result: ok. 9 passed" "$logs/compat-result.log" || return + fleet::service_grants::previous_release_refuses_plugin_service_grants_on_same_database_rollback \ + fleet::service_grants::previous_release_authorizes_and_revokes_after_authority_projection_rollback \ + fleet::service_grants::authority_projection_resumes_after_daemon_is_killed_with_committed_partial_backfill 2>&1 | tee "$logs/compat-result.log" || return + grep -q "test result: ok. 11 passed" "$logs/compat-result.log" || return # The GitHub plugin store beside an older poller, and that poller upgraded in place. cargo test -p fractal --locked --test integration -- --ignored --exact \ fleet::previous_release_poller_beside_a_github_plugin_member_and_its_upgrade 2>&1 | tee "$logs/compat-plugin-result.log" || return