From 44f257cb06484feda3412d9382e3587393796353 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Sun, 6 Sep 2026 02:23:15 -0500 Subject: [PATCH] docs: record accepted phase-2 foundation contract --- ...9-06_agent-project-workspace-foundation.md | 339 + .../2026-09-06_foundation-phase2-contract.md | 386 ++ .../2026-09-06_workspace-schema-and-audit.md | 873 +++ docs/plans/foundation-v1-candidate/README.md | 364 + docs/plans/foundation-v1-candidate/REVIEW.md | 153 + docs/plans/foundation-v1-candidate/RUNTIME.md | 319 + docs/plans/foundation-v1-candidate/check.py | 156 + .../command-events.fixtures.json | 2719 ++++++++ .../command-events.schema.json | 195 + .../fingerprint-vectors.json | 295 + .../records.fixtures.json | 1607 +++++ .../records.schema.json | 1699 +++++ .../runtime.fixtures.json | 5891 ++++++++++++++++ .../runtime.schema.json | 5933 +++++++++++++++++ .../semantic-model.fixtures.json | 854 +++ .../foundation-v1-candidate/semantic-model.py | 66 + 16 files changed, 21849 insertions(+) create mode 100644 docs/plans/2026-09-06_agent-project-workspace-foundation.md create mode 100644 docs/plans/2026-09-06_foundation-phase2-contract.md create mode 100644 docs/plans/2026-09-06_workspace-schema-and-audit.md create mode 100644 docs/plans/foundation-v1-candidate/README.md create mode 100644 docs/plans/foundation-v1-candidate/REVIEW.md create mode 100644 docs/plans/foundation-v1-candidate/RUNTIME.md create mode 100644 docs/plans/foundation-v1-candidate/check.py create mode 100644 docs/plans/foundation-v1-candidate/command-events.fixtures.json create mode 100644 docs/plans/foundation-v1-candidate/command-events.schema.json create mode 100644 docs/plans/foundation-v1-candidate/fingerprint-vectors.json create mode 100644 docs/plans/foundation-v1-candidate/records.fixtures.json create mode 100644 docs/plans/foundation-v1-candidate/records.schema.json create mode 100644 docs/plans/foundation-v1-candidate/runtime.fixtures.json create mode 100644 docs/plans/foundation-v1-candidate/runtime.schema.json create mode 100644 docs/plans/foundation-v1-candidate/semantic-model.fixtures.json create mode 100644 docs/plans/foundation-v1-candidate/semantic-model.py diff --git a/docs/plans/2026-09-06_agent-project-workspace-foundation.md b/docs/plans/2026-09-06_agent-project-workspace-foundation.md new file mode 100644 index 00000000..466717dc --- /dev/null +++ b/docs/plans/2026-09-06_agent-project-workspace-foundation.md @@ -0,0 +1,339 @@ +# Agent, project, and workspace foundation + +Status: documentation draft for Jason's review. No implementation authorized. +Date: 2026-09-06. Plan author: darkwing, current pi session +`01a06e48-0718-71f2-a889-c263c4800fb9`. +Baseline: `69d1bb3aa4b826218aa4cca3710f2d98c0b9d7ba` in `mosaicstack/stack-v2`. +Issue: [#53](https://git.mosaicstack.dev/mosaicstack/stack-v2/issues/53), +opened by rocko under the authorized seat identity, POST 201 reported at +2026-09-06T00:12:33Z. + +Start here for the intended behavior. Field proposals and execution evidence +are in [Schema and audit discussion](2026-09-06_workspace-schema-and-audit.md). +Phase-2 detail is now in the +[Record and operation contract candidate](2026-09-06_foundation-phase2-contract.md). +These documents are not implemented APIs or approved JSON Schemas. + +## 1. Why we are doing this + +Jason wants one familiar interaction agent to work in several separate areas +without creating another agent identity for each assignment. Workers should +also reuse their definitions across projects and workspaces. + +A fresh conversation must be able to continue checked work without inheriting +an old conversation's confusion. Files and work records, not conversation +memory alone, tell the agent what to do next. + +Development must remain understandable and testable by Jason. We agree on a +small result and its test, build only that result after approval, then stop +for Jason to try it. Passing automated tests is not user acceptance. + +## 2. Requirements agreed in the owner conversation + +These describe intent. Exact field names, storage paths, and mechanisms below +remain proposals unless separately approved. + +| ID | Requirement | +|---|---| +| R1 | An agent has a reusable identity, type, execution program, SOUL, configuration, and permission limits. Creating an assignment need not create another agent identity. | +| R2 | A project registers participating agents and controls their visibility and permitted work through role-based access control, RBAC. Owner round 1, Q2: the user may delegate bounded registration/assignment authority to the system; actions outside those limits require approval. | +| R3 | A project contains N workspaces; each workspace has exactly one parent project, owner Q5. Each workspace registers participating agents and keeps its work separate. Owner Q3: project membership permits shared project information and only explicitly permitted workspaces, not all workspace content. Dependencies are references, not additional parents. | +| R4 | The same agent can participate in many projects and workspaces, with separate working sessions. One definition per worker type may suffice; specialized definitions remain possible. | +| R5 | Launch names the agent, project, and workspace. Those choices determine mission, tasks, state, working paths, and message destination. The agent does not guess its assignment from its seat directory. | +| R6 | Shared instructions and skill definitions may be reused. Work-specific information points to the declared workspace and relevant project records, not a global agent task list. | +| R7 | Resume and Fresh are distinct launch operations. Resume is the default. Owner Q4 clarification: if no conversation has ever existed in the declared agent/project/workspace scope, initial launch creates it and announces this without an offer. Missing or damaged established conversations are errors, not first use. Fresh does not automatically import the old conversation or its automatic summary. | +| R8 | A fresh conversation supports continuing, abandoning, or selecting established work, independently of conversation choice. Owner Q8: Abandon defaults to ending this agent's selected assignments, not cancelling the shared mission/tasks. Owner Q9: an unfinished prerequisite requires an explicit authorized assignment change, never silent expansion or proceeding as if it were complete. | +| R9 | Users and authorized system services can launch or relaunch an agent with fresh context. Mission recovery uses saved work records. | +| R10 | Default concurrency is one active working session per agent/project/workspace. Users can tune concurrency; budgets, usage measurement, and automatic scaling are requirements for later phases. | +| R11 | Terminal, desktop, and web interfaces refer to the same workspace work records. They show the active agent/project/workspace and do not keep competing task lists. | +| R12 | Messages must address the appropriate workspace. Identity reuse must not mix conversations or work across projects. | +| R13 | Separate folders provide logical organization, not a demonstrated security sandbox. Security enforcement needs its own evidence. | +| R14 | Execution records retain the reusable agent identity and identify the particular assignment/session that acted. Capture context through the system, not agent self-description. Owner Q13: concise action records name actor/scope/session/task, operation, target, authorization, outcome, and evidence references. Detailed evidence is stored separately with access controls; no credentials in either. | +| R15 | Jason approves progression between phases and tests implementation increments before later work depends on them. No automatic queue-running. | +| R16 | Owner ruling, 2026-09-06: SOUL remains canonical per agent. Each Resume or Fresh launch loads the current approved revision into execution-specific inputs and records it. Running conversations do not silently reload changed instructions. Recording the revision does not permanently pin a workspace to it. | +| R17 | Owner Q20/Q21 extends the launch fingerprint to shared behavior-affecting agent configuration: SOUL, shared instructions, applicable enabled skill versions, harness/model settings, and role configuration. Exclude credentials, chat, and task progress. TUI/GUI/WUI show automatic non-blocking mismatch notices recommending Fresh and support on-demand checks against the same record, without repeated interruption or automatic restart. | +| R18 | Owner Q1/Q5: missions may exist at project and workspace levels, with explicit single-parent relationships. A workspace mission has at most one parent project mission, or stands alone within its owning workspace/project scope. Each mission has one owner and authoritative record. A parent may have many children; dependencies are not extra parents. | +| R19 | Owner Q7: delegated, authorized agents may make non-destructive, goal-directed decisions and decompose work autonomously within the established plan. Routine tasks may be accepted by an authorized independent reviewer against agreed criteria. No user interaction is needed for each within-plan decision; scope deviations and declared owner checkpoints still require approval. | +| R20 | Owner Q10: conversation and permitted workspace inspection may precede a mission/task. Requests to change things become explicit recorded assignments without requiring lengthy mission setup. Scope and permissions still apply. | +| R21 | Owner Q11/Q15: Resume targeting an already-running session reports the conflict and offers connection to a user. A service receives an already-active result with the execution identity and must explicitly request connection or another authorized operation. No automatic connection, replacement, or duplicate launch. | +| R22 | Owner Q12: agents share permitted workspace missions, tasks, decisions, and evidence. Reading another agent's conversation needs separate permission or an explicitly authorized handoff. Read permission never implies automatic conversation loading. | +| R23 | Owner Q14: workspace membership removal stops affected executions and blocks further actions in that workspace. Independently authorized work elsewhere continues. Global agent disable is separate; already-issued actions need reconciliation, not an assumption that stopping undoes them. | +| R24 | Owner Q16: one controlling interface connection per running session initially. Other authorized connections may observe; transfer of control is explicit. Observation requires conversation access permission. | +| R25 | Owner Q17: Fresh during active work requests controlled replacement. Stop admitting new actions, preserve checked state, settle or identify unfinished actions, then launch Fresh only when safe. If safe replacement cannot be established, stop and report rather than start competing work. | +| R26 | Owner Q18: an authorized agent/service may investigate uncertain results with non-destructive checks and resume dependent work only after evidence resolves the uncertainty. Otherwise escalate. Blindly repeating the original action is not a recovery check. | +| R27 | Owner Q19: required audit-recording failure blocks affected executions. Other work continues only if its required recording works. Refuse before an affected action; treat effects with missing result evidence as uncertain and reconcile them. | +| R28 | Owner Q22: only explicitly designated general user preferences are shared by default. Personal and project-specific information is supplied only where authorized and relevant, not by automatically loading the whole user profile into every launch. | +| R29 | Owner Q23: closing a workspace retires it from active work, safely stops its work, retains files/history, and blocks ordinary new launches until reopened. Deletion and retention cleanup are separate authorized operations. | +| R30 | Owner Q24: existing sessions remain legacy records until explicitly adopted through reviewed project/workspace assignment. No inferred membership from filenames and no automatic default-project placement. Preserve historical evidence. | +| R31 | Owner Q25: an approved plan change pauses affected work for reconciliation. An authorized coordinator may adjust assignments within its delegation; unaffected work can continue. Account for actions already underway. Escalate adjustments beyond delegated authority or that cannot be resolved safely; do not finish obsolete assignments merely because they started earlier. | +| R32 | Owner Q26: use standard scope permission roles with registration-specific narrowing. A project/workspace role describes what the agent may do there; it does not redefine its reusable identity/type or exceed its permission ceiling. Exact role names and grant lists require review. | +| R33 | Owner Q27 A: initial managed commands require invocation-level evidence: actor/scope/assignment, authorized command, enforced filesystem/network limits, start/end, outcome, and controlled evidence references. Separate tracing of every internal file/network operation is not required. Isolation, credential protection, fail-closed recording, revocation, and uncertainty recovery remain mandatory. | +| R34 | Owner Q28 A: the initial managed terminal may be Mosaic-controlled with Pi remaining the engine; native Pi screen/shortcut parity is not required. Clients use the same mediated operations, with no waiver of scope, permission, recording, privacy or recovery requirements. This is not runtime implementation approval. | + +## 3. The objects in plain language + +```text +Shared agent definition: darkwing + Identity, type, Pi configuration, SOUL, permission limits + +Project: mosaic-stack-v2 + Registered agents: darkwing, code-be-01, rev-code-01 + Project decisions and shared project state + | + +-- Workspace: sessions + | Registered agents and assignments + | Workspace mission, tasks, files, state + | Darkwing conversations and execution records + | Code-be-01 conversations and execution records + | + +-- Workspace: skills + Separate assignments, files, state, and conversations + +Project: personal + Workspace: journal + Darkwing registered here too, with separate work context +``` + +Agents are referenced by projects and workspaces; they are not copied into +new identities for each registration. A session belongs to one +agent/project/workspace combination. A running instance is one execution +attempt using that session. Resuming a conversation creates another execution +attempt, not another agent identity. + +Owner Q5 distinguishes containment from dependencies: one project owns each +workspace; a workspace mission may contribute to at most one project mission. +A standalone workspace mission still belongs to its workspace and project. +Dependency references do not create another parent or confer its permissions. + +Proposed ownership rule: project-wide decisions have one authoritative home. +Workspace records reference the relevant project revision rather than copy it +into an independently editable project state. Individual assignments stay +separate even when several agents share a workspace. + +## 4. Resume, Fresh, and the work decision + +| Conversation operation | Work decision | Intended result | +|---|---|---| +| Resume | Continue | Reopen the selected conversation and reconcile it with current authorized work state. | +| Fresh | Continue | New conversation; load checked mission, task status, and relevant evidence. Do not import the old chat. | +| Fresh | Abandon | End this agent's selected assignments and start a new conversation. Underlying missions/tasks remain for reassignment unless separately cancelled with authority. Preserve history and files. | +| Fresh | Select | Start with explicitly selected work and relevant dependency information. An unfinished prerequisite needs an authorized assignment change before execution. Unselected work is not silently cancelled. | + +Owner Q4 ruling: first use creates the initial conversation automatically and +announces "Starting initial conversation" without a confirmation offer. This +is not replacement of existing context or a third public launch command. +Subsequent default launches resume. Owner Q11: if that conversation is already +running, report the conflict and offer to connect rather than automatically +connecting or launching another process. Owner Q15: a service receives an +already-active result with the execution identity and chooses any next +connection or other operation explicitly under its authority. +A missing/damaged established conversation is an error, not permission to +create a replacement. Ambiguity still refuses. + +Owner Q10: initial conversation and permitted inspection do not require a +mission/task. Requests to make changes become recorded assignments within the +user's or service's authority. No mission setup ceremony is required for chat. + +Owner Q6 approved Fresh/Continue loading the assigned mission and success +criteria, assigned tasks/status, relevant approved decisions, dependencies, +blockers, and verified-result references. A proposed next step is labelled as +a proposal, not an authorized assignment. Old chat/automatic summaries stay +out; unverified notes remain labelled as unverified. + +Owner Q7/Q9: an explicit assignment change need not require Jason personally. +An authorized coordinator may approve prerequisite work within delegated plan +limits and record the change. The worker never silently expands its assignment. +This autonomy does not waive the owner-controlled phase boundaries below. + +Owner Q16/Q17: an existing execution has one controlling interface connection; +authorized observers do not become additional controllers. A Fresh request +initiates controlled replacement, stopping new actions and preserving checked +state. Unfinished actions must be resolved or explicitly identified before +replacement; if safety is uncertain, stop and report. Do not copy old chat +into the new session as a substitute for checked work state. + +Proposals for review: +- Abandon and Select are not valid with Resume in the first version. Keeping + the old conversation would retain the context the user meant to set aside. +- If the caller lacks access to a required dependency, the system refuses + rather than silently omitting it. +- A relaunch first resolves the old execution's status. Starting Fresh is + not permission to leave two sessions claiming the same assignment. +- A fresh launch does not delete files or cleanse incorrect files. Retained + artifacts must be distinguished from active work records. + +These rules need lifecycle and failure details before implementation. See +[open decisions](2026-09-06_workspace-schema-and-audit.md#7-open-decisions). + +## 5. What the owner has tested so far + +On 2026-09-05 Jason launched the existing `researcher` definition with +workspace and session name `owner-checkpoint-1`, allowing only `read,ls`. +The supplied terminal output showed Pi 0.84.4, a successful model response, +and an empty `/var/lib/mosaic/workspaces/owner-checkpoint-1` listing through +`ls`. After exiting and relaunching, the agent recalled a phrase from the +conversation without a tool call. + +This demonstrates the observed launch/list/resume path. It does not prove +cross-workspace access controls, long-conversation correctness, execution +auditing, Fresh mission recovery, or any project model. Fresh was discussed +but not demonstrated. This plan does not infer broad user acceptance from +the earlier test or mark unfinished tests as passed. + +## 6. Current code references, not future guarantees + +All source references below are at the baseline commit named above. These +are starting points for the later independent analysis, not its verdict. + +| Current behavior | Source | +|---|---| +| On every launch, agent defaults and role are read from a definition and current seat SOUL is copied to a shared per-agent runtime location. This is not a one-time copy or a live update to already-running instructions. | `scripts/agent.sh:78-130` | +| Session defaults to `agent-` under the global sessions directory, independently of workspace selection. | `scripts/agent.sh:132-138` | +| Role tools narrow requested tools; enabled skill definitions are resolved and passed as container paths. | `scripts/agent.sh:140-179` | +| Interactive mission is copied to `agent-missions/.json`; workspace is a separately selected folder; Compose starts the container. | `scripts/agent.sh:181-199` | +| Pi changes working directory, uses the named session directory, and adds `-c` when it is nonempty. | `adapters/pi/adapter.sh:23-50` | +| The whole data root is mounted at `/var/lib/mosaic`, not just the selected workspace. | `compose.yaml:39-43` | +| Dispatcher generates one shared system-prompt path; the loader also uses one `.partial` path and injects global user Markdown. | `src/run-agent.sh:37-41`; `src/load-contracts.sh:40-41,68-77,97` | +| Headless tasks get exclusive input snapshots and a final result containing workspace, session, tools, model, and timing. | `scripts/mosaic-task.mjs:295-325,442-466` | + +The per-agent mission/SOUL paths and shared prompt paths require explicit +concurrency analysis. Do not claim that independent workspace names already +prevent launch-time context mix-ups. No race reproduction has been performed +in this documentation phase. + +## 7. Scope and existing plans + +Authorized now: these two planning documents, CURRENT.md routing, issue +intake, and append-only build/session history. No runtime schema files, +implementation, new agent definitions, credential changes, migration, +release activation, map generation, or skill integration. + +The [auth/provider plan](2026-09-03_auth-provider-harness-registry.md), issue +#50, stays paused. Its seat-global selection and generated per-seat files +must be reconciled with concurrent workspace sessions before implementation. +OAuth refresh gate 7 is still unresolved; this plan does not approve it. + +[ROADMAP.md](ROADMAP.md) supplies earlier direction, not authority to skip +this exercise. The old registry-first maps are historical candidates, not a +complete plan for this object model. Issue #51 and untracked skills remain +separate work. No source is moved into `packages/` in this phase. + +Keep the repository canon: sole system config, no new root files, no secrets +in documents/images, reviewed role authority, and write-once run evidence +under `/runs/`. Runtime project/workspace records must not become a +second system configuration or a way to grant themselves wider authority. + +## 8. Phases, each stopped for owner review + +| Phase | Output | Required stop | +|---|---|---| +| 1. Document, behavior confirmed | Agreed requirements, proposed record shapes, initial source references, audit limitations, and open decisions. | Jason confirmed the behavior summary on 2026-09-06 and subsequently authorized phase 2. | +| 2. Resolve details, current | Exact object relationships, schemas, permissions, command behavior, state ownership, and action-record guarantees, with read-only investigation. | Q27 selects invocation-level command evidence with enforced limits. Complete the remaining details, then Jason approves a specific plan revision for mapping. | +| 3. Map with Archify | Separate current/planned diagrams and a ledger tracing launch, state, permissions, messaging, and execution receipts. | Independent map review plus Jason's visual acceptance. | +| 4. Independent gap analysis | A distinct non-authoring agent compares the pinned implementation and agreed plan; reports missing, conflicting, or unsupported connections. | A different agent reviews the report; Jason decides each finding and whether another plan/map revision is needed. | +| 5. Plan one implementation increment | Named author/reviewer, allowed paths, acceptance test, rollback, and protected operations. | Jason authorizes that one increment. | +| 6. Implement and user-test | Local suites, independent candidate review, verified release if needed, and a short test Jason performs. | Jason explicitly accepts before another increment begins. | + +Documentation, the decision interview, and phase-2 detailed design/read-only +investigation are authorized. Individual behavior rulings and documentation +completion are not full schema approval. A diagram passing rendering checks is not evidence +that its claims are correct. No review request is implied by naming a future +reviewer. + +Roles: Jason owns scope, decisions, and acceptance. Darkwing authors this +plan and coordinates. Proposed later map author: rocko. Proposed later +independent reviewer/gap analyst: filbert, if available and not a design or +map author. Proposed peer reviewer of the gap report: ms-test, if independent +of its authorship. Confirm assignments at the phase boundary. If an independent +seat is unavailable, report blocked; the author does not take its place. + +## 9. Evidence required in later phases + +Archify work must cite code and plan lines at named commits, separate facts +from proposals and external measurements, and bind spec/ledger/HTML hashes. +Use the approved lane preview and browser checks; preserve old verdicts. +A reviewer verifies the exact candidate. The later gap analyst must check +both code and plan, not infer correctness from the diagram or its author. +Unspecified paths and missing enforcement are findings, never invented edges. + +Candidate user tests, to agree before implementation: + +- Same agent in two workspaces retains different files, tasks, and chats. +- Fresh/Continue remembers an approved task but not an unrecorded chat phrase. +- Resume reopens only the intended workspace's conversation. If already + running, it reports the conflict and offers connection without auto-attach. +- Unassigned conversation and permitted inspection work; a change request + creates an authorized recorded assignment, not untracked mutations. +- Agents can read shared work records but cannot read a colleague's transcript + without a separate grant. Granting access does not auto-load the transcript. +- Change canonical SOUL while two workspaces run: both show a configuration + mismatch, retain their recorded launch inputs, and recommend Fresh. Relaunch + one workspace with the new revision; only that execution becomes current. + Verify each interface uses the same status, and task progress alone does + not produce a base-configuration warning. See R16-R17 and D16. +- Abandon preserves history and does not cancel another agent's work. +- Select includes dependency information, obtains an explicit authorized + assignment change before undertaking unfinished prerequisites, and leaves + unselected work explicit. +- An authorized reviewer accepts a routine task without a user prompt, with + criteria and evidence recorded. A plan deviation or protected action does + not inherit that permission. +- Unauthorized registration, ambiguous addressing, and stale task ownership + refuse without acting in another workspace. +- Removing one workspace membership stops affected work and blocks further + actions there while leaving independently authorized work elsewhere running. + In-flight effects are reconciled rather than declared undone. +- Only one authorized interface controls a session; observers cannot issue + controls and explicit transfer prevents the old controller from continuing. +- Fresh during active work does not overlap unsafe executions. Unknown effects + block dependent work until authorized, non-destructive investigation resolves + them or escalation occurs; no blind replay. +- Audit failure blocks affected work without unnecessarily stopping executions + that can still meet their recording requirements. +- Configuration notices cover shared behavior-affecting inputs, appear without + blocking work, and can be requested on demand without changing execution. +- Synthetic personal-journal context is absent from a coding launch unless + explicitly authorized/relevant; designated shared preferences remain usable. +- Closing a workspace preserves records and blocks new launches until reopening. + Adopting legacy sessions requires explicit reviewed assignment, not name-based + inference, and does not rewrite their historical evidence. +- A changed approved plan pauses affected actions/dependents until reconciled; + delegated reassignment and continued unaffected work retain authority evidence. +- Standard scope roles are narrowed by registration and parent/agent ceilings. + A role label alone cannot grant access to other workspaces or self-acceptance. +- Each managed action can be traced to a session, execution attempt, task, + authority decision, and evidence-backed outcome, including interrupted work. + +Later tests must cover strict schemas, cross-project references, path escape, +concurrent launch, shared-file races, stale messages, audit write failures, +and partial external effects. Terminal/desktop/web clients need situational +and accessibility tests when implemented; none are claimed by this draft. +CI runners remain owner-deferred. Local suites plus `verify.sh` are the repo +publication gate, with exact-candidate review and owner phase approval. + +No deployment or migration occurs now, so existing operation is unchanged. +Any later migration must preserve old sessions/run records, be explicit about +reset/prune effects, and have an owner-reviewed recovery and rollback test. + +## 10. First owner review + +Review R1-R33 for faithful intent. The owner authorized the grill-me interview +on 2026-09-06. Rounds 1-6, Q1-Q26, are recorded in the linked discussion. +Q25/Q26 add affected-work reconciliation after approved plan changes and +standard scope permission roles with registration-specific narrowing. + +Jason confirmed the behavior summary with "That looks correct" on 2026-09-06, +after Q1-Q26. Shared understanding of intended behavior is confirmed. This is +not whole-schema approval or a claim that every technical branch is resolved. + +Jason subsequently answered yes to phase 2: detailed records, permissions, +commands, and audit guarantees with read-only technical investigation. The +linked phase-2 candidate records the first source/document findings and proposed +common types. Jason answered Q27 A: invocation-level command evidence with +enforced limits, without a promise to enumerate every internal effect. +The explicit /goal request resumed phase 2 after reboot recovery. The schema +package now includes checked record/command shapes and semantic-rule proposals. +Jason answered Q28 A, recorded as R34. The owner-review package now reconciles +D1-D16 against the candidate schemas/rules and explicit implementation proof gates. +Phase-2 acceptance remains Jason's decision. No mapping, independent gap review, +implementation, publication, or migration follows automatically. diff --git a/docs/plans/2026-09-06_foundation-phase2-contract.md b/docs/plans/2026-09-06_foundation-phase2-contract.md new file mode 100644 index 00000000..6fb7dca9 --- /dev/null +++ b/docs/plans/2026-09-06_foundation-phase2-contract.md @@ -0,0 +1,386 @@ +# Foundation phase 2: record and operation contract candidate + +Status: phase-2 planning baseline accepted by Jason on 2026-09-06 ("accept phase 2"). Not approved for mapping +or implementation. Owner authorized this phase on 2026-09-06 after confirming +the behavior summary. Tracking: `mosaicstack/stack-v2#53`. + +Inputs: [agreed behavior R1-R33](2026-09-06_agent-project-workspace-foundation.md) +and [decision/interview record](2026-09-06_workspace-schema-and-audit.md). +This file proposes common types and operation rules. The linked +[Schema and semantic-rule package](foundation-v1-candidate/README.md) now contains +checked command/event and eleven-kind record schemas, permission bundles, +reference/lifecycle/storage rules, hash vectors, and #50 compatibility notes. +The [runtime contract](foundation-v1-candidate/RUNTIME.md) and runtime schema now +cover mediated execution/control, requests, messages and artifact bodies after +Q28 A. The [owner-review package](foundation-v1-candidate/REVIEW.md) reconciles +D1-D16 and lists unproved implementation gates. None of this is implemented runtime behavior. No new owner requirement is inferred from a technical proposal. + +## 1. Evidence boundary + +Repository baseline: `69d1bb3aa4b826218aa4cca3710f2d98c0b9d7ba`. +The inspected source files have no working-tree difference from that commit. +Existing runtime image: `mosaic-poc-agent:0.84.4-r0.0.12`, image ID +`sha256:a72aa79f98e54c3c974f5ad08b82e1643a4aa6eff259ac891b738120ba963ca1`. + +A tool-free worker examined supplied, line-numbered source excerpts through +`scripts/run-task.sh`. Task specification: +[`tasks/foundation-phase2-source-facts.json`](../../tasks/foundation-phase2-source-facts.json). +Run: `r-20260906T024609Z-68ee7f`, under `/runs/`. +`result.json` SHA-256: +`e81ac68a369a9315d827e6fc7117033f794ab7b214d2610ca07081a668045875`. +The run reports success, exit 0, no tools or persistent session, and 1490 +whitespace-delimited response words. This is a source-analysis response, not +an independent review verdict or a runtime test of the proposed controls. + +Author checks qualify the worker's suggestions: + +- One supplied excerpt header says `adapters/pi/adapter.sh:65-106`, although + the file ends at line 96. The supplied numbered text and worker's executable + citations end at 96. Preserve that input as recorded; no lines 97-106 exist. +- A recorded stdout response is not a trusted account of arbitrary side effects. +- The exclusive active-work key must include agent/project/workspace, not a + session ID that lets two different Fresh sessions evade the same-scope limit. +- A session transcript grows. Verify identity, supported format, and accepted + checkpoints; do not mistake its changing content hash for corruption. +- `--no-extensions` disables discovery, not explicitly supplied `-e` extensions. + The current adapter supplies no `-e`; future reviewed extensions are possible, + but their enforcement and failure behavior need investigation. +- Command receipts and complete internal file/network tracing are different + guarantees. The worker's suggestions do not settle their required granularity. + +### 1.1 Pinned Pi documentation + +Host Pi is 0.85.1. Its documentation was not used as proof of 0.84.4 behavior. +The author copied the 0.84.4 package's README, package metadata, docs, and +examples from the existing image using `docker create` and `docker cp`. +The extraction container was never started and was removed afterward. No +credentials, runtime sessions, or user-context files were copied. Temporary +extraction: `/tmp/mosaic-foundation-pi-0844.poVO9d`. + +To reproduce, create an unstarted container from the exact image ID above and +copy the named files under +`/opt/app/node_modules/@earendil-works/pi-coding-agent/`. Do not substitute a +newly installed host version. The temporary directory is not canonical evidence; +the image ID, file paths, and hashes identify the documentation used. + +| Package file | SHA-256 | +|---|---| +| `package.json` | `db9fead11bd2ddf7a327d2c2d11b535f30d059241c251d376837d5ab638a5576` | +| `README.md` | `f2ffe4e825ea457ecb728cabbb15b545655cda2e3bab9b5b1fc28b950a3abd08` | +| `docs/rpc.md` | `010811d3526435b4fff5b03ee3a40f5bcb47fa17d5034fbd6b598955f56020d7` | +| `docs/json.md` | `094b8d1b25aebd949334b695b18e8e7e73d934b82337439af12f6936d73aca84` | +| `docs/session-format.md` | `c0f25475ab08fb96e244e6bf433aeaa41b69bfb5a52de5c7b01b81c900a84a54` | +| `docs/security.md` | `5df4b27e7b0db49f50807f0e5d8a77e6dc099c76adab6edf21c5b705ede6efab` | +| `docs/containerization.md` | `29ac379f744052adf301e744559cb43d0e6e84d1b04f4757f1710680991be10b` | + +README and these five documentation files were read completely. They establish +documented capabilities and cautions, not measured implementation behavior. +No SDK, extension, RPC client, or isolation mechanism was implemented or tested. + +### 1.2 Findings that constrain the contract + +| Evidence | Supported statement | Design consequence, still proposed | +|---|---|---| +| `scripts/agent.sh:132-138`; `adapters/pi/adapter.sh:29-44` | Session default is per agent; nonempty session directory causes `-c`. | Replace latest-file inference with a scoped conversation index and exact session binding. | +| Pinned README, Session options; `docs/session-format.md:386-438` | Pi documents exact session selection and session-manager APIs. | Mosaic can investigate using an exact validated path; no need to expose partial UUID search to clients. | +| Pinned `docs/session-format.md:19-27` | Older session formats are automatically migrated when loaded. | Preserve a legacy source before any reviewed adoption/conversion; do not load original historical files merely to inspect them. | +| `scripts/agent.sh:121-123,181-185`; `src/run-agent.sh:37-41`; `src/load-contracts.sh:40-41,97` | SOUL, mission, and generated prompt locations are shared by agent or data root. | Resolve stable execution-specific inputs and avoid shared temporary-file names. No race reproduction is claimed. | +| `scripts/agent.sh:144-162`; `scripts/mosaic-task.mjs:364-378` | Interactive path intersects role tools; headless path intersects mission/task tools. | One future authorization resolver must apply all applicable ceilings on both paths. Current checks are not a project/workspace RBAC system. | +| `compose.yaml:39-43`; pinned `docs/security.md:31-37` | Broad data-root mount; Pi explicitly has no built-in sandbox. | Tool names and working directory cannot establish cross-workspace privacy or evidence protection. | +| `scripts/mosaic-task.mjs:295-302,408-466` | Exclusive-create snapshots/results and Compose process outcome, not a complete trusted action ledger. | Separate invocation outcome, external effect, acceptance, and confirmed execution termination. | +| Pinned `docs/rpc.md:43-80,905-911,1012-1060` | Prompt acceptance, settled processing, and tool events are documented and distinct. | Acceptance of an RPC prompt is not task acceptance; events alone are not durable pre-action authorization. | +| Pinned `docs/rpc.md:124-184,479-550,620-642` | Abort, queue clearing, direct bash, and session switching are separate commands. A session switch can be cancelled while the response says success. | Do not pass arbitrary raw RPC commands through a Mosaic connection. Do not equate abort acknowledgement or idle processing with process death. | +| `adapters/pi/adapter.sh:81-96` | Mosaic currently runs plain print or native interactive mode, with no explicit extension or RPC invocation. | Documented Pi integration options are not already implemented Mosaic attachment, control-transfer, or audit guarantees. | + +## 2. Proposed common record types + +Plain-language rule: an ID names an object, a revision names the exact approved +copy, and a scope names where it belongs. A display name is only a label. +These proposed types are shared across records; they are not fields accepted +by today's task runner. + +| Type | Exact proposed representation and validation | +|---|---| +| `Id` | String matching `^[a-z0-9][a-z0-9._-]{0,63}$`. New runtime IDs use lowercase UUID v4; reject collisions with exclusive allocation. Existing definition IDs require explicit resolution, not a guessed alias. | +| `Revision` | Integer from 1 through 9007199254740991. A create request expects revision 0 to mean absent; 0 is never a persisted revision. | +| `UtcTime` | A valid UTC instant encoded as `YYYY-MM-DDTHH:mm:ss.sssZ`. Validate calendar/time values as well as shape. Wall-clock time is not proof of causal order. | +| `Digest` | String `sha256:` followed by exactly 64 lowercase hexadecimal characters. A digest detects content change; it is not a signature or access grant. | +| `Scope` | Discriminated object: `{kind:"system"}`, `{kind:"project",projectId:Id}`, or `{kind:"workspace",projectId:Id,workspaceId:Id}`. No omitted or extra fields; workspace ownership must match its project. | +| `RecordRef` | `{kind:RecordKind,id:Id,scope:Scope,revision:Revision}`. Resolve exactly; a reference never means latest or grants access. `RecordKind` is the closed catalog in section 3. | +| `ActorRef` | `{kind:"human"|"service"|"agent",principalId:Id,executionId:Id|null}`. An agent requires its authenticated execution ID; human/service actors use null. Producer supplies this from verified invocation context, never from a caller's identity claim. | +| `FileTarget` | `{workspace:Scope,relativePath:string}` where scope must be workspace kind. Nonempty slash-separated relative path, at most 4096 UTF-8 bytes; reject NUL, control characters, empty components, `.`/`..`, backslashes and absolute paths. Validate filesystem containment and symlinks at use time, not merely through a string prefix check. | + +Unknown fields/versions fail validation. Required fields cannot be omitted. +Use explicit null only where the type permits it; an empty list means none, +not unrestricted. Permissions and source-reference lists contain no duplicates. +Proposed generic list limit is 1024 items and record size limit is 1 MiB of +UTF-8 JSON, with detailed evidence stored separately. Limits need workload +review before becoming an implementation contract. Reject oversize input; +never silently truncate authority, dependencies, or recovery context. + +Common envelope for declarative records: `schemaVersion:1`, `kind:RecordKind`, +`id:Id`, `scope:Scope`, `revision:Revision`, `createdAt:UtcTime`, +`createdBy:ActorRef`, `supersedes:RecordRef|null`, and `authorizationRef:Id`. +`authorizationRef` resolves a trusted authorization event, not a recursive grant +from the record being created. System bootstrap authority resolves to reviewed +policy and the authenticated owner; no record may authorize its own creation. + +The first revision has null `supersedes`. Later revisions reference the exact +previous revision of the same object and immutable owning scope. A mutable +current index is a rebuildable view, not the authoritative history. + +## 3. Record catalog and ownership + +The catalog names proposed types, not approved role or directory additions. +Fields below supplement the common envelope. Complete per-kind field types, +conditional requirements, and transition validation are still being drafted. +There is deliberately no unrestricted `metadata` or `permissions:any` field. + +| RecordKind | Payload to define | Authorized writer | +|---|---|---| +| `agent-definition` | Display name, reusable type, harness reference, canonical SOUL/instruction/skill references, reviewed role ceiling and configuration references. | Reviewed configuration author, not a workspace worker. | +| `project` | Display name, policy reference and lifecycle. | Authorized project administration. | +| `workspace` | Display name, parent project via scope, policy reference, lifecycle and logical working-file root. | Authorized workspace administration. | +| `registration` | Agent ID, scope role reference, narrowing restriction set, active/revoked status and delegation reference. Project and workspace registrations are separate records. | Actor with bounded registration authority. | +| `mission` | Objective, criteria, lifecycle, optional parent project-mission reference and policy restrictions. Project missions have no workspace parent. | Authorized work owner. | +| `task` | Purpose, criteria, optional mission reference, approved intent reference, dependencies and lifecycle. An ad-hoc task still needs purpose/criteria and explicit authorization. | Authorized work owner/coordinator. | +| `assignment` | Exact task reference, agent ID, lifecycle, assigned policy/work revisions and coordinator decision. | Authorized coordinator; progress does not grant assignment authority. | +| `decision` | Decision kind, approved intent/evidence references, affected records, delegation bounds and decision outcome. | Authorized decision maker. Acceptance checks authorship independence separately. | +| `session` | Agent ID, immutable project/workspace scope, creation mode, predecessor reference and exact harness identity binding. | Launch resolver; lifecycle observations are separate events. | +| `context-source` | Content reference, revision/digest, owner, permitted scopes, context category and explicit sharing designation. | Authorized context publisher. Relevance cannot invent a grant. | +| `adapter-capability` | Adapter/package identity, supported operations, observable and enforceable action classes, tested coverage references and limitations. | Reviewed adapter authority. A worker cannot self-certify coverage. | + +Execution, active claim, connection, message, context manifest, and audit event +are runtime evidence types, not mutable declarative records. Their complete +envelopes remain a dependent drafting task. Do not force them into a common +mutable `status` record or rewrite a run to update its progress. + +## 4. Permission resolution + +Proposed operations are distinct from tool names. A `read` tool grant does not +imply permission to read another conversation, credential, or audit payload. + +An action must satisfy both the requester's authority to request it and the +performer's authority to execute it. The performer is bounded by reviewed +agent policy, project registration, explicit workspace registration, applicable +parent/workspace mission policy, task policy, and launch restrictions. Resolve +all required references before taking the intersection. Missing/invalid required +policy is an error, not an empty policy to skip. An optional absent restriction +adds no grant and does not remove any ancestor ceiling. + +Each layer checks operations and their targets. Project participation alone +never admits a workspace action. Multiple assignments do not produce a union +that lets an action borrow another task's wider grant. Bind a changing action +to one explicit assignment and current intent revision. Tool availability is +only a coarse filter before per-action authorization. + +Proposed standard role catalog for later review: + +- Reader: permitted work records and scoped file inspection. +- Contributor: permitted inspection plus assigned file changes and result + submission, with command execution subject to Q27's invocation-audit ruling + and verified permission, containment, and evidence checks. +- Reviewer: permitted evidence inspection and independent routine acceptance. +- Coordinator: permitted within-plan decomposition and assignment changes. + +These roles are not a rank hierarchy. Coordinator does not automatically mean +file writer, reviewer, membership administrator, or credential administrator. +Separate explicit grants govern registration, conversation reading/observation, +control transfer, retirement/reopening, and protected operations. Exact operation +sets and any combined standard roles need review. Shared role authority still +changes only through reviewed commits under `roles/`; no live role-policy file +was added or modified during this phase. + +## 5. Proposed command contract + +Use the target `mosaic` command family already proposed by #50. These spellings +are candidate interface decisions, not commands to run today. Terminal, +desktop, web, and service clients submit the same authorized operations. + +| Candidate command | Operation/result rule | +|---|---| +| `mosaic agent resume --project --workspace [--session ]` | Default launch operation. Use exact session if provided; otherwise use the authoritative current scoped session. Genuine first use creates and announces initial conversation. Missing established history refuses. | +| `mosaic agent fresh --project --workspace ` | New conversation, no old chat/automatic summary. During active work, request controlled replacement; do not overlap executions. | +| Work flags for Resume/Fresh: `--work continue|select|abandon|none`, repeatable `--assignment ` | Omitted work flag means continue selected assignments. No selected work means taskless conversation/inspection, not arbitrary changes. Select/Abandon require explicit assignment IDs. Abandon ends only those assignments. Validate referenced revisions before launch. | +| `mosaic execution connect --mode control|observe` | Exact active execution, explicit authorization. Control is exclusive; observe needs conversation access. No automatic connection from a conflict response. | +| `mosaic execution transfer --to-connection --expected-generation ` | Explicit authorized transfer; old generation stops admitting control input. Being an observer is not permission to take control. | +| `mosaic execution config-check ` | Return matching/changed/unknown, launch/current references and check time. Automatic non-blocking notices use the same comparison record. | +| `mosaic workspace retire --project ` | Stop admitting new work, safely stop/reconcile active work, retain files/history. Report retirement pending if safety is unresolved. | +| `mosaic workspace reopen --project ` | Revalidate current policy and membership; no automatic restoration of revoked access or launch. Exact assignment reactivation rules need review. | + +The runtime schema now fixes `requestVersion:1`, `requestId:RuntimeId`, +`operation`, `scope`, `expectedRefs:RecordRef[]`, `assignmentRef` and closed +`parameters`. Input and command requests have their own narrower shapes. The +service supplies authenticated actor and authorization; clients cannot submit +trusted producer/outcome records. + +The runtime schema defines the common response: version, request ID, outcome, +reason code, optional execution ID and classified receipt/data references. +Accepted means durable admission, not completion. Success/acceptance cannot have +null receipts. Invalid/unauthorized pre-admission refusals and audit failures are +not success receipts. Already-active identity requires authorization; wrappers +never silently connect or Fresh. + +The linked runtime contract supplies all 29 operation names, request coverage, +error codes, JSON stdin/file semantics, message routing and #50 boundaries. CLI +presentation/aliases in a later charter must map to these same operations. + +## 6. Ordering and recovery obligations + +1. Authenticate and validate before resolving private state for a caller. +2. Resolve exact record revisions, scope, permission, and expected audit coverage. +3. Serialize active-work admission by agent/project/workspace. Default limit is + one, independent of session ID. Validate history before claiming first use. +4. Commit authorization and intent to trusted durable storage before effects. + Proposed durability requires file flush plus parent-directory flush and + atomic publication on a supported local filesystem; unsupported storage + refuses. Crash-order and multi-record commit mechanics still need design. +5. Resolve exact immutable launch inputs and record the manifest. A successful + spawn is not a confirmed session binding; require adapter identity evidence. +6. Serialize controller changes separately by execution ID and generation. + Reject stale generations for new input even if an old connection still lives. +7. Before managed actions, recheck policy, assignment/plan revisions, active + claim generation and required recording. A changed approved plan pauses + affected work; a shared base-configuration notice alone does not. +8. For replacement/revocation/retirement, close admission first, account for + queued requests, settle or identify outstanding effects, and confirm the + execution can no longer act before admitting conflicting new work. +9. Append observations and recovery decisions. A timeout, abort acknowledgement, + or Pi `agent_settled` event alone does not prove container/process termination. + +A scoped conversation index must retain initial-creation history and missing/ +pruned-session tombstones. A missing index is not proof of first use. Retrying +a request must resolve its prior durable decision; a timeout or missing response +must not replay an external action. Request identity binds authenticated actor, +operation, scope, and normalized arguments. Reuse with different arguments is +an error. Tombstone retention and post-prune retry behavior remain unresolved. + +The enforcing runtime component is not an autonomous conductor agent. It has +only its reviewed operation authority; changing a task's state cannot change +policy. Required audit failure blocks affected actions, including recovery +checks that cannot meet their own recording requirements. + +## 7. Storage and evidence + +Keep immutable execution evidence under `/runs/`. A proposed new +execution record uses its run directory as the evidence owner; projects and +workspaces reference it instead of maintaining competing result copies. +Existing v1 records are never rewritten or silently reinterpreted as v2 evidence. + +Keep conversation bytes under `/sessions/`, but resolve them through +explicit scoped metadata rather than directory naming. Do not mount all sessions, +all runs, all user context, or the whole data root into a worker's tool-accessible +filesystem. Only the necessary approved inputs and working paths are exposed. +A trusted recorder must be outside worker write permissions. OS ownership and +mount tests must verify these boundaries before any isolation claim. + +Proposed metadata ownership: project/workspace records in their dedicated +runtime metadata namespace; current indexes under a derived system state +namespace. No actual directory choice or second configuration file is installed. +Exact paths, per-directory writers/readers, export, retention, prune/reset +references, and rollback must be specified before schema approval. + +Legacy adoption makes a new mapping receipt. Preserve the original source and +its identity before adapter conversion. Pi's documented automatic format +migration is a reason to inspect metadata without opening a legacy session in +Pi. Fresh does not load an adopted transcript just because it is accessible. + +## 8. Configuration fingerprints + +Proposed algorithm: SHA-256 over a versioned canonical JSON manifest using RFC +8785 serialization. Hash exact instruction/SOUL bytes as referenced content; +normalize structured settings through their strict schema first. Preserve +instruction order; sort set-valued permissions and source inventories by their +explicit stable keys. Publish test vectors before implementing the comparator. + +Comparable base configuration covers canonical SOUL/shared instructions, +applicable enabled skills and their dependency content, canonical harness/model +settings, and reviewed role configuration. Exclude timestamps, display labels, +chat, task progress, private user context, and credentials. Content changes must +be detected even if a path stays the same. Do not hash unrelated skills merely +because they are installed. + +The full launch manifest separately binds execution identity, selected approved +context, effective restrictions, session choice, adapter/image identity, and +non-secret credential-account reference where authorized. Its hash naturally +differs between launches. Never compare full launch hashes as the base-config +change test. Private context source references/digests remain access-controlled. + +Exact included JSON keys, skill dependency inventory rules, configuration +revision races, approved launch overrides, and notification transport still +need D10/D16 design and #50 reconciliation. A launch fingerprint is not continuous +proof of live process state, and a changed role grant may require immediate +revocation rather than waiting for Fresh. + +## 9. Owner decision after investigation + +### Q27: command-level evidence or internal-effect evidence + +A command such as `npm test` can invoke other processes, read/write many files, +and attempt network access. Pinned Pi documents tool invocation/result events; +it explicitly does not provide a sandbox. Mosaic's current adapter does not +capture those events as a trusted per-action ledger. + +Choices presented to the owner; Jason selected A on 2026-09-06: + +- A: for the initial managed command facility, record the authorized command + invocation, actor/scope/assignment, enforced filesystem/network limits, + start/end, outcome, and controlled evidence references. Be explicit that this + does not separately enumerate every internal file read/write or network call. +- B: require separately attributable internal file/network effects before + enabling command execution. Keep commands unavailable until that stronger + coverage is designed and verified. + +Owner ruling: A, with real sandbox enforcement and honest coverage labels. +This keeps test/build commands practical while preserving accountable invocation +and fail-closed admission. Use typed, allowlisted command metadata. Neither +events nor detailed evidence may contain credentials; unfiltered argument, +environment, and output capture is not approved. The ruling does not waive +workspace isolation, credential protection, action recording, revocation, +or uncertainty recovery. A command +whose effects cannot stay within the authorized boundary must still refuse. + +This ruling settles D11's command-audit granularity, not a specific sandbox, +RPC/SDK choice, product UI replacement, or implementation increment. It does +not grant shell access to any current research worker. + +## 10. Phase-2 exit gate remains open + +Q27 and Q28 are answered; R34 records the managed-terminal ruling. Runtime, +control/input, command artifacts, permission/routing/recovery rules and the +D1-D16 reconciliation now form an owner-review candidate. Jason's specific +phase-2 acceptance is now recorded. Implementation must prove the listed mechanisms; +any change to owner behavior returns for a new decision. + +Candidate acceptance evidence must include negative schema fixtures, reference +and permission checks, representative lifecycle/crash traces, hash test vectors, +and a capability matrix that distinguishes documented, code-inspected, and +runtime-tested support. Current evidence is source/document inspection and author +schema/hash/synthetic-model checks only. No +runtime feature or security guarantee, independent verdict, whole-schema approval, +or readiness for mapping follows from this draft. + +## 11. Continuing goal task record + +Goal: issue-53-phase2. Owner: Jason. Assigned author: darkwing in the explicit +repository working directory. The repeated /goal request resumes this existing +assignment; it does not create a second authority record. CURRENT owns live +control state; BUILD-LOG and SESSIONS hold append-only history. + +| Task | Criterion and dependencies | Status and evidence | +|---|---|---| +| P2-1 | Recover Q1-Q27 requirements and pre-reboot work. | Done for author recovery; R1-R33 and preserved source/run evidence. | +| P2-2 | Repair command/record/path schemas and fixtures after P2-1. | Author checks pass: 38 command cases, 38 record cases, 16 path cases, plus 5 deliberately shape-valid forgeries. Runtime semantics remain separate. | +| P2-3 | Define permission/reference/lifecycle/storage rules after P2-2. | Review proposals in schema package sections 2-6; no live policy installed. | +| P2-4 | Define comparable fingerprints and reconcile #50 boundaries. | Seven restricted-domain vectors pass; package sections 6.1-6.2 retain the unresolved OAuth gate. | +| P2-5 | Choose managed terminal requirement and finalize affected execution/control/artifact schemas. | Author checkpoint complete after Jason's Q28 A. Runtime schema, fixtures and RUNTIME.md provide the review candidate; no runtime capability is claimed. | +| P2-6 | Assemble exact-candidate review package, trace D1-D16, and recommend one testable increment. Depends on P2-5. | Owner package in REVIEW.md; 155 runtime cases and 35 synthetic rule-model cases supplement earlier checks. First recommendation refined to a read-only synthetic scope/permission inspector, not live registration. | +| P2-7 | Obtain Jason's specific phase-2 acceptance after P2-6. | Done: Jason said "accept phase 2" after clarification that this accepts the planning baseline, not security certification or implementation. Goal satisfied; later mapping/implementation still require separate authority. | + +Jason clarified that /goal belongs to the separate ~/.mosaic deployment, not +this environment. Continue through existing file-based records. No extension +installation, active --wait-timeout 60, or automatic follow-up was requested for +this phase-2 session. Separate #54 native-extension work is not part of this goal; +this session has not migrated its goal state or configured that extension. +Owner waits are manual and never expire into approval. No numeric work budget was supplied; aggregate usage is +unavailable, not reset on resumption. diff --git a/docs/plans/2026-09-06_workspace-schema-and-audit.md b/docs/plans/2026-09-06_workspace-schema-and-audit.md new file mode 100644 index 00000000..8f63644c --- /dev/null +++ b/docs/plans/2026-09-06_workspace-schema-and-audit.md @@ -0,0 +1,873 @@ +# Workspace schema and execution audit discussion + +Status: proposed details for owner review, not an implementation contract. +Date: 2026-09-06. Parent plan: +[Agent, project, and workspace foundation](2026-09-06_agent-project-workspace-foundation.md). +Tracking: `mosaicstack/stack-v2#53`. + +Field names, enums, enforcement mechanisms, and storage suggestions in this +file are proposals. Behavior explicitly recorded as an owner ruling is agreed; +exact transition schemas remain proposed. JSON blocks are illustrative records, +not JSON Schemas. Requirements R1-R33 come from the owner discussion in the +parent plan. +Section 2.1 records the 2026-09-06 owner ruling; its field names and hash +mechanics are still proposals, not additional approved schema decisions. +Phase 2 now authorizes detailed drafting and read-only investigation. See the +[Record and operation contract candidate](2026-09-06_foundation-phase2-contract.md). +Adopting a schema or changing runtime behavior still requires later approval. + +## 1. Identity and ownership + +Proposed rule: stable IDs identify records; display names are editable labels. +Names such as `code-be-01` remain useful to people but are not sufficient to +identify an execution attempt. Use explicit composite references, not a +flattened name such as `agent-project-workspace` that can be misparsed. + +| Record | Proposed required information | Owner and scope | +|---|---|---| +| Agent definition | Schema version, agent ID, name, type, harness reference, SOUL reference, role/policy reference, configuration revision | Reviewed shared identity/configuration. No mission progress or project-specific chat. | +| Project | Version, project ID, name, policy reference, revision | Authorized project administration. Contains workspaces; references registered agents. | +| Project registration | Project ID, agent ID, scope role reference and narrowing restrictions, status, revision, granting actor and decision reference | Authorized administrator. Explicit visibility and participation grant, not an agent self-enrollment claim. | +| Workspace | Version, project ID, workspace ID, name, revision, logical file/state references | Authorized workspace administration. Exactly one parent project, confirmed by owner Q5. | +| Workspace registration | Project ID, workspace ID, agent ID, scope role reference and narrowing restrictions, status, revision, granting actor and decision reference | Requires valid project registration. May narrow but not widen it. | +| Mission | Version, mission ID, owning scope, objective, acceptance criteria, status, revision | An authorized work owner. Scope and single-parent relationships are decided in D1; exact fields and lifecycle transitions remain to be specified. | +| Task | Version, task ID, optional mission reference, owning workspace reference, purpose/acceptance criteria, dependencies, status, revision | Work owner sets intent; Q10 permits lightweight assignments without lengthy mission setup. Exact ad-hoc task shape remains proposed. Execution results do not automatically imply acceptance. | +| Assignment | Version, assignment ID, task reference, agent ID, full scope, revision, active claim reference | Work coordinator. Distinct from the reusable agent definition and from one attempt to execute it. | +| Session | Version, session ID, agent/project/workspace IDs, harness session reference, creation mode, predecessor reference when applicable | Workspace-scoped conversation metadata. Scope is immutable. Does not store credentials. | +| Execution | Version, execution ID, full scope, session ID, launch decision, claim ID/generation, start evidence, resolved-context reference, launch/configuration hash references | Runtime-created attempt record. Resume retains session ID but creates a new execution ID. | +| Connection | Version, connection ID, authenticated client actor, session/execution references, observer/controller mode, control generation, admission decision, lifecycle | Proposed representation of Q16. One controlling interface; observation and transfer require permission. Connection is not another agent execution. | +| Context manifest | Version, immutable manifest ID, source references/revisions, selected assignments, resolved skills/policies, prior-session inclusion rule | Launch resolver. Records exactly which approved inputs were supplied. | +| Event | Version, event ID, event kind, subject references, actor/execution identity, observation source, outcome/evidence references | Trusted producer, append-only. An agent's narrative is not execution evidence. | + +A field that is optional needs an explicit absence rule in the eventual +schema. Do not use a missing grant to mean unrestricted access, an absent +workspace to mean the last-used workspace, or a missing task to mean any task. +Owner Q10 permits conversation and allowed workspace inspection without a +mission/task, but scope, permissions, and session/execution identity still +apply. Requests to change things become explicit recorded assignments without +lengthy mission setup. Proposed task representation permits no mission reference +for such work, while requiring purpose and acceptance criteria. Missing mission +is not an unrestricted grant. Taskless read/conversation event fields and the +first guaranteed action-audit set remain D11. + +Proposed formal-schema requirements: + +- Every record has a version; reject unsupported versions and unknown fields. +- References resolve to the intended scope and permitted record version. +- Workspace ID alone is never a sufficient cross-project address. +- Parent and membership status are checked, not just file existence. Owner + Q5 requires single-parent hierarchy: each workspace has exactly one project; + each workspace mission has at most one parent project mission, with standalone + missions still owned by their workspace. Dependencies are separate typed + references, not parents, ownership duplication, or access grants. +- Display names never authorize access or select paths by themselves. +- IDs and relative paths reject traversal, separators where inappropriate, + symlink escape, and collisions. Missing targets refuse; do not auto-enroll. +- Changed declarative records create new revisions. Immutable snapshots retain + the exact revision used by a launch. Authority cannot change through state. +- Final schemas must specify timestamp format, ID generation, uniqueness, + array limits, status transitions, null/absence rules, and secret exclusions. + +### 1.1 Scope permission roles, owner Q26 + +Use standard permission roles to simplify project/workspace registration, with +registration-specific restrictions that narrow them. Reader, contributor, +reviewer, and coordinator were examples, not an approved role catalog. + +A scope role grants operations in the named scope; it does not change the +agent's identity/type or expand reviewed role authority. Grants remain bounded +by agent, project, workspace, mission, and task policy where applicable. Missing +scope membership still refuses access. A reviewer role does not authorize +accepting the holder's own delivery. Grant changes and role-definition changes +are different operations; shared authority changes still require reviewed +commits under repository policy. + +Exact role names, permission sets, catalog representation, membership fields, +and enforcement remain D3. Proposed references in section 1 are not an approved +RBAC schema or a new configuration location. + +## 2. Launch request and resolved context + +Illustrative request for a new conversation continuing established work: + +```json +{ + "launchVersion": 1, + "requestId": "req-001", + "agentId": "code-be-01", + "projectId": "mosaic-stack-v2", + "workspaceId": "sessions", + "conversation": { + "operation": "fresh" + }, + "work": { + "operation": "continue", + "assignmentIds": ["assignment-014"], + "expectedStateRevision": 7 + } +} +``` + +Names are illustrative IDs. Authentication is not established by this JSON. +The service must attach the verified requesting user/service identity from +the authenticated invocation. A client-supplied actor field cannot grant +permission. `requestId` detects duplicate requests; its exact retry semantics +and storage lifetime remain D8. + +Resume instead names `conversation.operation: resume` and an exact `sessionId`, +or uses a documented unambiguous current-session lookup in the same scope. +Owner Q4 ruling: if that scope has never had a conversation, default launch +creates the initial conversation and announces it without an offer. Record +initial creation as distinct from a successful resume. An established session +that is missing or damaged causes an error, not automatic replacement. How +first-use history is established and retained needs a storage/recovery design; +absence of a transcript file alone is insufficient proof of first use. +Fresh allocates a new session ID. Selecting work requires explicit assignment +or task IDs; the exact record fields remain to be specified. Owner Q8 limits +default Abandon to this agent's selected assignments; underlying work remains +unless separately cancelled with authority. Q9 requires an explicit authorized +assignment change before undertaking an unfinished prerequisite, not automatic +addition to the selected work. Authorization can be delegated within the +approved plan under Q7; it need not involve a human prompt for every change. + +Proposed launch sequence: + +1. Authenticate the requester and validate the entire request. +2. Resolve the agent definition, project, workspace, and both registrations. +3. Check project/workspace visibility and action rights. Derive effective + authority from the agent ceiling and applicable registrations, mission, + task, and explicit launch restriction. A lower layer never widens it. +4. Resolve work references and dependencies against the expected state + revision. State that changed during the decision causes reconciliation or + refusal, not an unnoticed switch to a different assignment. +5. Resolve Resume/Fresh and any active execution. An active Resume returns the + Q11/Q15 conflict result or user offer, not another launch. Q17 Fresh requests + controlled replacement: stop new actions, preserve checked state, resolve or + identify in-flight effects, and confirm safety before acquiring a new active + claim. Uncertain safety blocks replacement, never starts competing work. +6. Generate execution-specific inputs and a context manifest. Paths to work + state come from the selected workspace, never the agent's global seat dir. +7. Persist the launch decision and identity binding before starting work. + Record a start result separately. Refusal and failed start are not success. +8. Start the program through its reviewed adapter using the exact context. + Record actual startup and bind its session/process to the execution ID. +9. On exit or interruption, preserve evidence and reconcile active claims. + A missing completion record means unknown/interrupted, not successful. + +These are semantic steps, not a claim that multiple file writes are one +transaction. Crash ordering, claim recovery, and adapter support require +explicit design and tests. They are D7-D9 and D12. + +Context content approved in owner Q6, with field layout still proposed: + +- Assigned mission and success criteria, current assigned tasks and status. +- Relevant approved project/workspace decisions, not all project history. +- Dependencies, blockers, and references to verified results. +- A proposed next step, visibly distinguished from authorized assignment. +- Unverified notes remain labelled as unverified. +- No old conversation or automatic chat summary for Fresh. Resume retains only + its authorized conversation; old session IDs may remain as audit references. + +Shared governance, identity, and skills still apply through the launch contract. +Owner Q22: user context is not automatically the whole profile. Only explicitly +designated general preferences are shared by default; personal/project-specific +information is supplied where authorized and relevant. Record selected source +references/revisions without copying private content into public metadata. +The exact source/revision representation, context grants, and publishers of +checked state remain schema details. This decision does not change the current +user-context files, dispatch implementation, or install a filtering mechanism. + +A generated summary of work can help reading, but cannot replace source +records or convert an agent claim into accepted state. Fresh must not quietly +follow a transcript reference and reload the discarded conversation. Any +intentional historical lookup needs an explicit policy and visible record. + +The context manifest should record non-secret source identity/revision, +resolved skill versions, effective policy reference, release/image identity, +harness/provider/model selection, included work, and generation time. Hashes +may bind non-secret content, but do not hash credentials into public records. +Input manifests are execution-specific and write-once; shared prompt scratch +files or per-agent mutable mission files do not meet this proposal. + +### 2.1 Canonical configuration and change notices + +Owner ruling, 2026-09-06, R16-R17: keep canonical SOUL shared by agent identity, +load the current approved revision on each Resume or Fresh launch, and retain +execution-specific launch inputs. Running instructions are not silently +replaced. All TUI/GUI/WUI clients can reference the launch hash and display a +canonical-versus-running configuration mismatch with a Fresh recommendation. +A new configuration does not automatically restart sessions or abandon work. + +Owner Q20: cover shared behavior-affecting agent configuration, not just SOUL. +Included categories are SOUL, shared instructions, applicable enabled skill +versions, harness/model settings, and role configuration. Exclude credentials, +conversation history, and changing task progress. Q21: display automatic, +non-blocking mismatch notices and support on-demand checks. Keep the mismatch +visible without repeated interruption, and make details available. Permission +removal is enforced separately, not delayed behind a Fresh recommendation. + +Illustrative notice, wording still for review: + +```text +Darkwing / Mosaic Stack v2 / sessions +Agent configuration changed since this session started. +Start Fresh with the current configuration to continue your saved work. +Details: running configuration, current configuration, launch record. +``` + +Proposed record and comparison mechanics: + +- `launchManifestHash` binds the complete non-secret input manifest for one + execution. It identifies the recorded launch, not the latest desired state. +- `agentConfigHashAtLaunch` identifies the comparable canonical agent + configuration loaded by that execution, including SOUL content/version. +- A shared status operation returns the execution and launch references, + stored configuration hash, current canonical configuration hash/revision, + check time, comparison status, and Fresh recommendation. All clients use + this operation with the same access checks, not private copies of SOUL. +- Compute both configuration hashes using the same versioned input definition + and deterministic representation. Q20 establishes included categories; exact + field/dependency coverage, algorithm, and encoding remain D16. Hash applicable + shared content, not just its path or unrelated enabled resources. +- Do not compare whole launch manifests for configuration drift: execution + IDs, timestamps, and workspace/task selections legitimately differ between + launches. Ordinary work-state changes must not look like base-config edits. +- Do not include secret values or hashes of secrets. Credential refresh and + selection need their own lifecycle; this notice does not solve #50. +- Status is `matching`, `changed`, or `unknown`. Missing canonical data, + unsupported hash format, or unverified loaded inputs cannot report matching. + Never rewrite an old launch hash to make a running session look current. +- Pin a consistent input snapshot before starting the execution. If canonical + configuration changes during startup, compare against that exact snapshot + afterward; never label a mixture of two revisions as the loaded state. +- A launch fingerprint describes what was supplied and verified at startup. + It is not continuous proof that nothing in the process changed afterward. + Any supported in-process reconfiguration needs a new observed event/status + model; until then, such changes cannot be represented as verified matching. +- Record comparison observations with execution ID, compared revisions/hashes, + check time, source, and reason, without exposing private configuration. + Canonical changes need their own actor/revision record. Notification delivery + does not count as relaunch or adoption of the new configuration. +- Resume with changed configuration warns that the retained conversation can + still reflect old instructions. Fresh starts without that conversation; + adopting the new configuration does not clear the workspace or choose + Abandon on the user's behalf. + +Q21 settles automatic non-blocking notices plus on-demand checking. Transport, +change-detection mechanism, acknowledgement behavior, and notification frequency +remain D16. No polling service is installed or implementation authorized by +this decision. Short hashes may be shown for readability; the full values and +source revisions must remain available through the authorized launch record. +Hashes provide comparison and evidence binding, not permission or proof of +safe behavior. Permission revocation still follows D3 and managed-action +checks; an old launch snapshot is not a right to keep revoked authority. + +## 3. State is work data, not authority + +Proposed separation: + +| Information | How it changes | +|---|---| +| Desired mission, task, membership, and policy | Authorized, versioned changes. Workers cannot elevate grants through progress notes. | +| Observations and decisions | Append-only events with actor, scope, source, and evidence. Corrections reference the earlier event. | +| Current task/project/workspace status | A replaceable current view built from accepted changes, with revision checking and a named writer. | +| Chat transcript | Conversation history, not authoritative task completion or permission. | +| Files produced by work | Mutable working files plus immutable evidence references where needed. A file alone does not prove acceptance. | + +Prefer one authoritative copy of project decisions. A launch records the +project revision it saw. Owner Q25 requires reconciliation of affected work +after approved plan changes; an old conversation cannot overrule a newer +approved decision. Revision delivery, impact detection, and stale-action +rejection still need design and tests, including on Resume. + +Candidate work states, still for review: `proposed`, `ready`, `active`, +`blocked`, `ready-for-review`, `accepted`, `abandoned`. Completion reported by +an execution can move work toward review, never silently to acceptance by its +own author. Owner Q7 permits an authorized independent reviewer to accept +routine tasks against agreed criteria. Owner-controlled implementation +checkpoints remain separate. Task states, session lifecycle, and execution +outcomes are different fields. + +Owner Q8: default Abandon ends this agent's selected assignments. It does not +cancel the underlying shared mission/task or another agent's involvement. +Underlying work remains available for reassignment unless separately cancelled +with authority. Selection preserves source IDs and dependency evidence; +unselected records remain present with explicit status. Owner Q9 requires an +explicit assignment change before undertaking unfinished prerequisite work. +Under Q7, an authorized coordinator can approve that change within the plan +without a human prompt. No silent expansion by the executing worker. +Cross-project selection remains excluded in the initial proposal unless +separately authorized and designed. + +Two writers updating the same task need an expected revision and conflict +response. Avoid last-writer-wins. A registration change or permission +revocation during execution must be enforceable at subsequent managed actions, +not only checked once at launch. Owner Q14 requires stopping the affected +workspace executions and blocking further actions there while leaving other +independently authorized work running. Global agent disable is a separate +operation. In-flight effects require reconciliation; stop is not undo. Exact +revocation propagation, stopping, and enforcement mechanisms remain D3/D7. + +### 3.1 Delegated autonomy, owner Q7 + +A software factory needs autonomous decisions within an established goal and +plan. Delegated agents may decompose work and make non-destructive decisions +that advance that goal without seeking user approval each time, provided they +stay within their authority and the plan. An authorized independent reviewer +can accept routine task results against agreed criteria. User approval still +controls declared phase boundaries, plan deviations, and protected operations. + +Proposed evidence for each delegated decision: deciding actor/execution, +approved plan revision, delegation reference/limits, affected task/assignment, +reason, and observed result or follow-up evidence. Record the actual delegated +authorizer, not a fictitious owner approval. The acting agent's claim that an +action is harmless is not proof that it is authorized or within scope. + +Exact permitted actions, risk checks, and delegation revocation are still D3 +and D11. This ruling does not authorize implementation during this interview, +unbounded task expansion, or self-approval of a worker's delivery. + +### 3.2 Approved plan changes, owner Q25 + +Pause affected work when an approved goal, plan, or acceptance criterion changes. +Account for actions already underway rather than assuming they can be undone. +An authorized coordinator may reconcile and adjust assignments within delegated +limits; independently valid, unaffected work may continue. Resume affected work +only after reconciliation. Escalate beyond delegated authority or when safe +resolution cannot be established. An unapproved proposal does not replace the +approved plan or grant authority to continue under new criteria. + +Proposed transition evidence: old/new approved revision references, change +approval, affected assignments/dependencies, outstanding-action disposition, +coordinator authority, and resume/reassignment decision. Add evidence rather +than rewriting original launch inputs or historical action records. Exact +fields, publishing/notification paths, impact detection, and stale-revision +fencing remain to be specified under D2/D8/D15. + +This differs from a non-blocking shared-configuration mismatch notice under +Q21. An affected assignment must not continue solely because a Fresh launch +has not been requested. Q25 does not require automatic Fresh for every plan +change; context reconciliation and controlled replacement remain distinct. + +## 4. Accountability and action evidence + +The agent identity remains `code-be-01`. Execution metadata answers which +of its sessions acted, on whose request, within which scope and authority. +This is useful even when no cross-workspace mistake occurred. + +Distinguish five things: + +1. Requester: the authenticated human/service asking for work. +2. Performer: the reusable agent and the particular execution/session. +3. Producer: the launcher, tool gateway, adapter, or external receipt source + that observed and recorded an event. +4. Subject: project/workspace, assignment/task, and target of the action. +5. Authority: policy and membership revisions plus any required approval. + +### 4.1 Proposed event envelope + +```json +{ + "eventVersion": 1, + "eventId": "event-002", + "eventType": "action.finished", + "executionId": "exec-003", + "sessionId": "session-002", + "agentId": "code-be-01", + "projectId": "mosaic-stack-v2", + "workspaceId": "sessions", + "assignmentId": "assignment-014", + "taskId": "task-014", + "actionId": "action-001", + "causedByEventId": "event-001", + "sequence": 2, + "recordedAt": "2026-09-06T00:00:00Z", + "producer": "managed-file-tool", + "operation": "file.write", + "target": { "relativePath": "notes/result.md" }, + "authorityRef": "decision-003", + "outcome": "succeeded", + "evidenceRefs": ["receipt-001"] +} +``` + +This is a shape example, not a real receipt. `decision-003` would bind the +requester's authenticated identity, full launch scope, current permission +check, claim generation, and any owner approval. The producer fills those +fields from trusted execution context; it does not accept agent-supplied +scope or success statements as evidence. Evidence references must resolve to +accessible immutable records with defined content and provenance. + +### 4.2 What counts as an action + +Proposed minimum classes to enumerate before implementation: + +- Launch/resume/fresh/replacement, refusals, exits, and interrupted executions. +- Mission/task assignment, claim, state change, acceptance, and abandonment. +- Registration/permission changes and explicit owner approvals. +- Managed file/tool invocations, external requests, message send/delivery, + repository integration, and release operations when these are permitted. +- Usage observations with provider evidence or an explicit estimate label. + +Not all of these exist as managed operations today. Adding an enum does not +create interception or enforcement. D11 decides the first guaranteed set. + +### 4.3 Intent, effect, and result + +Proposed behavior for managed actions with side effects: + +1. Persist authorized intent with action ID, target scope, and expected state. +2. Perform the action through the enforcing component. +3. Persist the observed result and evidence, linked to the intent. + +Owner Q19: if required intent cannot be persisted, refuse before the action. +If the action may have happened but its result cannot be recorded, block the +affected execution and treat the outcome as unknown. Other executions may +continue only if their own required recording still works. Do not retry +blindly, claim the action never happened, or invent a success receipt. + +Owner Q18: an authorized agent/service may investigate using non-destructive +checks within delegated authority. Dependent work resumes only after evidence +resolves the result; otherwise escalate. The original uncertain action must +not be repeated merely as a test. Recovery checks must also satisfy their +applicable permissions and recording requirements, not bypass an audit outage. + +Proposed mechanics: distinguish unknown state from observed failure; after +recording is restored, append recovered evidence with its actual observation +and recovery times. Do not overwrite prior events or claim that a record was +written during an outage when it was not. The exact out-of-band failure signal +and recovery receipt format remain D8/D9. External effects and local logging +are not one atomic write. + +Use external request/receipt IDs and idempotency support where available. +Without them, an interrupted action may require human reconciliation. A zero +shell exit code only proves that the invoked process reported success; it +does not prove every intended external effect. Clocks are informational; +per-execution sequence and causal references establish local ordering without +claiming a global order across machines. + +### 4.4 Coverage and trust limits + +A launcher can record process lifecycle. It cannot automatically observe every +file write, child process, network request, or manually entered shell command +inside a running program. A transcript is useful evidence but is neither a +complete action audit nor a trusted authority source. + +Each adapter must declare its observable/enforceable operation set. Record +coverage with the execution, for example lifecycle-only versus managed-tool +events. If a requested audit guarantee exceeds support, refuse that launch +mode or require a separately approved limited mode. Never report full coverage +just because the process has an execution ID. + +No claim of tamper-proof logging follows from append-only application code. +A worker that can write the evidence directory could forge or remove records. +A trusted producer outside the worker's write permissions is a proposed +requirement for trustworthy managed-action receipts. Storage access and +failure tests must establish it; the current broad data-root mount does not. + +Owner Q13 chose concise action records: actor and project/workspace/session/ +task, operation, target, authorization, outcome, and evidence references. +Detailed evidence is separate and access-controlled; do not copy full request/ +response content into every action event. Neither metadata nor evidence may +contain credentials. Exact safe field lists and evidence retention remain open. + +Never put credentials, auth headers, raw environment contents, or arbitrary +unfiltered tool payloads in new audit metadata. Use operation-specific safe +fields and protected evidence references. Redaction failures must not leak +secrets through diagnostics. Define who may view sensitive task/file/message +content; workspace RBAC must apply to audit queries too. Existing transcripts +and run outputs need a separate privacy assessment, not retroactive claims. + +## 5. Messages and concurrent execution + +Proposed message envelope: version, message ID, sender identity/scope, +authenticated producer, destination agent/project/workspace, optional exact +session/execution/assignment, message kind, causal/reply reference, creation +and expiry times, and body reference with visibility rules. + +User-addressed workspace messages may follow the workspace's current authorized +session under a stated policy. Execution results and approvals bind to their +exact execution/assignment revision. A late result must not become an +instruction or approval for replacement work. Ambiguous destinations refuse; +transport delivery and task acceptance are separate receipts. + +Owner Q12 permits shared mission/task/decision records and authorized evidence +within a workspace, not blanket access to other agents' conversations. A +transcript needs a separate read permission or explicit authorized handoff. +Neither a shared workspace nor a read grant automatically injects that chat +into another session. Fresh's old-chat exclusion still applies. + +Default active limit is one session for each agent/project/workspace tuple. +Owner Q11: an interactive Resume that finds the session already running must +state the conflict and offer to connect, never automatically connect, replace, +or create a duplicate. The owner may already be connected elsewhere. Q15: +a service receives a machine-readable already-active result with the existing +execution identity and must explicitly request connection or another authorized +operation; it does not receive an unanswered interactive prompt. + +Owner Q16: one controlling interface connection at a time. Other permitted +connections may observe. Taking control is explicit and requires appropriate +authority; observation does not grant control. Proposed connection records +bind client identity and mode to the exact session/execution. Control-transfer +mechanics must prevent a stale controller from submitting commands after +transfer. Ordinary scoped inter-agent messages are not an implicit controller +connection; their admission/attribution rules remain distinct. + +Owner Q17: Fresh requests controlled replacement rather than requiring a +separate stop command. Stop admitting new actions, preserve checked work state, +and settle or identify unfinished effects. Start Fresh only after safe +replacement is established; otherwise stop and report. This is not permission +to replay uncertain actions or import a conversation summary as checked state. +Adapter attachment, control transfer, stop/recovery, and durable claim behavior +must be measured and tested before claiming support. + +User tuning changes a limit, not task ownership. Several agents can work in +one workspace but shared files/tasks still need coordination. Proposed active +claims have a unique ID and increasing generation. Managed writers reject +stale generations, so an old process cannot continue after its replacement. +Timeout alone is not proof that an old process has stopped, especially for +unmanaged external actions. Recovery policy is D7. + +Budgets and automatic scaling are deferred requirements. Do not place invented +budget defaults into the first schema or imply that recorded usage alone +provides a hard spending limit. The limit scope, approval rights, usage delay, +and response to overruns need a later planning decision. + +## 6. Storage constraints, not a migration plan + +Keep `/runs/` as canonical write-once execution evidence. Workspace +views reference evidence there rather than duplicating or rewriting it. +Existing `result.json` records remain untouched. A future version may extend +the record contract through new records and readers, never by rewriting old +runs. New events are append-only and terminal results are written once. + +Proposed organization to discuss: projects own workspace metadata/work state; +workspace-and-agent scope owns session references; execution IDs own launch +inputs and receipts. Whether session bytes live in workspace subdirectories +or remain under `/sessions/` is D6. Logical ownership does not force +a particular filesystem layout. No new storage path is approved by implication. + +Every persistent file class needs an owner, writer, reader policy, retention +rule, and recovery rule. Shared agent settings are not a second system config. +Keep secrets in runtime credential storage, not project/workspace metadata. +Do not treat a project directory as permission to edit reviewed role authority. + +Current `prune` receipts and data-root `reset` behavior still govern existing +records. The new design must specify dangling references after pruning, +metadata export, reset scope, and recovery before migration. It does not +silently protect new records from reset or authorize a new deletion path. +A safe rollback cannot depend on editing historical evidence. + +### 6.1 Workspace retirement and legacy adoption + +Owner Q23: closing a workspace retires it from active work. Stop its active +work safely, retain files/history, and prevent ordinary new launches until it +is reopened. This is not deletion or an implicit cancellation of every mission. +Outstanding actions and assignment dispositions need reconciliation under the +existing replacement/recovery rules. Reopening must check current authority; +it must not automatically restore a revoked membership. Those exact transition +records and reopening behavior are still to be designed and reviewed. + +Owner Q24: preserve existing unscoped sessions as legacy records. Adopting one +requires explicit reviewed project/workspace assignment. Do not guess from +agent or directory names, place everything in a default project automatically, +or rewrite old execution evidence to pretend it originally had new scope. + +Proposed adoption evidence: authorized requester/reviewer, legacy source ID and +non-secret content identity, destination agent/project/workspace, membership +checks, and a new mapping/adoption receipt. This is proposed metadata, not an +approved migration API. Ambiguous lineage or missing access refuses adoption. +Old conversation content remains historical and is not loaded by Fresh. + +Actual storage paths, retention intervals, retirement state transitions, +reopening, recovery after prune/reset, and rollback remain D6. Closing does +not exempt records from separately authorized repository retention/reset rules, +and no new deletion tool is approved by the retirement decision. + +## 7. Open decisions + +| ID | Owner decisions or open question | Remaining proposal or engineering work | +|---|---|---| +| D1 | Scope/hierarchy resolved in Q1/Q5: project owns N workspaces, workspace has exactly one project; a workspace mission has at most one parent project mission or stands alone within its owning scope. Dependencies are not parents. | Formal field definitions and mission lifecycle/completion rules remain to be specified; no multiple-parent ownership. | +| D2 | Recovery content resolved in Q6: assigned mission/criteria, tasks/status, approved decisions, dependencies/blockers, verified-result references, labelled proposed next step and unverified notes; no old chat/automatic summary. | Exact record representation and publisher authority remain schema details; routine acceptance follows Q7/D15. | +| D3 | Q2/Q3/Q14 resolve bounded delegation, scoped visibility, and affected-execution revocation. Q26 chooses standard scope permission roles with per-registration narrowing; they do not redefine agent identity or expand ceilings. | Exact role catalog/grants, record fields, actor authentication, propagation, and stopping need schemas/enforcement. Role names were illustrative; shared role authority remains reviewed-commit controlled. | +| D4 | Resolved by Q4 clarification A: create and announce the initial conversation automatically on genuine first use, without an offer. Later default launches resume; missing/damaged established sessions and ambiguity are errors. | Record initial creation distinctly from resume. Specify reliable first-use history and recovery checks under D6/D8; do not infer first use from a missing transcript. | +| D5 | Default behavior resolved in Q8/Q9: end only this agent's selected assignments on Abandon; undertaking unfinished prerequisites needs an explicit authorized assignment change. | Preserve underlying work/history and other assignments. Q7 allows within-plan delegated authorization without asking the user each time. Fields and interruption sequencing remain open. | +| D6 | Q23 retires closed workspaces safely while retaining files/history and blocking ordinary launches until reopened. Q24 requires explicit reviewed legacy adoption, not inferred membership. | Exact layout, lifecycle/reopening, mapping records, retention intervals, prune/reset reference handling, and migration rollback remain engineering work. Preserve old evidence. | +| D7 | Q11/Q15 require conflict/offer for users and already-active result for services; connection is explicit. Q16 permits one controller plus authorized observers. Q17 requests controlled Fresh replacement, refusing unsafe overlap. | Connection/claim schemas, stale-controller rejection, adapter support, stopping, crash recovery, and concurrency tuning remain engineering work. Timeout alone is not proof an execution stopped. | +| D8 | Q18 permits delegated non-destructive investigation of unknown outcomes, evidence-based continuation, and escalation when unresolved; no blind replay. Exact atomicity/retry guarantees remain open. | Unique requests/actions, linked intent/result/recovery evidence, actual observation times, and explicit unknown status; no blanket exactly-once promise. | +| D9 | Q19 blocks affected executions when required audit recording fails; independently recordable work may continue. Effects with missing result evidence follow Q18 recovery. Storage integrity/trust and failure reporting details remain open. | Refuse before effects; never bypass audit requirements for recovery checks. A trusted writer and out-of-band outage signal need design and tests. | +| D10 | Partly resolved by R16-R17: current approved SOUL at launch, stable per-execution inputs, and cross-interface mismatch notice. Credential sharing and other configuration lifecycle details remain open. | Preserve the owner ruling in section 2.1; reconcile #50 before coding. Exact fingerprint and notification mechanics move to D16. | +| D11 | Q10 permits unassigned conversation/inspection and recorded change assignments. Q13 separates concise metadata from controlled evidence. Q27 A requires command-invocation records with enforced limits, not separate tracing of every internal file/network effect. | Complete taskless/read/chat fields, command/event schemas, evidence allowlists, and enforcement. No isolation, credential, recording, revocation, or recovery gate is waived. | +| D12 | Phase-2 inspection of documentation extracted from the pinned image establishes documented exact-session selection, RPC/JSON events, queue/abort distinctions, and no built-in sandbox. Current Mosaic adapter uses plain print/native TUI instead. | No live RPC, hook, controller, or isolation test yet. Investigate the enforcing integration and failure behavior; host Pi 0.85.1 is not evidence for runtime 0.84.4. | +| D13 | Q12/Q13 separate shared work records, transcript grants, and controlled audit evidence. Q22 shares only designated general preferences by default and supplies personal/project context only where authorized and relevant. | Exact context classification/grants and enforcement remain to be specified. Read permission does not imply automatic transcript loading; replace blanket global user-context injection only through approved implementation. | +| D14 | Jason answered Q28 A: a Mosaic-controlled terminal backed by Pi is acceptable. R34 records this; native UI parity is not an initial requirement. | Runtime/control/input schemas and shared operations now form an owner-review candidate. No UI implementation, engine replacement or safety waiver follows. | +| D15 | Q7 allows authorized independent routine acceptance and delegated non-destructive within-plan decisions. Q25 pauses affected work after approved plan changes, permits delegated reconciliation, and lets independently valid unaffected work continue. | Preserve owner checkpoints and plan-deviation/protected-operation approval. Readiness writers, impact detection, stale-action rejection, conflicts, and change evidence remain open; workers do not self-accept. | +| D16 | Q20 covers shared behavior-affecting config: SOUL, instructions, applicable enabled skills, harness/model settings, and role config, excluding credentials/chat/task progress. Q21 requires automatic non-blocking notices and on-demand checking. | Exact hash/dependency fields, encoding, snapshot verification, delivery/acknowledgement, and frequency remain technical details. Separate comparable config from whole launch identity; no silent refresh. | + +The owner authorized a grill-me interview on 2026-09-06. Ask each round's +questions only after their prerequisites are settled. Record answers without +silently resolving qualifications. Independent analysis later may add questions +or reject recommendations, not overwrite owner rulings. + +### 7.1 Owner interview record, round 1, 2026-09-06 + +Source: Jason's answers in pi session +`01a06e48-0718-71f2-a889-c263c4800fb9`. Interview Q numbers are separate from +D decision IDs. This records partial alignment, not full design approval. + +- Q1, D1: "c. Glad you thought of that answer too." Option C permits both + project and workspace missions with explicit links, including standalone + workspace missions within project scope. Each has one authoritative owner. +- Q2, D3: "B". User delegates bounded authority for system registration and + assignments. Outside-limit actions require approval, not agent self-grants. +- Q3, D3: "B". Project membership gives shared project information plus + explicitly permitted workspaces, not visibility into all workspace content. +- Q4, D4, verbatim: "B, I'm not sure the offer is necessary. A declaration of + initial conversation instantiation is good, but an offer on a non-existent + item is unnecessary." The no-offer preference is clear. First-creation + behavior needs a focused clarification before the command rules are settled. + +Q4 clarification, 2026-09-06: Jason answered "A" to automatic first creation +with an announcement and no offer. Later launches resume by default; Fresh +explicitly starts a new conversation. Missing or damaged previously established +conversations are errors rather than first-use cases. This resolves the +qualification above without rewriting the original answer. + +Next: continue mission relationships, Fresh recovery, completion authority, +and work-selection decisions. Do not treat an unanswered question or an +interview recommendation as an owner decision. + +### 7.2 Owner interview record, round 2, 2026-09-06 + +Source: Jason's answers in the same pi session as round 1. Previous answers +remain recorded above; this is not full plan/schema approval. + +- Q5, D1: A, with the owner qualification that parent:child relationships + stay strictly one-to-many. A project has N workspaces; each workspace requires + exactly one parent project. A workspace mission has at most one parent + project mission as proposed in Q5. Dependencies are different from parents. +- Q6, D2: "agreed" to the full proposed Fresh/Continue information set: + mission/criteria, assigned tasks/status, approved decisions, dependencies, + blockers, verified-result references, labelled proposed next step, and + labelled unverified notes. Old chat and automatic summaries stay out. +- Q7, D15/D3: B. Authorized reviewers may accept routine tasks. Jason clarified + that a software factory needs autonomous goal-directed decisions, layered + decomposition, and delegated non-destructive actions within the established + plan without user interaction each time. Deviation does not inherit that + authority. The agreed user implementation checkpoints remain in place. +- Q8, D5: A. Default Abandon ends this agent's selected assignments; missions + and tasks remain for reassignment unless separately cancelled with authority. +- Q9, D5: B. Show an unfinished prerequisite and obtain an explicit assignment + change before doing it; include relevant dependency information, not silent + extra work. Read with Q7: the authorizer may be a delegated coordinator, not + necessarily the user. Record the assignment change and its actual authority. + +Next questions concern review separation with reused agent identities, +unassigned interaction, revocation, concurrency conflicts, and audit behavior. +No downstream recommendation is settled by the answers above. + +### 7.3 Owner interview record, round 3, 2026-09-06 + +Source: Jason's answers in the same pi session as rounds 1-2. No full schema +approval or implementation authorization is implied. + +- Q10, D11: A. Permit conversation and authorized workspace inspection before + a mission/task exists. Requests to change things become explicit recorded + assignments without requiring a lengthy setup process. +- Q11, D7/D14: owner correction to the automatic-connect recommendation. + State the active-session conflict and offer connection because the user may + already be connected and have forgotten. Owner example, verbatim: + "I see that session is aalready active. Would you like to connect?" + No automatic connection or duplicate launch. Non-interactive service + response was not specified by this answer and remains open. +- Q12, D13: B. Shared work records and permitted evidence, but another agent's + conversation needs a separate permission or explicit handoff. Read access + does not imply automatic loading into the receiving conversation. +- Q13, D11/D13: A. Concise action metadata and evidence references; detailed + evidence separately controlled, not copied wholesale into each audit event. + Credentials must not appear in either. +- Q14, D3/D7: A. Workspace membership removal stops affected executions and + blocks further actions there; other independently authorized work continues. + Global agent disable is separate. Reconcile effects already in flight. + +Next: clarify service-side conflict handling and decide connection ownership, +replacement, uncertain-action recovery, and audit-failure behavior. Technical +capability checks must supply facts, not be questions the owner must guess at. + +### 7.4 Owner interview record, round 4, 2026-09-06 + +Source: Jason answered A to each of Q15-Q19 in the same pi session as prior +rounds. These settle behavior, not unmeasured runtime capabilities. + +- Q15, D7/D14: service receives an already-active result with execution identity + and explicitly requests any authorized connection/next operation. No automatic + attachment or interactive offer waiting for a nonexistent human response. +- Q16, D7: one controlling interface connection; other authorized connections + may observe, with explicit control transfer and conversation access checks. +- Q17, D7: Fresh requests controlled replacement. Stop new actions, preserve + checked state, settle or identify unfinished actions, and only replace safely. + If safety cannot be established, stop/report rather than overlap executions. +- Q18, D8: delegated authorized agents/services may investigate unknown results + with non-destructive checks. Resume dependent work only on resolving evidence; + otherwise escalate. Repeating the uncertain action is not a recovery test. +- Q19, D9: audit-recording failure blocks affected executions. Other work may + continue only when its required recording works. Refuse before effects, and + reconcile effects already issued whose results could not be recorded. + +Next: configuration fingerprint scope/notices and workspace retention/migration +choices. Exact schema and runtime mechanisms remain unapproved until examined; +no implementation or broader phase advancement follows from these answers. + +### 7.5 Owner interview record, round 5, 2026-09-06 + +Source: Jason answered Q20 B, Q21 B, Q22 B, Q23 A, Q24 A in the same pi session. +These are behavior decisions, not permission to change runtime configuration. + +- Q20, D16: shared behavior-affecting configuration fingerprint, not SOUL only. + Include SOUL, shared instructions, applicable enabled skill versions, + harness/model settings, and role config. Exclude credentials, chat, and task + progress; revocation remains an enforcement event, not merely a notice. +- Q21, D16: automatic non-blocking notices plus on-demand checks; keep mismatch + visible without repeated interruption or automatic restart. +- Q22, D13: designated general preferences may be shared; personal and project + information is scoped by authorization and relevance, not a blanket profile. +- Q23, D6: close means retire from active work, stop safely, retain files and + history, and block normal launches until reopened. Cleanup/deletion is separate. +- Q24, D6: preserve legacy sessions, then explicitly review and assign their + project/workspace on adoption. Do not infer membership or auto-place them. + +Next behavioral questions concern changes to an approved plan during execution +and how scope permissions are expressed. Engineering questions remain open for +fact-finding and schema review, not guesses or silent implementation decisions. + +### 7.6 Owner interview record, round 6, 2026-09-06 + +Source: Jason answered Q25 A and Q26 B in the same pi session. + +- Q25, D15: pause affected work after an approved plan change and reconcile + underway effects and assignments. A delegated coordinator can adjust work + within its limits; unaffected work may continue. Escalate beyond authority + or when safe resolution is unavailable, rather than finish obsolete work. +- Q26, D3: standard scope roles with registration-specific narrowing. A scope + role describes permission there, not agent identity/type. Exact names and + grant lists remain subject to review; no expanded agent ceiling is implied. + +### 7.7 Interview checkpoint, confirmation pending + +Q1-Q26 have answers, with qualifications retained above, including the explicit +Q4 correction. No additional owner-behavior question is currently ready. Ask +Jason to confirm shared understanding of R1-R32; do not equate these individual +answers with interview completion or approval of the whole schema. + +D1-D16 retain unresolved engineering questions: fields and record lifecycles, +authorization/enforcement, work-state revisions and recovery, adapter/session +capabilities, observable action coverage, storage/migration, configuration +hashing/notification, and concrete command/UI contracts. Detailed design and +fact-finding need next-phase authorization. Technical findings that introduce +new behavioral tradeoffs come back to the owner, not silent design decisions. + +No mapping, independent gap analysis, implementation, migration, commit, push, +or issue closure follows automatically from this interview checkpoint. + +### 7.8 Owner confirmation of intended behavior, 2026-09-06 + +Following round 6 and the assistant's behavior summary, Jason replied: +"That looks correct." This confirms shared understanding of intended behavior +represented by R1-R32. Section 7.7 records the preceding pending checkpoint; +its confirmation request is now satisfied. + +This confirmation does not approve exact schemas, establish runtime support, +or resolve the remaining engineering branches. Phase 2, detailed design and +read-only technical investigation, still requires explicit authorization. +Mapping, independent gap analysis, implementation, migration, commit, push, +and issue closure remain outside current authority. + +### 7.9 Phase-2 authorization and first investigation, 2026-09-06 + +Jason answered yes to detailed records, permissions, commands, and audit +guarantees with read-only technical investigation. This supersedes the pending +authorization recorded in section 7.8. Mapping, implementation, migration, +publication, and issue closure remain outside authority. + +The linked phase-2 candidate records tool-free source-analysis run +`r-20260906T024609Z-68ee7f`, pinned image/document identities, author +qualifications, proposed common types, operation rules, and remaining work. +The run is investigative output, not independent gap analysis or approval. + +Q27 is now ready for the owner: accountable command invocation with enforced +limits and controlled evidence, or separately attributable internal file/network +effects before command execution is enabled. Recommendation A is recorded in +the candidate; no answer or added approved requirement is inferred. + +### 7.10 Owner Q27 ruling, 2026-09-06 + +Jason answered "Q27: A". Initial managed command auditing records the authorized +invocation, actor/scope/assignment, enforced filesystem/network limits, +start/end, outcome, and controlled evidence references. It does not require +separate enumeration of every internal file read/write or network operation. + +This settles the question left pending in section 7.9 and adds R33. Workspace +isolation, credential protection, fail-closed recording, revocation, and +uncertainty recovery remain required. Exact schemas and enforcing mechanisms +are still phase-2 work; this is not implementation or mapping approval. + +### 7.11 Resumed goal and Q28 frontier, 2026-09-06 + +After reboot recovery, Jason explicitly set the phase-2 goal and repeated it +with --wait-timeout 60. This resumed the existing planning assignment, not a +second goal or an implementation mandate. No exposed goal runtime API or +automatic timeout/wake has been verified; CURRENT records file-based state. + +The linked phase-2 package now has checked command/record schemas, negative +fixtures, explicit calendar/path checks, restricted-domain fingerprint vectors, +and permission/reference/lifecycle/storage and #50 compatibility proposals. +These are author design checks, not independent review or runtime enforcement. + +Q28 is ready: may the first managed release use a Mosaic-controlled terminal +client, or must it preserve the native Pi terminal with full control mediation? +Recommendation A is recorded in the package. No answer is inferred. Runtime +execution/control/input-routing and command artifact contracts depend on that +choice; manual owner response is the next resumption condition. + +### 7.12 Owner Q28 ruling and goal clarification, 2026-09-06 + +Jason answered "Q28: A". R34 records the managed-terminal ruling. The author +continued P2-5/P2-6: closed runtime/control/artifact shapes, synthetic rule checks, +and the owner-review package. The prior Q28 wait in section 7.11 is historical. + +Jason also clarified that /goal came from the separate ~/.mosaic deployment and +is not implemented in this development environment. Continue the same goal through +the existing repository records; no extension installation or active wait timeout +is requested. Goal completion still requires Jason's phase-2 verdict. + +[Owner review and D1-D16 reconciliation](foundation-v1-candidate/REVIEW.md) is the +current candidate index. Runtime security/enforcement and later phase approvals +remain separate from the author checks. Earlier open-detail descriptions above +are preserved as the interview/design history, not claims of implemented behavior. + +## 8. Trace checklist for the later independent analysis + +The non-authoring agent must trace, at exact code and plan revisions: + +- Request authentication -> registrations -> effective permissions. +- Workspace selection -> authoritative state -> context manifest -> program. +- Resume/Fresh choice -> exact session -> unique execution -> active claim. +- Existing-session conflict -> authorized connection -> sole controller or + observer -> explicit control transfer -> stale-controller refusal. +- Canonical configuration -> stable launch inputs/hash -> running execution + status -> shared comparison -> TUI/GUI/WUI notice -> authorized relaunch. +- Assignment -> action authorization -> side effect -> intent/result evidence. +- State update -> revision conflict handling -> visible task/project status. +- Message address -> permission check -> execution-aware delivery -> receipt. +- Exit/crash -> uncertain effects -> recovery -> replacement permission. +- Audit query -> scoped visibility -> retention/prune and recovery behavior. + +For each connection: cite the actual implementation or explicitly record it +as missing; cite the approved plan requirement; name the writer/enforcer and +the receipt; identify unsupported guarantees and a reproducible test. Separate +implementation gaps from holes or contradictions in the plan. Do not fix the +candidate during review or substitute the map author's assurances for evidence. + +The independent report and Archify maps are later deliverables. This file +contains no independent verdict and no assertion that these controls exist. diff --git a/docs/plans/foundation-v1-candidate/README.md b/docs/plans/foundation-v1-candidate/README.md new file mode 100644 index 00000000..fb158897 --- /dev/null +++ b/docs/plans/foundation-v1-candidate/README.md @@ -0,0 +1,364 @@ +# Foundation contract candidate: schemas and semantic rules + +Planning artifacts for #53 phase 2. These files are not loaded by Mosaic, +installed as policy, or approved for implementation. The owner confirmed R1-R34; +field spellings, role bundles, state transitions, and mechanisms here are proposals. + +Parent: [phase-2 contract](../2026-09-06_foundation-phase2-contract.md). +Behavior: [foundation requirements](../2026-09-06_agent-project-workspace-foundation.md). +Decision history: [schema discussion](../2026-09-06_workspace-schema-and-audit.md). + +## 1. What is executable here + +- [Command schema](command-events.schema.json): a closed command request and + four event variants: intent, started, finished, and recovered. +- [Record schema](records.schema.json): closed payloads for eleven declarative + record kinds, including explicit references, revisions, and optional absence. +- [Command fixtures](command-events.fixtures.json): 38 shape cases and five + deliberately shape-valid forgeries requiring separate runtime rejection. +- [Record fixtures](records.fixtures.json): 38 record cases and 16 path cases. +- [Fingerprint vectors](fingerprint-vectors.json): seven restricted-domain + examples of canonical comparison, content changes, and set/order semantics. +- [Runtime schema](runtime.schema.json) and [fixtures](runtime.fixtures.json): + 155 cases for mediated control/execution, messages and artifact bodies, plus + five additional shape-valid semantic forgeries. +- [Rule model](semantic-model.py) and [fixtures](semantic-model.fixtures.json): + 35 synthetic reference, permission, path, acceptance and recovery cases. +- [Author checker](check.py): checks all three schemas and fixtures/models using the + existing Python `jsonschema` package, observed version 4.26.0. Installs nothing. + +Run from the repository: + +```bash +python3 docs/plans/foundation-v1-candidate/check.py +``` + +These are design checks, not product tests. Schema validation does not prove +permissions, identity, filesystem containment, durable writes, or correct +reference resolution. The ten forged/stale records intentionally pass shape +validation. A future runtime must reject them for their semantic reasons. + +The checker explicitly asserts UTC calendar validity and the +`mosaic-relative-path` format. The latter rejects paths over 4096 UTF-8 bytes, +Unicode control/format/surrogate characters, backslashes, and empty/dot/parent +components. A validator that ignores required formats must not be certified +for these contracts. String length alone counts characters, not UTF-8 bytes. +Filesystem symlinks, hard links, mounts, races, and case collisions require +separate checks at the operation boundary; this formatter does not inspect files. + +## 2. Reference and publication rules + +A `registryRef` identifies an exact external definition by registry, ID, +revision, and digest. It is not a new system configuration location. Harness +and settings registries must reconcile with #50; agent/scope-role authority +must resolve to reviewed repository policy. Registry absence refuses an action; +no default provider, account, role, or workspace substitution is allowed. + +A `recordRef` resolves to exactly one record kind, ID, owning scope, and revision. +The resolver checks the authenticated caller's access before returning content. +A reference to another scope is not membership in that scope. A record revision +cannot move its owning scope or change kind/ID. `supersedes` must name the +immediately prior revision of the same object. Reject cycles and skipped or +competing revisions, even when each individual JSON document is valid. + +Project/workspace record IDs must agree with their scope IDs. A workspace has +one owning project. Workspace registration references an active project +registration for the same agent/project. A workspace mission's optional parent +is a project mission in that project. Project missions have no parent mission +in the initial design. Task mission/dependency references must resolve to +permitted work; dependency cycles and self-dependencies refuse readiness. +Cross-scope dependency information is filtered by access and grants no extra +execution authority. Cross-project execution selection is not introduced here. + +Assignment agent, task, and workspace must match its execution binding. A task +may have no mission but still has purpose, criteria, and approved intent. Its +intent decision is independently authorized; neither task nor decision grants +itself permission. Decision subject/basis/evidence references must resolve and +be consistent with the requested decision kind. A delegation authorizer cannot +grant operations outside its own reviewed delegation ceiling. + +Acceptance records identify exact criteria, delivered artifact revisions, +authoring identities, and an authorized non-author reviewer through the basis +artifact. The decision schema's artifact pointer is not proof of these facts. +The acceptance resolver must inspect and validate that basis. Owner checkpoints +remain distinct from ordinary reviewer acceptance. + +Context marked shared by default must be a general preference explicitly +published for that purpose. An author cannot turn private content into shared +preferences merely by changing an enum. Validate publisher authority, permitted +scopes, relevance, and provenance. Fresh rejects transcript/automatic-summary +inputs regardless of whether a caller can read the old conversation. + +An adapter's `verified` declaration needs evidence for the exact image/package, +mode, operation set, and tested failure behavior. Evidence references alone do +not certify the adapter. Refuse required guarantees that lack matching evidence. + +## 3. Proposed permission catalog + +Operations are exact strings, not glob patterns. All are default-deny. +A scope role combines allowed operations with permitted targets; registration +restrictions can only narrow that result. `restrictions:null` means no additional +restriction, not a grant. An explicit empty operations array permits none. +A path grant with `path:null` explicitly names the whole workspace root; it +still requires the operation and all ancestor grants. No empty-string root alias. + +| Proposed bundle | Operations | +|---|---| +| Reader | `work.read`, `file.read`, `work.propose` | +| Contributor | Reader operations plus `file.change`, `command.execute`, `result.submit` | +| Reviewer | `work.read`, `file.read`, `audit.read`, `task.accept` | +| Coordinator | `work.read`, `work.propose`, `task.create`, `assignment.change` | + +These are review candidates, not additions to `roles/`. They are nonhierarchical. +Combined roles need an explicit reviewed bundle; do not union arbitrary role +labels at launch. A reviewer never accepts its own authored delivery. + +The following operations need separate explicit grants: `registration.manage`, +`conversation.read`, `conversation.observe`, `execution.launch`, +`execution.control`, `execution.transfer`, `workspace.retire`, +`workspace.reopen`, `message.send`. `audit.read` exposes only evidence the +principal is entitled to see, not every referenced payload. No bundle grants +git integration, release, credential management, destructive maintenance, or +shared policy changes. Those stay under the repository's conductor/owner rules. + +Control-plane operations authenticate the requesting user/service/agent and +check its scope grant; the authorized runtime component performs them. An agent +being launched does not need permission to launch itself. Its reviewed ceiling +instead bounds the new execution's tools and actions. For assigned work, check +both the originating delegation and the acting agent's current authority. + +For a workspace action, resolve the reviewed agent ceiling, project registration, +explicit workspace registration, applicable parent/workspace mission restrictions, +task restriction, and execution restriction. Intersect operations, file targets, +and network targets independently. A missing required layer refuses; never skip +an unreadable policy. Bind an action to one assignment rather than borrowing +permissions from other assignments. Recheck revocation and current approved +intent before admission, not merely at launch. + +Command network permission concerns command processes. Model-provider access +is a separate, narrowly authorized runtime channel. `network:none` for a command +cannot be satisfied merely by Pi's startup `--offline` flag. No credential file, +Docker socket, host home, or shared evidence directory belongs in the command's +writable/readable sandbox solely because it exists in the configured data root. + +## 4. Command and audit rules + +A command request supplies a proposed execution binding and immutable command +specification reference. These are claims to validate, not trusted identity. +The gateway resolves the authenticated channel, exact live execution/session, +agent/workspace, assignment/task revision, and active generation. A client cannot +supply event producer, authorization verdict, or observed outcome fields. + +The command specification is controlled evidence, not raw metadata. It must +identify the authorized executable/arguments or shell program, cwd, permitted +input sources, output policy, and applicable constraints without containing +credentials. Exact command-specification and sandbox-limit artifact schemas +remain dependent work; these reference slots are not permission for arbitrary +JSON payloads. Required artifacts must resolve and validate before execution. + +Order of operation: + +1. Authenticate and validate the full request, references, permissions, current + generation, approved intent, and required coverage. +2. Reserve its idempotency identity and persist the authorization and command + intent, including the exact enforced-limit reference, before issuing effects. +3. Establish the sandbox and its process-group identity. Persist observed start + separately. Start failure produces a not-started outcome, not false success. +4. Record exit/signal plus proof that the command's entire admitted process group + can no longer act. A shell's exit code alone does not prove descendants stopped. +5. Persist the command outcome. Zero exit with proven termination can mean + command success while effects remain unverified. It never means task acceptance. +6. If effects or required recording are uncertain, block dependent work and use + authorized non-destructive checks. Append recovery evidence with its real + observation time; do not edit an earlier unknown record into success. + +`command.finished` permits one initial terminal observation per command ID. +Later knowledge uses `command.recovered`, naming the prior observation and the +independent check events. Unconfirmed termination requires an unknown outcome. +A confirmed failure needs a nonzero exit or a signal. No process issued means +null exit/signal and effects not-issued. A reconciled effect claim needs evidence. + +The recorder rejects duplicate event IDs, reused sequence numbers, contradictory +command bindings, causal cycles, missing intents, and unauthorized producers. +JSON Schema cannot enforce these cross-record rules. Per-execution sequence +orders its observations; clocks do not create a global order across machines. + +Neither metadata nor detailed evidence may contain credentials. Use allowlisted +metadata and controlled artifact references; do not dump arguments, environment, +stdout, or RPC messages into the audit stream by default. Content classification +and release of evidence are separate authorized operations. An evidence pointer +is not an exception to the no-secrets rule. + +## 5. Proposed lifecycle transitions + +All changes require expected revisions and authorized writers. No last-writer-wins. +These transitions describe intended work, not changes to old run evidence. + +| Object | Proposed transitions and guards | +|---|---| +| Project | Active to retired only by authorized administration, with owned work safely accounted for. Reopening requires revalidated policy; cascading membership restoration is forbidden. | +| Workspace | Active to retiring closes launch/action admission. Retiring to retired requires stopped executions and reconciled/explicitly blocked effects. Reopen moves retired to active without launching work or restoring revoked grants. | +| Registration | Active to revoked blocks affected work immediately. A later regrant is a new authorized revision after current policy checks, not automatic revival. | +| Mission | Proposed to active requires approved intent. Active/blocked may proceed to ready-for-review after evidence is available. Accepted requires authorized independent acceptance; cancellation needs separate authority. Child completion alone does not accept its parent. | +| Task | Proposed to ready requires criteria, approved intent, and resolved prerequisite readiness. Ready to active requires an assignment/claim. Active may block or submit for review. Reviewer accepts exact evidence; rejection returns work for correction. Cancellation is separate from assignment Abandon. | +| Assignment | Selected to paused on approved-plan change or unresolved effects; reconciliation may select it again within delegation. Ended is terminal with an explicit completed/abandoned/revoked/reassigned/canceled reason. Reassignment creates a new assignment, not a different agent under the old ID. | +| Session | Immutable identity/scope and creation lineage. Resume creates a new execution, not a new conversation record. Fresh creates a new conversation and preserves the predecessor only as lineage, not loaded chat. | +| Execution | Admission, observed start, stopping, observed termination, and uncertainty are separate immutable events. No reusable active claim until prior work is proven unable to act. | +| Connection | Observe/control admission checks transcript and operation grants. One controller generation per execution. Explicit transfer invalidates the old generation before new input is accepted. Disconnect is not permission to start another execution. | + +The early discussion's candidate task state `abandoned` is replaced in this +proposal by assignment endReason `abandoned`; task cancellation stays explicit. +This follows Q8 rather than silently ending shared work. + +## 6. Storage, retry, and crash traces + +Proposed ownership remains under the sole configured data root. Shared system +configuration is still `~/.config/mosaic-dev/config.json`; reviewed role authority +still lives in repository `roles/`. No runtime directory is created by this plan. + +- Project/workspace metadata: `/projects//`, with one + workspace metadata subtree per workspace ID. Immutable revisions and checked + current indexes are separate. Shared agent definitions stay outside projects. +- Working files: `/workspaces//`, where an immutable + workspace record resolves storage ID. Display names never construct paths. +- Conversations: `/sessions//`, resolved through the + scoped conversation registry, never latest-file discovery. +- Evidence: `/runs//`, with immutable inputs and uniquely named + event/result artifacts. The trusted host recorder writes; workers cannot. +- Current indexes, first-use tombstones, request decisions, and active claims: + `/state/foundation/`. These are derived/control records, not a second + system configuration. Private source content retains publisher-controlled + storage and is selected into immutable launch inputs only when authorized. + +A proposed host-side per-scope writer serializes admissions and checks expected +revisions. Unique temporary files, flush, atomic rename, and parent-directory +flush publish one durable transaction decision; referenced payloads are written +before that decision. Readers accept only payloads named by a complete commit +record. Indexes rebuild from committed decisions. Never infer atomicity across +several independent renames. Filesystem support and process-lock behavior need +failure tests before this design can be called implemented. + +| Crash point | Recovery rule | +|---|---| +| Before committed intent | Do not issue the action. Uncommitted artifacts do not grant authority. | +| After intent, before observed start | Outcome is not assumed not-started. Reconcile the exact process/container identity before considering replay. | +| After start, before result | Block dependent work; inspect the recorded process group and authorized evidence. Timeout of Compose or an RPC acknowledgement alone is insufficient. | +| After result, before response | Return the existing request decision/result after reauthentication, never run the action again. | +| During claim transfer/replacement | Reject both stale input and conflicting launch until committed generation and old-process disposition are established. | +| During index publication | Rebuild from committed revisions; do not silently select another session or infer first use from absent files. | +| During plan revision | Pause affected work until its expected intent/assignment revisions reconcile; unaffected valid work can continue. | + +Idempotency identity binds authenticated requester, request ID, operation, scope, +and normalized request digest. The same ID with different content refuses. +A repeated request reuses its existing outcome only after current visibility +checks. Automatic retention cleanup is not introduced. Keep request/first-use +history while the scope remains available; explicit pruning must retain enough +non-secret tombstone metadata to refuse ambiguous replay or missing-session +replacement. Owner-authorized data-root reset remains destructive and does not +promise restoration of those indexes. Never silently adopt leftover files after +reset into a newly registered scope. + +Legacy adoption preserves original bytes and source identity before any format +conversion. Produce a new reviewed mapping/conversion receipt. Missing lineage, +ambiguous source ownership, or insufficient permission refuses adoption. + +### 6.1 Fingerprint projection and vectors + +The proposed comparable projection has exactly `hashScopeVersion`, `agentId`, +`soulDigest`, ordered `instructions`, ID-sorted `skills`, `harness`, +`modelSettingsDigest`, and `roleConfigDigest`. Instruction entries contain ID +and content digest. Skill entries contain ID, declared package version, and +content digest. Harness contains canonical ID, actual pinned package version, +and package/image content identity. Reject duplicate component IDs. + +Digests represent the resolved operative content, not only a filename or an +administrative revision number. Normalize operative model/role settings through +their strict source schema; retain their original source revisions separately +in the full launch manifest. Do not include timestamps, display labels, private +user context, chat, progress, or credential bytes/hashes in this base projection. +Approved account selection is a non-secret launch binding, not credential content. + +Serialize the projection with RFC 8785 and hash its UTF-8 bytes using SHA-256. +The seven vectors use only ASCII keys/values and safe integers. The author +checker proves those examples and skill-set sorting, not a general-purpose JCS +implementation. Instruction order changes the hash; skill inventory order does +not. Changed SOUL, skill version, model settings, or role configuration changes +it. The full launch manifest remains distinct and includes work-specific input +identity. Cross-interface notification uses the same base comparison, never +hash equality as proof of live process state. + +### 6.2 Compatibility boundary with #50 + +The author re-read the existing auth/provider/harness plan. Its canonical harness +IDs are executable names, so registry references remain dynamic IDs such as `pi`, +not an enum of providers or a host executable chosen through PATH fallback. +The old examples spelling `claude-code` do not override its later explicit +owner ruling that the ID is `claude`. + +Settings references point to the centrally authored settings profile. Account +references remain a provider/account pair, with each component using the ID +format; the combined slash-separated pair is not a filesystem path or an `Id`. +There is no independent account registry per project or workspace. Endpoint +restrictions resolve canonical provider/approved network definitions; they do +not register the provider again for each assignment. + +The proposed agent-definition record is a versioned resolved representation of +reviewed identity, not a second mutable source alongside `agent.json`. An exact +reviewed-source binding and migration adapter are required before adopting this +schema. Likewise, schema `registryRef.revision`/digest are proposed identity +requirements; current #50 records do not already supply every such field. +A cached projection cannot authorize changes absent from its canonical source. + +#50's per-seat generated files need reconciliation with R16's stable per-execution +launch inputs before concurrent scoped launches. Central credential ownership, +profile ceilings, explicit account choice, no identity fallback, and no writes +to default harness homes remain binding. Credential values and their hashes stay +out of these manifests. In-session account swapping remains deferred, not enabled +by a controller's access to raw engine commands. + +OAuth refresh gate 7 remains unresolved. No refresh/login/credential operation +was performed during this reconciliation. A future launch requiring refresh +must refuse until the authorized registry/materializer path meets its gate; +this contract does not invent a refresh protocol or resume #50 implementation. + +## 7. Managed interface ruling and completed candidate + +The shapes and rules above do not establish how terminal input is mediated. +The pinned documentation describes native Pi TUI commands and a separate RPC +mode. Current Mosaic starts native TUI or print mode; it does not implement a +shared authenticated control service or arbitrary attachment to a live RPC +process. RPC events alone are not a pre-action permission gate. + +Jason answered **Q28 A**: a Mosaic-controlled terminal backed by Pi is acceptable. +The same operations are intended for later desktop/web clients; native screen and +shortcut parity is not required initially. No runtime change follows from the ruling. + +The [runtime contract](RUNTIME.md) and [runtime schema](runtime.schema.json) now +cover execution/claim/control records, typed requests/responses, routing, launch +inputs, command specifications/limits and concrete evidence bodies. The +[runtime fixtures](runtime.fixtures.json) include positive conditional branches +and negative cases. The [synthetic rule model](semantic-model.py) with its +[fixtures](semantic-model.fixtures.json) checks proposed reference/permission and +recovery rules, not actual observations or enforcement. The existing checker +runs them together and checks catalog/projection consistency. + +New project/workspace/mission/task change, mission acceptance, decision issuance +and adoption operations are separate explicit grants, not silent bundle expansion. +All proposals now go to owner review. No capability is admitted merely because +its record passes JSON validation. + +## 8. Owner-review and first-increment proposal + +Start with the [owner-review package](REVIEW.md). It traces D1-D16, separates +checked proposals from unproved runtime capabilities, and requests a phase-2 verdict. + +Refined first-increment recommendation: a read-only scope/permission inspector +for a coherent synthetic bundle, explicitly labelled preview with no live grants. +Owner tests two workspaces, exact membership, ambiguity, stale/missing references +and widening refusals, with no data-root/credential/session changes. Live metadata +publication is not yet the smallest safe increment: it also needs trusted writing, +retention and closure of legacy broad-mount bypasses. This refines, rather than +implements, the earlier metadata-registration proposal. + +Phase-2 acceptance, Archify mapping, distinct-agent gap review and an implementation +charter remain separate gates. Author checks are not independent approval. diff --git a/docs/plans/foundation-v1-candidate/REVIEW.md b/docs/plans/foundation-v1-candidate/REVIEW.md new file mode 100644 index 00000000..7588e10f --- /dev/null +++ b/docs/plans/foundation-v1-candidate/REVIEW.md @@ -0,0 +1,153 @@ +# #53 phase 2: owner review + +**Owner: Jason. Status: phase-2 planning baseline accepted, 2026-09-06.** + +This is a design contract, not a claim that Mosaic now enforces it. The existing +agent launch remains a limited legacy checkpoint. Q1-Q28 establish the behavior +requirements; this package proposes the exact records and operating rules. + +## What you are approving + +- One reusable agent identity, explicitly registered into projects/workspaces. + Each workspace has one project. Membership, dependencies and conversation + visibility remain separate. +- Resume by default; automatic announced first conversation only on genuine first + use. Fresh excludes old chat and rebuilds authorized work context. Damaged history + causes an error. Existing legacy history needs explicit reviewed adoption. +- Standard nonhierarchical permission bundles, narrowed by registrations, mission, + task and execution limits. Administrative/control powers are separate grants. + No task combines other assignments' permissions or accepts its own delivery. +- **Q28 A:** a Mosaic-controlled terminal backed by Pi. The broker, not terminal + shortcuts, engine text or client state, owns admission, control and routing. + One controller; explicitly authorized observers and transfer. +- Invocation-level command evidence with real enforced limits. No promise to trace + every internal file/network operation. Stopping, recovery, privacy and recording + remain mandatory even when a command reports exit zero. +- Append-only evidence, serialized publication, safe refusal and no blind replay. + Stable launch inputs; non-blocking shared-configuration notices recommend Fresh. + +You are **not** approving implementation, migration, live policy changes, new +credentials, a release, mapping, independent-review acceptance, commit/push or +issue closure. Those retain their separate gates. This goal is complete only +when you accept the phase-2 contract, not when its author says the checks pass. + +## Review order + +1. This summary and the proposed first increment below. +2. [Permission bundles and publication/lifecycle rules](README.md). +3. [Mediated operations, evidence and implementation gates](RUNTIME.md). +4. The exact [declarative records](records.schema.json), + [command events](command-events.schema.json), and + [runtime/control/artifact shapes](runtime.schema.json), as needed. + +The schema types are closed. Runtime schema includes 16 runtime/artifact kinds, +28 control operations, prompt/stop/dialog input and common responses. The separate +command request completes the 29-operation catalog. Source registry references +remain dynamic identifiers; these files are not a new live registry. + +## Checks and their limits + +Run the author checks with: + +```bash +python3 docs/plans/foundation-v1-candidate/check.py +``` + +- 38 command shape cases, 38 declarative record cases and 16 path cases. +- Seven restricted-domain hash vectors, also checked against the projection type. +- 155 runtime/control/artifact cases, including valid conditional branches and + refusal shapes. Zero controller generation is invalid; actual stale-generation + refusal is a state check, not something JSON Schema alone proves. +- 35 synthetic reference, permission, path, acceptance and claim/recovery model + cases. These execute proposed rules against fixture assumptions, not live facts. +- Ten deliberately shape-valid forgeries remain shape-valid. A trusted runtime + must reject their false authority, bindings, hashes or assertions. + +The checker also compares shared definitions and checks that the operation catalog +has request coverage. Fixtures are not an authenticated run, a coherent deployed +registry or a sandbox test. The reference model assumes its input observations; +it cannot authenticate a producer or observe a real process. No independent agent +has approved this package. Full JCS implementation/Unicode vectors and live +failure-injection/security tests belong to the separately chartered implementation. + +## D1-D16 reconciliation + +“Candidate” below means a review proposal covers the question, not that code is +implemented or the owner has approved every field. + +| Design question | Candidate location and remaining proof gate | +|---|---| +| D1: scope/hierarchy | Record schemas and README reference/lifecycle rules. Actual parent, mission-completion and acyclicity checks required. | +| D2: Fresh recovery content | Context classifications, launch inputs and RUNTIME recovery projection. Actual publisher/loader provenance and no-old-chat tests required. | +| D3: delegation/visibility/revocation | Permission bundles, delegation basis and current-authority rules. Actual identity, ceiling, propagation and affected-work stopping tests required. | +| D4: genuine first use/Resume | Explicit initial/resume/fresh records, snapshot/leaf binding and historical markers. Damaged-state and initial-bootstrap tests required. | +| D5: Abandon/prerequisites | Typed work selection and assignment changes; assignment-only Abandon and independent reviewer rules. Interruption/authorization tests required. | +| D6: storage/retirement/adoption | README storage and RUNTIME retention/reopening/adoption rollback rules. Real protection, mapping and recovery tests required. | +| D7: conflicts/connections/replacement | Claim, connection, control and termination shapes plus synthetic traces. Actual single-controller, concurrency and full-cohort stopping proof required. | +| D8: uncertainty recovery | README crash traces, RUNTIME evidence, synthetic claim model. Files/processes/journal failure injection required. | +| D9: audit failure/integrity | Command events, classified artifacts, publisher ordering and outage rules. Trusted durable writer tests required. | +| D10: shared config/#50 | README compatibility and RUNTIME stable snapshots. Current #50 per-seat materialization and OAuth gate 7 remain external constraints. | +| D11: taskless work/command coverage | Closed command/control shapes and Q27 rule. No unassigned file changes; actual command isolation/recording required. | +| D12: adapter enforcement | Q28 A architecture and capability matrix. Pinned docs are evidence of documented APIs, not complete mediation. | +| D13: context/privacy | Context-source classifications, launch inputs, artifact visibility and routing. Actual loader/output/recipient tests required. | +| D14: shared interface | Q28 A plus complete operation/request catalog and common response codes. CLI presentation cannot create extra authority. | +| D15: plan changes/autonomy/acceptance | README lifecycle/reference rules, request binding, decision/delegation basis and synthetic acceptance cases. Current-intent, non-author reviewer and evidence checks must be enforced. | +| D16: fingerprints/notices | Projection, vectors and RUNTIME event-triggered comparison. No silent reload or continuous-state claim; real delivery/adapter checks required. | + +The requirement source remains R1-R34 in the foundation plan. Independent mapping +and gap review may find defects in this candidate; changes must preserve owner +rulings or return for a new owner decision. + +## Technical gates that acceptance does not waive + +1. Actual mediation, narrow mounts/egress, credential separation and stopping. +2. Authentic, durable publication and safe recovery/idempotency. +3. Conversation/context/output privacy and current permission checks. +4. Reset/prune protection for newly required state/evidence. Current scripts have + not gained the proposed protections. +5. Reconciliation with #50's canonical definitions and stable per-execution inputs; + no credential refresh experiment was performed and OAuth gate 7 is still open. +6. **Legacy bypass closure:** current broad-mount/native launch paths cannot remain + an ungoverned route into protected foundation state. Before activating that state, + refuse those paths or establish a separately approved isolation boundary. Do not + assume a new broker makes the old adapter safe. + +None requires changing a settled owner behavior today. If implementation research +cannot meet a gate with the selected adapter, stop and report instead of weakening +it or silently upgrading the pinned engine. + +## Recommended first user-testable increment + +**A read-only foundation scope/permission inspector using a synthetic bundle.** + +Example future spelling: `mosaic foundation inspect `. The later +charter settles the executable/wrapper. It validates a coherent candidate graph, +resolves exact project/workspace membership and previews the permission intersection. +Output must say **preview: no live registrations or permission grants**. + +Owner test: + +1. Inspect one project with two workspaces and an agent registered only in the first. +2. See the exact authorized first-workspace view and refusal for the second. +3. Try ambiguous IDs, missing parents, stale revisions and an overbroad grant; + each must fail clearly rather than select a default. +4. Confirm no data-root state, credentials, sessions or running agents changed. + +This refines the earlier metadata-registration recommendation: live persistence +also requires publisher, retention and legacy-bypass protections. A read-only +inspector supplies a small usable checkpoint without pretending those already +exist. It requires a coherent semantic fixture bundle, not simply combining the +independent shape fixtures in this directory. + +Only after phase-2 acceptance, separately approved mapping and independent gap +review should that increment receive an implementation charter. Owner testing +then precedes any dependent increment. + +## Owner verdict + +Jason explicitly answered **"accept phase 2"** after the plain-language +clarification that this accepts the plan, not a security certification or +implementation mandate. Receipt recorded at 2026-09-06 06:52 UTC. + +Goal issue-53-phase2 is satisfied. Technical mapping, independent review and +implementation remain separately authorized phases; none starts automatically. diff --git a/docs/plans/foundation-v1-candidate/RUNTIME.md b/docs/plans/foundation-v1-candidate/RUNTIME.md new file mode 100644 index 00000000..525fc442 --- /dev/null +++ b/docs/plans/foundation-v1-candidate/RUNTIME.md @@ -0,0 +1,319 @@ +# Mediated runtime contract — phase-2 review candidate + +Status: proposed technical contract after Jason's **Q28 A** ruling. No component +below has been installed. Pi remains the engine. A Mosaic-controlled terminal +is acceptable; native Pi screen/shortcut parity is not an initial requirement. +The same authorized operations are intended for later desktop/web clients. + +This file completes the operation and evidence rules alongside [the package +rules](README.md) and [runtime shapes](runtime.schema.json). Closed JSON shapes +are necessary, not sufficient. `check.py` checks synthetic examples, not a live +permission system. Fixtures are independent shape cases, not one valid run graph. + +## 1. Components and authority + +| Component | Owns | Must not do | +|---|---|---| +| Mosaic client | Scope display, user interaction, authenticated requests, authorized rendering | Hold client-private task truth, set trusted actor/producer, bypass the broker | +| Control broker | Authentication binding, policy intersection, current claims/controllers, admission, routing | Treat agent text or engine events as approval, fall back to another scope/account | +| Trusted publisher | Serialized immutable records, artifact index, receipts, recoverable projections | Accept a worker's producer label as proof, acknowledge an undurable commit | +| Engine adapter | Exact Pi instance/session, pinned configuration, reviewed tool bridge | Expose raw engine control channels, discover ambient extensions/context | +| Command gateway and supervisor | Enforced command limits, process cohort identity, observations and stopping | Mount credentials, host control endpoints, private engine home, or shared evidence into command jobs | + +The broker/publisher/supervisor are runtime infrastructure, not a new autonomous +conductor agent. Git, credentials and shared policy retain conductor/owner +authority. This design does not add a background goal scheduler. + +Initial ingress proposal: a local owner client over a private, ownership-checked +local channel. Bind owner identity through OS credentials and reviewed bootstrap +policy, not a JSON principal ID. Sandboxed engines/jobs must not reach that owner +control endpoint. Agent/service ingress uses a distinct, execution/delegation-bound +channel with narrower operations. Provider API credentials are never control-plane +credentials. Remote ingress is refused until an authenticated mapping is approved +and tested; a future web interface is not permission to trust HTTP actor headers. +A compromised host owner/root is outside the sandbox boundary, not something this +contract claims to contain. + +## 2. Wire, operations, and receipts + +The proposed control transport uses bounded UTF-8 JSON frames. Reject duplicate +keys, non-finite numbers, unknown fields, bad encodings and metadata frames over +1 MiB before admission. No shell expansion, URL fetching or host-path resolution +is implied by an argument. Sidecar body ingestion is authenticated, private, +bounded by the selected operation/profile, and correlated to the request. It +cannot publish work or grant authority independently. Validate content and digest +before replacing a staging handle with a trusted artifact reference. + +`controlRequest` defines request ID, target scope, expected record references, +optional assignment reference, exact operation and closed parameters. Actor, +producer, authorization and outcome come from the service. Public ingress validates +only its request sub-schema; a valid runtime-record or response object is never +accepted as a client request. `command.execute` +retains its separate command request shape. `inputRequest` is exclusively for +prompt, stop and approved dialog replies, with execution/connection generations. + +All 29 permission names have a request contract: 28 control operations and the +separate command request. Descriptive CLI commands are wrappers, never another +permission system. JSON stdin/file forms submit the same request; they do not +allow arbitrary engine JSON. No new command described here exists today. + +| Family | Required interpretation beyond shape | +|---|---| +| Project/workspace create/change | Proposed ID/payload is not a published envelope. Validate exact record-kind payload, owning scope, lifecycle and reserved/delegated target IDs; publisher supplies envelope/authorization. Workspace creation needs an existing exact project. | +| Mission/task create/change | Preserve single-parent ownership, mission policy intersection, dependency acyclicity and current approved intent. A proposed accepted status cannot bypass acceptance. | +| Assignment change | Null current reference explicitly requests creation; otherwise exact current ID/revision must match. New assignment does not abandon existing assignments. | +| Registration manage | Explicit creation/update; grantee identity, parent ceilings, allowed role and delegation must resolve. Never infer membership from creation or dependency. | +| Work read | `records` returns authorized work records; `execution-status` returns safe execution metadata; `configuration` runs the shared hash check. No transcript, account secret or private launch-input dump. | +| File read/change | Only the bound workspace, permitted path components and current limits. Contents/entries are distinct views. Put with null expected digest requires absence; delete requires an existing matching digest. No root deletion. | +| Work propose/result submit | A proposal is not approved work; a submitted result is not acceptance. File/work changes require a recorded assignment. | +| Task/mission accept | Exact subject/criteria revisions, independently authorized reviewer, verified evidence and current approval authority. | +| Decision issue | Validate decision-kind basis and issuing authority. Creation uses a new ID; revision/revocation requires the exact current decision in expectedRefs and the same immutable identity/scope. A model cannot issue owner approval because it can write prose or name the owner. | +| Conversation read/observe | Check separate conversation grants on each page/stream. Record visibility never auto-loads a transcript. | +| Execution launch/control/transfer | Apply sections 3-4, not native engine launch/attach semantics. | +| Workspace retire/reopen | Stop admission immediately; finalize retirement only after safe stop/reconciliation. Retain files/history. Reopen does not restore revoked grants or restart work. | +| Message send | Apply section 5 at both send and delivery. No automatic work assignment or acceptance. | +| Audit read | Resolve classified artifacts with the caller's own rights; knowing a reference is not permission. | +| Session adopt | Explicit reviewed decision plus preserved legacy snapshot; no filename-derived membership or in-place historical conversion. | + +New creation/change/acceptance/adoption operation names are **separate explicit +grants**, not implicit additions to Reader/Contributor/Reviewer/Coordinator. +In particular `mission.accept` does not follow automatically from `task.accept`. +System-scoped registration delegation requires reviewed ceiling authority and +an approved `delegation-basis`: grantee, allowed operations, existing scopes, +preallocated new target IDs, parent decision, expiry and finite use limit. The +parent's limits still intersect it. A scope role cannot redefine shared policy. +Bootstrap creation uses explicit owner authority and an auditable bootstrap +assignment/bundle; ordinary agents cannot select a bootstrap bypass. Once work +exists, changing actions bind to their recorded assignment. Taskless discussion +and inspection never silently become file changes. + +`controlResponse` distinguishes succeeded, accepted, already-active, refused and +unknown. Accepted means durable admission only. Success/acceptance needs a receipt. +An already-active response exposes identity only after authorization. Pre-admission +invalid/unauthorized requests may receive an unreceipted refusal; an audit outage +or uncertain action is never represented as success. Unknown effects require +recovery, not a retry under a new ID. Outcome data is a classified reference. + +Reason codes are closed: allowed, invalid-request, not-authorized, stale-revision, +missing-state, already-active, control-conflict, retired, unsupported-capability, +audit-unavailable, unknown-effects, unsafe-replacement, request-id-conflict, +expired. Client copy must distinguish these without leaking private state. + +Request identity is bound to authenticated principal, instance/epoch and canonical +request digest, including referenced input digests. A matching retry returns its +existing receipt/state. Different content under the same ID refuses. Private +bodies are not copied into a public request log. After a reset/lost index, old +channels/claims cannot authorize replay: recover the authoritative namespace or +require explicit reinitialization and new intent. Do not silently recreate it. + +## 3. Launch, claims, sessions, and configuration + +1. Authenticate, resolve exact identities/revisions and current policy. Closed or + ambiguous scope, bad config, missing evidence or unsupported adapter refuses. +2. Resolve work selection. Continue is the default; select/abandon name exact + assignments. Abandon changes only those assignments after authorization. + None permits conversation/inspection, not arbitrary changes. +3. Reserve the single `(agent, project, workspace)` claim in a serialized durable + transaction. Concurrency initially remains one per tuple; unsupported higher + tuning refuses rather than being silently ignored. +4. Resume selects the recorded current session or an explicit same-scope session. + Genuine first use creates and announces an initial conversation. Once history + or initialization is recorded, missing state is an error, not new first use. + Resume pins an immutable pre-load snapshot and selected leaf (null only for a + verified empty history). Verify the engine loads that history/branch; unsupported + selection refuses. These private hashes are not part of the comparable base. +5. Fresh creates a new conversation with no old chat/automatic summary. Metadata + may retain predecessor references; they are not transcript loading authority. + If an execution is active, an explicit replacement binding/generation and + authority are required. Stop admission, verify old engine and command cohorts + stopped, reconcile effects, then release its claim. Idle/abort/EOF is not proof. +6. Bootstrap the selected pinned engine in a private instance with inference and + tool admission closed. Obtain/verify native session identity and effective + settings. If the adapter cannot establish this before effects, it is unsupported. + Do not guess the latest file or invent an engine session header. +7. Publish the session binding and full launch manifest, verify snapshot digests, + then open only the approved capabilities. Record started state and actual + process identity. Incomplete bootstrap enters recovery, not automatic replay. + +A manifest includes exact agent/session/settings/capability references, image +identity, comparable base projection, context snapshots, policy references and +selected assignments. `agentConfigHash` hashes the normalized base projection; +`launchManifestHash` hashes normalized `inputs`, not its own hash or timestamps. +Preserve ordered inputs. Normalize the skill set before JCS serialization. +Credentials and credential hashes are absent. Account selection is non-secret +identity metadata, resolved through #50 without fallback or in-session swapping. + +Private/personal/project/work context appears only in authorized launch inputs. +Designated shared general preferences need their classification record; when they +serve as shared behavior instructions, include their content digest in the base +instruction projection. Do not omit a shared instruction merely because its +source is named USER. Context selection verifies source kind, classification, +audience and scope; a supplied category is not proof. Work context is a structured +projection of R6's approved records, preserving proposed/unverified labels. + +Canonical approved configuration publication triggers a comparison for affected +executions. Also compare on client connection/reconnection and on demand. Publish +matching/changed/unknown and checked time. Missing current sources yields unknown, +not matching. Deduplicate notices by execution/old-hash/new-hash/status, retain the +current status badge, and deliver on reconnect using the recorded cursor. A local +UI toast acknowledgement changes no canonical state. No periodic model polling +or silent reload is required. These are event-triggered comparisons, not proof +of continuous live memory equality. Permission revocation acts immediately even +though ordinary configuration drift is a non-blocking Fresh recommendation. + +## 4. Control and the Pi adapter boundary + +A connection is observe or control. Both need their own visibility grants; control +is not implicit transcript access. There is one current controlling connection +and generation per execution. Check both execution and controller generations on +admission. Transfer is explicit, targets an authorized connection, and invalidates +old queued input before admitting new-controller input. Previously admitted work +keeps its true causal actor; transfer does not retroactively rename it. + +A client disconnect does not release an execution claim or prove work stopped. +Recovery replacement without the current controller requires an explicit +qualified owner/delegation decision; knowing the current generation is not a grant. +Revocation closes affected ingress/streams and fences new unsafe actions. It also +stops affected running work, recording uncertainty until actual stopping is proven. +Unrelated independently authorized/recordable work can continue. + +Proposed Pi integration: a broker-owned RPC process with a reviewed, pinned tool +bridge, no builtin tool escape, no ambient packages/extensions/templates/context, +and no raw RPC endpoint exposed to clients. The bridge requests gateway actions; +it does not execute arbitrary project commands inside the credential-bearing +engine process. Engine events report observations, never permission decisions. +This architecture is proposed, not a claim that the current adapter does it. + +Initial prompt body is bounded text. Stop means fence admission and request safe +cancellation; only supervisor proof closes the execution. Dialog replies match an +outstanding approved dialog, connection, execution and generation. Unsupported +engine commands/dialogs fail visibly; no pass-through of bash, session switching, +model changes, login, package installation or reload. Additional reviewed mappings +must preserve the same contracts. Display engine text as untrusted data: no terminal +control/clipboard escape execution or web markup privileges. + +## 5. Messages, queues, and late results + +A message has sender, source scope, recipient agent/scope, routing mode, class, +private body reference, subject references, expiry, reply correlation and trusted +authorization. Sender identity comes from the channel. Record admission before +publishing to the queue. Delivery rechecks current sender delegation, receiver +membership, body visibility, expiry and exact target binding. + +- Current-scoped-session is for permitted ordinary notices. Resolve at delivery + within that exact agent/workspace, never a global newest session. Missing or + inactive recipient can remain queued until expiry; it does not auto-launch. +- Exact-session never follows Fresh. Exact-execution requires both session and + execution identity. Results/interactive approvals use exact-execution routing. +- An approval message only references a separately valid decision. Match pending + request ID/digest, intent revision, scope and execution; text saying approved + confers nothing. Late results remain evidence for their original execution. +- Delivered means an attributable receiver acknowledgement, not task success or + acceptance. Lost acknowledgement gives unknown, not safe permission to resend. +- Retries reuse identity/content. Receiver deduplication precedes processing. + Do not claim exactly-once delivery across an unproved crash boundary. + +Expiry is explicit and checked against trusted service time and policy bounds; +there is no hidden default TTL or automatic approval on timeout. Current-schema +calendar validation does not establish clock correctness. + +## 6. Command limits and concrete evidence + +`command-spec` contains reviewed command-profile/parameter-schema identities, +classified parameter/input references and workspace-relative cwd (null explicitly +means workspace root). No raw argv/environment appears in public metadata. The +reviewed profile fixes executable identity and parameter grammar; it is not an +agent-supplied shell wrapper. The parameter-schema reference must equal the +profile's registered schema; callers cannot substitute a weaker schema. Profile/schema bodies are immutable reviewed contract +assets identified by commit/content, not per-workspace copies of authority. + +`sandbox-limits` records the selected sandbox profile, workspace grants, permitted +endpoint identities, wall-time/memory/process ceilings, and the explicit absence +of credential/host-control access. Workspace paths supplement the reviewed image, +scratch and system-filesystem rules in the profile; they do not pretend to list +all internal reads. Resolve current policy and take the least-privilege limits. +The profile must actually enforce filesystem and network boundaries, including +symlinks, mounts, /proc access, endpoint redirects/DNS and child processes. +A declaration, Pi tool allowlist or --offline flag alone is insufficient. + +Initial file-effect concurrency proposal: a workspace read/write lease. Writers +are exclusive; read-only commands may share a read lease. Hold a write lease until +its cohort ends and effects are accounted for. An uncertain writer blocks affected +access, not unrelated workspaces or control-plane recovery. Finer concurrency is +a later reviewed optimization. Metadata publication uses its separate serialized +revision guard. File put uses verified content/destination and durable atomic +publication; crashes never turn absence of a result into permission to replay. + +Evidence bodies now include process observations, termination proof, decision +basis and delegation basis. The publisher verifies their producer and meaning: + +| Body | Required additional truth check | +|---|---| +| Process observation | Exact backend object/cohort from admitted launch, pinned image, observation attributable to supervisor; PID/name alone is insufficient | +| Termination proof | Admission is fenced and original cohort/descendants are gone. Never-started proof also establishes no start was admitted and no old producer can start it later. Absence or idle alone supplies neither proof. | +| Decision basis | Subject/criteria/evidence revisions resolve; authors derived from delivery provenance; reviewer is authorized and not an author; request-bound approvals match digest/binding | +| Delegation basis | Issuer/parent authority, target allocations, operations, expiry/use limit and ceilings all hold at use time | +| Command result | Resolve outcomeEventId to the actual command finished/recovered event with matching command/binding. There is no second outcome/signal vocabulary. Classified stdout/stderr/output references and truncation remain distinct from work acceptance. | + +Artifact indexes disclose kind, scope, digest, byte length, media type, visibility, +publisher and authorization, not absolute storage paths. Index and referenced +body must agree. Metadata reads do not authorize body reads. Output capture is +bounded/classified by profile; truncation must be explicit in the result evidence, +never silently presented as full output. Credentials are allowed in neither +metadata nor evidence; do not rely on a generic secret-pattern regex as proof. + +The trusted journal publishes intent before effects, started after attributable +creation, and outcome only after observed completion. Failure after effects blocks +that execution and preserves unknown state. Recovery first proves stopping and +reconciles actual files/results, then appends a new observation; it never edits an +old receipt or blindly repeats the invocation. + +Launch authorization must preauthorize the supervisor's specific fail-safe fencing +and stopping of its own bound cohort when required recording fails. Attempt that +stop even if a new stop event cannot be written; do not start exploratory recovery +commands through an unaudited fallback. Signal the outage without sensitive content +and retain unknown state until recording recovers and stopping/effects are verified. +A later observed-at time records the later observation, not a fabricated stop time. + +## 7. Storage, retention, and implementation admission + +Use the storage ownership/publication rules in README sections 2 and 6. Mutable +indexes are rebuildable projections, not the authority. The recorded runtime +namespace/epoch and exact scope must survive restart or be declared unavailable. +No metadata search may infer scope from an engine filename or host working path. +Legacy sessions remain separate until reviewed adoption preserves the original. +Adoption rollback before activation discards only unpublished staging and appends +its failure receipt. After activation, safely stop affected work, explicitly +revise/revoke the adoption approval, and preserve all original/new history and +work effects. A now-invalid current mapping causes refusal; it does not silently +select another conversation or become first use. A separately authorized explicit +Resume/Fresh can establish the next valid mapping. Reversing work effects requires +its own reconciliation/assignment, never an automatic historical rewrite. + +No new retention duration is implied: retain records and history by default. +Workspace retirement is not deletion. Evidence needed for current state, active +claims, unresolved effects, live references or required recovery cannot be pruned +without satisfying its protection/receipt rules. A pruned reference is explicitly +pruned, not current verifiable evidence. Existing reset/prune scripts have not +acquired these protections; reconcile and test them before enabling this mode. + +The first mediated adapter is admitted only after an implementation charter and +proof of: complete mediation; narrow mounts/egress/credential separation; exact +session/config binding; crash-safe writer/idempotency; cohort stopping; revocation +and stale-controller fencing; context/output privacy; protected retention; closure of legacy broad-mount/unmediated entrypoints into +the protected namespace; and #50 account/materialization compatibility. Unsupported capability fails closed. +Pinned Pi documentation is not a passing admission test. + +| Capability | Evidence available now | Still required before managed execution | +|---|---|---| +| Native/print launch | Current source inspected; earlier owner launch/resume example | New mediated launch implementation and negative tests | +| Exact selection and RPC events | Pinned 0.84.4 documentation read | Verify exact bootstrap/resume identity and cancelled/error cases | +| Pre-action mediation | Architecture and typed requests only | Reviewed bridge/gateway and bypass/failure tests | +| Sandbox | Pinned Pi documentation says no builtin sandbox; current Compose broad mount inspected | Actual filesystem/network/credential boundary tests | +| Stop/replace/control | Typed records and synthetic traces | Real process-cohort, crash, concurrent-client and revocation tests | +| Audit/publication/recovery | Existing writeOnce source plus candidate rules/models | Durable failure-injection and trusted-producer tests | +| Context/config/privacy | Source risks identified; hashes and candidate classifications | Admission/loading/output tests on actual adapter | +| OAuth refresh | #50 boundary read; gate 7 still open | Separately authorized provider/materializer proof | + +These are explicit implementation acceptance gates, not missing permissions that +an agent may improvise around. No runtime feature claim follows from this draft. diff --git a/docs/plans/foundation-v1-candidate/check.py b/docs/plans/foundation-v1-candidate/check.py new file mode 100644 index 00000000..db2958da --- /dev/null +++ b/docs/plans/foundation-v1-candidate/check.py @@ -0,0 +1,156 @@ +"""Author-only checks for planning fixtures. Not a Mosaic runtime validator. + +Run: python3 docs/plans/foundation-v1-candidate/check.py +Requires the existing jsonschema package; never installs dependencies. +""" +import json +import hashlib +import runpy +from copy import deepcopy +import unicodedata +from datetime import datetime +from pathlib import Path + +from jsonschema import Draft202012Validator, FormatChecker + +ROOT = Path(__file__).resolve().parent + + +def unique_object(pairs): + result = {} + for key, value in pairs: + if key in result: + raise ValueError(f"duplicate JSON key: {key}") + result[key] = value + return result + + +def reject_constant(value): + raise ValueError(f"non-JSON numeric constant: {value}") + + +def load(name): + return json.loads((ROOT / name).read_text(), object_pairs_hook=unique_object, + parse_constant=reject_constant) + + +formats = FormatChecker() + + +@formats.checks("date-time") +def utc_milliseconds(value): + if not isinstance(value, str): + return True # Schema type validation handles non-strings. + try: + parsed = datetime.strptime(value, "%Y-%m-%dT%H:%M:%S.%fZ") + except ValueError: + return False + return parsed.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z" == value + + +@formats.checks("mosaic-relative-path") +def relative_path(value): + if not isinstance(value, str): + return True + try: + size = len(value.encode("utf-8")) + except UnicodeEncodeError: + return False + return ( + 0 < size <= 4096 + and not any(unicodedata.category(c) in {"Cc", "Cf", "Cs"} for c in value) + and "\\" not in value + and all(part not in {"", ".", ".."} for part in value.split("/")) + ) + + +assert not formats.conforms("é" * 2049, "mosaic-relative-path") +assert not formats.conforms("a\u202eb", "mosaic-relative-path") +assert not formats.conforms("2026-02-30T03:00:00.000Z", "date-time") +assert formats.conforms("2028-02-29T03:00:00.000Z", "date-time") +schema = load("command-events.schema.json") +Draft202012Validator.check_schema(schema) +validator = Draft202012Validator(schema, format_checker=formats) +fixtures = load("command-events.fixtures.json") +assert fixtures["fixtureVersion"] == 1 +names = set() +failures = [] +for case in fixtures["cases"] + fixtures["semanticObligations"]: + assert case["name"] not in names, case["name"] + names.add(case["name"]) + actual = validator.is_valid(case["document"]) + if actual != case["schemaValid"]: + failures.append(case["name"]) +if failures: + raise SystemExit("FAIL: " + ", ".join(failures)) +print(f"PASS: {len(fixtures['cases'])} shape fixtures") +print(f"PASS: {len(fixtures['semanticObligations'])} deliberate shape-valid forgeries") +records = load("records.schema.json") +Draft202012Validator.check_schema(records) +for name in ("id", "runtimeId", "revision", "digest", "time", "actor", "artifactRef"): + assert records["$defs"][name] == schema["$defs"][name], name +record_validator = Draft202012Validator(records, format_checker=formats) +record_fixtures = load("records.fixtures.json") +assert record_fixtures["fixtureVersion"] == 1 +record_failures = [] +for case in record_fixtures["cases"]: + if record_validator.is_valid(case["document"]) != case["schemaValid"]: + record_failures.append(case["name"]) +for case in record_fixtures["typeCases"]: + subtype = {"$ref": "#/$defs/" + case["definition"], "$defs": records["$defs"]} + check = Draft202012Validator(subtype, format_checker=formats) + if check.is_valid(case["value"]) != case["schemaValid"]: + record_failures.append(case["name"]) +if record_failures: + raise SystemExit("FAIL records: " + ", ".join(record_failures)) +print(f"PASS: {len(record_fixtures['cases'])} record shape fixtures") +print(f"PASS: {len(record_fixtures['typeCases'])} path fixtures") +vectors = load("fingerprint-vectors.json") +assert vectors["vectorVersion"] == 1 +baseline_digest = vectors["vectors"][0]["digest"] +for vector in vectors["vectors"]: + data = deepcopy(vector["input"]) + assert set(vectors["excludedInputs"]).isdisjoint(data) + assert len({skill["id"] for skill in data["skills"]}) == len(data["skills"]) + data["skills"].sort(key=lambda item: item["id"]) + canonical = json.dumps(data, sort_keys=True, separators=(",", ":"), ensure_ascii=False) + assert canonical.isascii(), "These fixtures do not establish general Unicode JCS behavior" + digest = "sha256:" + hashlib.sha256(canonical.encode("utf-8")).hexdigest() + assert canonical == vector["canonical"] and digest == vector["digest"], vector["name"] + assert (digest == baseline_digest) == (vector["relationToBaseline"] == "same") +print(f"PASS: {len(vectors['vectors'])} restricted-domain fingerprint vectors") +runtime = load("runtime.schema.json") +Draft202012Validator.check_schema(runtime) +for name in ("id", "runtimeId", "revision", "digest", "time", "actor", "artifactRef"): + assert runtime["$defs"][name] == schema["$defs"][name], name +assert runtime["$defs"]["operation"] == records["$defs"]["operation"] +assert set(runtime["$defs"]["controlRequest"]["properties"]["operation"]["enum"]) == ( + set(records["$defs"]["operation"]["enum"]) - {"command.execute"} +) +projection_validator = Draft202012Validator( + {"$ref": "#/$defs/baseProjection", "$defs": runtime["$defs"]}, + format_checker=formats) +for vector in vectors["vectors"]: + assert projection_validator.is_valid(vector["input"]), vector["name"] +runtime_validator = Draft202012Validator(runtime, format_checker=formats) +runtime_fixtures = load("runtime.fixtures.json") +assert runtime_fixtures["fixtureVersion"] == 1 +runtime_failures = [] +for case in runtime_fixtures["cases"] + runtime_fixtures["semanticObligations"]: + if runtime_validator.is_valid(case["document"]) != case["schemaValid"]: + runtime_failures.append(case["name"]) +if runtime_failures: + raise SystemExit("FAIL runtime: " + ", ".join(runtime_failures)) +print(f"PASS: {len(runtime_fixtures['cases'])} runtime/artifact shape fixtures") +print(f"PASS: {len(runtime_fixtures['semanticObligations'])} runtime semantic obligations remain shape-valid") +model_fixtures = load("semantic-model.fixtures.json") +assert model_fixtures["fixtureVersion"] == 1 +model = runpy.run_path(str(ROOT / "semantic-model.py"))["evaluate"] +for case in model_fixtures["cases"]: + assert model(case) == case["expected"], case["name"] +for bundle in (fixtures, record_fixtures, runtime_fixtures, model_fixtures): + case_names = [case["name"] for case in bundle["cases"] + + bundle.get("semanticObligations", [])] + assert len(case_names) == len(set(case_names)), "Duplicate fixture names" +print(f"PASS: {len(model_fixtures['cases'])} synthetic reference/permission/lifecycle model cases") +print("Runtime semantic enforcement is NOT implemented or tested by these checks.") diff --git a/docs/plans/foundation-v1-candidate/command-events.fixtures.json b/docs/plans/foundation-v1-candidate/command-events.fixtures.json new file mode 100644 index 00000000..41e4fd6d --- /dev/null +++ b/docs/plans/foundation-v1-candidate/command-events.fixtures.json @@ -0,0 +1,2719 @@ +{ + "fixtureVersion": 1, + "cases": [ + { + "name": "request", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000003", + "operation": "command.execute", + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "timeoutSeconds": 60 + } + }, + { + "name": "intent", + "schemaValid": true, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000004", + "eventType": "command.intent", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 1, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000007", + "payload": { + "requestId": "00000000-0000-4000-8000-000000000003", + "requestDigest": "sha256:1111111111111111111111111111111111111111111111111111111111111111", + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "limitsRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "coverage": "command-invocation-v1" + } + } + }, + { + "name": "started", + "schemaValid": true, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000008", + "eventType": "command.started", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 2, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000004", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "processRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "finished", + "schemaValid": true, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "succeeded", + "exitCode": 0, + "signal": null, + "termination": "confirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "unverified", + "evidenceRefs": [] + } + } + }, + { + "name": "unknown", + "schemaValid": true, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "unknown", + "exitCode": null, + "signal": null, + "termination": "unconfirmed", + "terminationProofRef": null, + "effects": "unverified", + "evidenceRefs": [] + } + } + }, + { + "name": "failed", + "schemaValid": true, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "failed", + "exitCode": 1, + "signal": null, + "termination": "confirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "unverified", + "evidenceRefs": [] + } + } + }, + { + "name": "not-started", + "schemaValid": true, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "failed", + "exitCode": null, + "signal": null, + "termination": "not-started", + "terminationProofRef": null, + "effects": "not-issued", + "evidenceRefs": [] + } + } + }, + { + "name": "recovered", + "schemaValid": true, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000010", + "eventType": "command.recovered", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 4, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000009", + "payload": { + "priorEventId": "00000000-0000-4000-8000-000000000009", + "checkEventIds": [ + "00000000-0000-4000-8000-000000000011" + ], + "decisionRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "result": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "succeeded", + "exitCode": 0, + "signal": null, + "termination": "confirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "unverified", + "evidenceRefs": [] + } + } + } + }, + { + "name": "unknown-request-field", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000003", + "operation": "command.execute", + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "timeoutSeconds": 60, + "actor": { + "kind": "human", + "principalId": "invented", + "executionId": null + } + } + }, + { + "name": "wrong-request-version", + "schemaValid": false, + "document": { + "requestVersion": 2, + "requestId": "00000000-0000-4000-8000-000000000003", + "operation": "command.execute", + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "timeoutSeconds": 60 + } + }, + { + "name": "missing-workspace", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000003", + "operation": "command.execute", + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "timeoutSeconds": 60 + } + }, + { + "name": "traversal-id", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000003", + "operation": "command.execute", + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "../other" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "timeoutSeconds": 60 + } + }, + { + "name": "zero-revision", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000003", + "operation": "command.execute", + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 0 + } + }, + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "timeoutSeconds": 60 + } + }, + { + "name": "missing-assignment", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000003", + "operation": "command.execute", + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "timeoutSeconds": 60 + } + }, + { + "name": "wrong-reference-kind", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000003", + "operation": "command.execute", + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "task", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "timeoutSeconds": 60 + } + }, + { + "name": "zero-timeout", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000003", + "operation": "command.execute", + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "timeoutSeconds": 0 + } + }, + { + "name": "oversize-timeout", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000003", + "operation": "command.execute", + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "timeoutSeconds": 601 + } + }, + { + "name": "unsafe-integer", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000003", + "operation": "command.execute", + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 9007199254740992, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "timeoutSeconds": 60 + } + }, + { + "name": "malformed-runtime-id", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "not-a-uuid", + "operation": "command.execute", + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "timeoutSeconds": 60 + } + }, + { + "name": "unknown-event-field", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000004", + "eventType": "command.intent", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 1, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000007", + "payload": { + "requestId": "00000000-0000-4000-8000-000000000003", + "requestDigest": "sha256:1111111111111111111111111111111111111111111111111111111111111111", + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "limitsRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "coverage": "command-invocation-v1" + }, + "rawEnvironment": {} + } + }, + { + "name": "unknown-payload-field", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000004", + "eventType": "command.intent", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 1, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000007", + "payload": { + "requestId": "00000000-0000-4000-8000-000000000003", + "requestDigest": "sha256:1111111111111111111111111111111111111111111111111111111111111111", + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "limitsRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "coverage": "command-invocation-v1", + "rawCommand": "synthetic-placeholder" + } + } + }, + { + "name": "unsupported-coverage", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000004", + "eventType": "command.intent", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 1, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000007", + "payload": { + "requestId": "00000000-0000-4000-8000-000000000003", + "requestDigest": "sha256:1111111111111111111111111111111111111111111111111111111111111111", + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "limitsRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "coverage": "every-internal-effect" + } + } + }, + { + "name": "invalid-calendar-date", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000004", + "eventType": "command.intent", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 1, + "recordedAt": "2026-02-30T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000007", + "payload": { + "requestId": "00000000-0000-4000-8000-000000000003", + "requestDigest": "sha256:1111111111111111111111111111111111111111111111111111111111111111", + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "limitsRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "coverage": "command-invocation-v1" + } + } + }, + { + "name": "noncanonical-time", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000004", + "eventType": "command.intent", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 1, + "recordedAt": "2026-09-06T03:00:00Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000007", + "payload": { + "requestId": "00000000-0000-4000-8000-000000000003", + "requestDigest": "sha256:1111111111111111111111111111111111111111111111111111111111111111", + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "limitsRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "coverage": "command-invocation-v1" + } + } + }, + { + "name": "missing-producer", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000004", + "eventType": "command.intent", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 1, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000007", + "payload": { + "requestId": "00000000-0000-4000-8000-000000000003", + "requestDigest": "sha256:1111111111111111111111111111111111111111111111111111111111111111", + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "limitsRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "coverage": "command-invocation-v1" + } + } + }, + { + "name": "agent-without-execution", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000004", + "eventType": "command.intent", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 1, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": null + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000007", + "payload": { + "requestId": "00000000-0000-4000-8000-000000000003", + "requestDigest": "sha256:1111111111111111111111111111111111111111111111111111111111111111", + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "limitsRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "coverage": "command-invocation-v1" + } + } + }, + { + "name": "human-with-execution", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000004", + "eventType": "command.intent", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 1, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "human", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000007", + "payload": { + "requestId": "00000000-0000-4000-8000-000000000003", + "requestDigest": "sha256:1111111111111111111111111111111111111111111111111111111111111111", + "commandSpecRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "limitsRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "coverage": "command-invocation-v1" + } + } + }, + { + "name": "mixed-event-payload", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000008", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 2, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000004", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "processRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "success-nonzero-exit", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "succeeded", + "exitCode": 1, + "signal": null, + "termination": "confirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "unverified", + "evidenceRefs": [] + } + } + }, + { + "name": "success-without-termination", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "succeeded", + "exitCode": 0, + "signal": null, + "termination": "unconfirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "unverified", + "evidenceRefs": [] + } + } + }, + { + "name": "success-without-proof", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "succeeded", + "exitCode": 0, + "signal": null, + "termination": "confirmed", + "terminationProofRef": null, + "effects": "unverified", + "evidenceRefs": [] + } + } + }, + { + "name": "unknown-with-proof", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "unknown", + "exitCode": null, + "signal": null, + "termination": "unconfirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "unverified", + "evidenceRefs": [] + } + } + }, + { + "name": "not-started-with-exit", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "failed", + "exitCode": 0, + "signal": null, + "termination": "not-started", + "terminationProofRef": null, + "effects": "not-issued", + "evidenceRefs": [] + } + } + }, + { + "name": "duplicate-evidence", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "succeeded", + "exitCode": 0, + "signal": null, + "termination": "confirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "unverified", + "evidenceRefs": [ + { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ] + } + } + }, + { + "name": "duplicate-recovery-check", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000010", + "eventType": "command.recovered", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 4, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000009", + "payload": { + "priorEventId": "00000000-0000-4000-8000-000000000009", + "checkEventIds": [ + "00000000-0000-4000-8000-000000000011", + "00000000-0000-4000-8000-000000000011" + ], + "decisionRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "result": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "succeeded", + "exitCode": 0, + "signal": null, + "termination": "confirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "unverified", + "evidenceRefs": [] + } + } + } + }, + { + "name": "recovery-without-check", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000010", + "eventType": "command.recovered", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 4, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000009", + "payload": { + "priorEventId": "00000000-0000-4000-8000-000000000009", + "checkEventIds": [], + "decisionRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "result": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "succeeded", + "exitCode": 0, + "signal": null, + "termination": "confirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "unverified", + "evidenceRefs": [] + } + } + } + }, + { + "name": "failed-zero-exit", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "failed", + "exitCode": 0, + "signal": null, + "termination": "confirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "unverified", + "evidenceRefs": [] + } + } + }, + { + "name": "reconciled-without-evidence", + "schemaValid": false, + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "succeeded", + "exitCode": 0, + "signal": null, + "termination": "confirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "reconciled", + "evidenceRefs": [] + } + } + } + ], + "semanticObligations": [ + { + "name": "forged-producer", + "schemaValid": true, + "requiredRuntimeCheck": "Authenticate the producer channel; never trust a JSON identity.", + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000900" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "succeeded", + "exitCode": 0, + "signal": null, + "termination": "confirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "unverified", + "evidenceRefs": [] + } + } + }, + { + "name": "wrong-assignment-scope", + "schemaValid": true, + "requiredRuntimeCheck": "Resolve and compare the entire assignment/task/execution scope.", + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "other-workspace" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "succeeded", + "exitCode": 0, + "signal": null, + "termination": "confirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "unverified", + "evidenceRefs": [] + } + } + }, + { + "name": "stale-generation", + "schemaValid": true, + "requiredRuntimeCheck": "Compare against the current live admission generation.", + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 2, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "succeeded", + "exitCode": 0, + "signal": null, + "termination": "confirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "unverified", + "evidenceRefs": [] + } + } + }, + { + "name": "wrong-principal", + "schemaValid": true, + "requiredRuntimeCheck": "Bind performer identity to the authenticated execution.", + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "other-agent", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "succeeded", + "exitCode": 0, + "signal": null, + "termination": "confirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "artifact-fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "unverified", + "evidenceRefs": [] + } + } + }, + { + "name": "invented-proof", + "schemaValid": true, + "requiredRuntimeCheck": "Resolve and authenticate actual process-group termination evidence.", + "document": { + "eventVersion": 1, + "eventId": "00000000-0000-4000-8000-000000000009", + "eventType": "command.finished", + "commandId": "00000000-0000-4000-8000-000000000005", + "sequence": 3, + "recordedAt": "2026-09-06T03:00:00.000Z", + "observedAt": "2026-09-06T03:00:00.000Z", + "actor": { + "kind": "agent", + "principalId": "agent-fixture", + "executionId": "00000000-0000-4000-8000-000000000002" + }, + "producer": { + "componentId": "command-gateway", + "instanceId": "00000000-0000-4000-8000-000000000006" + }, + "binding": { + "agentId": "agent-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000002", + "claimGeneration": 1, + "assignmentRef": { + "kind": "assignment", + "id": "assignment-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + }, + "taskRef": { + "kind": "task", + "id": "task-fixture", + "scope": { + "kind": "workspace", + "projectId": "project-fixture", + "workspaceId": "workspace-fixture" + }, + "revision": 1 + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000007", + "causedByEventId": "00000000-0000-4000-8000-000000000008", + "payload": { + "intentEventId": "00000000-0000-4000-8000-000000000004", + "outcome": "succeeded", + "exitCode": 0, + "signal": null, + "termination": "confirmed", + "terminationProofRef": { + "runId": "r-fixture", + "artifactId": "missing-proof", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "effects": "unverified", + "evidenceRefs": [] + } + } + } + ] +} diff --git a/docs/plans/foundation-v1-candidate/command-events.schema.json b/docs/plans/foundation-v1-candidate/command-events.schema.json new file mode 100644 index 00000000..5196bbef --- /dev/null +++ b/docs/plans/foundation-v1-candidate/command-events.schema.json @@ -0,0 +1,195 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "urn:mosaic:planning:issue-53:command-events:candidate-1", + "title": "Planning candidate only: managed command request and evidence", + "description": "Not a runtime contract. Schema validity does not prove authentication, authorization, containment, durable recording, or reference integrity.", + "oneOf": [ + { "$ref": "#/$defs/request" }, + { "$ref": "#/$defs/event" } + ], + "$defs": { + "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$" }, + "runtimeId": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" }, + "revision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, + "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }, + "time": { "type": "string", "format": "date-time", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$" }, + "scope": { + "type": "object", "additionalProperties": false, + "required": ["kind", "projectId", "workspaceId"], + "properties": { + "kind": { "const": "workspace" }, + "projectId": { "$ref": "#/$defs/id" }, + "workspaceId": { "$ref": "#/$defs/id" } + } + }, + "workRef": { + "type": "object", "additionalProperties": false, + "required": ["kind", "id", "scope", "revision"], + "properties": { + "kind": { "enum": ["task", "assignment"] }, + "id": { "$ref": "#/$defs/id" }, + "scope": { "$ref": "#/$defs/scope" }, + "revision": { "$ref": "#/$defs/revision" } + } + }, + "taskRef": { "allOf": [{ "$ref": "#/$defs/workRef" }, { "properties": { "kind": { "const": "task" } } }] }, + "assignmentRef": { "allOf": [{ "$ref": "#/$defs/workRef" }, { "properties": { "kind": { "const": "assignment" } } }] }, + "artifactRef": { + "type": "object", "additionalProperties": false, + "required": ["runId", "artifactId", "digest"], + "properties": { + "runId": { "$ref": "#/$defs/id" }, + "artifactId": { "$ref": "#/$defs/id" }, + "digest": { "$ref": "#/$defs/digest" } + } + }, + "actor": { + "type": "object", "additionalProperties": false, + "required": ["kind", "principalId", "executionId"], + "properties": { + "kind": { "enum": ["human", "service", "agent"] }, + "principalId": { "$ref": "#/$defs/id" }, + "executionId": { "oneOf": [{ "$ref": "#/$defs/runtimeId" }, { "type": "null" }] } + }, + "if": { "properties": { "kind": { "const": "agent" } } }, + "then": { "properties": { "executionId": { "$ref": "#/$defs/runtimeId" } } }, + "else": { "properties": { "executionId": { "type": "null" } } } + }, + "binding": { + "type": "object", "additionalProperties": false, + "required": ["agentId", "scope", "sessionId", "executionId", "claimGeneration", "assignmentRef", "taskRef"], + "properties": { + "agentId": { "$ref": "#/$defs/id" }, + "scope": { "$ref": "#/$defs/scope" }, + "sessionId": { "$ref": "#/$defs/runtimeId" }, + "executionId": { "$ref": "#/$defs/runtimeId" }, + "claimGeneration": { "$ref": "#/$defs/revision" }, + "assignmentRef": { "$ref": "#/$defs/assignmentRef" }, + "taskRef": { "$ref": "#/$defs/taskRef" } + } + }, + "request": { + "type": "object", "additionalProperties": false, + "required": ["requestVersion", "requestId", "operation", "binding", "commandSpecRef", "timeoutSeconds"], + "properties": { + "requestVersion": { "const": 1 }, + "requestId": { "$ref": "#/$defs/runtimeId" }, + "operation": { "const": "command.execute" }, + "binding": { "$ref": "#/$defs/binding" }, + "commandSpecRef": { "$ref": "#/$defs/artifactRef" }, + "timeoutSeconds": { "type": "integer", "minimum": 1, "maximum": 600 } + } + }, + "producer": { + "type": "object", "additionalProperties": false, + "required": ["componentId", "instanceId"], + "properties": { + "componentId": { "$ref": "#/$defs/id" }, + "instanceId": { "$ref": "#/$defs/runtimeId" } + } + }, + "intent": { + "type": "object", "additionalProperties": false, + "required": ["requestId", "requestDigest", "commandSpecRef", "limitsRef", "coverage"], + "properties": { + "requestId": { "$ref": "#/$defs/runtimeId" }, + "requestDigest": { "$ref": "#/$defs/digest" }, + "commandSpecRef": { "$ref": "#/$defs/artifactRef" }, + "limitsRef": { "$ref": "#/$defs/artifactRef" }, + "coverage": { "const": "command-invocation-v1" } + } + }, + "started": { + "type": "object", "additionalProperties": false, + "required": ["intentEventId", "processRef"], + "properties": { + "intentEventId": { "$ref": "#/$defs/runtimeId" }, + "processRef": { "$ref": "#/$defs/artifactRef" } + } + }, + "finished": { + "type": "object", "additionalProperties": false, + "required": ["intentEventId", "outcome", "exitCode", "signal", "termination", "terminationProofRef", "effects", "evidenceRefs"], + "properties": { + "intentEventId": { "$ref": "#/$defs/runtimeId" }, + "outcome": { "enum": ["succeeded", "failed", "canceled", "unknown"] }, + "exitCode": { "type": ["integer", "null"], "minimum": 0, "maximum": 255 }, + "signal": { "oneOf": [{ "type": "null" }, { "type": "string", "pattern": "^SIG[A-Z0-9]{1,16}$" }] }, + "termination": { "enum": ["confirmed", "unconfirmed", "not-started"] }, + "terminationProofRef": { "oneOf": [{ "$ref": "#/$defs/artifactRef" }, { "type": "null" }] }, + "effects": { "enum": ["not-issued", "unverified", "reconciled"] }, + "evidenceRefs": { "type": "array", "maxItems": 1024, "uniqueItems": true, "items": { "$ref": "#/$defs/artifactRef" } } + }, + "allOf": [ + { + "if": { "properties": { "outcome": { "const": "succeeded" } } }, + "then": { "properties": { "exitCode": { "const": 0 }, "signal": { "type": "null" }, "termination": { "const": "confirmed" }, "effects": { "enum": ["unverified", "reconciled"] } } } + }, + { + "if": { "properties": { "termination": { "const": "confirmed" } } }, + "then": { "properties": { "terminationProofRef": { "$ref": "#/$defs/artifactRef" } } }, + "else": { "properties": { "terminationProofRef": { "type": "null" } } } + }, + { + "if": { "properties": { "termination": { "const": "unconfirmed" } } }, + "then": { "properties": { "outcome": { "const": "unknown" }, "effects": { "const": "unverified" } } } + }, + { + "if": { "properties": { "termination": { "const": "not-started" } } }, + "then": { "properties": { "outcome": { "enum": ["failed", "canceled"] }, "exitCode": { "type": "null" }, "signal": { "type": "null" }, "effects": { "const": "not-issued" } } }, + "else": { "properties": { "effects": { "enum": ["unverified", "reconciled"] } } } + }, + { + "if": { "properties": { "signal": { "type": "string" } } }, + "then": { "properties": { "exitCode": { "type": "null" } } } + }, + { + "if": { "properties": { "outcome": { "const": "failed" }, "termination": { "const": "confirmed" } } }, + "then": { "anyOf": [ + { "properties": { "exitCode": { "type": "integer", "minimum": 1 } } }, + { "properties": { "signal": { "type": "string" } } } + ] } + }, + { + "if": { "properties": { "effects": { "const": "reconciled" } } }, + "then": { "properties": { "evidenceRefs": { "minItems": 1 } } } + } + ] + }, + "recovered": { + "type": "object", "additionalProperties": false, + "required": ["priorEventId", "checkEventIds", "decisionRef", "result"], + "properties": { + "priorEventId": { "$ref": "#/$defs/runtimeId" }, + "checkEventIds": { "type": "array", "minItems": 1, "maxItems": 1024, "uniqueItems": true, "items": { "$ref": "#/$defs/runtimeId" } }, + "decisionRef": { "$ref": "#/$defs/artifactRef" }, + "result": { "$ref": "#/$defs/finished" } + } + }, + "event": { + "type": "object", "additionalProperties": false, + "required": ["eventVersion", "eventId", "eventType", "commandId", "sequence", "recordedAt", "observedAt", "actor", "producer", "binding", "authorizationRef", "causedByEventId", "payload"], + "properties": { + "eventVersion": { "const": 1 }, + "eventId": { "$ref": "#/$defs/runtimeId" }, + "eventType": { "enum": ["command.intent", "command.started", "command.finished", "command.recovered"] }, + "commandId": { "$ref": "#/$defs/runtimeId" }, + "sequence": { "$ref": "#/$defs/revision" }, + "recordedAt": { "$ref": "#/$defs/time" }, + "observedAt": { "$ref": "#/$defs/time" }, + "actor": { "$ref": "#/$defs/actor" }, + "producer": { "$ref": "#/$defs/producer" }, + "binding": { "$ref": "#/$defs/binding" }, + "authorizationRef": { "$ref": "#/$defs/runtimeId" }, + "causedByEventId": { "$ref": "#/$defs/runtimeId" }, + "payload": { "type": "object" } + }, + "allOf": [ + { "if": { "properties": { "eventType": { "const": "command.intent" } } }, "then": { "properties": { "payload": { "$ref": "#/$defs/intent" } } } }, + { "if": { "properties": { "eventType": { "const": "command.started" } } }, "then": { "properties": { "payload": { "$ref": "#/$defs/started" } } } }, + { "if": { "properties": { "eventType": { "const": "command.finished" } } }, "then": { "properties": { "payload": { "$ref": "#/$defs/finished" } } } }, + { "if": { "properties": { "eventType": { "const": "command.recovered" } } }, "then": { "properties": { "payload": { "$ref": "#/$defs/recovered" } } } } + ] + } + } +} diff --git a/docs/plans/foundation-v1-candidate/fingerprint-vectors.json b/docs/plans/foundation-v1-candidate/fingerprint-vectors.json new file mode 100644 index 00000000..46b2e992 --- /dev/null +++ b/docs/plans/foundation-v1-candidate/fingerprint-vectors.json @@ -0,0 +1,295 @@ +{ + "vectorVersion": 1, + "scope": "ASCII keys and values plus safe integers only; no general RFC 8785 implementation claim", + "vectors": [ + { + "name": "baseline", + "input": { + "hashScopeVersion": 1, + "agentId": "agent-fixture", + "soulDigest": "sha256:e3c07000f9fb5e89ca8a489d9e2701b99f858dd735aabbb9cedb0455348b2cc2", + "instructions": [ + { + "id": "instruction-a", + "digest": "sha256:1b10996322128f9c87fdfdeaa052b4a915cfb47265c0f499e9ef8dd0ab0f02ce" + }, + { + "id": "instruction-b", + "digest": "sha256:f41cff3c94eef22b1fa1ebf50ecf5a0a06ec275e5c7929da95ece66cac13eb00" + } + ], + "skills": [ + { + "id": "skill-a", + "version": "1.0.0", + "digest": "sha256:c99aba8fe6d6d7f0e76a1bbd21e31fa8d2f624cb08918526fef3e7643c4e4ef8" + }, + { + "id": "skill-b", + "version": "1.0.0", + "digest": "sha256:f1f1581311e9f7cb73eb43913fed3fd894c1180af8d817d143b40f635c0ff61b" + } + ], + "harness": { + "id": "pi", + "version": "0.84.4", + "digest": "sha256:3a035a4176b40589ade570419395d80c0e38c18579db48f6a32e5661bee1fe1c" + }, + "modelSettingsDigest": "sha256:10a0e705a201f894d7ea5f6176d53b6b64e206aa928a38d0d2c218aac89952f9", + "roleConfigDigest": "sha256:c73b3b8eae276f63c1bdc0b43cfa46c011f1dee52a4dcad487e21f21730a009c" + }, + "canonical": "{\"agentId\":\"agent-fixture\",\"harness\":{\"digest\":\"sha256:3a035a4176b40589ade570419395d80c0e38c18579db48f6a32e5661bee1fe1c\",\"id\":\"pi\",\"version\":\"0.84.4\"},\"hashScopeVersion\":1,\"instructions\":[{\"digest\":\"sha256:1b10996322128f9c87fdfdeaa052b4a915cfb47265c0f499e9ef8dd0ab0f02ce\",\"id\":\"instruction-a\"},{\"digest\":\"sha256:f41cff3c94eef22b1fa1ebf50ecf5a0a06ec275e5c7929da95ece66cac13eb00\",\"id\":\"instruction-b\"}],\"modelSettingsDigest\":\"sha256:10a0e705a201f894d7ea5f6176d53b6b64e206aa928a38d0d2c218aac89952f9\",\"roleConfigDigest\":\"sha256:c73b3b8eae276f63c1bdc0b43cfa46c011f1dee52a4dcad487e21f21730a009c\",\"skills\":[{\"digest\":\"sha256:c99aba8fe6d6d7f0e76a1bbd21e31fa8d2f624cb08918526fef3e7643c4e4ef8\",\"id\":\"skill-a\",\"version\":\"1.0.0\"},{\"digest\":\"sha256:f1f1581311e9f7cb73eb43913fed3fd894c1180af8d817d143b40f635c0ff61b\",\"id\":\"skill-b\",\"version\":\"1.0.0\"}],\"soulDigest\":\"sha256:e3c07000f9fb5e89ca8a489d9e2701b99f858dd735aabbb9cedb0455348b2cc2\"}", + "digest": "sha256:adf4c227fb2cfbf04f4fcb9e0d616242ab69932a5865c42d2f8a01af149d140c", + "relationToBaseline": "same" + }, + { + "name": "skill-set-reordering", + "input": { + "hashScopeVersion": 1, + "agentId": "agent-fixture", + "soulDigest": "sha256:e3c07000f9fb5e89ca8a489d9e2701b99f858dd735aabbb9cedb0455348b2cc2", + "instructions": [ + { + "id": "instruction-a", + "digest": "sha256:1b10996322128f9c87fdfdeaa052b4a915cfb47265c0f499e9ef8dd0ab0f02ce" + }, + { + "id": "instruction-b", + "digest": "sha256:f41cff3c94eef22b1fa1ebf50ecf5a0a06ec275e5c7929da95ece66cac13eb00" + } + ], + "skills": [ + { + "id": "skill-b", + "version": "1.0.0", + "digest": "sha256:f1f1581311e9f7cb73eb43913fed3fd894c1180af8d817d143b40f635c0ff61b" + }, + { + "id": "skill-a", + "version": "1.0.0", + "digest": "sha256:c99aba8fe6d6d7f0e76a1bbd21e31fa8d2f624cb08918526fef3e7643c4e4ef8" + } + ], + "harness": { + "id": "pi", + "version": "0.84.4", + "digest": "sha256:3a035a4176b40589ade570419395d80c0e38c18579db48f6a32e5661bee1fe1c" + }, + "modelSettingsDigest": "sha256:10a0e705a201f894d7ea5f6176d53b6b64e206aa928a38d0d2c218aac89952f9", + "roleConfigDigest": "sha256:c73b3b8eae276f63c1bdc0b43cfa46c011f1dee52a4dcad487e21f21730a009c" + }, + "canonical": "{\"agentId\":\"agent-fixture\",\"harness\":{\"digest\":\"sha256:3a035a4176b40589ade570419395d80c0e38c18579db48f6a32e5661bee1fe1c\",\"id\":\"pi\",\"version\":\"0.84.4\"},\"hashScopeVersion\":1,\"instructions\":[{\"digest\":\"sha256:1b10996322128f9c87fdfdeaa052b4a915cfb47265c0f499e9ef8dd0ab0f02ce\",\"id\":\"instruction-a\"},{\"digest\":\"sha256:f41cff3c94eef22b1fa1ebf50ecf5a0a06ec275e5c7929da95ece66cac13eb00\",\"id\":\"instruction-b\"}],\"modelSettingsDigest\":\"sha256:10a0e705a201f894d7ea5f6176d53b6b64e206aa928a38d0d2c218aac89952f9\",\"roleConfigDigest\":\"sha256:c73b3b8eae276f63c1bdc0b43cfa46c011f1dee52a4dcad487e21f21730a009c\",\"skills\":[{\"digest\":\"sha256:c99aba8fe6d6d7f0e76a1bbd21e31fa8d2f624cb08918526fef3e7643c4e4ef8\",\"id\":\"skill-a\",\"version\":\"1.0.0\"},{\"digest\":\"sha256:f1f1581311e9f7cb73eb43913fed3fd894c1180af8d817d143b40f635c0ff61b\",\"id\":\"skill-b\",\"version\":\"1.0.0\"}],\"soulDigest\":\"sha256:e3c07000f9fb5e89ca8a489d9e2701b99f858dd735aabbb9cedb0455348b2cc2\"}", + "digest": "sha256:adf4c227fb2cfbf04f4fcb9e0d616242ab69932a5865c42d2f8a01af149d140c", + "relationToBaseline": "same" + }, + { + "name": "instruction-order-change", + "input": { + "hashScopeVersion": 1, + "agentId": "agent-fixture", + "soulDigest": "sha256:e3c07000f9fb5e89ca8a489d9e2701b99f858dd735aabbb9cedb0455348b2cc2", + "instructions": [ + { + "id": "instruction-b", + "digest": "sha256:f41cff3c94eef22b1fa1ebf50ecf5a0a06ec275e5c7929da95ece66cac13eb00" + }, + { + "id": "instruction-a", + "digest": "sha256:1b10996322128f9c87fdfdeaa052b4a915cfb47265c0f499e9ef8dd0ab0f02ce" + } + ], + "skills": [ + { + "id": "skill-a", + "version": "1.0.0", + "digest": "sha256:c99aba8fe6d6d7f0e76a1bbd21e31fa8d2f624cb08918526fef3e7643c4e4ef8" + }, + { + "id": "skill-b", + "version": "1.0.0", + "digest": "sha256:f1f1581311e9f7cb73eb43913fed3fd894c1180af8d817d143b40f635c0ff61b" + } + ], + "harness": { + "id": "pi", + "version": "0.84.4", + "digest": "sha256:3a035a4176b40589ade570419395d80c0e38c18579db48f6a32e5661bee1fe1c" + }, + "modelSettingsDigest": "sha256:10a0e705a201f894d7ea5f6176d53b6b64e206aa928a38d0d2c218aac89952f9", + "roleConfigDigest": "sha256:c73b3b8eae276f63c1bdc0b43cfa46c011f1dee52a4dcad487e21f21730a009c" + }, + "canonical": "{\"agentId\":\"agent-fixture\",\"harness\":{\"digest\":\"sha256:3a035a4176b40589ade570419395d80c0e38c18579db48f6a32e5661bee1fe1c\",\"id\":\"pi\",\"version\":\"0.84.4\"},\"hashScopeVersion\":1,\"instructions\":[{\"digest\":\"sha256:f41cff3c94eef22b1fa1ebf50ecf5a0a06ec275e5c7929da95ece66cac13eb00\",\"id\":\"instruction-b\"},{\"digest\":\"sha256:1b10996322128f9c87fdfdeaa052b4a915cfb47265c0f499e9ef8dd0ab0f02ce\",\"id\":\"instruction-a\"}],\"modelSettingsDigest\":\"sha256:10a0e705a201f894d7ea5f6176d53b6b64e206aa928a38d0d2c218aac89952f9\",\"roleConfigDigest\":\"sha256:c73b3b8eae276f63c1bdc0b43cfa46c011f1dee52a4dcad487e21f21730a009c\",\"skills\":[{\"digest\":\"sha256:c99aba8fe6d6d7f0e76a1bbd21e31fa8d2f624cb08918526fef3e7643c4e4ef8\",\"id\":\"skill-a\",\"version\":\"1.0.0\"},{\"digest\":\"sha256:f1f1581311e9f7cb73eb43913fed3fd894c1180af8d817d143b40f635c0ff61b\",\"id\":\"skill-b\",\"version\":\"1.0.0\"}],\"soulDigest\":\"sha256:e3c07000f9fb5e89ca8a489d9e2701b99f858dd735aabbb9cedb0455348b2cc2\"}", + "digest": "sha256:7512d1c8dec7a2894ce218ff5ccb71a09df7ffa0a15d3ea67d11378bf611b7e7", + "relationToBaseline": "different" + }, + { + "name": "soul-content-change", + "input": { + "hashScopeVersion": 1, + "agentId": "agent-fixture", + "soulDigest": "sha256:1e988c391be3a384709c5f72d59f55a30dc6b8990de89ce40bb29bff1dd0a61e", + "instructions": [ + { + "id": "instruction-a", + "digest": "sha256:1b10996322128f9c87fdfdeaa052b4a915cfb47265c0f499e9ef8dd0ab0f02ce" + }, + { + "id": "instruction-b", + "digest": "sha256:f41cff3c94eef22b1fa1ebf50ecf5a0a06ec275e5c7929da95ece66cac13eb00" + } + ], + "skills": [ + { + "id": "skill-a", + "version": "1.0.0", + "digest": "sha256:c99aba8fe6d6d7f0e76a1bbd21e31fa8d2f624cb08918526fef3e7643c4e4ef8" + }, + { + "id": "skill-b", + "version": "1.0.0", + "digest": "sha256:f1f1581311e9f7cb73eb43913fed3fd894c1180af8d817d143b40f635c0ff61b" + } + ], + "harness": { + "id": "pi", + "version": "0.84.4", + "digest": "sha256:3a035a4176b40589ade570419395d80c0e38c18579db48f6a32e5661bee1fe1c" + }, + "modelSettingsDigest": "sha256:10a0e705a201f894d7ea5f6176d53b6b64e206aa928a38d0d2c218aac89952f9", + "roleConfigDigest": "sha256:c73b3b8eae276f63c1bdc0b43cfa46c011f1dee52a4dcad487e21f21730a009c" + }, + "canonical": "{\"agentId\":\"agent-fixture\",\"harness\":{\"digest\":\"sha256:3a035a4176b40589ade570419395d80c0e38c18579db48f6a32e5661bee1fe1c\",\"id\":\"pi\",\"version\":\"0.84.4\"},\"hashScopeVersion\":1,\"instructions\":[{\"digest\":\"sha256:1b10996322128f9c87fdfdeaa052b4a915cfb47265c0f499e9ef8dd0ab0f02ce\",\"id\":\"instruction-a\"},{\"digest\":\"sha256:f41cff3c94eef22b1fa1ebf50ecf5a0a06ec275e5c7929da95ece66cac13eb00\",\"id\":\"instruction-b\"}],\"modelSettingsDigest\":\"sha256:10a0e705a201f894d7ea5f6176d53b6b64e206aa928a38d0d2c218aac89952f9\",\"roleConfigDigest\":\"sha256:c73b3b8eae276f63c1bdc0b43cfa46c011f1dee52a4dcad487e21f21730a009c\",\"skills\":[{\"digest\":\"sha256:c99aba8fe6d6d7f0e76a1bbd21e31fa8d2f624cb08918526fef3e7643c4e4ef8\",\"id\":\"skill-a\",\"version\":\"1.0.0\"},{\"digest\":\"sha256:f1f1581311e9f7cb73eb43913fed3fd894c1180af8d817d143b40f635c0ff61b\",\"id\":\"skill-b\",\"version\":\"1.0.0\"}],\"soulDigest\":\"sha256:1e988c391be3a384709c5f72d59f55a30dc6b8990de89ce40bb29bff1dd0a61e\"}", + "digest": "sha256:743afecfe90e5fc88e51efa712fed9bd8b21a63495f24862d8ae41b14c849ac4", + "relationToBaseline": "different" + }, + { + "name": "skill-version-change", + "input": { + "hashScopeVersion": 1, + "agentId": "agent-fixture", + "soulDigest": "sha256:e3c07000f9fb5e89ca8a489d9e2701b99f858dd735aabbb9cedb0455348b2cc2", + "instructions": [ + { + "id": "instruction-a", + "digest": "sha256:1b10996322128f9c87fdfdeaa052b4a915cfb47265c0f499e9ef8dd0ab0f02ce" + }, + { + "id": "instruction-b", + "digest": "sha256:f41cff3c94eef22b1fa1ebf50ecf5a0a06ec275e5c7929da95ece66cac13eb00" + } + ], + "skills": [ + { + "id": "skill-a", + "version": "1.0.1", + "digest": "sha256:c99aba8fe6d6d7f0e76a1bbd21e31fa8d2f624cb08918526fef3e7643c4e4ef8" + }, + { + "id": "skill-b", + "version": "1.0.0", + "digest": "sha256:f1f1581311e9f7cb73eb43913fed3fd894c1180af8d817d143b40f635c0ff61b" + } + ], + "harness": { + "id": "pi", + "version": "0.84.4", + "digest": "sha256:3a035a4176b40589ade570419395d80c0e38c18579db48f6a32e5661bee1fe1c" + }, + "modelSettingsDigest": "sha256:10a0e705a201f894d7ea5f6176d53b6b64e206aa928a38d0d2c218aac89952f9", + "roleConfigDigest": "sha256:c73b3b8eae276f63c1bdc0b43cfa46c011f1dee52a4dcad487e21f21730a009c" + }, + "canonical": "{\"agentId\":\"agent-fixture\",\"harness\":{\"digest\":\"sha256:3a035a4176b40589ade570419395d80c0e38c18579db48f6a32e5661bee1fe1c\",\"id\":\"pi\",\"version\":\"0.84.4\"},\"hashScopeVersion\":1,\"instructions\":[{\"digest\":\"sha256:1b10996322128f9c87fdfdeaa052b4a915cfb47265c0f499e9ef8dd0ab0f02ce\",\"id\":\"instruction-a\"},{\"digest\":\"sha256:f41cff3c94eef22b1fa1ebf50ecf5a0a06ec275e5c7929da95ece66cac13eb00\",\"id\":\"instruction-b\"}],\"modelSettingsDigest\":\"sha256:10a0e705a201f894d7ea5f6176d53b6b64e206aa928a38d0d2c218aac89952f9\",\"roleConfigDigest\":\"sha256:c73b3b8eae276f63c1bdc0b43cfa46c011f1dee52a4dcad487e21f21730a009c\",\"skills\":[{\"digest\":\"sha256:c99aba8fe6d6d7f0e76a1bbd21e31fa8d2f624cb08918526fef3e7643c4e4ef8\",\"id\":\"skill-a\",\"version\":\"1.0.1\"},{\"digest\":\"sha256:f1f1581311e9f7cb73eb43913fed3fd894c1180af8d817d143b40f635c0ff61b\",\"id\":\"skill-b\",\"version\":\"1.0.0\"}],\"soulDigest\":\"sha256:e3c07000f9fb5e89ca8a489d9e2701b99f858dd735aabbb9cedb0455348b2cc2\"}", + "digest": "sha256:e0f04f584a661c847aca886ff4283d6d30260ebe0a63a6e7ecb92f29ac91aa4f", + "relationToBaseline": "different" + }, + { + "name": "model-settings-change", + "input": { + "hashScopeVersion": 1, + "agentId": "agent-fixture", + "soulDigest": "sha256:e3c07000f9fb5e89ca8a489d9e2701b99f858dd735aabbb9cedb0455348b2cc2", + "instructions": [ + { + "id": "instruction-a", + "digest": "sha256:1b10996322128f9c87fdfdeaa052b4a915cfb47265c0f499e9ef8dd0ab0f02ce" + }, + { + "id": "instruction-b", + "digest": "sha256:f41cff3c94eef22b1fa1ebf50ecf5a0a06ec275e5c7929da95ece66cac13eb00" + } + ], + "skills": [ + { + "id": "skill-a", + "version": "1.0.0", + "digest": "sha256:c99aba8fe6d6d7f0e76a1bbd21e31fa8d2f624cb08918526fef3e7643c4e4ef8" + }, + { + "id": "skill-b", + "version": "1.0.0", + "digest": "sha256:f1f1581311e9f7cb73eb43913fed3fd894c1180af8d817d143b40f635c0ff61b" + } + ], + "harness": { + "id": "pi", + "version": "0.84.4", + "digest": "sha256:3a035a4176b40589ade570419395d80c0e38c18579db48f6a32e5661bee1fe1c" + }, + "modelSettingsDigest": "sha256:72cd5dffcf6b4b2cb1986845713df70a95132b430c9ad47d8b9e190d5eddf850", + "roleConfigDigest": "sha256:c73b3b8eae276f63c1bdc0b43cfa46c011f1dee52a4dcad487e21f21730a009c" + }, + "canonical": "{\"agentId\":\"agent-fixture\",\"harness\":{\"digest\":\"sha256:3a035a4176b40589ade570419395d80c0e38c18579db48f6a32e5661bee1fe1c\",\"id\":\"pi\",\"version\":\"0.84.4\"},\"hashScopeVersion\":1,\"instructions\":[{\"digest\":\"sha256:1b10996322128f9c87fdfdeaa052b4a915cfb47265c0f499e9ef8dd0ab0f02ce\",\"id\":\"instruction-a\"},{\"digest\":\"sha256:f41cff3c94eef22b1fa1ebf50ecf5a0a06ec275e5c7929da95ece66cac13eb00\",\"id\":\"instruction-b\"}],\"modelSettingsDigest\":\"sha256:72cd5dffcf6b4b2cb1986845713df70a95132b430c9ad47d8b9e190d5eddf850\",\"roleConfigDigest\":\"sha256:c73b3b8eae276f63c1bdc0b43cfa46c011f1dee52a4dcad487e21f21730a009c\",\"skills\":[{\"digest\":\"sha256:c99aba8fe6d6d7f0e76a1bbd21e31fa8d2f624cb08918526fef3e7643c4e4ef8\",\"id\":\"skill-a\",\"version\":\"1.0.0\"},{\"digest\":\"sha256:f1f1581311e9f7cb73eb43913fed3fd894c1180af8d817d143b40f635c0ff61b\",\"id\":\"skill-b\",\"version\":\"1.0.0\"}],\"soulDigest\":\"sha256:e3c07000f9fb5e89ca8a489d9e2701b99f858dd735aabbb9cedb0455348b2cc2\"}", + "digest": "sha256:a31265b96fa99f716115cde97292534316f67e4751c1acd83edfc9258e7234de", + "relationToBaseline": "different" + }, + { + "name": "role-configuration-change", + "input": { + "hashScopeVersion": 1, + "agentId": "agent-fixture", + "soulDigest": "sha256:e3c07000f9fb5e89ca8a489d9e2701b99f858dd735aabbb9cedb0455348b2cc2", + "instructions": [ + { + "id": "instruction-a", + "digest": "sha256:1b10996322128f9c87fdfdeaa052b4a915cfb47265c0f499e9ef8dd0ab0f02ce" + }, + { + "id": "instruction-b", + "digest": "sha256:f41cff3c94eef22b1fa1ebf50ecf5a0a06ec275e5c7929da95ece66cac13eb00" + } + ], + "skills": [ + { + "id": "skill-a", + "version": "1.0.0", + "digest": "sha256:c99aba8fe6d6d7f0e76a1bbd21e31fa8d2f624cb08918526fef3e7643c4e4ef8" + }, + { + "id": "skill-b", + "version": "1.0.0", + "digest": "sha256:f1f1581311e9f7cb73eb43913fed3fd894c1180af8d817d143b40f635c0ff61b" + } + ], + "harness": { + "id": "pi", + "version": "0.84.4", + "digest": "sha256:3a035a4176b40589ade570419395d80c0e38c18579db48f6a32e5661bee1fe1c" + }, + "modelSettingsDigest": "sha256:10a0e705a201f894d7ea5f6176d53b6b64e206aa928a38d0d2c218aac89952f9", + "roleConfigDigest": "sha256:8fd7961482cfd42e64fb7e3a5b878b1acf03d36d9f5266c06faa700d17647e4d" + }, + "canonical": "{\"agentId\":\"agent-fixture\",\"harness\":{\"digest\":\"sha256:3a035a4176b40589ade570419395d80c0e38c18579db48f6a32e5661bee1fe1c\",\"id\":\"pi\",\"version\":\"0.84.4\"},\"hashScopeVersion\":1,\"instructions\":[{\"digest\":\"sha256:1b10996322128f9c87fdfdeaa052b4a915cfb47265c0f499e9ef8dd0ab0f02ce\",\"id\":\"instruction-a\"},{\"digest\":\"sha256:f41cff3c94eef22b1fa1ebf50ecf5a0a06ec275e5c7929da95ece66cac13eb00\",\"id\":\"instruction-b\"}],\"modelSettingsDigest\":\"sha256:10a0e705a201f894d7ea5f6176d53b6b64e206aa928a38d0d2c218aac89952f9\",\"roleConfigDigest\":\"sha256:8fd7961482cfd42e64fb7e3a5b878b1acf03d36d9f5266c06faa700d17647e4d\",\"skills\":[{\"digest\":\"sha256:c99aba8fe6d6d7f0e76a1bbd21e31fa8d2f624cb08918526fef3e7643c4e4ef8\",\"id\":\"skill-a\",\"version\":\"1.0.0\"},{\"digest\":\"sha256:f1f1581311e9f7cb73eb43913fed3fd894c1180af8d817d143b40f635c0ff61b\",\"id\":\"skill-b\",\"version\":\"1.0.0\"}],\"soulDigest\":\"sha256:e3c07000f9fb5e89ca8a489d9e2701b99f858dd735aabbb9cedb0455348b2cc2\"}", + "digest": "sha256:00284f7073e857b7fd43d81ea3958d269ed07dbcf68a7b8b34661745836fba2e", + "relationToBaseline": "different" + } + ], + "excludedInputs": [ + "taskProgress", + "conversation", + "credentials", + "privateUserContext", + "displayName", + "recordedAt", + "sourceRecordRevision" + ] +} diff --git a/docs/plans/foundation-v1-candidate/records.fixtures.json b/docs/plans/foundation-v1-candidate/records.fixtures.json new file mode 100644 index 00000000..19d466d5 --- /dev/null +++ b/docs/plans/foundation-v1-candidate/records.fixtures.json @@ -0,0 +1,1607 @@ +{ + "fixtureVersion": 1, + "cases": [ + { + "name": "agent-definition", + "schemaValid": true, + "document": { + "schemaVersion": 1, + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "displayName": "fixture", + "agentType": "fixture", + "harnessRef": { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "settingsRef": { + "registry": "settings", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "soulRef": { + "registry": "context-content", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "instructionRefs": [], + "skillRefs": [], + "policyRef": { + "registry": "agent-policy", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "status": "enabled" + } + } + }, + { + "name": "project", + "schemaValid": true, + "document": { + "schemaVersion": 1, + "kind": "project", + "id": "fixture", + "scope": { + "kind": "project", + "projectId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "displayName": "fixture", + "policyRef": { + "registry": "project-policy", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "status": "active" + } + } + }, + { + "name": "workspace", + "schemaValid": true, + "document": { + "schemaVersion": 1, + "kind": "workspace", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "displayName": "fixture", + "policyRef": { + "registry": "project-policy", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "status": "active", + "fileRootId": "fixture" + } + } + }, + { + "name": "registration", + "schemaValid": true, + "document": { + "schemaVersion": 1, + "kind": "registration", + "id": "fixture", + "scope": { + "kind": "project", + "projectId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "agentId": "fixture", + "scopeRoleRef": { + "registry": "scope-role", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "restrictions": null, + "projectRegistrationRef": null, + "status": "active", + "delegationRef": null + } + } + }, + { + "name": "mission", + "schemaValid": true, + "document": { + "schemaVersion": 1, + "kind": "mission", + "id": "fixture", + "scope": { + "kind": "project", + "projectId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "objective": "fixture", + "criteria": [ + { + "id": "fixture", + "text": "fixture" + } + ], + "parentMissionRef": null, + "restrictions": null, + "status": "proposed" + } + } + }, + { + "name": "task", + "schemaValid": true, + "document": { + "schemaVersion": 1, + "kind": "task", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "purpose": "fixture", + "criteria": [ + { + "id": "fixture", + "text": "fixture" + } + ], + "missionRef": null, + "intentRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "dependencies": [], + "restrictions": null, + "status": "proposed" + } + } + }, + { + "name": "assignment", + "schemaValid": true, + "document": { + "schemaVersion": 1, + "kind": "assignment", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "taskRef": { + "kind": "task", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "agentId": "fixture", + "intentRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "status": "selected", + "endReason": null + } + } + }, + { + "name": "decision", + "schemaValid": true, + "document": { + "schemaVersion": 1, + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "decisionKind": "plan-approval", + "subjectRefs": [ + { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + ], + "outcome": "approved", + "basisRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "evidenceRefs": [], + "delegatedOperations": [] + } + } + }, + { + "name": "session", + "schemaValid": true, + "document": { + "schemaVersion": 1, + "kind": "session", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "agentId": "fixture", + "creationMode": "initial", + "predecessorRef": null, + "harnessRef": { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "harnessSessionId": "fixture", + "sessionArtifactId": "fixture" + } + } + }, + { + "name": "context-source", + "schemaValid": true, + "document": { + "schemaVersion": 1, + "kind": "context-source", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "contentRef": { + "registry": "context-content", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "category": "general-preference", + "sharedByDefault": false, + "permittedScopes": [ + { + "kind": "system" + } + ], + "relevanceRefs": [] + } + } + }, + { + "name": "adapter-capability", + "schemaValid": true, + "document": { + "schemaVersion": 1, + "kind": "adapter-capability", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "harnessRef": { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "operations": [], + "observableClasses": [], + "enforceableClasses": [], + "evidenceRefs": [], + "status": "documented-only" + } + } + }, + { + "name": "unknown-payload-agent-definition", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "displayName": "fixture", + "agentType": "fixture", + "harnessRef": { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "settingsRef": { + "registry": "settings", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "soulRef": { + "registry": "context-content", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "instructionRefs": [], + "skillRefs": [], + "policyRef": { + "registry": "agent-policy", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "status": "enabled", + "unexpected": true + } + } + }, + { + "name": "unknown-payload-project", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "project", + "id": "fixture", + "scope": { + "kind": "project", + "projectId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "displayName": "fixture", + "policyRef": { + "registry": "project-policy", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "status": "active", + "unexpected": true + } + } + }, + { + "name": "unknown-payload-workspace", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "workspace", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "displayName": "fixture", + "policyRef": { + "registry": "project-policy", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "status": "active", + "fileRootId": "fixture", + "unexpected": true + } + } + }, + { + "name": "unknown-payload-registration", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "registration", + "id": "fixture", + "scope": { + "kind": "project", + "projectId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "agentId": "fixture", + "scopeRoleRef": { + "registry": "scope-role", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "restrictions": null, + "projectRegistrationRef": null, + "status": "active", + "delegationRef": null, + "unexpected": true + } + } + }, + { + "name": "unknown-payload-mission", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "mission", + "id": "fixture", + "scope": { + "kind": "project", + "projectId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "objective": "fixture", + "criteria": [ + { + "id": "fixture", + "text": "fixture" + } + ], + "parentMissionRef": null, + "restrictions": null, + "status": "proposed", + "unexpected": true + } + } + }, + { + "name": "unknown-payload-task", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "task", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "purpose": "fixture", + "criteria": [ + { + "id": "fixture", + "text": "fixture" + } + ], + "missionRef": null, + "intentRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "dependencies": [], + "restrictions": null, + "status": "proposed", + "unexpected": true + } + } + }, + { + "name": "unknown-payload-assignment", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "assignment", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "taskRef": { + "kind": "task", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "agentId": "fixture", + "intentRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "status": "selected", + "endReason": null, + "unexpected": true + } + } + }, + { + "name": "unknown-payload-decision", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "decisionKind": "plan-approval", + "subjectRefs": [ + { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + ], + "outcome": "approved", + "basisRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "evidenceRefs": [], + "delegatedOperations": [], + "unexpected": true + } + } + }, + { + "name": "unknown-payload-session", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "session", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "agentId": "fixture", + "creationMode": "initial", + "predecessorRef": null, + "harnessRef": { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "harnessSessionId": "fixture", + "sessionArtifactId": "fixture", + "unexpected": true + } + } + }, + { + "name": "unknown-payload-context-source", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "context-source", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "contentRef": { + "registry": "context-content", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "category": "general-preference", + "sharedByDefault": false, + "permittedScopes": [ + { + "kind": "system" + } + ], + "relevanceRefs": [], + "unexpected": true + } + } + }, + { + "name": "unknown-payload-adapter-capability", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "adapter-capability", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "harnessRef": { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "operations": [], + "observableClasses": [], + "enforceableClasses": [], + "evidenceRefs": [], + "status": "documented-only", + "unexpected": true + } + } + }, + { + "name": "unsupported-version", + "schemaValid": false, + "document": { + "schemaVersion": 2, + "kind": "task", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "purpose": "fixture", + "criteria": [ + { + "id": "fixture", + "text": "fixture" + } + ], + "missionRef": null, + "intentRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "dependencies": [], + "restrictions": null, + "status": "proposed" + } + } + }, + { + "name": "missing-policy", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "project", + "id": "fixture", + "scope": { + "kind": "project", + "projectId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "displayName": "fixture", + "status": "active" + } + } + }, + { + "name": "invalid-role-registry", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "registration", + "id": "fixture", + "scope": { + "kind": "project", + "projectId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "agentId": "fixture", + "scopeRoleRef": { + "registry": "settings", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "restrictions": null, + "projectRegistrationRef": null, + "status": "active", + "delegationRef": null + } + } + }, + { + "name": "project-with-workspace-scope", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "project", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "p", + "workspaceId": "w" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "displayName": "fixture", + "policyRef": { + "registry": "project-policy", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "status": "active" + } + } + }, + { + "name": "task-system-scope", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "task", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "purpose": "fixture", + "criteria": [ + { + "id": "fixture", + "text": "fixture" + } + ], + "missionRef": null, + "intentRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "dependencies": [], + "restrictions": null, + "status": "proposed" + } + } + }, + { + "name": "project-mission-with-parent", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "mission", + "id": "fixture", + "scope": { + "kind": "project", + "projectId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "objective": "fixture", + "criteria": [ + { + "id": "fixture", + "text": "fixture" + } + ], + "parentMissionRef": { + "kind": "mission", + "id": "other", + "revision": 1, + "scope": { + "kind": "project", + "projectId": "p" + } + }, + "restrictions": null, + "status": "proposed" + } + } + }, + { + "name": "workspace-registration-without-project-registration", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "registration", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "p", + "workspaceId": "w" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "agentId": "fixture", + "scopeRoleRef": { + "registry": "scope-role", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "restrictions": null, + "projectRegistrationRef": null, + "status": "active", + "delegationRef": null + } + } + }, + { + "name": "private-context-shared", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "context-source", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "contentRef": { + "registry": "context-content", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "category": "personal", + "sharedByDefault": true, + "permittedScopes": [ + { + "kind": "system" + } + ], + "relevanceRefs": [] + } + } + }, + { + "name": "initial-session-with-predecessor", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "session", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "agentId": "fixture", + "creationMode": "initial", + "predecessorRef": { + "kind": "session", + "id": "other", + "revision": 1, + "scope": { + "kind": "workspace", + "projectId": "p", + "workspaceId": "w" + } + }, + "harnessRef": { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "harnessSessionId": "fixture", + "sessionArtifactId": "fixture" + } + } + }, + { + "name": "ended-assignment-without-reason", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "assignment", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "taskRef": { + "kind": "task", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "agentId": "fixture", + "intentRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "status": "ended", + "endReason": null + } + } + }, + { + "name": "live-assignment-with-end-reason", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "assignment", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "taskRef": { + "kind": "task", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "agentId": "fixture", + "intentRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "status": "selected", + "endReason": "abandoned" + } + } + }, + { + "name": "new-record-with-predecessor", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "task", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": { + "kind": "task", + "id": "other", + "revision": 1, + "scope": { + "kind": "workspace", + "projectId": "p", + "workspaceId": "w" + } + }, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "purpose": "fixture", + "criteria": [ + { + "id": "fixture", + "text": "fixture" + } + ], + "missionRef": null, + "intentRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "dependencies": [], + "restrictions": null, + "status": "proposed" + } + } + }, + { + "name": "revision-without-predecessor", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "task", + "id": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "revision": 2, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "purpose": "fixture", + "criteria": [ + { + "id": "fixture", + "text": "fixture" + } + ], + "missionRef": null, + "intentRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "dependencies": [], + "restrictions": null, + "status": "proposed" + } + } + }, + { + "name": "verified-adapter-without-evidence", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "adapter-capability", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "harnessRef": { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "operations": [], + "observableClasses": [], + "enforceableClasses": [], + "evidenceRefs": [], + "status": "verified" + } + } + }, + { + "name": "delegation-without-grants", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "decisionKind": "delegation", + "subjectRefs": [ + { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + ], + "outcome": "approved", + "basisRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "evidenceRefs": [], + "delegatedOperations": [] + } + } + }, + { + "name": "non-delegation-with-grants", + "schemaValid": false, + "document": { + "schemaVersion": 1, + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1, + "createdAt": "2026-09-06T03:00:00.000Z", + "createdBy": { + "kind": "human", + "principalId": "owner-fixture", + "executionId": null + }, + "supersedes": null, + "authorizationRef": "00000000-0000-4000-8000-000000000001", + "payload": { + "decisionKind": "plan-approval", + "subjectRefs": [ + { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + ], + "outcome": "approved", + "basisRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "evidenceRefs": [], + "delegatedOperations": [ + "command.execute" + ] + } + } + } + ], + "typeCases": [ + { + "name": "simple", + "definition": "relativePath", + "value": "src/file.txt", + "schemaValid": true + }, + { + "name": "space", + "definition": "relativePath", + "value": "my folder/file", + "schemaValid": true + }, + { + "name": "unicode", + "definition": "relativePath", + "value": "docs/caf\u00e9.md", + "schemaValid": true + }, + { + "name": "absolute", + "definition": "relativePath", + "value": "/etc/passwd", + "schemaValid": false + }, + { + "name": "parent", + "definition": "relativePath", + "value": "../other", + "schemaValid": false + }, + { + "name": "embedded-parent", + "definition": "relativePath", + "value": "a/../b", + "schemaValid": false + }, + { + "name": "dot", + "definition": "relativePath", + "value": ".", + "schemaValid": false + }, + { + "name": "embedded-dot", + "definition": "relativePath", + "value": "a/./b", + "schemaValid": false + }, + { + "name": "trailing-slash", + "definition": "relativePath", + "value": "a/", + "schemaValid": false + }, + { + "name": "double-slash", + "definition": "relativePath", + "value": "a//b", + "schemaValid": false + }, + { + "name": "backslash", + "definition": "relativePath", + "value": "a\\b", + "schemaValid": false + }, + { + "name": "newline", + "definition": "relativePath", + "value": "a\nb", + "schemaValid": false + }, + { + "name": "nul", + "definition": "relativePath", + "value": "a\u0000b", + "schemaValid": false + }, + { + "name": "unicode-byte-limit", + "definition": "relativePath", + "value": "\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9", + "schemaValid": false + }, + { + "name": "bidi-control", + "definition": "relativePath", + "value": "a\u202eb", + "schemaValid": false + }, + { + "name": "space-before-separator", + "definition": "relativePath", + "value": "my folder /file", + "schemaValid": true + } + ] +} diff --git a/docs/plans/foundation-v1-candidate/records.schema.json b/docs/plans/foundation-v1-candidate/records.schema.json new file mode 100644 index 00000000..3a84fbf0 --- /dev/null +++ b/docs/plans/foundation-v1-candidate/records.schema.json @@ -0,0 +1,1699 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "urn:mosaic:planning:issue-53:records:candidate-1", + "title": "Planning candidate only: declarative record shapes", + "description": "References, parent ownership, transition permissions and authenticated writers require semantic validation outside this schema. No runtime consumes this file.", + "oneOf": [ + { + "$ref": "#/$defs/agent-definition" + }, + { + "$ref": "#/$defs/project" + }, + { + "$ref": "#/$defs/workspace" + }, + { + "$ref": "#/$defs/registration" + }, + { + "$ref": "#/$defs/mission" + }, + { + "$ref": "#/$defs/task" + }, + { + "$ref": "#/$defs/assignment" + }, + { + "$ref": "#/$defs/decision" + }, + { + "$ref": "#/$defs/session" + }, + { + "$ref": "#/$defs/context-source" + }, + { + "$ref": "#/$defs/adapter-capability" + } + ], + "$defs": { + "id": { + "type": "string", + "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$" + }, + "runtimeId": { + "type": "string", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "revision": { + "type": "integer", + "minimum": 1, + "maximum": 9007199254740991 + }, + "digest": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + }, + "time": { + "type": "string", + "format": "date-time", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$" + }, + "actor": { + "type": "object", + "additionalProperties": false, + "required": [ + "kind", + "principalId", + "executionId" + ], + "properties": { + "kind": { + "enum": [ + "human", + "service", + "agent" + ] + }, + "principalId": { + "$ref": "#/$defs/id" + }, + "executionId": { + "oneOf": [ + { + "$ref": "#/$defs/runtimeId" + }, + { + "type": "null" + } + ] + } + }, + "if": { + "properties": { + "kind": { + "const": "agent" + } + } + }, + "then": { + "properties": { + "executionId": { + "$ref": "#/$defs/runtimeId" + } + } + }, + "else": { + "properties": { + "executionId": { + "type": "null" + } + } + } + }, + "artifactRef": { + "type": "object", + "additionalProperties": false, + "required": [ + "runId", + "artifactId", + "digest" + ], + "properties": { + "runId": { + "$ref": "#/$defs/id" + }, + "artifactId": { + "$ref": "#/$defs/id" + }, + "digest": { + "$ref": "#/$defs/digest" + } + } + }, + "workspaceScope": { + "type": "object", + "additionalProperties": false, + "required": [ + "kind", + "projectId", + "workspaceId" + ], + "properties": { + "kind": { + "const": "workspace" + }, + "projectId": { + "$ref": "#/$defs/id" + }, + "workspaceId": { + "$ref": "#/$defs/id" + } + } + }, + "projectScope": { + "type": "object", + "additionalProperties": false, + "required": [ + "kind", + "projectId" + ], + "properties": { + "kind": { + "const": "project" + }, + "projectId": { + "$ref": "#/$defs/id" + } + } + }, + "systemScope": { + "type": "object", + "additionalProperties": false, + "required": [ + "kind" + ], + "properties": { + "kind": { + "const": "system" + } + } + }, + "scope": { + "oneOf": [ + { + "$ref": "#/$defs/systemScope" + }, + { + "$ref": "#/$defs/projectScope" + }, + { + "$ref": "#/$defs/workspaceScope" + } + ] + }, + "recordRef": { + "type": "object", + "additionalProperties": false, + "required": [ + "kind", + "id", + "scope", + "revision" + ], + "properties": { + "kind": { + "enum": [ + "agent-definition", + "project", + "workspace", + "registration", + "mission", + "task", + "assignment", + "decision", + "session", + "context-source", + "adapter-capability" + ] + }, + "id": { + "$ref": "#/$defs/id" + }, + "scope": { + "$ref": "#/$defs/scope" + }, + "revision": { + "$ref": "#/$defs/revision" + } + } + }, + "registryRef": { + "type": "object", + "additionalProperties": false, + "required": [ + "registry", + "id", + "revision", + "digest" + ], + "properties": { + "registry": { + "enum": [ + "harness", + "settings", + "context-content", + "scope-role", + "agent-policy", + "project-policy", + "endpoint" + ] + }, + "id": { + "$ref": "#/$defs/id" + }, + "revision": { + "$ref": "#/$defs/revision" + }, + "digest": { + "$ref": "#/$defs/digest" + } + } + }, + "operation": { + "enum": [ + "work.read", + "file.read", + "file.change", + "command.execute", + "work.propose", + "task.create", + "assignment.change", + "result.submit", + "task.accept", + "registration.manage", + "conversation.read", + "conversation.observe", + "execution.launch", + "execution.control", + "execution.transfer", + "workspace.retire", + "workspace.reopen", + "message.send", + "audit.read", + "project.create", + "project.change", + "workspace.create", + "workspace.change", + "mission.create", + "mission.change", + "mission.accept", + "task.change", + "decision.issue", + "session.adopt" + ] + }, + "relativePath": { + "type": "string", + "format": "mosaic-relative-path", + "minLength": 1, + "maxLength": 4096, + "pattern": "^(?!/)(?!.*[\\\\\\u0000-\\u001f\\u007f])(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*//)[^/]+(?:/[^/]+)*$" + }, + "pathGrant": { + "type": "object", + "additionalProperties": false, + "required": [ + "root", + "path" + ], + "properties": { + "root": { + "const": "workspace" + }, + "path": { + "oneOf": [ + { + "$ref": "#/$defs/relativePath" + }, + { + "type": "null" + } + ] + } + } + }, + "restrictions": { + "type": "object", + "additionalProperties": false, + "required": [ + "operations", + "readPaths", + "writePaths", + "network", + "endpointRefs" + ], + "properties": { + "operations": { + "type": "array", + "items": { + "$ref": "#/$defs/operation" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "readPaths": { + "type": "array", + "items": { + "$ref": "#/$defs/pathGrant" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "writePaths": { + "type": "array", + "items": { + "$ref": "#/$defs/pathGrant" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "network": { + "enum": [ + "none", + "approved-endpoints" + ] + }, + "endpointRefs": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "endpoint" + } + } + } + ] + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + } + }, + "allOf": [ + { + "if": { + "properties": { + "network": { + "const": "none" + } + } + }, + "then": { + "properties": { + "endpointRefs": { + "maxItems": 0 + } + } + }, + "else": { + "properties": { + "endpointRefs": { + "minItems": 1 + } + } + } + } + ] + }, + "criterion": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "text" + ], + "properties": { + "id": { + "$ref": "#/$defs/id" + }, + "text": { + "type": "string", + "minLength": 1, + "maxLength": 4000 + } + } + }, + "contentRefs": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "context-content" + } + } + } + ] + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "envelope": { + "type": "object", + "additionalProperties": false, + "required": [ + "schemaVersion", + "kind", + "id", + "scope", + "revision", + "createdAt", + "createdBy", + "supersedes", + "authorizationRef", + "payload" + ], + "properties": { + "schemaVersion": { + "const": 1 + }, + "kind": { + "enum": [ + "agent-definition", + "project", + "workspace", + "registration", + "mission", + "task", + "assignment", + "decision", + "session", + "context-source", + "adapter-capability" + ] + }, + "id": { + "$ref": "#/$defs/id" + }, + "scope": { + "$ref": "#/$defs/scope" + }, + "revision": { + "$ref": "#/$defs/revision" + }, + "createdAt": { + "$ref": "#/$defs/time" + }, + "createdBy": { + "$ref": "#/$defs/actor" + }, + "supersedes": { + "oneOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "type": "null" + } + ] + }, + "authorizationRef": { + "$ref": "#/$defs/runtimeId" + }, + "payload": { + "type": "object" + } + }, + "allOf": [ + { + "if": { + "properties": { + "revision": { + "const": 1 + } + } + }, + "then": { + "properties": { + "supersedes": { + "type": "null" + } + } + }, + "else": { + "properties": { + "supersedes": { + "$ref": "#/$defs/recordRef" + } + } + } + } + ] + }, + "agent-definitionPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "displayName", + "agentType", + "harnessRef", + "settingsRef", + "soulRef", + "instructionRefs", + "skillRefs", + "policyRef", + "status" + ], + "properties": { + "displayName": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "agentType": { + "$ref": "#/$defs/id" + }, + "harnessRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "harness" + } + } + } + ] + }, + "settingsRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "settings" + } + } + } + ] + }, + "soulRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "context-content" + } + } + } + ] + }, + "instructionRefs": { + "$ref": "#/$defs/contentRefs" + }, + "skillRefs": { + "$ref": "#/$defs/contentRefs" + }, + "policyRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "agent-policy" + } + } + } + ] + }, + "status": { + "enum": [ + "enabled", + "disabled" + ] + } + } + }, + "agent-definition": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "agent-definition" + }, + "payload": { + "$ref": "#/$defs/agent-definitionPayload" + }, + "scope": { + "$ref": "#/$defs/systemScope" + } + } + } + ] + }, + "projectPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "displayName", + "policyRef", + "status" + ], + "properties": { + "displayName": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "policyRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "project-policy" + } + } + } + ] + }, + "status": { + "enum": [ + "active", + "retired" + ] + } + } + }, + "project": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "project" + }, + "payload": { + "$ref": "#/$defs/projectPayload" + }, + "scope": { + "$ref": "#/$defs/projectScope" + } + } + } + ] + }, + "workspacePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "displayName", + "policyRef", + "status", + "fileRootId" + ], + "properties": { + "displayName": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "policyRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "project-policy" + } + } + } + ] + }, + "status": { + "enum": [ + "active", + "retiring", + "retired" + ] + }, + "fileRootId": { + "$ref": "#/$defs/id" + } + } + }, + "workspace": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "workspace" + }, + "payload": { + "$ref": "#/$defs/workspacePayload" + }, + "scope": { + "$ref": "#/$defs/workspaceScope" + } + } + } + ] + }, + "registrationPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "agentId", + "scopeRoleRef", + "restrictions", + "projectRegistrationRef", + "status", + "delegationRef" + ], + "properties": { + "agentId": { + "$ref": "#/$defs/id" + }, + "scopeRoleRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "scope-role" + } + } + } + ] + }, + "restrictions": { + "oneOf": [ + { + "$ref": "#/$defs/restrictions" + }, + { + "type": "null" + } + ] + }, + "projectRegistrationRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "registration" + } + } + } + ] + }, + { + "type": "null" + } + ] + }, + "status": { + "enum": [ + "active", + "revoked" + ] + }, + "delegationRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "decision" + } + } + } + ] + }, + { + "type": "null" + } + ] + } + } + }, + "registration": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "registration" + }, + "payload": { + "$ref": "#/$defs/registrationPayload" + }, + "scope": { + "oneOf": [ + { + "$ref": "#/$defs/projectScope" + }, + { + "$ref": "#/$defs/workspaceScope" + } + ] + } + } + }, + { + "if": { + "properties": { + "scope": { + "properties": { + "kind": { + "const": "project" + } + } + } + } + }, + "then": { + "properties": { + "payload": { + "properties": { + "projectRegistrationRef": { + "type": "null" + } + } + } + } + }, + "else": { + "properties": { + "payload": { + "properties": { + "projectRegistrationRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "registration" + } + } + } + ] + } + } + } + } + } + } + ] + }, + "missionPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "objective", + "criteria", + "parentMissionRef", + "restrictions", + "status" + ], + "properties": { + "objective": { + "type": "string", + "minLength": 1, + "maxLength": 4000 + }, + "criteria": { + "type": "array", + "items": { + "$ref": "#/$defs/criterion" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + }, + "parentMissionRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "mission" + } + } + } + ] + }, + { + "type": "null" + } + ] + }, + "restrictions": { + "oneOf": [ + { + "$ref": "#/$defs/restrictions" + }, + { + "type": "null" + } + ] + }, + "status": { + "enum": [ + "proposed", + "active", + "blocked", + "ready-for-review", + "accepted", + "canceled" + ] + } + } + }, + "mission": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "mission" + }, + "payload": { + "$ref": "#/$defs/missionPayload" + }, + "scope": { + "oneOf": [ + { + "$ref": "#/$defs/projectScope" + }, + { + "$ref": "#/$defs/workspaceScope" + } + ] + } + } + }, + { + "if": { + "properties": { + "scope": { + "properties": { + "kind": { + "const": "project" + } + } + } + } + }, + "then": { + "properties": { + "payload": { + "properties": { + "parentMissionRef": { + "type": "null" + } + } + } + } + } + } + ] + }, + "taskPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "purpose", + "criteria", + "missionRef", + "intentRef", + "dependencies", + "restrictions", + "status" + ], + "properties": { + "purpose": { + "type": "string", + "minLength": 1, + "maxLength": 4000 + }, + "criteria": { + "type": "array", + "items": { + "$ref": "#/$defs/criterion" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + }, + "missionRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "mission" + } + } + } + ] + }, + { + "type": "null" + } + ] + }, + "intentRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "decision" + } + } + } + ] + }, + "dependencies": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "task" + } + } + } + ] + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "restrictions": { + "oneOf": [ + { + "$ref": "#/$defs/restrictions" + }, + { + "type": "null" + } + ] + }, + "status": { + "enum": [ + "proposed", + "ready", + "active", + "blocked", + "ready-for-review", + "accepted", + "canceled" + ] + } + } + }, + "task": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "task" + }, + "payload": { + "$ref": "#/$defs/taskPayload" + }, + "scope": { + "$ref": "#/$defs/workspaceScope" + } + } + } + ] + }, + "assignmentPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "taskRef", + "agentId", + "intentRef", + "status", + "endReason" + ], + "properties": { + "taskRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "task" + } + } + } + ] + }, + "agentId": { + "$ref": "#/$defs/id" + }, + "intentRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "decision" + } + } + } + ] + }, + "status": { + "enum": [ + "selected", + "paused", + "ended" + ] + }, + "endReason": { + "enum": [ + null, + "completed", + "abandoned", + "revoked", + "reassigned", + "canceled" + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "const": "ended" + } + } + }, + "then": { + "properties": { + "endReason": { + "type": "string" + } + } + }, + "else": { + "properties": { + "endReason": { + "type": "null" + } + } + } + } + ] + }, + "assignment": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "assignment" + }, + "payload": { + "$ref": "#/$defs/assignmentPayload" + }, + "scope": { + "$ref": "#/$defs/workspaceScope" + } + } + } + ] + }, + "decisionPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "decisionKind", + "subjectRefs", + "outcome", + "basisRef", + "evidenceRefs", + "delegatedOperations" + ], + "properties": { + "decisionKind": { + "enum": [ + "plan-approval", + "delegation", + "assignment-change", + "acceptance", + "owner-checkpoint", + "reconciliation" + ] + }, + "subjectRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/recordRef" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + }, + "outcome": { + "enum": [ + "approved", + "rejected" + ] + }, + "basisRef": { + "$ref": "#/$defs/artifactRef" + }, + "evidenceRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/artifactRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "delegatedOperations": { + "type": "array", + "items": { + "$ref": "#/$defs/operation" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + } + }, + "allOf": [ + { + "if": { + "properties": { + "decisionKind": { + "const": "delegation" + }, + "outcome": { + "const": "approved" + } + } + }, + "then": { + "properties": { + "delegatedOperations": { + "minItems": 1 + } + } + }, + "else": { + "properties": { + "delegatedOperations": { + "maxItems": 0 + } + } + } + } + ] + }, + "decision": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "decision" + }, + "payload": { + "$ref": "#/$defs/decisionPayload" + } + } + } + ] + }, + "sessionPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "agentId", + "creationMode", + "predecessorRef", + "harnessRef", + "harnessSessionId", + "sessionArtifactId" + ], + "properties": { + "agentId": { + "$ref": "#/$defs/id" + }, + "creationMode": { + "enum": [ + "initial", + "fresh", + "adopted" + ] + }, + "predecessorRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "session" + } + } + } + ] + }, + { + "type": "null" + } + ] + }, + "harnessRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "harness" + } + } + } + ] + }, + "harnessSessionId": { + "$ref": "#/$defs/id" + }, + "sessionArtifactId": { + "$ref": "#/$defs/id" + } + }, + "allOf": [ + { + "if": { + "properties": { + "creationMode": { + "const": "initial" + } + } + }, + "then": { + "properties": { + "predecessorRef": { + "type": "null" + } + } + } + } + ] + }, + "session": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "session" + }, + "payload": { + "$ref": "#/$defs/sessionPayload" + }, + "scope": { + "$ref": "#/$defs/workspaceScope" + } + } + } + ] + }, + "context-sourcePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "contentRef", + "category", + "sharedByDefault", + "permittedScopes", + "relevanceRefs" + ], + "properties": { + "contentRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "context-content" + } + } + } + ] + }, + "category": { + "enum": [ + "general-preference", + "personal", + "project", + "work" + ] + }, + "sharedByDefault": { + "type": "boolean" + }, + "permittedScopes": { + "type": "array", + "items": { + "$ref": "#/$defs/scope" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + }, + "relevanceRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/recordRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + } + }, + "allOf": [ + { + "if": { + "properties": { + "sharedByDefault": { + "const": true + } + } + }, + "then": { + "properties": { + "category": { + "const": "general-preference" + } + } + } + } + ] + }, + "context-source": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "context-source" + }, + "payload": { + "$ref": "#/$defs/context-sourcePayload" + } + } + } + ] + }, + "adapter-capabilityPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "harnessRef", + "operations", + "observableClasses", + "enforceableClasses", + "evidenceRefs", + "status" + ], + "properties": { + "harnessRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "harness" + } + } + } + ] + }, + "operations": { + "type": "array", + "items": { + "$ref": "#/$defs/operation" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "observableClasses": { + "type": "array", + "items": { + "$ref": "#/$defs/id" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "enforceableClasses": { + "type": "array", + "items": { + "$ref": "#/$defs/id" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "evidenceRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/artifactRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "status": { + "enum": [ + "documented-only", + "verified" + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "const": "verified" + } + } + }, + "then": { + "properties": { + "evidenceRefs": { + "minItems": 1 + } + } + } + } + ] + }, + "adapter-capability": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "adapter-capability" + }, + "payload": { + "$ref": "#/$defs/adapter-capabilityPayload" + }, + "scope": { + "$ref": "#/$defs/systemScope" + } + } + } + ] + } + } +} diff --git a/docs/plans/foundation-v1-candidate/runtime.fixtures.json b/docs/plans/foundation-v1-candidate/runtime.fixtures.json new file mode 100644 index 00000000..4e0e2f84 --- /dev/null +++ b/docs/plans/foundation-v1-candidate/runtime.fixtures.json @@ -0,0 +1,5891 @@ +{ + "fixtureVersion": 1, + "cases": [ + { + "name": "runtime-authorization", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "authorization", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "requestId": "00000000-0000-4000-8000-000000000001", + "requestDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "requester": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "scope": { + "kind": "system" + }, + "operation": "work.read", + "outcome": "allowed", + "reasonCode": "allowed", + "policyRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "checkedRecordRefs": [] + } + } + }, + { + "name": "runtime-launch-manifest", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "launch-manifest", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "inputs": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "conversationMode": "initial", + "priorConversationRef": null, + "selectedAssignments": [], + "contextInputs": [], + "baseProjection": { + "hashScopeVersion": 1, + "agentId": "fixture", + "soulDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "instructions": [], + "skills": [], + "harness": { + "id": "fixture", + "version": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "modelSettingsDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "roleConfigDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "policyRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "accountRef": null, + "adapterCapabilityRef": { + "kind": "adapter-capability", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "imageDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "agentDefinitionRef": { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "sessionRecordRef": { + "kind": "session", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "settingsRef": { + "registry": "settings", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "resumeSnapshotRef": null, + "resumeLeafId": null + }, + "agentConfigHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "launchManifestHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "hashAlgorithm": "sha256-rfc8785-v1" + } + } + }, + { + "name": "runtime-execution-transition", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "execution-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "authorizationId": "00000000-0000-4000-8000-000000000001", + "manifestRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "state": "admitted", + "processRef": null, + "terminationProofRef": null, + "resultRef": null + } + } + }, + { + "name": "runtime-claim-transition", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "claim-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "claimId": "00000000-0000-4000-8000-000000000001", + "state": "reserved", + "authorizationId": "00000000-0000-4000-8000-000000000001", + "terminationProofRef": null + } + } + }, + { + "name": "runtime-connection-transition", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "connection-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "client": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "mode": "observe", + "state": "granted", + "controlGeneration": null, + "authorizationId": "00000000-0000-4000-8000-000000000001" + } + } + }, + { + "name": "runtime-message", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "message", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "messageId": "00000000-0000-4000-8000-000000000001", + "sender": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "sourceScope": { + "kind": "system" + }, + "recipient": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "routing": "current-scoped-session", + "sessionId": null, + "executionId": null + }, + "messageKind": "work-notice", + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "subjectRefs": [], + "expiresAt": "2026-09-06T04:00:00.000Z", + "replyToMessageId": null, + "authorizationId": "00000000-0000-4000-8000-000000000001" + } + } + }, + { + "name": "runtime-message-delivery", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "message-delivery", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "messageId": "00000000-0000-4000-8000-000000000001", + "outcome": "queued", + "recipientBinding": null, + "authorizationId": "00000000-0000-4000-8000-000000000001", + "observationRef": null + } + } + }, + { + "name": "runtime-command-spec", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "command-spec", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "profileRef": { + "catalog": "command-profile", + "id": "fixture", + "sourceCommit": "0000000000000000000000000000000000000000", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "parameterSchemaRef": { + "catalog": "parameter-schema", + "id": "fixture", + "sourceCommit": "0000000000000000000000000000000000000000", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "parametersRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "cwd": null, + "inputRefs": [], + "outputPolicy": "classified-artifacts-only" + } + } + }, + { + "name": "runtime-sandbox-limits", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "sandbox-limits", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "profileRef": { + "catalog": "sandbox-profile", + "id": "fixture", + "sourceCommit": "0000000000000000000000000000000000000000", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "readPaths": [], + "writePaths": [], + "network": "none", + "endpointRefs": [], + "timeoutSeconds": 1, + "memoryMiB": 16, + "processLimit": 1, + "credentialAccess": false, + "hostControlAccess": false, + "coverage": "command-invocation-v1" + } + } + }, + { + "name": "runtime-artifact-index", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "artifact-index", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "artifactId": "fixture", + "artifactKind": "command-spec", + "scope": { + "kind": "system" + }, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "byteLength": 0, + "mediaType": "application/json", + "visibility": "work", + "publisher": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "authorizationId": "00000000-0000-4000-8000-000000000001" + } + } + }, + { + "name": "runtime-configuration-check", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "configuration-check", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "launchHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "currentHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "status": "matching", + "sourceRefs": [], + "noticeKey": "fixture" + } + } + }, + { + "name": "inputRequest", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "prompt", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "expectedControlGeneration": 1, + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "dialogId": null + } + }, + { + "name": "input-stop", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "stop", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "expectedControlGeneration": 1, + "bodyRef": null, + "dialogId": null + } + }, + { + "name": "input-dialog", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "dialog-reply", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "expectedControlGeneration": 1, + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "dialogId": "00000000-0000-4000-8000-000000000001" + } + }, + { + "name": "unknown-field-runtime-authorization", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "authorization", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "requestId": "00000000-0000-4000-8000-000000000001", + "requestDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "requester": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "scope": { + "kind": "system" + }, + "operation": "work.read", + "outcome": "allowed", + "reasonCode": "allowed", + "policyRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "checkedRecordRefs": [] + }, + "unexpected": true + } + }, + { + "name": "unknown-field-runtime-launch-manifest", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "launch-manifest", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "inputs": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "conversationMode": "initial", + "priorConversationRef": null, + "selectedAssignments": [], + "contextInputs": [], + "baseProjection": { + "hashScopeVersion": 1, + "agentId": "fixture", + "soulDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "instructions": [], + "skills": [], + "harness": { + "id": "fixture", + "version": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "modelSettingsDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "roleConfigDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "policyRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "accountRef": null, + "adapterCapabilityRef": { + "kind": "adapter-capability", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "imageDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "agentDefinitionRef": { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "sessionRecordRef": { + "kind": "session", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "settingsRef": { + "registry": "settings", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "resumeSnapshotRef": null, + "resumeLeafId": null + }, + "agentConfigHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "launchManifestHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "hashAlgorithm": "sha256-rfc8785-v1" + }, + "unexpected": true + } + }, + { + "name": "unknown-field-runtime-execution-transition", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "execution-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "authorizationId": "00000000-0000-4000-8000-000000000001", + "manifestRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "state": "admitted", + "processRef": null, + "terminationProofRef": null, + "resultRef": null + }, + "unexpected": true + } + }, + { + "name": "unknown-field-runtime-claim-transition", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "claim-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "claimId": "00000000-0000-4000-8000-000000000001", + "state": "reserved", + "authorizationId": "00000000-0000-4000-8000-000000000001", + "terminationProofRef": null + }, + "unexpected": true + } + }, + { + "name": "unknown-field-runtime-connection-transition", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "connection-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "client": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "mode": "observe", + "state": "granted", + "controlGeneration": null, + "authorizationId": "00000000-0000-4000-8000-000000000001" + }, + "unexpected": true + } + }, + { + "name": "unknown-field-runtime-message", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "message", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "messageId": "00000000-0000-4000-8000-000000000001", + "sender": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "sourceScope": { + "kind": "system" + }, + "recipient": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "routing": "current-scoped-session", + "sessionId": null, + "executionId": null + }, + "messageKind": "work-notice", + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "subjectRefs": [], + "expiresAt": "2026-09-06T04:00:00.000Z", + "replyToMessageId": null, + "authorizationId": "00000000-0000-4000-8000-000000000001" + }, + "unexpected": true + } + }, + { + "name": "unknown-field-runtime-message-delivery", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "message-delivery", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "messageId": "00000000-0000-4000-8000-000000000001", + "outcome": "queued", + "recipientBinding": null, + "authorizationId": "00000000-0000-4000-8000-000000000001", + "observationRef": null + }, + "unexpected": true + } + }, + { + "name": "unknown-field-runtime-command-spec", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "command-spec", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "profileRef": { + "catalog": "command-profile", + "id": "fixture", + "sourceCommit": "0000000000000000000000000000000000000000", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "parameterSchemaRef": { + "catalog": "parameter-schema", + "id": "fixture", + "sourceCommit": "0000000000000000000000000000000000000000", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "parametersRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "cwd": null, + "inputRefs": [], + "outputPolicy": "classified-artifacts-only" + }, + "unexpected": true + } + }, + { + "name": "unknown-field-runtime-sandbox-limits", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "sandbox-limits", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "profileRef": { + "catalog": "sandbox-profile", + "id": "fixture", + "sourceCommit": "0000000000000000000000000000000000000000", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "readPaths": [], + "writePaths": [], + "network": "none", + "endpointRefs": [], + "timeoutSeconds": 1, + "memoryMiB": 16, + "processLimit": 1, + "credentialAccess": false, + "hostControlAccess": false, + "coverage": "command-invocation-v1" + }, + "unexpected": true + } + }, + { + "name": "unknown-field-runtime-artifact-index", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "artifact-index", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "artifactId": "fixture", + "artifactKind": "command-spec", + "scope": { + "kind": "system" + }, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "byteLength": 0, + "mediaType": "application/json", + "visibility": "work", + "publisher": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "authorizationId": "00000000-0000-4000-8000-000000000001" + }, + "unexpected": true + } + }, + { + "name": "unknown-field-runtime-configuration-check", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "configuration-check", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "launchHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "currentHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "status": "matching", + "sourceRefs": [], + "noticeKey": "fixture" + }, + "unexpected": true + } + }, + { + "name": "unknown-field-inputRequest", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "prompt", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "expectedControlGeneration": 1, + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "dialogId": null, + "unexpected": true + } + }, + { + "name": "unknown-field-input-stop", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "stop", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "expectedControlGeneration": 1, + "bodyRef": null, + "dialogId": null, + "unexpected": true + } + }, + { + "name": "unknown-field-input-dialog", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "dialog-reply", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "expectedControlGeneration": 1, + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "dialogId": "00000000-0000-4000-8000-000000000001", + "unexpected": true + } + }, + { + "name": "allow-without-policy", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "authorization", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "requestId": "00000000-0000-4000-8000-000000000001", + "requestDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "requester": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "scope": { + "kind": "system" + }, + "operation": "work.read", + "outcome": "allowed", + "reasonCode": "allowed", + "policyRefs": [], + "checkedRecordRefs": [] + } + } + }, + { + "name": "allow-with-refusal-reason", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "authorization", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "requestId": "00000000-0000-4000-8000-000000000001", + "requestDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "requester": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "scope": { + "kind": "system" + }, + "operation": "work.read", + "outcome": "allowed", + "reasonCode": "not-authorized", + "policyRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "checkedRecordRefs": [] + } + } + }, + { + "name": "fresh-with-history", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "launch-manifest", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "inputs": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "conversationMode": "initial", + "priorConversationRef": { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "selectedAssignments": [], + "contextInputs": [], + "baseProjection": { + "hashScopeVersion": 1, + "agentId": "fixture", + "soulDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "instructions": [], + "skills": [], + "harness": { + "id": "fixture", + "version": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "modelSettingsDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "roleConfigDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "policyRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "accountRef": null, + "adapterCapabilityRef": { + "kind": "adapter-capability", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "imageDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "agentDefinitionRef": { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "sessionRecordRef": { + "kind": "session", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "settingsRef": { + "registry": "settings", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "resumeSnapshotRef": null, + "resumeLeafId": null + }, + "agentConfigHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "launchManifestHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "hashAlgorithm": "sha256-rfc8785-v1" + } + } + }, + { + "name": "resume-without-history", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "launch-manifest", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "inputs": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "conversationMode": "resume", + "priorConversationRef": null, + "selectedAssignments": [], + "contextInputs": [], + "baseProjection": { + "hashScopeVersion": 1, + "agentId": "fixture", + "soulDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "instructions": [], + "skills": [], + "harness": { + "id": "fixture", + "version": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "modelSettingsDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "roleConfigDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "policyRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "accountRef": null, + "adapterCapabilityRef": { + "kind": "adapter-capability", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "imageDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "agentDefinitionRef": { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "sessionRecordRef": { + "kind": "session", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "settingsRef": { + "registry": "settings", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "resumeSnapshotRef": null, + "resumeLeafId": null + }, + "agentConfigHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "launchManifestHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "hashAlgorithm": "sha256-rfc8785-v1" + } + } + }, + { + "name": "startup-without-process", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "execution-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "authorizationId": "00000000-0000-4000-8000-000000000001", + "manifestRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "state": "started", + "processRef": null, + "terminationProofRef": null, + "resultRef": null + } + } + }, + { + "name": "termination-without-proof", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "execution-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "authorizationId": "00000000-0000-4000-8000-000000000001", + "manifestRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "state": "terminated", + "processRef": null, + "terminationProofRef": null, + "resultRef": null + } + } + }, + { + "name": "released-claim-without-proof", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "claim-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "claimId": "00000000-0000-4000-8000-000000000001", + "state": "released", + "authorizationId": "00000000-0000-4000-8000-000000000001", + "terminationProofRef": null + } + } + }, + { + "name": "controller-without-generation", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "connection-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "client": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "mode": "control", + "state": "granted", + "controlGeneration": null, + "authorizationId": "00000000-0000-4000-8000-000000000001" + } + } + }, + { + "name": "observer-with-controller-generation", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "connection-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "client": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "mode": "observe", + "state": "granted", + "controlGeneration": 1, + "authorizationId": "00000000-0000-4000-8000-000000000001" + } + } + }, + { + "name": "late-result-follows-current-session", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "message", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "messageId": "00000000-0000-4000-8000-000000000001", + "sender": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "sourceScope": { + "kind": "system" + }, + "recipient": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "routing": "current-scoped-session", + "sessionId": null, + "executionId": null + }, + "messageKind": "execution-result", + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "subjectRefs": [], + "expiresAt": "2026-09-06T04:00:00.000Z", + "replyToMessageId": null, + "authorizationId": "00000000-0000-4000-8000-000000000001" + } + } + }, + { + "name": "delivery-without-binding", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "message-delivery", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "messageId": "00000000-0000-4000-8000-000000000001", + "outcome": "delivered", + "recipientBinding": null, + "authorizationId": "00000000-0000-4000-8000-000000000001", + "observationRef": null + } + } + }, + { + "name": "raw-command-metadata", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "command-spec", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "profileRef": { + "catalog": "command-profile", + "id": "fixture", + "sourceCommit": "0000000000000000000000000000000000000000", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "parameterSchemaRef": { + "catalog": "parameter-schema", + "id": "fixture", + "sourceCommit": "0000000000000000000000000000000000000000", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "parametersRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "cwd": null, + "inputRefs": [], + "outputPolicy": "classified-artifacts-only", + "rawCommand": "synthetic-placeholder" + } + } + }, + { + "name": "credential-enabled-sandbox", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "sandbox-limits", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "profileRef": { + "catalog": "sandbox-profile", + "id": "fixture", + "sourceCommit": "0000000000000000000000000000000000000000", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "readPaths": [], + "writePaths": [], + "network": "none", + "endpointRefs": [], + "timeoutSeconds": 1, + "memoryMiB": 16, + "processLimit": 1, + "credentialAccess": true, + "hostControlAccess": false, + "coverage": "command-invocation-v1" + } + } + }, + { + "name": "host-control-enabled-sandbox", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "sandbox-limits", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "profileRef": { + "catalog": "sandbox-profile", + "id": "fixture", + "sourceCommit": "0000000000000000000000000000000000000000", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "readPaths": [], + "writePaths": [], + "network": "none", + "endpointRefs": [], + "timeoutSeconds": 1, + "memoryMiB": 16, + "processLimit": 1, + "credentialAccess": false, + "hostControlAccess": true, + "coverage": "command-invocation-v1" + } + } + }, + { + "name": "network-none-with-endpoint", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "sandbox-limits", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "profileRef": { + "catalog": "sandbox-profile", + "id": "fixture", + "sourceCommit": "0000000000000000000000000000000000000000", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "readPaths": [], + "writePaths": [], + "network": "none", + "endpointRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "timeoutSeconds": 1, + "memoryMiB": 16, + "processLimit": 1, + "credentialAccess": false, + "hostControlAccess": false, + "coverage": "command-invocation-v1" + } + } + }, + { + "name": "network-permitted-without-endpoint", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "sandbox-limits", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "profileRef": { + "catalog": "sandbox-profile", + "id": "fixture", + "sourceCommit": "0000000000000000000000000000000000000000", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "readPaths": [], + "writePaths": [], + "network": "approved-endpoints", + "endpointRefs": [], + "timeoutSeconds": 1, + "memoryMiB": 16, + "processLimit": 1, + "credentialAccess": false, + "hostControlAccess": false, + "coverage": "command-invocation-v1" + } + } + }, + { + "name": "claim-total-internal-audit", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "sandbox-limits", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "profileRef": { + "catalog": "sandbox-profile", + "id": "fixture", + "sourceCommit": "0000000000000000000000000000000000000000", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "readPaths": [], + "writePaths": [], + "network": "none", + "endpointRefs": [], + "timeoutSeconds": 1, + "memoryMiB": 16, + "processLimit": 1, + "credentialAccess": false, + "hostControlAccess": false, + "coverage": "every-internal-effect" + } + } + }, + { + "name": "unknown-comparison-with-hash", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "configuration-check", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "launchHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "currentHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "status": "unknown", + "sourceRefs": [], + "noticeKey": "fixture" + } + } + }, + { + "name": "forged-input-producer", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "prompt", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "expectedControlGeneration": 1, + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "dialogId": null, + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + } + } + }, + { + "name": "zero-controller-generation", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "prompt", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "expectedControlGeneration": 0, + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "dialogId": null + } + }, + { + "name": "raw-rpc-bash", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "bash", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "expectedControlGeneration": 1, + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "dialogId": null + } + }, + { + "name": "stop-with-payload", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "stop", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "expectedControlGeneration": 1, + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "dialogId": null + } + }, + { + "name": "dialog-without-id", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "dialog-reply", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "expectedControlGeneration": 1, + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "dialogId": null + } + }, + { + "name": "prompt-without-payload", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "prompt", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "expectedControlGeneration": 1, + "bodyRef": null, + "dialogId": null + } + }, + { + "name": "control-project.create", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "project.create", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "proposedId": "fixture", + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "control-unknown-project.create", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "project.create", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "proposedId": "fixture", + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "unexpected": true + } + } + }, + { + "name": "control-project.change", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "project.change", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRef": { + "kind": "project", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "control-unknown-project.change", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "project.change", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRef": { + "kind": "project", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "unexpected": true + } + } + }, + { + "name": "control-workspace.create", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "workspace.create", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "proposedId": "fixture", + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "control-unknown-workspace.create", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "workspace.create", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "proposedId": "fixture", + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "unexpected": true + } + } + }, + { + "name": "control-workspace.change", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "workspace.change", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRef": { + "kind": "workspace", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "control-unknown-workspace.change", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "workspace.change", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRef": { + "kind": "workspace", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "unexpected": true + } + } + }, + { + "name": "control-mission.create", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "mission.create", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "proposedId": "fixture", + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "control-unknown-mission.create", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "mission.create", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "proposedId": "fixture", + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "unexpected": true + } + } + }, + { + "name": "control-mission.change", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "mission.change", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRef": { + "kind": "mission", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "control-unknown-mission.change", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "mission.change", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRef": { + "kind": "mission", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "unexpected": true + } + } + }, + { + "name": "control-task.create", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "task.create", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "proposedId": "fixture", + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "control-unknown-task.create", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "task.create", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "proposedId": "fixture", + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "unexpected": true + } + } + }, + { + "name": "control-task.change", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "task.change", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRef": { + "kind": "task", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "control-unknown-task.change", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "task.change", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRef": { + "kind": "task", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "unexpected": true + } + } + }, + { + "name": "control-mission.accept", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "mission.accept", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRef": { + "kind": "mission", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "decisionRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + } + } + }, + { + "name": "control-unknown-mission.accept", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "mission.accept", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRef": { + "kind": "mission", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "decisionRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "unexpected": true + } + } + }, + { + "name": "control-task.accept", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "task.accept", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRef": { + "kind": "task", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "decisionRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + } + } + }, + { + "name": "control-unknown-task.accept", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "task.accept", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRef": { + "kind": "task", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "decisionRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "unexpected": true + } + } + }, + { + "name": "control-work.read", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "work.read", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRefs": [ + { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + ], + "cursorId": null, + "limit": 1, + "view": "records", + "executionIds": [] + } + } + }, + { + "name": "control-unknown-work.read", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "work.read", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRefs": [ + { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + ], + "cursorId": null, + "limit": 1, + "unexpected": true, + "view": "records", + "executionIds": [] + } + } + }, + { + "name": "control-file.read", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "file.read", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "path": { + "root": "workspace", + "path": null + }, + "view": "contents", + "offsetBytes": 0, + "maxBytes": 1 + } + } + }, + { + "name": "control-unknown-file.read", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "file.read", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "path": { + "root": "workspace", + "path": null + }, + "view": "contents", + "offsetBytes": 0, + "maxBytes": 1, + "unexpected": true + } + } + }, + { + "name": "control-file.change", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "file.change", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "path": { + "root": "workspace", + "path": "fixture" + }, + "change": "put", + "expectedDigest": null, + "contentRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "control-unknown-file.change", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "file.change", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "path": { + "root": "workspace", + "path": "fixture" + }, + "change": "put", + "expectedDigest": null, + "contentRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "unexpected": true + } + } + }, + { + "name": "control-work.propose", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "work.propose", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "subjectRefs": [ + { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + ], + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "control-unknown-work.propose", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "work.propose", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "subjectRefs": [ + { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + ], + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "unexpected": true + } + } + }, + { + "name": "control-assignment.change", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "assignment.change", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "currentRef": { + "kind": "assignment", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "proposedId": "fixture" + } + } + }, + { + "name": "control-unknown-assignment.change", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "assignment.change", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "unexpected": true, + "currentRef": { + "kind": "assignment", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "proposedId": "fixture" + } + } + }, + { + "name": "control-result.submit", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "result.submit", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "assignmentRef": { + "kind": "assignment", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "evidenceRefs": [ + { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ] + } + } + }, + { + "name": "control-unknown-result.submit", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "result.submit", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "assignmentRef": { + "kind": "assignment", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "evidenceRefs": [ + { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "unexpected": true + } + } + }, + { + "name": "control-registration.manage", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "registration.manage", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "currentRef": null, + "proposedId": "fixture", + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "control-unknown-registration.manage", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "registration.manage", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "currentRef": null, + "proposedId": "fixture", + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "unexpected": true + } + } + }, + { + "name": "control-conversation.read", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "conversation.read", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "sessionRef": { + "kind": "session", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "cursorId": null, + "limit": 1 + } + } + }, + { + "name": "control-unknown-conversation.read", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "conversation.read", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "sessionRef": { + "kind": "session", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "cursorId": null, + "limit": 1, + "unexpected": true + } + } + }, + { + "name": "control-conversation.observe", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "conversation.observe", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + } + } + } + }, + { + "name": "control-unknown-conversation.observe", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "conversation.observe", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "unexpected": true + } + } + }, + { + "name": "control-execution.launch", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "execution.launch", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "agentId": "fixture", + "mode": "resume", + "assignmentRefs": [], + "sessionId": null, + "workMode": "continue", + "replacementBinding": null, + "expectedControlGeneration": null, + "replacementDecisionRef": null + } + } + }, + { + "name": "control-unknown-execution.launch", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "execution.launch", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "agentId": "fixture", + "mode": "resume", + "assignmentRefs": [], + "unexpected": true, + "sessionId": null, + "workMode": "continue", + "replacementBinding": null, + "expectedControlGeneration": null, + "replacementDecisionRef": null + } + } + }, + { + "name": "control-execution.control", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "execution.control", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001" + } + } + }, + { + "name": "control-unknown-execution.control", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "execution.control", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "unexpected": true + } + } + }, + { + "name": "control-execution.transfer", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "execution.transfer", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "fromConnectionId": "00000000-0000-4000-8000-000000000001", + "toConnectionId": "00000000-0000-4000-8000-000000000001", + "expectedControlGeneration": 1 + } + } + }, + { + "name": "control-unknown-execution.transfer", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "execution.transfer", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "fromConnectionId": "00000000-0000-4000-8000-000000000001", + "toConnectionId": "00000000-0000-4000-8000-000000000001", + "expectedControlGeneration": 1, + "unexpected": true + } + } + }, + { + "name": "control-workspace.retire", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "workspace.retire", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "workspaceRef": { + "kind": "workspace", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "decisionRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + } + } + }, + { + "name": "control-unknown-workspace.retire", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "workspace.retire", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "workspaceRef": { + "kind": "workspace", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "decisionRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "unexpected": true + } + } + }, + { + "name": "control-workspace.reopen", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "workspace.reopen", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "workspaceRef": { + "kind": "workspace", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "decisionRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + } + } + }, + { + "name": "control-unknown-workspace.reopen", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "workspace.reopen", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "workspaceRef": { + "kind": "workspace", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "decisionRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "unexpected": true + } + } + }, + { + "name": "control-message.send", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "message.send", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "recipient": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "routing": "current-scoped-session", + "sessionId": null, + "executionId": null + }, + "messageKind": "work-notice", + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "subjectRefs": [], + "expiresAt": "2026-09-06T04:00:00.000Z", + "replyToMessageId": null + } + } + }, + { + "name": "control-unknown-message.send", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "message.send", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "recipient": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "routing": "current-scoped-session", + "sessionId": null, + "executionId": null + }, + "messageKind": "work-notice", + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "subjectRefs": [], + "expiresAt": "2026-09-06T04:00:00.000Z", + "replyToMessageId": null, + "unexpected": true + } + } + }, + { + "name": "control-audit.read", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "audit.read", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "artifactRefs": [ + { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ] + } + } + }, + { + "name": "control-unknown-audit.read", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "audit.read", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "artifactRefs": [ + { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "unexpected": true + } + } + }, + { + "name": "control-decision.issue", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "decision.issue", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "proposedId": "fixture", + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "control-unknown-decision.issue", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "decision.issue", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "proposedId": "fixture", + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "unexpected": true + } + } + }, + { + "name": "control-session.adopt", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "session.adopt", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "agentId": "fixture", + "legacySnapshotRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "decisionRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + } + } + }, + { + "name": "control-unknown-session.adopt", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "session.adopt", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "agentId": "fixture", + "legacySnapshotRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "decisionRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "unexpected": true + } + } + }, + { + "name": "runtime-process-observation", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "process-observation", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "backend": "docker", + "containerId": "0000000000000000000000000000000000000000000000000000000000000000", + "imageDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "processGroupRef": "fixture", + "state": "created" + } + } + }, + { + "name": "runtime-unknown-process-observation", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "process-observation", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "backend": "docker", + "containerId": "0000000000000000000000000000000000000000000000000000000000000000", + "imageDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "processGroupRef": "fixture", + "state": "created", + "unexpected": true + } + } + }, + { + "name": "runtime-termination-proof", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "termination-proof", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "processRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "observerId": "fixture", + "processGroupEmpty": true, + "observationRefs": [ + { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "proofMode": "stopped", + "admissionFenced": true, + "startAdmitted": true + } + } + }, + { + "name": "runtime-unknown-termination-proof", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "termination-proof", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "processRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "observerId": "fixture", + "processGroupEmpty": true, + "observationRefs": [ + { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "unexpected": true, + "proofMode": "stopped", + "admissionFenced": true, + "startAdmitted": true + } + } + }, + { + "name": "runtime-delegation-basis", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "delegation-basis", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "grantee": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "scope": { + "kind": "system" + }, + "operations": [ + "work.read" + ], + "existingScopeRefs": [], + "newProjectIds": [], + "newWorkspaceIds": [], + "parentDecisionRef": null, + "expiresAt": null, + "maxUses": 1, + "ceilingRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ] + } + } + }, + { + "name": "runtime-unknown-delegation-basis", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "delegation-basis", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "grantee": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "scope": { + "kind": "system" + }, + "operations": [ + "work.read" + ], + "existingScopeRefs": [], + "newProjectIds": [], + "newWorkspaceIds": [], + "parentDecisionRef": null, + "expiresAt": null, + "maxUses": 1, + "ceilingRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "unexpected": true + } + } + }, + { + "name": "termination-proof-with-live-processes", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "termination-proof", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "processRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "observerId": "fixture", + "processGroupEmpty": false, + "observationRefs": [ + { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "proofMode": "stopped", + "admissionFenced": true, + "startAdmitted": true + } + } + }, + { + "name": "network-reference-is-not-an-endpoint", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "sandbox-limits", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "profileRef": { + "catalog": "sandbox-profile", + "id": "fixture", + "sourceCommit": "0000000000000000000000000000000000000000", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "readPaths": [], + "writePaths": [], + "network": "approved-endpoints", + "endpointRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "timeoutSeconds": 1, + "memoryMiB": 16, + "processLimit": 1, + "credentialAccess": false, + "hostControlAccess": false, + "coverage": "command-invocation-v1" + } + } + }, + { + "name": "runtime-decision-basis", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "decision-basis", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "decisionKind": "plan-approval", + "subjectRefs": [ + { + "kind": "task", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + ], + "criteriaIds": [], + "authorActors": [], + "reviewer": null, + "reviewedEvidenceRefs": [], + "rationaleRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "priorDecisionRefs": [], + "requestId": null, + "requestDigest": null, + "binding": null + } + } + }, + { + "name": "acceptance-without-criteria-reviewer-evidence", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "decision-basis", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "decisionKind": "acceptance", + "subjectRefs": [ + { + "kind": "task", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + ], + "criteriaIds": [], + "authorActors": [], + "reviewer": null, + "reviewedEvidenceRefs": [], + "rationaleRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "priorDecisionRefs": [], + "requestId": null, + "requestDigest": null, + "binding": null + } + } + }, + { + "name": "control-response-accepted", + "schemaValid": true, + "document": { + "responseVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "outcome": "accepted", + "reasonCode": "allowed", + "receiptRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "executionId": null, + "dataRef": null + } + }, + { + "name": "accepted-without-receipt", + "schemaValid": false, + "document": { + "responseVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "outcome": "accepted", + "reasonCode": "allowed", + "receiptRef": null, + "executionId": null, + "dataRef": null + } + }, + { + "name": "accepted-with-refusal-reason", + "schemaValid": false, + "document": { + "responseVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "outcome": "accepted", + "reasonCode": "not-authorized", + "receiptRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "executionId": null, + "dataRef": null + } + }, + { + "name": "select-without-assignment", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "execution.launch", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "agentId": "fixture", + "mode": "resume", + "assignmentRefs": [], + "sessionId": null, + "workMode": "select", + "replacementBinding": null, + "expectedControlGeneration": null, + "replacementDecisionRef": null + } + } + }, + { + "name": "fresh-with-explicit-old-session", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "execution.launch", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "agentId": "fixture", + "mode": "fresh", + "assignmentRefs": [], + "sessionId": "00000000-0000-4000-8000-000000000001", + "workMode": "continue", + "replacementBinding": null, + "expectedControlGeneration": null, + "replacementDecisionRef": null + } + } + }, + { + "name": "replacement-generation-without-binding", + "schemaValid": false, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "execution.launch", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "agentId": "fixture", + "mode": "fresh", + "assignmentRefs": [], + "sessionId": null, + "workMode": "continue", + "replacementBinding": null, + "expectedControlGeneration": 1, + "replacementDecisionRef": null + } + } + }, + { + "name": "authorization-refused", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "authorization", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "requestId": "00000000-0000-4000-8000-000000000001", + "requestDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "requester": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "scope": { + "kind": "system" + }, + "operation": "work.read", + "outcome": "refused", + "reasonCode": "not-authorized", + "policyRefs": [], + "checkedRecordRefs": [] + } + } + }, + { + "name": "manifest-resume", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "launch-manifest", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "inputs": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "conversationMode": "resume", + "priorConversationRef": { + "kind": "session", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "selectedAssignments": [], + "contextInputs": [], + "baseProjection": { + "hashScopeVersion": 1, + "agentId": "fixture", + "soulDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "instructions": [], + "skills": [], + "harness": { + "id": "fixture", + "version": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "modelSettingsDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "roleConfigDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "policyRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "accountRef": null, + "adapterCapabilityRef": { + "kind": "adapter-capability", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "imageDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "agentDefinitionRef": { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "sessionRecordRef": { + "kind": "session", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "settingsRef": { + "registry": "settings", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "resumeSnapshotRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "resumeLeafId": null + }, + "agentConfigHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "launchManifestHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "hashAlgorithm": "sha256-rfc8785-v1" + } + } + }, + { + "name": "manifest-fresh", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "launch-manifest", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "inputs": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "conversationMode": "fresh", + "priorConversationRef": null, + "selectedAssignments": [], + "contextInputs": [], + "baseProjection": { + "hashScopeVersion": 1, + "agentId": "fixture", + "soulDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "instructions": [], + "skills": [], + "harness": { + "id": "fixture", + "version": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "modelSettingsDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "roleConfigDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "policyRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "accountRef": null, + "adapterCapabilityRef": { + "kind": "adapter-capability", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "imageDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "agentDefinitionRef": { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "sessionRecordRef": { + "kind": "session", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "settingsRef": { + "registry": "settings", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "resumeSnapshotRef": null, + "resumeLeafId": null + }, + "agentConfigHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "launchManifestHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "hashAlgorithm": "sha256-rfc8785-v1" + } + } + }, + { + "name": "execution-started-with-process", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "execution-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "authorizationId": "00000000-0000-4000-8000-000000000001", + "manifestRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "state": "started", + "processRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "terminationProofRef": null, + "resultRef": null + } + } + }, + { + "name": "execution-terminated-with-proof", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "execution-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "authorizationId": "00000000-0000-4000-8000-000000000001", + "manifestRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "state": "terminated", + "processRef": null, + "terminationProofRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "resultRef": null + } + } + }, + { + "name": "claim-released-with-proof", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "claim-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "claimId": "00000000-0000-4000-8000-000000000001", + "state": "released", + "authorizationId": "00000000-0000-4000-8000-000000000001", + "terminationProofRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "connection-controller", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "connection-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "connectionId": "00000000-0000-4000-8000-000000000001", + "client": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "mode": "control", + "state": "granted", + "controlGeneration": 1, + "authorizationId": "00000000-0000-4000-8000-000000000001" + } + } + }, + { + "name": "message-exact-execution-result", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "message", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "messageId": "00000000-0000-4000-8000-000000000001", + "sender": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "sourceScope": { + "kind": "system" + }, + "recipient": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "routing": "exact-execution", + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001" + }, + "messageKind": "execution-result", + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "subjectRefs": [ + { + "kind": "task", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + ], + "expiresAt": "2026-09-06T04:00:00.000Z", + "replyToMessageId": null, + "authorizationId": "00000000-0000-4000-8000-000000000001" + } + } + }, + { + "name": "message-exact-approval", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "message", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "messageId": "00000000-0000-4000-8000-000000000001", + "sender": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "sourceScope": { + "kind": "system" + }, + "recipient": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "routing": "exact-execution", + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001" + }, + "messageKind": "approval", + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "subjectRefs": [ + { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + ], + "expiresAt": "2026-09-06T04:00:00.000Z", + "replyToMessageId": null, + "authorizationId": "00000000-0000-4000-8000-000000000001" + } + } + }, + { + "name": "message-delivered", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "message-delivery", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "messageId": "00000000-0000-4000-8000-000000000001", + "outcome": "delivered", + "recipientBinding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "authorizationId": "00000000-0000-4000-8000-000000000001", + "observationRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + } + } + }, + { + "name": "network-approved-endpoint", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "sandbox-limits", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "profileRef": { + "catalog": "sandbox-profile", + "id": "fixture", + "sourceCommit": "0000000000000000000000000000000000000000", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "readPaths": [], + "writePaths": [], + "network": "approved-endpoints", + "endpointRefs": [ + { + "registry": "endpoint", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "timeoutSeconds": 1, + "memoryMiB": 16, + "processLimit": 1, + "credentialAccess": false, + "hostControlAccess": false, + "coverage": "command-invocation-v1" + } + } + }, + { + "name": "config-unknown", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "configuration-check", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "launchHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "currentHash": null, + "status": "unknown", + "sourceRefs": [], + "noticeKey": "fixture" + } + } + }, + { + "name": "response-succeeded", + "schemaValid": true, + "document": { + "responseVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "outcome": "succeeded", + "reasonCode": "allowed", + "receiptRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "executionId": null, + "dataRef": null + } + }, + { + "name": "response-refused", + "schemaValid": true, + "document": { + "responseVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "outcome": "refused", + "reasonCode": "not-authorized", + "receiptRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "executionId": null, + "dataRef": null + } + }, + { + "name": "response-unknown", + "schemaValid": true, + "document": { + "responseVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "outcome": "unknown", + "reasonCode": "unknown-effects", + "receiptRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "executionId": null, + "dataRef": null + } + }, + { + "name": "response-already-active", + "schemaValid": true, + "document": { + "responseVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "outcome": "already-active", + "reasonCode": "already-active", + "receiptRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "executionId": "00000000-0000-4000-8000-000000000001", + "dataRef": null + } + }, + { + "name": "launch-select", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "execution.launch", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "agentId": "fixture", + "mode": "resume", + "assignmentRefs": [ + { + "kind": "assignment", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + ], + "sessionId": null, + "workMode": "select", + "replacementBinding": null, + "expectedControlGeneration": null, + "replacementDecisionRef": null + } + } + }, + { + "name": "launch-fresh-replacement", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "execution.launch", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "agentId": "fixture", + "mode": "fresh", + "assignmentRefs": [], + "sessionId": null, + "workMode": "continue", + "replacementBinding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "expectedControlGeneration": 1, + "replacementDecisionRef": { + "kind": "decision", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + } + } + }, + { + "name": "file-delete", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "file.change", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "path": { + "root": "workspace", + "path": "fixture" + }, + "change": "delete", + "expectedDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "contentRef": null + } + } + }, + { + "name": "acceptance-basis-complete-shape", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "decision-basis", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "decisionKind": "acceptance", + "subjectRefs": [ + { + "kind": "task", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + ], + "criteriaIds": [ + "criterion-fixture" + ], + "authorActors": [ + { + "kind": "human", + "principalId": "fixture", + "executionId": null + } + ], + "reviewer": { + "kind": "human", + "principalId": "reviewer-fixture", + "executionId": null + }, + "reviewedEvidenceRefs": [ + { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "rationaleRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "priorDecisionRefs": [], + "requestId": null, + "requestDigest": null, + "binding": null + } + } + }, + { + "name": "classified-general-preference", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "launch-manifest", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "inputs": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "conversationMode": "initial", + "priorConversationRef": null, + "selectedAssignments": [], + "contextInputs": [ + { + "category": "general-preference", + "sourceRef": { + "registry": "context-content", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "snapshotRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "classificationRef": { + "kind": "context-source", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + } + } + ], + "baseProjection": { + "hashScopeVersion": 1, + "agentId": "fixture", + "soulDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "instructions": [], + "skills": [], + "harness": { + "id": "fixture", + "version": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "modelSettingsDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "roleConfigDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "policyRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "accountRef": null, + "adapterCapabilityRef": { + "kind": "adapter-capability", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "imageDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "agentDefinitionRef": { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "sessionRecordRef": { + "kind": "session", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "settingsRef": { + "registry": "settings", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "resumeSnapshotRef": null, + "resumeLeafId": null + }, + "agentConfigHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "launchManifestHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "hashAlgorithm": "sha256-rfc8785-v1" + } + } + }, + { + "name": "preference-without-classification", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "launch-manifest", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "inputs": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "conversationMode": "initial", + "priorConversationRef": null, + "selectedAssignments": [], + "contextInputs": [ + { + "category": "general-preference", + "sourceRef": { + "registry": "context-content", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "snapshotRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "classificationRef": null + } + ], + "baseProjection": { + "hashScopeVersion": 1, + "agentId": "fixture", + "soulDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "instructions": [], + "skills": [], + "harness": { + "id": "fixture", + "version": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "modelSettingsDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "roleConfigDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "policyRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "accountRef": null, + "adapterCapabilityRef": { + "kind": "adapter-capability", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "imageDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "agentDefinitionRef": { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "sessionRecordRef": { + "kind": "session", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "settingsRef": { + "registry": "settings", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "resumeSnapshotRef": null, + "resumeLeafId": null + }, + "agentConfigHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "launchManifestHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "hashAlgorithm": "sha256-rfc8785-v1" + } + } + }, + { + "name": "read-configuration", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "work.read", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRefs": [], + "cursorId": null, + "limit": 1, + "view": "configuration", + "executionIds": [ + "00000000-0000-4000-8000-000000000001" + ] + } + } + }, + { + "name": "read-execution-status", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "work.read", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "targetRefs": [], + "cursorId": null, + "limit": 1, + "view": "execution-status", + "executionIds": [ + "00000000-0000-4000-8000-000000000001" + ] + } + } + }, + { + "name": "create-initial-assignment", + "schemaValid": true, + "document": { + "requestVersion": 1, + "requestId": "00000000-0000-4000-8000-000000000001", + "operation": "assignment.change", + "scope": { + "kind": "system" + }, + "expectedRefs": [], + "assignmentRef": null, + "parameters": { + "proposedPayloadRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "currentRef": null, + "proposedId": "fixture" + } + } + }, + { + "name": "never-started-proof-shape", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "termination-proof", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "processRef": null, + "observerId": "fixture", + "processGroupEmpty": true, + "observationRefs": [ + { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "proofMode": "never-started", + "admissionFenced": true, + "startAdmitted": false + } + } + }, + { + "name": "cannot-claim-never-started-after-admission", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "termination-proof", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "processRef": null, + "observerId": "fixture", + "processGroupEmpty": true, + "observationRefs": [ + { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "proofMode": "never-started", + "admissionFenced": true, + "startAdmitted": true + } + } + }, + { + "name": "command-result-body", + "schemaValid": true, + "document": { + "documentVersion": 1, + "kind": "command-result", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "commandId": "00000000-0000-4000-8000-000000000001", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "stdoutRef": null, + "stderrRef": null, + "outputRefs": [], + "outputTruncated": false, + "outcomeEventId": "00000000-0000-4000-8000-000000000001" + } + } + }, + { + "name": "result-rejects-duplicate-stop-proof", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "command-result", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "commandId": "00000000-0000-4000-8000-000000000001", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "stdoutRef": null, + "stderrRef": null, + "outputRefs": [], + "outputTruncated": false, + "outcomeEventId": "00000000-0000-4000-8000-000000000001", + "terminationProofRef": null + } + } + }, + { + "name": "result-rejects-second-outcome-definition", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "command-result", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "commandId": "00000000-0000-4000-8000-000000000001", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "stdoutRef": null, + "stderrRef": null, + "outputRefs": [], + "outputTruncated": false, + "outcomeEventId": "00000000-0000-4000-8000-000000000001", + "outcome": "succeeded" + } + } + }, + { + "name": "command-result-missing-truncation-flag", + "schemaValid": false, + "document": { + "documentVersion": 1, + "kind": "command-result", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "commandId": "00000000-0000-4000-8000-000000000001", + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "stdoutRef": null, + "stderrRef": null, + "outputRefs": [], + "outputTruncated": null, + "outcomeEventId": "00000000-0000-4000-8000-000000000001" + } + } + } + ], + "semanticObligations": [ + { + "name": "forged-manifest-hash", + "schemaValid": true, + "requiredRuntimeCheck": "Recompute the manifest hash from canonical normalized inputs.", + "document": { + "documentVersion": 1, + "kind": "launch-manifest", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "inputs": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "conversationMode": "initial", + "priorConversationRef": null, + "selectedAssignments": [], + "contextInputs": [], + "baseProjection": { + "hashScopeVersion": 1, + "agentId": "fixture", + "soulDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "instructions": [], + "skills": [], + "harness": { + "id": "fixture", + "version": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "modelSettingsDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "roleConfigDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "policyRefs": [ + { + "registry": "harness", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "accountRef": null, + "adapterCapabilityRef": { + "kind": "adapter-capability", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "imageDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "agentDefinitionRef": { + "kind": "agent-definition", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "sessionRecordRef": { + "kind": "session", + "id": "fixture", + "scope": { + "kind": "system" + }, + "revision": 1 + }, + "settingsRef": { + "registry": "settings", + "id": "fixture", + "revision": 1, + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "resumeSnapshotRef": null, + "resumeLeafId": null + }, + "agentConfigHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "launchManifestHash": "sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "hashAlgorithm": "sha256-rfc8785-v1" + } + } + }, + { + "name": "mismatched-session-binding", + "schemaValid": true, + "requiredRuntimeCheck": "Resolve the actual engine session against the admitted scope.", + "document": { + "documentVersion": 1, + "kind": "execution-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000099", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "authorizationId": "00000000-0000-4000-8000-000000000001", + "manifestRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "state": "admitted", + "processRef": null, + "terminationProofRef": null, + "resultRef": null + } + } + }, + { + "name": "wrong-message-workspace", + "schemaValid": true, + "requiredRuntimeCheck": "Check sender/recipient permission at send and delivery.", + "document": { + "documentVersion": 1, + "kind": "message", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "messageId": "00000000-0000-4000-8000-000000000001", + "sender": { + "kind": "human", + "principalId": "fixture", + "executionId": null + }, + "sourceScope": { + "kind": "system" + }, + "recipient": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "other" + }, + "routing": "current-scoped-session", + "sessionId": null, + "executionId": null + }, + "messageKind": "work-notice", + "bodyRef": { + "runId": "fixture", + "artifactId": "fixture", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + "subjectRefs": [], + "expiresAt": "2026-09-06T04:00:00.000Z", + "replyToMessageId": null, + "authorizationId": "00000000-0000-4000-8000-000000000001" + } + } + }, + { + "name": "false-config-equality", + "schemaValid": true, + "requiredRuntimeCheck": "Matching requires recomputed equal comparable hashes.", + "document": { + "documentVersion": 1, + "kind": "configuration-check", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "launchHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000", + "currentHash": "sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "status": "matching", + "sourceRefs": [], + "noticeKey": "fixture" + } + } + }, + { + "name": "invented-authorization", + "schemaValid": true, + "requiredRuntimeCheck": "Resolve a trusted authorization and serialize the current claim.", + "document": { + "documentVersion": 1, + "kind": "claim-transition", + "id": "00000000-0000-4000-8000-000000000001", + "runId": "fixture", + "recordedAt": "2026-09-06T04:00:00.000Z", + "observedAt": "2026-09-06T04:00:00.000Z", + "producer": { + "componentId": "fixture", + "instanceId": "00000000-0000-4000-8000-000000000001" + }, + "causedById": null, + "payload": { + "binding": { + "agentId": "fixture", + "scope": { + "kind": "workspace", + "projectId": "fixture", + "workspaceId": "fixture" + }, + "sessionId": "00000000-0000-4000-8000-000000000001", + "executionId": "00000000-0000-4000-8000-000000000001", + "claimGeneration": 1 + }, + "claimId": "00000000-0000-4000-8000-000000000001", + "state": "reserved", + "authorizationId": "00000000-0000-4000-8000-000000000099", + "terminationProofRef": null + } + } + } + ] +} diff --git a/docs/plans/foundation-v1-candidate/runtime.schema.json b/docs/plans/foundation-v1-candidate/runtime.schema.json new file mode 100644 index 00000000..efa4d021 --- /dev/null +++ b/docs/plans/foundation-v1-candidate/runtime.schema.json @@ -0,0 +1,5933 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "urn:mosaic:planning:issue-53:runtime:candidate-1", + "title": "Planning candidate: mediated runtime records, input and artifact contracts", + "description": "No runtime consumes this schema. Cross-record identity, authorization, hash and transition checks are mandatory in addition to shape validation.", + "oneOf": [ + { + "$ref": "#/$defs/runtime-authorization" + }, + { + "$ref": "#/$defs/runtime-launch-manifest" + }, + { + "$ref": "#/$defs/runtime-execution-transition" + }, + { + "$ref": "#/$defs/runtime-claim-transition" + }, + { + "$ref": "#/$defs/runtime-connection-transition" + }, + { + "$ref": "#/$defs/runtime-message" + }, + { + "$ref": "#/$defs/runtime-message-delivery" + }, + { + "$ref": "#/$defs/runtime-command-spec" + }, + { + "$ref": "#/$defs/runtime-sandbox-limits" + }, + { + "$ref": "#/$defs/runtime-artifact-index" + }, + { + "$ref": "#/$defs/runtime-configuration-check" + }, + { + "$ref": "#/$defs/inputRequest" + }, + { + "$ref": "#/$defs/controlRequest" + }, + { + "$ref": "#/$defs/runtime-process-observation" + }, + { + "$ref": "#/$defs/runtime-termination-proof" + }, + { + "$ref": "#/$defs/runtime-delegation-basis" + }, + { + "$ref": "#/$defs/runtime-decision-basis" + }, + { + "$ref": "#/$defs/controlResponse" + }, + { + "$ref": "#/$defs/runtime-command-result" + } + ], + "$defs": { + "id": { + "type": "string", + "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$" + }, + "runtimeId": { + "type": "string", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "revision": { + "type": "integer", + "minimum": 1, + "maximum": 9007199254740991 + }, + "digest": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + }, + "time": { + "type": "string", + "format": "date-time", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$" + }, + "actor": { + "type": "object", + "additionalProperties": false, + "required": [ + "kind", + "principalId", + "executionId" + ], + "properties": { + "kind": { + "enum": [ + "human", + "service", + "agent" + ] + }, + "principalId": { + "$ref": "#/$defs/id" + }, + "executionId": { + "oneOf": [ + { + "$ref": "#/$defs/runtimeId" + }, + { + "type": "null" + } + ] + } + }, + "if": { + "properties": { + "kind": { + "const": "agent" + } + } + }, + "then": { + "properties": { + "executionId": { + "$ref": "#/$defs/runtimeId" + } + } + }, + "else": { + "properties": { + "executionId": { + "type": "null" + } + } + } + }, + "artifactRef": { + "type": "object", + "additionalProperties": false, + "required": [ + "runId", + "artifactId", + "digest" + ], + "properties": { + "runId": { + "$ref": "#/$defs/id" + }, + "artifactId": { + "$ref": "#/$defs/id" + }, + "digest": { + "$ref": "#/$defs/digest" + } + } + }, + "workspaceScope": { + "type": "object", + "additionalProperties": false, + "required": [ + "kind", + "projectId", + "workspaceId" + ], + "properties": { + "kind": { + "const": "workspace" + }, + "projectId": { + "$ref": "#/$defs/id" + }, + "workspaceId": { + "$ref": "#/$defs/id" + } + } + }, + "projectScope": { + "type": "object", + "additionalProperties": false, + "required": [ + "kind", + "projectId" + ], + "properties": { + "kind": { + "const": "project" + }, + "projectId": { + "$ref": "#/$defs/id" + } + } + }, + "systemScope": { + "type": "object", + "additionalProperties": false, + "required": [ + "kind" + ], + "properties": { + "kind": { + "const": "system" + } + } + }, + "scope": { + "oneOf": [ + { + "$ref": "#/$defs/systemScope" + }, + { + "$ref": "#/$defs/projectScope" + }, + { + "$ref": "#/$defs/workspaceScope" + } + ] + }, + "recordRef": { + "type": "object", + "additionalProperties": false, + "required": [ + "kind", + "id", + "scope", + "revision" + ], + "properties": { + "kind": { + "enum": [ + "agent-definition", + "project", + "workspace", + "registration", + "mission", + "task", + "assignment", + "decision", + "session", + "context-source", + "adapter-capability" + ] + }, + "id": { + "$ref": "#/$defs/id" + }, + "scope": { + "$ref": "#/$defs/scope" + }, + "revision": { + "$ref": "#/$defs/revision" + } + } + }, + "registryRef": { + "type": "object", + "additionalProperties": false, + "required": [ + "registry", + "id", + "revision", + "digest" + ], + "properties": { + "registry": { + "enum": [ + "harness", + "settings", + "context-content", + "scope-role", + "agent-policy", + "project-policy", + "endpoint" + ] + }, + "id": { + "$ref": "#/$defs/id" + }, + "revision": { + "$ref": "#/$defs/revision" + }, + "digest": { + "$ref": "#/$defs/digest" + } + } + }, + "operation": { + "enum": [ + "work.read", + "file.read", + "file.change", + "command.execute", + "work.propose", + "task.create", + "assignment.change", + "result.submit", + "task.accept", + "registration.manage", + "conversation.read", + "conversation.observe", + "execution.launch", + "execution.control", + "execution.transfer", + "workspace.retire", + "workspace.reopen", + "message.send", + "audit.read", + "project.create", + "project.change", + "workspace.create", + "workspace.change", + "mission.create", + "mission.change", + "mission.accept", + "task.change", + "decision.issue", + "session.adopt" + ] + }, + "relativePath": { + "type": "string", + "format": "mosaic-relative-path", + "minLength": 1, + "maxLength": 4096, + "pattern": "^(?!/)(?!.*[\\\\\\u0000-\\u001f\\u007f])(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*//)[^/]+(?:/[^/]+)*$" + }, + "pathGrant": { + "type": "object", + "additionalProperties": false, + "required": [ + "root", + "path" + ], + "properties": { + "root": { + "const": "workspace" + }, + "path": { + "oneOf": [ + { + "$ref": "#/$defs/relativePath" + }, + { + "type": "null" + } + ] + } + } + }, + "restrictions": { + "type": "object", + "additionalProperties": false, + "required": [ + "operations", + "readPaths", + "writePaths", + "network", + "endpointRefs" + ], + "properties": { + "operations": { + "type": "array", + "items": { + "$ref": "#/$defs/operation" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "readPaths": { + "type": "array", + "items": { + "$ref": "#/$defs/pathGrant" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "writePaths": { + "type": "array", + "items": { + "$ref": "#/$defs/pathGrant" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "network": { + "enum": [ + "none", + "approved-endpoints" + ] + }, + "endpointRefs": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "endpoint" + } + } + } + ] + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + } + }, + "allOf": [ + { + "if": { + "properties": { + "network": { + "const": "none" + } + } + }, + "then": { + "properties": { + "endpointRefs": { + "maxItems": 0 + } + } + }, + "else": { + "properties": { + "endpointRefs": { + "minItems": 1 + } + } + } + } + ] + }, + "criterion": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "text" + ], + "properties": { + "id": { + "$ref": "#/$defs/id" + }, + "text": { + "type": "string", + "minLength": 1, + "maxLength": 4000 + } + } + }, + "contentRefs": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "context-content" + } + } + } + ] + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "envelope": { + "type": "object", + "additionalProperties": false, + "required": [ + "schemaVersion", + "kind", + "id", + "scope", + "revision", + "createdAt", + "createdBy", + "supersedes", + "authorizationRef", + "payload" + ], + "properties": { + "schemaVersion": { + "const": 1 + }, + "kind": { + "enum": [ + "agent-definition", + "project", + "workspace", + "registration", + "mission", + "task", + "assignment", + "decision", + "session", + "context-source", + "adapter-capability" + ] + }, + "id": { + "$ref": "#/$defs/id" + }, + "scope": { + "$ref": "#/$defs/scope" + }, + "revision": { + "$ref": "#/$defs/revision" + }, + "createdAt": { + "$ref": "#/$defs/time" + }, + "createdBy": { + "$ref": "#/$defs/actor" + }, + "supersedes": { + "oneOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "type": "null" + } + ] + }, + "authorizationRef": { + "$ref": "#/$defs/runtimeId" + }, + "payload": { + "type": "object" + } + }, + "allOf": [ + { + "if": { + "properties": { + "revision": { + "const": 1 + } + } + }, + "then": { + "properties": { + "supersedes": { + "type": "null" + } + } + }, + "else": { + "properties": { + "supersedes": { + "$ref": "#/$defs/recordRef" + } + } + } + } + ] + }, + "agent-definitionPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "displayName", + "agentType", + "harnessRef", + "settingsRef", + "soulRef", + "instructionRefs", + "skillRefs", + "policyRef", + "status" + ], + "properties": { + "displayName": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "agentType": { + "$ref": "#/$defs/id" + }, + "harnessRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "harness" + } + } + } + ] + }, + "settingsRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "settings" + } + } + } + ] + }, + "soulRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "context-content" + } + } + } + ] + }, + "instructionRefs": { + "$ref": "#/$defs/contentRefs" + }, + "skillRefs": { + "$ref": "#/$defs/contentRefs" + }, + "policyRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "agent-policy" + } + } + } + ] + }, + "status": { + "enum": [ + "enabled", + "disabled" + ] + } + } + }, + "agent-definition": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "agent-definition" + }, + "payload": { + "$ref": "#/$defs/agent-definitionPayload" + }, + "scope": { + "$ref": "#/$defs/systemScope" + } + } + } + ] + }, + "projectPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "displayName", + "policyRef", + "status" + ], + "properties": { + "displayName": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "policyRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "project-policy" + } + } + } + ] + }, + "status": { + "enum": [ + "active", + "retired" + ] + } + } + }, + "project": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "project" + }, + "payload": { + "$ref": "#/$defs/projectPayload" + }, + "scope": { + "$ref": "#/$defs/projectScope" + } + } + } + ] + }, + "workspacePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "displayName", + "policyRef", + "status", + "fileRootId" + ], + "properties": { + "displayName": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "policyRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "project-policy" + } + } + } + ] + }, + "status": { + "enum": [ + "active", + "retiring", + "retired" + ] + }, + "fileRootId": { + "$ref": "#/$defs/id" + } + } + }, + "workspace": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "workspace" + }, + "payload": { + "$ref": "#/$defs/workspacePayload" + }, + "scope": { + "$ref": "#/$defs/workspaceScope" + } + } + } + ] + }, + "registrationPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "agentId", + "scopeRoleRef", + "restrictions", + "projectRegistrationRef", + "status", + "delegationRef" + ], + "properties": { + "agentId": { + "$ref": "#/$defs/id" + }, + "scopeRoleRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "scope-role" + } + } + } + ] + }, + "restrictions": { + "oneOf": [ + { + "$ref": "#/$defs/restrictions" + }, + { + "type": "null" + } + ] + }, + "projectRegistrationRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "registration" + } + } + } + ] + }, + { + "type": "null" + } + ] + }, + "status": { + "enum": [ + "active", + "revoked" + ] + }, + "delegationRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "decision" + } + } + } + ] + }, + { + "type": "null" + } + ] + } + } + }, + "registration": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "registration" + }, + "payload": { + "$ref": "#/$defs/registrationPayload" + }, + "scope": { + "oneOf": [ + { + "$ref": "#/$defs/projectScope" + }, + { + "$ref": "#/$defs/workspaceScope" + } + ] + } + } + }, + { + "if": { + "properties": { + "scope": { + "properties": { + "kind": { + "const": "project" + } + } + } + } + }, + "then": { + "properties": { + "payload": { + "properties": { + "projectRegistrationRef": { + "type": "null" + } + } + } + } + }, + "else": { + "properties": { + "payload": { + "properties": { + "projectRegistrationRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "registration" + } + } + } + ] + } + } + } + } + } + } + ] + }, + "missionPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "objective", + "criteria", + "parentMissionRef", + "restrictions", + "status" + ], + "properties": { + "objective": { + "type": "string", + "minLength": 1, + "maxLength": 4000 + }, + "criteria": { + "type": "array", + "items": { + "$ref": "#/$defs/criterion" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + }, + "parentMissionRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "mission" + } + } + } + ] + }, + { + "type": "null" + } + ] + }, + "restrictions": { + "oneOf": [ + { + "$ref": "#/$defs/restrictions" + }, + { + "type": "null" + } + ] + }, + "status": { + "enum": [ + "proposed", + "active", + "blocked", + "ready-for-review", + "accepted", + "canceled" + ] + } + } + }, + "mission": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "mission" + }, + "payload": { + "$ref": "#/$defs/missionPayload" + }, + "scope": { + "oneOf": [ + { + "$ref": "#/$defs/projectScope" + }, + { + "$ref": "#/$defs/workspaceScope" + } + ] + } + } + }, + { + "if": { + "properties": { + "scope": { + "properties": { + "kind": { + "const": "project" + } + } + } + } + }, + "then": { + "properties": { + "payload": { + "properties": { + "parentMissionRef": { + "type": "null" + } + } + } + } + } + } + ] + }, + "taskPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "purpose", + "criteria", + "missionRef", + "intentRef", + "dependencies", + "restrictions", + "status" + ], + "properties": { + "purpose": { + "type": "string", + "minLength": 1, + "maxLength": 4000 + }, + "criteria": { + "type": "array", + "items": { + "$ref": "#/$defs/criterion" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + }, + "missionRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "mission" + } + } + } + ] + }, + { + "type": "null" + } + ] + }, + "intentRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "decision" + } + } + } + ] + }, + "dependencies": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "task" + } + } + } + ] + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "restrictions": { + "oneOf": [ + { + "$ref": "#/$defs/restrictions" + }, + { + "type": "null" + } + ] + }, + "status": { + "enum": [ + "proposed", + "ready", + "active", + "blocked", + "ready-for-review", + "accepted", + "canceled" + ] + } + } + }, + "task": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "task" + }, + "payload": { + "$ref": "#/$defs/taskPayload" + }, + "scope": { + "$ref": "#/$defs/workspaceScope" + } + } + } + ] + }, + "assignmentPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "taskRef", + "agentId", + "intentRef", + "status", + "endReason" + ], + "properties": { + "taskRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "task" + } + } + } + ] + }, + "agentId": { + "$ref": "#/$defs/id" + }, + "intentRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "decision" + } + } + } + ] + }, + "status": { + "enum": [ + "selected", + "paused", + "ended" + ] + }, + "endReason": { + "enum": [ + null, + "completed", + "abandoned", + "revoked", + "reassigned", + "canceled" + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "const": "ended" + } + } + }, + "then": { + "properties": { + "endReason": { + "type": "string" + } + } + }, + "else": { + "properties": { + "endReason": { + "type": "null" + } + } + } + } + ] + }, + "assignment": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "assignment" + }, + "payload": { + "$ref": "#/$defs/assignmentPayload" + }, + "scope": { + "$ref": "#/$defs/workspaceScope" + } + } + } + ] + }, + "decisionPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "decisionKind", + "subjectRefs", + "outcome", + "basisRef", + "evidenceRefs", + "delegatedOperations" + ], + "properties": { + "decisionKind": { + "enum": [ + "plan-approval", + "delegation", + "assignment-change", + "acceptance", + "owner-checkpoint", + "reconciliation" + ] + }, + "subjectRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/recordRef" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + }, + "outcome": { + "enum": [ + "approved", + "rejected" + ] + }, + "basisRef": { + "$ref": "#/$defs/artifactRef" + }, + "evidenceRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/artifactRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "delegatedOperations": { + "type": "array", + "items": { + "$ref": "#/$defs/operation" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + } + }, + "allOf": [ + { + "if": { + "properties": { + "decisionKind": { + "const": "delegation" + }, + "outcome": { + "const": "approved" + } + } + }, + "then": { + "properties": { + "delegatedOperations": { + "minItems": 1 + } + } + }, + "else": { + "properties": { + "delegatedOperations": { + "maxItems": 0 + } + } + } + } + ] + }, + "decision": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "decision" + }, + "payload": { + "$ref": "#/$defs/decisionPayload" + } + } + } + ] + }, + "sessionPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "agentId", + "creationMode", + "predecessorRef", + "harnessRef", + "harnessSessionId", + "sessionArtifactId" + ], + "properties": { + "agentId": { + "$ref": "#/$defs/id" + }, + "creationMode": { + "enum": [ + "initial", + "fresh", + "adopted" + ] + }, + "predecessorRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "session" + } + } + } + ] + }, + { + "type": "null" + } + ] + }, + "harnessRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "harness" + } + } + } + ] + }, + "harnessSessionId": { + "$ref": "#/$defs/id" + }, + "sessionArtifactId": { + "$ref": "#/$defs/id" + } + }, + "allOf": [ + { + "if": { + "properties": { + "creationMode": { + "const": "initial" + } + } + }, + "then": { + "properties": { + "predecessorRef": { + "type": "null" + } + } + } + } + ] + }, + "session": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "session" + }, + "payload": { + "$ref": "#/$defs/sessionPayload" + }, + "scope": { + "$ref": "#/$defs/workspaceScope" + } + } + } + ] + }, + "context-sourcePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "contentRef", + "category", + "sharedByDefault", + "permittedScopes", + "relevanceRefs" + ], + "properties": { + "contentRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "context-content" + } + } + } + ] + }, + "category": { + "enum": [ + "general-preference", + "personal", + "project", + "work" + ] + }, + "sharedByDefault": { + "type": "boolean" + }, + "permittedScopes": { + "type": "array", + "items": { + "$ref": "#/$defs/scope" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + }, + "relevanceRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/recordRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + } + }, + "allOf": [ + { + "if": { + "properties": { + "sharedByDefault": { + "const": true + } + } + }, + "then": { + "properties": { + "category": { + "const": "general-preference" + } + } + } + } + ] + }, + "context-source": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "context-source" + }, + "payload": { + "$ref": "#/$defs/context-sourcePayload" + } + } + } + ] + }, + "adapter-capabilityPayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "harnessRef", + "operations", + "observableClasses", + "enforceableClasses", + "evidenceRefs", + "status" + ], + "properties": { + "harnessRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "harness" + } + } + } + ] + }, + "operations": { + "type": "array", + "items": { + "$ref": "#/$defs/operation" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "observableClasses": { + "type": "array", + "items": { + "$ref": "#/$defs/id" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "enforceableClasses": { + "type": "array", + "items": { + "$ref": "#/$defs/id" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "evidenceRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/artifactRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "status": { + "enum": [ + "documented-only", + "verified" + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "const": "verified" + } + } + }, + "then": { + "properties": { + "evidenceRefs": { + "minItems": 1 + } + } + } + } + ] + }, + "adapter-capability": { + "allOf": [ + { + "$ref": "#/$defs/envelope" + }, + { + "properties": { + "kind": { + "const": "adapter-capability" + }, + "payload": { + "$ref": "#/$defs/adapter-capabilityPayload" + }, + "scope": { + "$ref": "#/$defs/systemScope" + } + } + } + ] + }, + "producer": { + "type": "object", + "additionalProperties": false, + "required": [ + "componentId", + "instanceId" + ], + "properties": { + "componentId": { + "$ref": "#/$defs/id" + }, + "instanceId": { + "$ref": "#/$defs/runtimeId" + } + } + }, + "executionBinding": { + "type": "object", + "additionalProperties": false, + "required": [ + "agentId", + "scope", + "sessionId", + "executionId", + "claimGeneration" + ], + "properties": { + "agentId": { + "$ref": "#/$defs/id" + }, + "scope": { + "$ref": "#/$defs/workspaceScope" + }, + "sessionId": { + "$ref": "#/$defs/runtimeId" + }, + "executionId": { + "$ref": "#/$defs/runtimeId" + }, + "claimGeneration": { + "$ref": "#/$defs/revision" + } + } + }, + "reviewedArtifact": { + "type": "object", + "additionalProperties": false, + "required": [ + "catalog", + "id", + "sourceCommit", + "digest" + ], + "properties": { + "catalog": { + "enum": [ + "command-profile", + "sandbox-profile", + "parameter-schema" + ] + }, + "id": { + "$ref": "#/$defs/id" + }, + "sourceCommit": { + "type": "string", + "pattern": "^[0-9a-f]{40}$" + }, + "digest": { + "$ref": "#/$defs/digest" + } + } + }, + "accountRef": { + "type": "object", + "additionalProperties": false, + "required": [ + "providerId", + "accountId" + ], + "properties": { + "providerId": { + "$ref": "#/$defs/id" + }, + "accountId": { + "$ref": "#/$defs/id" + } + } + }, + "sourceComponent": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "digest" + ], + "properties": { + "id": { + "$ref": "#/$defs/id" + }, + "digest": { + "$ref": "#/$defs/digest" + } + } + }, + "versionedComponent": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "version", + "digest" + ], + "properties": { + "id": { + "$ref": "#/$defs/id" + }, + "version": { + "$ref": "#/$defs/id" + }, + "digest": { + "$ref": "#/$defs/digest" + } + } + }, + "baseProjection": { + "type": "object", + "additionalProperties": false, + "required": [ + "hashScopeVersion", + "agentId", + "soulDigest", + "instructions", + "skills", + "harness", + "modelSettingsDigest", + "roleConfigDigest" + ], + "properties": { + "hashScopeVersion": { + "const": 1 + }, + "agentId": { + "$ref": "#/$defs/id" + }, + "soulDigest": { + "$ref": "#/$defs/digest" + }, + "instructions": { + "type": "array", + "items": { + "$ref": "#/$defs/sourceComponent" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "skills": { + "type": "array", + "items": { + "$ref": "#/$defs/versionedComponent" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "harness": { + "$ref": "#/$defs/versionedComponent" + }, + "modelSettingsDigest": { + "$ref": "#/$defs/digest" + }, + "roleConfigDigest": { + "$ref": "#/$defs/digest" + } + } + }, + "contextInput": { + "type": "object", + "additionalProperties": false, + "required": [ + "category", + "sourceRef", + "snapshotRef", + "classificationRef" + ], + "properties": { + "category": { + "enum": [ + "governance", + "identity", + "skill", + "general-preference", + "personal", + "project", + "work" + ] + }, + "sourceRef": { + "oneOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "$ref": "#/$defs/recordRef" + } + ] + }, + "snapshotRef": { + "$ref": "#/$defs/artifactRef" + }, + "classificationRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "context-source" + } + } + } + ] + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "category": { + "enum": [ + "general-preference", + "personal", + "project" + ] + } + } + }, + "then": { + "properties": { + "classificationRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "context-source" + } + } + } + ] + } + } + } + } + ] + }, + "launchInputs": { + "type": "object", + "additionalProperties": false, + "required": [ + "binding", + "conversationMode", + "priorConversationRef", + "selectedAssignments", + "contextInputs", + "baseProjection", + "policyRefs", + "accountRef", + "adapterCapabilityRef", + "imageDigest", + "agentDefinitionRef", + "sessionRecordRef", + "settingsRef", + "resumeSnapshotRef", + "resumeLeafId" + ], + "properties": { + "binding": { + "$ref": "#/$defs/executionBinding" + }, + "conversationMode": { + "enum": [ + "initial", + "resume", + "fresh" + ] + }, + "priorConversationRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "session" + } + } + } + ] + }, + { + "type": "null" + } + ] + }, + "selectedAssignments": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "assignment" + } + } + } + ] + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "contextInputs": { + "type": "array", + "items": { + "$ref": "#/$defs/contextInput" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "baseProjection": { + "$ref": "#/$defs/baseProjection" + }, + "policyRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/registryRef" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + }, + "accountRef": { + "oneOf": [ + { + "$ref": "#/$defs/accountRef" + }, + { + "type": "null" + } + ] + }, + "adapterCapabilityRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "adapter-capability" + } + } + } + ] + }, + "imageDigest": { + "$ref": "#/$defs/digest" + }, + "agentDefinitionRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "agent-definition" + } + } + } + ] + }, + "sessionRecordRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "session" + } + } + } + ] + }, + "settingsRef": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "settings" + } + } + } + ] + }, + "resumeSnapshotRef": { + "oneOf": [ + { + "$ref": "#/$defs/artifactRef" + }, + { + "type": "null" + } + ] + }, + "resumeLeafId": { + "oneOf": [ + { + "$ref": "#/$defs/id" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "conversationMode": { + "const": "resume" + } + } + }, + "then": { + "properties": { + "priorConversationRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "session" + } + } + } + ] + } + } + }, + "else": { + "properties": { + "priorConversationRef": { + "type": "null" + } + } + } + }, + { + "if": { + "properties": { + "conversationMode": { + "const": "resume" + } + } + }, + "then": { + "properties": { + "resumeSnapshotRef": { + "$ref": "#/$defs/artifactRef" + } + } + }, + "else": { + "properties": { + "resumeSnapshotRef": { + "type": "null" + }, + "resumeLeafId": { + "type": "null" + } + } + } + } + ] + }, + "recipient": { + "type": "object", + "additionalProperties": false, + "required": [ + "agentId", + "scope", + "routing", + "sessionId", + "executionId" + ], + "properties": { + "agentId": { + "$ref": "#/$defs/id" + }, + "scope": { + "$ref": "#/$defs/workspaceScope" + }, + "routing": { + "enum": [ + "current-scoped-session", + "exact-session", + "exact-execution" + ] + }, + "sessionId": { + "oneOf": [ + { + "$ref": "#/$defs/runtimeId" + }, + { + "type": "null" + } + ] + }, + "executionId": { + "oneOf": [ + { + "$ref": "#/$defs/runtimeId" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "routing": { + "const": "current-scoped-session" + } + } + }, + "then": { + "properties": { + "sessionId": { + "type": "null" + }, + "executionId": { + "type": "null" + } + } + } + }, + { + "if": { + "properties": { + "routing": { + "const": "exact-session" + } + } + }, + "then": { + "properties": { + "sessionId": { + "$ref": "#/$defs/runtimeId" + }, + "executionId": { + "type": "null" + } + } + } + }, + { + "if": { + "properties": { + "routing": { + "const": "exact-execution" + } + } + }, + "then": { + "properties": { + "sessionId": { + "$ref": "#/$defs/runtimeId" + }, + "executionId": { + "$ref": "#/$defs/runtimeId" + } + } + } + } + ] + }, + "runtimeEnvelope": { + "type": "object", + "additionalProperties": false, + "required": [ + "documentVersion", + "kind", + "id", + "runId", + "recordedAt", + "observedAt", + "producer", + "causedById", + "payload" + ], + "properties": { + "documentVersion": { + "const": 1 + }, + "kind": { + "enum": [ + "authorization", + "launch-manifest", + "execution-transition", + "claim-transition", + "connection-transition", + "message", + "message-delivery", + "command-spec", + "sandbox-limits", + "artifact-index", + "configuration-check", + "process-observation", + "termination-proof", + "delegation-basis", + "decision-basis", + "command-result" + ] + }, + "id": { + "$ref": "#/$defs/runtimeId" + }, + "runId": { + "$ref": "#/$defs/id" + }, + "recordedAt": { + "$ref": "#/$defs/time" + }, + "observedAt": { + "$ref": "#/$defs/time" + }, + "producer": { + "$ref": "#/$defs/producer" + }, + "causedById": { + "oneOf": [ + { + "$ref": "#/$defs/runtimeId" + }, + { + "type": "null" + } + ] + }, + "payload": { + "type": "object" + } + } + }, + "authorizationRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "requestId", + "requestDigest", + "requester", + "scope", + "operation", + "outcome", + "reasonCode", + "policyRefs", + "checkedRecordRefs" + ], + "properties": { + "requestId": { + "$ref": "#/$defs/runtimeId" + }, + "requestDigest": { + "$ref": "#/$defs/digest" + }, + "requester": { + "$ref": "#/$defs/actor" + }, + "scope": { + "$ref": "#/$defs/scope" + }, + "operation": { + "$ref": "#/$defs/operation" + }, + "outcome": { + "enum": [ + "allowed", + "refused" + ] + }, + "reasonCode": { + "enum": [ + "allowed", + "invalid-request", + "not-authorized", + "stale-revision", + "missing-state", + "already-active", + "control-conflict", + "retired", + "unsupported-capability", + "audit-unavailable", + "unknown-effects", + "unsafe-replacement", + "request-id-conflict", + "expired" + ] + }, + "policyRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/registryRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "checkedRecordRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/recordRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + } + }, + "allOf": [ + { + "if": { + "properties": { + "outcome": { + "const": "allowed" + } + } + }, + "then": { + "properties": { + "reasonCode": { + "const": "allowed" + }, + "policyRefs": { + "minItems": 1 + } + } + }, + "else": { + "properties": { + "reasonCode": { + "not": { + "const": "allowed" + } + } + } + } + } + ] + }, + "runtime-authorization": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "authorization" + }, + "payload": { + "$ref": "#/$defs/authorizationRuntimePayload" + } + } + } + ] + }, + "launch-manifestRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "inputs", + "agentConfigHash", + "launchManifestHash", + "hashAlgorithm" + ], + "properties": { + "inputs": { + "$ref": "#/$defs/launchInputs" + }, + "agentConfigHash": { + "$ref": "#/$defs/digest" + }, + "launchManifestHash": { + "$ref": "#/$defs/digest" + }, + "hashAlgorithm": { + "const": "sha256-rfc8785-v1" + } + } + }, + "runtime-launch-manifest": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "launch-manifest" + }, + "payload": { + "$ref": "#/$defs/launch-manifestRuntimePayload" + } + } + } + ] + }, + "execution-transitionRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "binding", + "authorizationId", + "manifestRef", + "state", + "processRef", + "terminationProofRef", + "resultRef" + ], + "properties": { + "binding": { + "$ref": "#/$defs/executionBinding" + }, + "authorizationId": { + "$ref": "#/$defs/runtimeId" + }, + "manifestRef": { + "$ref": "#/$defs/artifactRef" + }, + "state": { + "enum": [ + "admitted", + "started", + "stop-requested", + "terminated", + "unknown" + ] + }, + "processRef": { + "oneOf": [ + { + "$ref": "#/$defs/artifactRef" + }, + { + "type": "null" + } + ] + }, + "terminationProofRef": { + "oneOf": [ + { + "$ref": "#/$defs/artifactRef" + }, + { + "type": "null" + } + ] + }, + "resultRef": { + "oneOf": [ + { + "$ref": "#/$defs/artifactRef" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "state": { + "const": "started" + } + } + }, + "then": { + "properties": { + "processRef": { + "$ref": "#/$defs/artifactRef" + } + } + } + }, + { + "if": { + "properties": { + "state": { + "const": "terminated" + } + } + }, + "then": { + "properties": { + "terminationProofRef": { + "$ref": "#/$defs/artifactRef" + } + } + } + } + ] + }, + "runtime-execution-transition": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "execution-transition" + }, + "payload": { + "$ref": "#/$defs/execution-transitionRuntimePayload" + } + } + } + ] + }, + "claim-transitionRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "binding", + "claimId", + "state", + "authorizationId", + "terminationProofRef" + ], + "properties": { + "binding": { + "$ref": "#/$defs/executionBinding" + }, + "claimId": { + "$ref": "#/$defs/runtimeId" + }, + "state": { + "enum": [ + "reserved", + "active", + "stopping", + "released", + "uncertain" + ] + }, + "authorizationId": { + "$ref": "#/$defs/runtimeId" + }, + "terminationProofRef": { + "oneOf": [ + { + "$ref": "#/$defs/artifactRef" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "state": { + "const": "released" + } + } + }, + "then": { + "properties": { + "terminationProofRef": { + "$ref": "#/$defs/artifactRef" + } + } + } + } + ] + }, + "runtime-claim-transition": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "claim-transition" + }, + "payload": { + "$ref": "#/$defs/claim-transitionRuntimePayload" + } + } + } + ] + }, + "connection-transitionRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "binding", + "connectionId", + "client", + "mode", + "state", + "controlGeneration", + "authorizationId" + ], + "properties": { + "binding": { + "$ref": "#/$defs/executionBinding" + }, + "connectionId": { + "$ref": "#/$defs/runtimeId" + }, + "client": { + "$ref": "#/$defs/actor" + }, + "mode": { + "enum": [ + "observe", + "control" + ] + }, + "state": { + "enum": [ + "granted", + "revoked", + "disconnected" + ] + }, + "controlGeneration": { + "oneOf": [ + { + "$ref": "#/$defs/revision" + }, + { + "type": "null" + } + ] + }, + "authorizationId": { + "$ref": "#/$defs/runtimeId" + } + }, + "allOf": [ + { + "if": { + "properties": { + "mode": { + "const": "control" + } + } + }, + "then": { + "properties": { + "controlGeneration": { + "$ref": "#/$defs/revision" + } + } + }, + "else": { + "properties": { + "controlGeneration": { + "type": "null" + } + } + } + } + ] + }, + "runtime-connection-transition": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "connection-transition" + }, + "payload": { + "$ref": "#/$defs/connection-transitionRuntimePayload" + } + } + } + ] + }, + "messageRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "messageId", + "sender", + "sourceScope", + "recipient", + "messageKind", + "bodyRef", + "subjectRefs", + "expiresAt", + "replyToMessageId", + "authorizationId" + ], + "properties": { + "messageId": { + "$ref": "#/$defs/runtimeId" + }, + "sender": { + "$ref": "#/$defs/actor" + }, + "sourceScope": { + "$ref": "#/$defs/scope" + }, + "recipient": { + "$ref": "#/$defs/recipient" + }, + "messageKind": { + "enum": [ + "work-notice", + "conversation", + "execution-result", + "approval" + ] + }, + "bodyRef": { + "$ref": "#/$defs/artifactRef" + }, + "subjectRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/recordRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "expiresAt": { + "$ref": "#/$defs/time" + }, + "replyToMessageId": { + "oneOf": [ + { + "$ref": "#/$defs/runtimeId" + }, + { + "type": "null" + } + ] + }, + "authorizationId": { + "$ref": "#/$defs/runtimeId" + } + }, + "allOf": [ + { + "if": { + "properties": { + "messageKind": { + "enum": [ + "execution-result", + "approval" + ] + } + } + }, + "then": { + "properties": { + "recipient": { + "properties": { + "routing": { + "const": "exact-execution" + } + } + }, + "subjectRefs": { + "minItems": 1 + } + } + } + } + ] + }, + "runtime-message": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "message" + }, + "payload": { + "$ref": "#/$defs/messageRuntimePayload" + } + } + } + ] + }, + "message-deliveryRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "messageId", + "outcome", + "recipientBinding", + "authorizationId", + "observationRef" + ], + "properties": { + "messageId": { + "$ref": "#/$defs/runtimeId" + }, + "outcome": { + "enum": [ + "queued", + "delivered", + "refused", + "expired", + "unknown" + ] + }, + "recipientBinding": { + "oneOf": [ + { + "$ref": "#/$defs/executionBinding" + }, + { + "type": "null" + } + ] + }, + "authorizationId": { + "$ref": "#/$defs/runtimeId" + }, + "observationRef": { + "oneOf": [ + { + "$ref": "#/$defs/artifactRef" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "outcome": { + "const": "delivered" + } + } + }, + "then": { + "properties": { + "recipientBinding": { + "$ref": "#/$defs/executionBinding" + }, + "observationRef": { + "$ref": "#/$defs/artifactRef" + } + } + } + } + ] + }, + "runtime-message-delivery": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "message-delivery" + }, + "payload": { + "$ref": "#/$defs/message-deliveryRuntimePayload" + } + } + } + ] + }, + "command-specRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "profileRef", + "parameterSchemaRef", + "parametersRef", + "cwd", + "inputRefs", + "outputPolicy" + ], + "properties": { + "profileRef": { + "allOf": [ + { + "$ref": "#/$defs/reviewedArtifact" + }, + { + "properties": { + "catalog": { + "const": "command-profile" + } + } + } + ] + }, + "parameterSchemaRef": { + "allOf": [ + { + "$ref": "#/$defs/reviewedArtifact" + }, + { + "properties": { + "catalog": { + "const": "parameter-schema" + } + } + } + ] + }, + "parametersRef": { + "$ref": "#/$defs/artifactRef" + }, + "cwd": { + "oneOf": [ + { + "$ref": "#/$defs/relativePath" + }, + { + "type": "null" + } + ] + }, + "inputRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/artifactRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "outputPolicy": { + "const": "classified-artifacts-only" + } + } + }, + "runtime-command-spec": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "command-spec" + }, + "payload": { + "$ref": "#/$defs/command-specRuntimePayload" + } + } + } + ] + }, + "sandbox-limitsRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "profileRef", + "scope", + "readPaths", + "writePaths", + "network", + "endpointRefs", + "timeoutSeconds", + "memoryMiB", + "processLimit", + "credentialAccess", + "hostControlAccess", + "coverage" + ], + "properties": { + "profileRef": { + "allOf": [ + { + "$ref": "#/$defs/reviewedArtifact" + }, + { + "properties": { + "catalog": { + "const": "sandbox-profile" + } + } + } + ] + }, + "scope": { + "$ref": "#/$defs/workspaceScope" + }, + "readPaths": { + "type": "array", + "items": { + "$ref": "#/$defs/pathGrant" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "writePaths": { + "type": "array", + "items": { + "$ref": "#/$defs/pathGrant" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "network": { + "enum": [ + "none", + "approved-endpoints" + ] + }, + "endpointRefs": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/$defs/registryRef" + }, + { + "properties": { + "registry": { + "const": "endpoint" + } + } + } + ] + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "timeoutSeconds": { + "type": "integer", + "minimum": 1, + "maximum": 600 + }, + "memoryMiB": { + "type": "integer", + "minimum": 16, + "maximum": 1048576 + }, + "processLimit": { + "type": "integer", + "minimum": 1, + "maximum": 65536 + }, + "credentialAccess": { + "const": false + }, + "hostControlAccess": { + "const": false + }, + "coverage": { + "const": "command-invocation-v1" + } + }, + "allOf": [ + { + "if": { + "properties": { + "network": { + "const": "none" + } + } + }, + "then": { + "properties": { + "endpointRefs": { + "maxItems": 0 + } + } + }, + "else": { + "properties": { + "endpointRefs": { + "minItems": 1 + } + } + } + } + ] + }, + "runtime-sandbox-limits": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "sandbox-limits" + }, + "payload": { + "$ref": "#/$defs/sandbox-limitsRuntimePayload" + } + } + } + ] + }, + "artifact-indexRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "artifactId", + "artifactKind", + "scope", + "digest", + "byteLength", + "mediaType", + "visibility", + "publisher", + "authorizationId" + ], + "properties": { + "artifactId": { + "$ref": "#/$defs/id" + }, + "artifactKind": { + "enum": [ + "command-spec", + "sandbox-limits", + "parameters", + "process-observation", + "termination-proof", + "command-result", + "context", + "message-body", + "decision-basis", + "review-evidence", + "launch-manifest", + "delegation-basis" + ] + }, + "scope": { + "$ref": "#/$defs/scope" + }, + "digest": { + "$ref": "#/$defs/digest" + }, + "byteLength": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "mediaType": { + "enum": [ + "application/json", + "text/plain", + "text/markdown", + "application/octet-stream" + ] + }, + "visibility": { + "enum": [ + "work", + "conversation", + "restricted" + ] + }, + "publisher": { + "$ref": "#/$defs/actor" + }, + "authorizationId": { + "$ref": "#/$defs/runtimeId" + } + } + }, + "runtime-artifact-index": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "artifact-index" + }, + "payload": { + "$ref": "#/$defs/artifact-indexRuntimePayload" + } + } + } + ] + }, + "configuration-checkRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "binding", + "launchHash", + "currentHash", + "status", + "sourceRefs", + "noticeKey" + ], + "properties": { + "binding": { + "$ref": "#/$defs/executionBinding" + }, + "launchHash": { + "$ref": "#/$defs/digest" + }, + "currentHash": { + "oneOf": [ + { + "$ref": "#/$defs/digest" + }, + { + "type": "null" + } + ] + }, + "status": { + "enum": [ + "matching", + "changed", + "unknown" + ] + }, + "sourceRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/registryRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "noticeKey": { + "$ref": "#/$defs/id" + } + }, + "allOf": [ + { + "if": { + "properties": { + "status": { + "const": "unknown" + } + } + }, + "then": { + "properties": { + "currentHash": { + "type": "null" + } + } + }, + "else": { + "properties": { + "currentHash": { + "$ref": "#/$defs/digest" + } + } + } + } + ] + }, + "runtime-configuration-check": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "configuration-check" + }, + "payload": { + "$ref": "#/$defs/configuration-checkRuntimePayload" + } + } + } + ] + }, + "inputRequest": { + "type": "object", + "additionalProperties": false, + "required": [ + "requestVersion", + "requestId", + "operation", + "binding", + "connectionId", + "expectedControlGeneration", + "bodyRef", + "dialogId" + ], + "properties": { + "requestVersion": { + "const": 1 + }, + "requestId": { + "$ref": "#/$defs/runtimeId" + }, + "operation": { + "enum": [ + "prompt", + "stop", + "dialog-reply" + ] + }, + "binding": { + "$ref": "#/$defs/executionBinding" + }, + "connectionId": { + "$ref": "#/$defs/runtimeId" + }, + "expectedControlGeneration": { + "$ref": "#/$defs/revision" + }, + "bodyRef": { + "oneOf": [ + { + "$ref": "#/$defs/artifactRef" + }, + { + "type": "null" + } + ] + }, + "dialogId": { + "oneOf": [ + { + "$ref": "#/$defs/runtimeId" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "operation": { + "const": "stop" + } + } + }, + "then": { + "properties": { + "bodyRef": { + "type": "null" + }, + "dialogId": { + "type": "null" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "prompt" + } + } + }, + "then": { + "properties": { + "bodyRef": { + "$ref": "#/$defs/artifactRef" + }, + "dialogId": { + "type": "null" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "dialog-reply" + } + } + }, + "then": { + "properties": { + "bodyRef": { + "$ref": "#/$defs/artifactRef" + }, + "dialogId": { + "$ref": "#/$defs/runtimeId" + } + } + } + } + ] + }, + "controlRequest": { + "type": "object", + "additionalProperties": false, + "required": [ + "requestVersion", + "requestId", + "operation", + "scope", + "expectedRefs", + "assignmentRef", + "parameters" + ], + "properties": { + "requestVersion": { + "const": 1 + }, + "requestId": { + "$ref": "#/$defs/runtimeId" + }, + "operation": { + "enum": [ + "project.create", + "project.change", + "workspace.create", + "workspace.change", + "mission.create", + "mission.change", + "task.create", + "task.change", + "mission.accept", + "task.accept", + "work.read", + "file.read", + "file.change", + "work.propose", + "assignment.change", + "result.submit", + "registration.manage", + "conversation.read", + "conversation.observe", + "execution.launch", + "execution.control", + "execution.transfer", + "workspace.retire", + "workspace.reopen", + "message.send", + "audit.read", + "decision.issue", + "session.adopt" + ] + }, + "scope": { + "$ref": "#/$defs/scope" + }, + "expectedRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/recordRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "assignmentRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "assignment" + } + } + } + ] + }, + { + "type": "null" + } + ] + }, + "parameters": { + "type": "object" + } + }, + "allOf": [ + { + "if": { + "properties": { + "operation": { + "const": "project.create" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-project.create" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "project.change" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-project.change" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "workspace.create" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-workspace.create" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "workspace.change" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-workspace.change" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "mission.create" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-mission.create" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "mission.change" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-mission.change" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "task.create" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-task.create" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "task.change" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-task.change" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "mission.accept" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-mission.accept" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "task.accept" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-task.accept" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "work.read" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-work.read" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "file.read" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-file.read" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "file.change" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-file.change" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "work.propose" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-work.propose" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "assignment.change" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-assignment.change" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "result.submit" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-result.submit" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "registration.manage" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-registration.manage" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "conversation.read" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-conversation.read" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "conversation.observe" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-conversation.observe" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "execution.launch" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-execution.launch" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "execution.control" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-execution.control" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "execution.transfer" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-execution.transfer" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "workspace.retire" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-workspace.retire" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "workspace.reopen" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-workspace.reopen" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "message.send" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-message.send" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "audit.read" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-audit.read" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "decision.issue" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-decision.issue" + } + } + } + }, + { + "if": { + "properties": { + "operation": { + "const": "session.adopt" + } + } + }, + "then": { + "properties": { + "parameters": { + "$ref": "#/$defs/params-session.adopt" + } + } + } + } + ] + }, + "params-project.create": { + "type": "object", + "additionalProperties": false, + "required": [ + "proposedId", + "proposedPayloadRef" + ], + "properties": { + "proposedId": { + "$ref": "#/$defs/id" + }, + "proposedPayloadRef": { + "$ref": "#/$defs/artifactRef" + } + } + }, + "params-project.change": { + "type": "object", + "additionalProperties": false, + "required": [ + "targetRef", + "proposedPayloadRef" + ], + "properties": { + "targetRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "project" + } + } + } + ] + }, + "proposedPayloadRef": { + "$ref": "#/$defs/artifactRef" + } + } + }, + "params-workspace.create": { + "type": "object", + "additionalProperties": false, + "required": [ + "proposedId", + "proposedPayloadRef" + ], + "properties": { + "proposedId": { + "$ref": "#/$defs/id" + }, + "proposedPayloadRef": { + "$ref": "#/$defs/artifactRef" + } + } + }, + "params-workspace.change": { + "type": "object", + "additionalProperties": false, + "required": [ + "targetRef", + "proposedPayloadRef" + ], + "properties": { + "targetRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "workspace" + } + } + } + ] + }, + "proposedPayloadRef": { + "$ref": "#/$defs/artifactRef" + } + } + }, + "params-mission.create": { + "type": "object", + "additionalProperties": false, + "required": [ + "proposedId", + "proposedPayloadRef" + ], + "properties": { + "proposedId": { + "$ref": "#/$defs/id" + }, + "proposedPayloadRef": { + "$ref": "#/$defs/artifactRef" + } + } + }, + "params-mission.change": { + "type": "object", + "additionalProperties": false, + "required": [ + "targetRef", + "proposedPayloadRef" + ], + "properties": { + "targetRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "mission" + } + } + } + ] + }, + "proposedPayloadRef": { + "$ref": "#/$defs/artifactRef" + } + } + }, + "params-task.create": { + "type": "object", + "additionalProperties": false, + "required": [ + "proposedId", + "proposedPayloadRef" + ], + "properties": { + "proposedId": { + "$ref": "#/$defs/id" + }, + "proposedPayloadRef": { + "$ref": "#/$defs/artifactRef" + } + } + }, + "params-task.change": { + "type": "object", + "additionalProperties": false, + "required": [ + "targetRef", + "proposedPayloadRef" + ], + "properties": { + "targetRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "task" + } + } + } + ] + }, + "proposedPayloadRef": { + "$ref": "#/$defs/artifactRef" + } + } + }, + "params-mission.accept": { + "type": "object", + "additionalProperties": false, + "required": [ + "targetRef", + "decisionRef" + ], + "properties": { + "targetRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "mission" + } + } + } + ] + }, + "decisionRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "decision" + } + } + } + ] + } + } + }, + "params-task.accept": { + "type": "object", + "additionalProperties": false, + "required": [ + "targetRef", + "decisionRef" + ], + "properties": { + "targetRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "task" + } + } + } + ] + }, + "decisionRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "decision" + } + } + } + ] + } + } + }, + "params-work.read": { + "type": "object", + "additionalProperties": false, + "required": [ + "targetRefs", + "cursorId", + "limit", + "executionIds", + "view" + ], + "properties": { + "targetRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/recordRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "cursorId": { + "oneOf": [ + { + "$ref": "#/$defs/id" + }, + { + "type": "null" + } + ] + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + }, + "executionIds": { + "type": "array", + "items": { + "$ref": "#/$defs/runtimeId" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "view": { + "enum": [ + "records", + "execution-status", + "configuration" + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "view": { + "const": "records" + } + } + }, + "then": { + "properties": { + "targetRefs": { + "minItems": 1 + }, + "executionIds": { + "maxItems": 0 + } + } + }, + "else": { + "properties": { + "targetRefs": { + "maxItems": 0 + }, + "executionIds": { + "minItems": 1 + } + } + } + } + ] + }, + "params-file.read": { + "type": "object", + "additionalProperties": false, + "required": [ + "path", + "view", + "offsetBytes", + "maxBytes" + ], + "properties": { + "path": { + "$ref": "#/$defs/pathGrant" + }, + "view": { + "enum": [ + "contents", + "entries" + ] + }, + "offsetBytes": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + }, + "maxBytes": { + "type": "integer", + "minimum": 1, + "maximum": 1048576 + } + } + }, + "params-file.change": { + "type": "object", + "additionalProperties": false, + "required": [ + "path", + "change", + "expectedDigest", + "contentRef" + ], + "properties": { + "path": { + "allOf": [ + { + "$ref": "#/$defs/pathGrant" + }, + { + "properties": { + "path": { + "$ref": "#/$defs/relativePath" + } + } + } + ] + }, + "change": { + "enum": [ + "put", + "delete" + ] + }, + "expectedDigest": { + "oneOf": [ + { + "$ref": "#/$defs/digest" + }, + { + "type": "null" + } + ] + }, + "contentRef": { + "oneOf": [ + { + "$ref": "#/$defs/artifactRef" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "change": { + "const": "put" + } + } + }, + "then": { + "properties": { + "contentRef": { + "$ref": "#/$defs/artifactRef" + } + } + }, + "else": { + "properties": { + "contentRef": { + "type": "null" + }, + "expectedDigest": { + "$ref": "#/$defs/digest" + } + } + } + } + ] + }, + "params-work.propose": { + "type": "object", + "additionalProperties": false, + "required": [ + "subjectRefs", + "bodyRef" + ], + "properties": { + "subjectRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/recordRef" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + }, + "bodyRef": { + "$ref": "#/$defs/artifactRef" + } + } + }, + "params-assignment.change": { + "type": "object", + "additionalProperties": false, + "required": [ + "proposedPayloadRef", + "currentRef", + "proposedId" + ], + "properties": { + "proposedPayloadRef": { + "$ref": "#/$defs/artifactRef" + }, + "currentRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "assignment" + } + } + } + ] + }, + { + "type": "null" + } + ] + }, + "proposedId": { + "$ref": "#/$defs/id" + } + } + }, + "params-result.submit": { + "type": "object", + "additionalProperties": false, + "required": [ + "assignmentRef", + "evidenceRefs" + ], + "properties": { + "assignmentRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "assignment" + } + } + } + ] + }, + "evidenceRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/artifactRef" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + } + } + }, + "params-registration.manage": { + "type": "object", + "additionalProperties": false, + "required": [ + "currentRef", + "proposedId", + "proposedPayloadRef" + ], + "properties": { + "currentRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "registration" + } + } + } + ] + }, + { + "type": "null" + } + ] + }, + "proposedId": { + "$ref": "#/$defs/id" + }, + "proposedPayloadRef": { + "$ref": "#/$defs/artifactRef" + } + } + }, + "params-conversation.read": { + "type": "object", + "additionalProperties": false, + "required": [ + "sessionRef", + "cursorId", + "limit" + ], + "properties": { + "sessionRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "session" + } + } + } + ] + }, + "cursorId": { + "oneOf": [ + { + "$ref": "#/$defs/id" + }, + { + "type": "null" + } + ] + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + } + }, + "params-conversation.observe": { + "type": "object", + "additionalProperties": false, + "required": [ + "binding" + ], + "properties": { + "binding": { + "$ref": "#/$defs/executionBinding" + } + } + }, + "params-execution.launch": { + "type": "object", + "additionalProperties": false, + "required": [ + "agentId", + "mode", + "assignmentRefs", + "sessionId", + "workMode", + "replacementBinding", + "expectedControlGeneration", + "replacementDecisionRef" + ], + "properties": { + "agentId": { + "$ref": "#/$defs/id" + }, + "mode": { + "enum": [ + "resume", + "fresh" + ] + }, + "assignmentRefs": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "assignment" + } + } + } + ] + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "sessionId": { + "oneOf": [ + { + "$ref": "#/$defs/runtimeId" + }, + { + "type": "null" + } + ] + }, + "workMode": { + "enum": [ + "continue", + "select", + "abandon", + "none" + ] + }, + "replacementBinding": { + "oneOf": [ + { + "$ref": "#/$defs/executionBinding" + }, + { + "type": "null" + } + ] + }, + "expectedControlGeneration": { + "oneOf": [ + { + "$ref": "#/$defs/revision" + }, + { + "type": "null" + } + ] + }, + "replacementDecisionRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "decision" + } + } + } + ] + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "mode": { + "const": "fresh" + } + } + }, + "then": { + "properties": { + "sessionId": { + "type": "null" + } + } + }, + "else": { + "properties": { + "replacementBinding": { + "type": "null" + }, + "expectedControlGeneration": { + "type": "null" + }, + "replacementDecisionRef": { + "type": "null" + } + } + } + }, + { + "if": { + "properties": { + "workMode": { + "enum": [ + "select", + "abandon" + ] + } + } + }, + "then": { + "properties": { + "assignmentRefs": { + "minItems": 1 + } + } + }, + "else": { + "properties": { + "assignmentRefs": { + "maxItems": 0 + } + } + } + }, + { + "if": { + "properties": { + "replacementBinding": { + "type": "null" + } + } + }, + "then": { + "properties": { + "expectedControlGeneration": { + "type": "null" + }, + "replacementDecisionRef": { + "type": "null" + } + } + }, + "else": { + "properties": { + "expectedControlGeneration": { + "$ref": "#/$defs/revision" + } + } + } + } + ] + }, + "params-execution.control": { + "type": "object", + "additionalProperties": false, + "required": [ + "binding", + "connectionId" + ], + "properties": { + "binding": { + "$ref": "#/$defs/executionBinding" + }, + "connectionId": { + "$ref": "#/$defs/runtimeId" + } + } + }, + "params-execution.transfer": { + "type": "object", + "additionalProperties": false, + "required": [ + "binding", + "fromConnectionId", + "toConnectionId", + "expectedControlGeneration" + ], + "properties": { + "binding": { + "$ref": "#/$defs/executionBinding" + }, + "fromConnectionId": { + "$ref": "#/$defs/runtimeId" + }, + "toConnectionId": { + "$ref": "#/$defs/runtimeId" + }, + "expectedControlGeneration": { + "$ref": "#/$defs/revision" + } + } + }, + "params-workspace.retire": { + "type": "object", + "additionalProperties": false, + "required": [ + "workspaceRef", + "decisionRef" + ], + "properties": { + "workspaceRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "workspace" + } + } + } + ] + }, + "decisionRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "decision" + } + } + } + ] + } + } + }, + "params-workspace.reopen": { + "type": "object", + "additionalProperties": false, + "required": [ + "workspaceRef", + "decisionRef" + ], + "properties": { + "workspaceRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "workspace" + } + } + } + ] + }, + "decisionRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "decision" + } + } + } + ] + } + } + }, + "params-message.send": { + "type": "object", + "additionalProperties": false, + "required": [ + "recipient", + "messageKind", + "bodyRef", + "subjectRefs", + "expiresAt", + "replyToMessageId" + ], + "properties": { + "recipient": { + "$ref": "#/$defs/recipient" + }, + "messageKind": { + "enum": [ + "work-notice", + "conversation", + "execution-result", + "approval" + ] + }, + "bodyRef": { + "$ref": "#/$defs/artifactRef" + }, + "subjectRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/recordRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "expiresAt": { + "$ref": "#/$defs/time" + }, + "replyToMessageId": { + "oneOf": [ + { + "$ref": "#/$defs/runtimeId" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "messageKind": { + "enum": [ + "execution-result", + "approval" + ] + } + } + }, + "then": { + "properties": { + "recipient": { + "properties": { + "routing": { + "const": "exact-execution" + } + } + }, + "subjectRefs": { + "minItems": 1 + } + } + } + } + ] + }, + "params-audit.read": { + "type": "object", + "additionalProperties": false, + "required": [ + "artifactRefs" + ], + "properties": { + "artifactRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/artifactRef" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + } + } + }, + "params-decision.issue": { + "type": "object", + "additionalProperties": false, + "required": [ + "proposedId", + "proposedPayloadRef" + ], + "properties": { + "proposedId": { + "$ref": "#/$defs/id" + }, + "proposedPayloadRef": { + "$ref": "#/$defs/artifactRef" + } + } + }, + "params-session.adopt": { + "type": "object", + "additionalProperties": false, + "required": [ + "agentId", + "legacySnapshotRef", + "decisionRef" + ], + "properties": { + "agentId": { + "$ref": "#/$defs/id" + }, + "legacySnapshotRef": { + "$ref": "#/$defs/artifactRef" + }, + "decisionRef": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "decision" + } + } + } + ] + } + } + }, + "process-observationRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "binding", + "backend", + "containerId", + "imageDigest", + "processGroupRef", + "state" + ], + "properties": { + "binding": { + "$ref": "#/$defs/executionBinding" + }, + "backend": { + "const": "docker" + }, + "containerId": { + "type": "string", + "pattern": "^[0-9a-f]{64}$" + }, + "imageDigest": { + "$ref": "#/$defs/digest" + }, + "processGroupRef": { + "$ref": "#/$defs/id" + }, + "state": { + "enum": [ + "created", + "running", + "exited", + "absent", + "unknown" + ] + } + } + }, + "runtime-process-observation": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "process-observation" + }, + "payload": { + "$ref": "#/$defs/process-observationRuntimePayload" + } + } + } + ] + }, + "termination-proofRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "binding", + "processRef", + "observerId", + "processGroupEmpty", + "observationRefs", + "proofMode", + "admissionFenced", + "startAdmitted" + ], + "properties": { + "binding": { + "$ref": "#/$defs/executionBinding" + }, + "processRef": { + "oneOf": [ + { + "$ref": "#/$defs/artifactRef" + }, + { + "type": "null" + } + ] + }, + "observerId": { + "$ref": "#/$defs/id" + }, + "processGroupEmpty": { + "const": true + }, + "observationRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/artifactRef" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + }, + "proofMode": { + "enum": [ + "stopped", + "never-started" + ] + }, + "admissionFenced": { + "const": true + }, + "startAdmitted": { + "type": "boolean" + } + }, + "allOf": [ + { + "if": { + "properties": { + "proofMode": { + "const": "stopped" + } + } + }, + "then": { + "properties": { + "processRef": { + "$ref": "#/$defs/artifactRef" + } + } + }, + "else": { + "properties": { + "startAdmitted": { + "const": false + } + } + } + } + ] + }, + "runtime-termination-proof": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "termination-proof" + }, + "payload": { + "$ref": "#/$defs/termination-proofRuntimePayload" + } + } + } + ] + }, + "delegation-basisRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "grantee", + "scope", + "operations", + "existingScopeRefs", + "newProjectIds", + "newWorkspaceIds", + "parentDecisionRef", + "expiresAt", + "maxUses", + "ceilingRefs" + ], + "properties": { + "grantee": { + "$ref": "#/$defs/actor" + }, + "scope": { + "$ref": "#/$defs/scope" + }, + "operations": { + "type": "array", + "items": { + "$ref": "#/$defs/operation" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + }, + "existingScopeRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/recordRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "newProjectIds": { + "type": "array", + "items": { + "$ref": "#/$defs/id" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "newWorkspaceIds": { + "type": "array", + "items": { + "$ref": "#/$defs/id" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "parentDecisionRef": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "decision" + } + } + } + ] + }, + { + "type": "null" + } + ] + }, + "expiresAt": { + "oneOf": [ + { + "$ref": "#/$defs/time" + }, + { + "type": "null" + } + ] + }, + "maxUses": { + "type": "integer", + "minimum": 1, + "maximum": 1000000 + }, + "ceilingRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/registryRef" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + } + } + }, + "runtime-delegation-basis": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "delegation-basis" + }, + "payload": { + "$ref": "#/$defs/delegation-basisRuntimePayload" + } + } + } + ] + }, + "decision-basisRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "decisionKind", + "subjectRefs", + "criteriaIds", + "authorActors", + "reviewer", + "reviewedEvidenceRefs", + "rationaleRef", + "priorDecisionRefs", + "requestId", + "requestDigest", + "binding" + ], + "properties": { + "decisionKind": { + "enum": [ + "plan-approval", + "assignment-change", + "acceptance", + "owner-checkpoint", + "reconciliation" + ] + }, + "subjectRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/recordRef" + }, + "minItems": 1, + "maxItems": 1024, + "uniqueItems": true + }, + "criteriaIds": { + "type": "array", + "items": { + "$ref": "#/$defs/id" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "authorActors": { + "type": "array", + "items": { + "$ref": "#/$defs/actor" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "reviewer": { + "oneOf": [ + { + "$ref": "#/$defs/actor" + }, + { + "type": "null" + } + ] + }, + "reviewedEvidenceRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/artifactRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "rationaleRef": { + "$ref": "#/$defs/artifactRef" + }, + "priorDecisionRefs": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/$defs/recordRef" + }, + { + "properties": { + "kind": { + "const": "decision" + } + } + } + ] + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "requestId": { + "oneOf": [ + { + "$ref": "#/$defs/runtimeId" + }, + { + "type": "null" + } + ] + }, + "requestDigest": { + "oneOf": [ + { + "$ref": "#/$defs/digest" + }, + { + "type": "null" + } + ] + }, + "binding": { + "oneOf": [ + { + "$ref": "#/$defs/executionBinding" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "decisionKind": { + "const": "acceptance" + } + } + }, + "then": { + "properties": { + "criteriaIds": { + "minItems": 1 + }, + "authorActors": { + "minItems": 1 + }, + "reviewer": { + "$ref": "#/$defs/actor" + }, + "reviewedEvidenceRefs": { + "minItems": 1 + } + } + } + }, + { + "if": { + "properties": { + "requestId": { + "type": "null" + } + } + }, + "then": { + "properties": { + "requestDigest": { + "type": "null" + } + } + }, + "else": { + "properties": { + "requestDigest": { + "$ref": "#/$defs/digest" + } + } + } + } + ] + }, + "runtime-decision-basis": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "decision-basis" + }, + "payload": { + "$ref": "#/$defs/decision-basisRuntimePayload" + } + } + } + ] + }, + "controlResponse": { + "type": "object", + "additionalProperties": false, + "required": [ + "responseVersion", + "requestId", + "outcome", + "reasonCode", + "receiptRef", + "executionId", + "dataRef" + ], + "properties": { + "responseVersion": { + "const": 1 + }, + "requestId": { + "oneOf": [ + { + "$ref": "#/$defs/runtimeId" + }, + { + "type": "null" + } + ] + }, + "outcome": { + "enum": [ + "succeeded", + "accepted", + "already-active", + "refused", + "unknown" + ] + }, + "reasonCode": { + "enum": [ + "allowed", + "invalid-request", + "not-authorized", + "stale-revision", + "missing-state", + "already-active", + "control-conflict", + "retired", + "unsupported-capability", + "audit-unavailable", + "unknown-effects", + "unsafe-replacement", + "request-id-conflict", + "expired" + ] + }, + "receiptRef": { + "oneOf": [ + { + "$ref": "#/$defs/artifactRef" + }, + { + "type": "null" + } + ] + }, + "executionId": { + "oneOf": [ + { + "$ref": "#/$defs/runtimeId" + }, + { + "type": "null" + } + ] + }, + "dataRef": { + "oneOf": [ + { + "$ref": "#/$defs/artifactRef" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "outcome": { + "enum": [ + "succeeded", + "accepted" + ] + } + } + }, + "then": { + "properties": { + "requestId": { + "$ref": "#/$defs/runtimeId" + }, + "reasonCode": { + "const": "allowed" + }, + "receiptRef": { + "$ref": "#/$defs/artifactRef" + } + } + } + }, + { + "if": { + "properties": { + "outcome": { + "const": "already-active" + } + } + }, + "then": { + "properties": { + "requestId": { + "$ref": "#/$defs/runtimeId" + }, + "reasonCode": { + "const": "already-active" + }, + "receiptRef": { + "$ref": "#/$defs/artifactRef" + }, + "executionId": { + "$ref": "#/$defs/runtimeId" + } + } + } + }, + { + "if": { + "properties": { + "outcome": { + "const": "refused" + } + } + }, + "then": { + "properties": { + "reasonCode": { + "not": { + "enum": [ + "allowed", + "already-active" + ] + } + }, + "dataRef": { + "type": "null" + }, + "executionId": { + "type": "null" + } + } + } + }, + { + "if": { + "properties": { + "outcome": { + "const": "unknown" + } + } + }, + "then": { + "properties": { + "reasonCode": { + "enum": [ + "unknown-effects", + "audit-unavailable" + ] + }, + "dataRef": { + "type": "null" + } + } + } + }, + { + "if": { + "properties": { + "requestId": { + "type": "null" + } + } + }, + "then": { + "properties": { + "outcome": { + "const": "refused" + }, + "reasonCode": { + "const": "invalid-request" + } + } + } + } + ] + }, + "command-resultRuntimePayload": { + "type": "object", + "additionalProperties": false, + "required": [ + "commandId", + "binding", + "outcomeEventId", + "stdoutRef", + "stderrRef", + "outputRefs", + "outputTruncated" + ], + "properties": { + "commandId": { + "$ref": "#/$defs/runtimeId" + }, + "binding": { + "$ref": "#/$defs/executionBinding" + }, + "outcomeEventId": { + "$ref": "#/$defs/runtimeId" + }, + "stdoutRef": { + "oneOf": [ + { + "$ref": "#/$defs/artifactRef" + }, + { + "type": "null" + } + ] + }, + "stderrRef": { + "oneOf": [ + { + "$ref": "#/$defs/artifactRef" + }, + { + "type": "null" + } + ] + }, + "outputRefs": { + "type": "array", + "items": { + "$ref": "#/$defs/artifactRef" + }, + "minItems": 0, + "maxItems": 1024, + "uniqueItems": true + }, + "outputTruncated": { + "type": "boolean" + } + } + }, + "runtime-command-result": { + "allOf": [ + { + "$ref": "#/$defs/runtimeEnvelope" + }, + { + "properties": { + "kind": { + "const": "command-result" + }, + "payload": { + "$ref": "#/$defs/command-resultRuntimePayload" + } + } + } + ] + } + } +} diff --git a/docs/plans/foundation-v1-candidate/semantic-model.fixtures.json b/docs/plans/foundation-v1-candidate/semantic-model.fixtures.json new file mode 100644 index 00000000..e3e069d8 --- /dev/null +++ b/docs/plans/foundation-v1-candidate/semantic-model.fixtures.json @@ -0,0 +1,854 @@ +{ + "fixtureVersion": 1, + "warning": "Synthetic model assumptions only; no runtime truth or enforcement established.", + "cases": [ + { + "name": "exact-reference", + "kind": "reference", + "input": { + "reference": { + "kind": "task", + "id": "task-a", + "scope": "workspace-a", + "revision": 1, + "digest": "synthetic-digest-a" + }, + "target": { + "kind": "task", + "id": "task-a", + "scope": "workspace-a", + "revision": 1, + "digest": "synthetic-digest-a" + }, + "pruned": false + }, + "expected": true + }, + { + "name": "wrong-reference-kind", + "kind": "reference", + "input": { + "reference": { + "kind": "task", + "id": "task-a", + "scope": "workspace-a", + "revision": 1, + "digest": "synthetic-digest-a" + }, + "target": { + "kind": "mission", + "id": "task-a", + "scope": "workspace-a", + "revision": 1, + "digest": "synthetic-digest-a" + }, + "pruned": false + }, + "expected": false + }, + { + "name": "wrong-reference-id", + "kind": "reference", + "input": { + "reference": { + "kind": "task", + "id": "task-a", + "scope": "workspace-a", + "revision": 1, + "digest": "synthetic-digest-a" + }, + "target": { + "kind": "task", + "id": "task-b", + "scope": "workspace-a", + "revision": 1, + "digest": "synthetic-digest-a" + }, + "pruned": false + }, + "expected": false + }, + { + "name": "wrong-reference-scope", + "kind": "reference", + "input": { + "reference": { + "kind": "task", + "id": "task-a", + "scope": "workspace-a", + "revision": 1, + "digest": "synthetic-digest-a" + }, + "target": { + "kind": "task", + "id": "task-a", + "scope": "workspace-b", + "revision": 1, + "digest": "synthetic-digest-a" + }, + "pruned": false + }, + "expected": false + }, + { + "name": "wrong-reference-revision", + "kind": "reference", + "input": { + "reference": { + "kind": "task", + "id": "task-a", + "scope": "workspace-a", + "revision": 1, + "digest": "synthetic-digest-a" + }, + "target": { + "kind": "task", + "id": "task-a", + "scope": "workspace-a", + "revision": 2, + "digest": "synthetic-digest-a" + }, + "pruned": false + }, + "expected": false + }, + { + "name": "wrong-reference-digest", + "kind": "reference", + "input": { + "reference": { + "kind": "task", + "id": "task-a", + "scope": "workspace-a", + "revision": 1, + "digest": "synthetic-digest-a" + }, + "target": { + "kind": "task", + "id": "task-a", + "scope": "workspace-a", + "revision": 1, + "digest": "synthetic-digest-b" + }, + "pruned": false + }, + "expected": false + }, + { + "name": "missing-reference", + "kind": "reference", + "input": { + "reference": { + "kind": "task", + "id": "task-a", + "scope": "workspace-a", + "revision": 1, + "digest": "synthetic-digest-a" + }, + "target": null, + "pruned": false + }, + "expected": false + }, + { + "name": "pruned-is-not-current-evidence", + "kind": "reference", + "input": { + "reference": { + "kind": "task", + "id": "task-a", + "scope": "workspace-a", + "revision": 1, + "digest": "synthetic-digest-a" + }, + "target": { + "kind": "task", + "id": "task-a", + "scope": "workspace-a", + "revision": 1, + "digest": "synthetic-digest-a" + }, + "pruned": true + }, + "expected": false + }, + { + "name": "all-layers-allow", + "kind": "permission", + "input": { + "authenticated": true, + "intentCurrent": true, + "assigned": true, + "operation": "file.change", + "layers": { + "agent": [ + "file.read", + "file.change" + ], + "project": [ + "file.read", + "file.change" + ], + "workspace": [ + "file.read", + "file.change" + ], + "mission": [ + "file.read", + "file.change" + ], + "task": [ + "file.read", + "file.change" + ], + "execution": [ + "file.read", + "file.change" + ] + } + }, + "expected": true + }, + { + "name": "deny-authenticated", + "kind": "permission", + "input": { + "authenticated": false, + "intentCurrent": true, + "assigned": true, + "operation": "file.change", + "layers": { + "agent": [ + "file.read", + "file.change" + ], + "project": [ + "file.read", + "file.change" + ], + "workspace": [ + "file.read", + "file.change" + ], + "mission": [ + "file.read", + "file.change" + ], + "task": [ + "file.read", + "file.change" + ], + "execution": [ + "file.read", + "file.change" + ] + } + }, + "expected": false + }, + { + "name": "deny-intentCurrent", + "kind": "permission", + "input": { + "authenticated": true, + "intentCurrent": false, + "assigned": true, + "operation": "file.change", + "layers": { + "agent": [ + "file.read", + "file.change" + ], + "project": [ + "file.read", + "file.change" + ], + "workspace": [ + "file.read", + "file.change" + ], + "mission": [ + "file.read", + "file.change" + ], + "task": [ + "file.read", + "file.change" + ], + "execution": [ + "file.read", + "file.change" + ] + } + }, + "expected": false + }, + { + "name": "deny-assigned", + "kind": "permission", + "input": { + "authenticated": true, + "intentCurrent": true, + "assigned": false, + "operation": "file.change", + "layers": { + "agent": [ + "file.read", + "file.change" + ], + "project": [ + "file.read", + "file.change" + ], + "workspace": [ + "file.read", + "file.change" + ], + "mission": [ + "file.read", + "file.change" + ], + "task": [ + "file.read", + "file.change" + ], + "execution": [ + "file.read", + "file.change" + ] + } + }, + "expected": false + }, + { + "name": "missing-required-agent", + "kind": "permission", + "input": { + "authenticated": true, + "intentCurrent": true, + "assigned": true, + "operation": "file.change", + "layers": { + "agent": null, + "project": [ + "file.read", + "file.change" + ], + "workspace": [ + "file.read", + "file.change" + ], + "mission": [ + "file.read", + "file.change" + ], + "task": [ + "file.read", + "file.change" + ], + "execution": [ + "file.read", + "file.change" + ] + } + }, + "expected": false + }, + { + "name": "missing-required-project", + "kind": "permission", + "input": { + "authenticated": true, + "intentCurrent": true, + "assigned": true, + "operation": "file.change", + "layers": { + "agent": [ + "file.read", + "file.change" + ], + "project": null, + "workspace": [ + "file.read", + "file.change" + ], + "mission": [ + "file.read", + "file.change" + ], + "task": [ + "file.read", + "file.change" + ], + "execution": [ + "file.read", + "file.change" + ] + } + }, + "expected": false + }, + { + "name": "missing-required-workspace", + "kind": "permission", + "input": { + "authenticated": true, + "intentCurrent": true, + "assigned": true, + "operation": "file.change", + "layers": { + "agent": [ + "file.read", + "file.change" + ], + "project": [ + "file.read", + "file.change" + ], + "workspace": null, + "mission": [ + "file.read", + "file.change" + ], + "task": [ + "file.read", + "file.change" + ], + "execution": [ + "file.read", + "file.change" + ] + } + }, + "expected": false + }, + { + "name": "missing-required-mission", + "kind": "permission", + "input": { + "authenticated": true, + "intentCurrent": true, + "assigned": true, + "operation": "file.change", + "layers": { + "agent": [ + "file.read", + "file.change" + ], + "project": [ + "file.read", + "file.change" + ], + "workspace": [ + "file.read", + "file.change" + ], + "mission": null, + "task": [ + "file.read", + "file.change" + ], + "execution": [ + "file.read", + "file.change" + ] + } + }, + "expected": false + }, + { + "name": "missing-required-task", + "kind": "permission", + "input": { + "authenticated": true, + "intentCurrent": true, + "assigned": true, + "operation": "file.change", + "layers": { + "agent": [ + "file.read", + "file.change" + ], + "project": [ + "file.read", + "file.change" + ], + "workspace": [ + "file.read", + "file.change" + ], + "mission": [ + "file.read", + "file.change" + ], + "task": null, + "execution": [ + "file.read", + "file.change" + ] + } + }, + "expected": false + }, + { + "name": "missing-required-execution", + "kind": "permission", + "input": { + "authenticated": true, + "intentCurrent": true, + "assigned": true, + "operation": "file.change", + "layers": { + "agent": [ + "file.read", + "file.change" + ], + "project": [ + "file.read", + "file.change" + ], + "workspace": [ + "file.read", + "file.change" + ], + "mission": [ + "file.read", + "file.change" + ], + "task": [ + "file.read", + "file.change" + ], + "execution": null + } + }, + "expected": false + }, + { + "name": "no-cross-assignment-union", + "kind": "permission", + "input": { + "authenticated": true, + "intentCurrent": true, + "assigned": true, + "operation": "file.change", + "layers": { + "agent": [ + "file.read", + "file.change" + ], + "project": [ + "file.read", + "file.change" + ], + "workspace": [ + "file.read", + "file.change" + ], + "mission": [ + "file.read", + "file.change" + ], + "task": [ + "file.read" + ], + "execution": [ + "file.read", + "file.change" + ] + }, + "otherAssignment": [ + "file.change" + ] + }, + "expected": false + }, + { + "name": "taskless-scoped-read", + "kind": "permission", + "input": { + "authenticated": true, + "intentCurrent": true, + "assigned": false, + "operation": "file.read", + "layers": { + "agent": [ + "file.read", + "file.change" + ], + "project": [ + "file.read", + "file.change" + ], + "workspace": [ + "file.read", + "file.change" + ], + "execution": [ + "file.read", + "file.change" + ] + } + }, + "expected": true + }, + { + "name": "descendant", + "kind": "path", + "input": { + "path": "src/a.js", + "grants": [ + "src" + ] + }, + "expected": true + }, + { + "name": "prefix-is-not-ancestor", + "kind": "path", + "input": { + "path": "src-other/a.js", + "grants": [ + "src" + ] + }, + "expected": false + }, + { + "name": "root-explicit", + "kind": "path", + "input": { + "path": "docs/a.md", + "grants": [ + null + ] + }, + "expected": true + }, + { + "name": "empty-grant", + "kind": "path", + "input": { + "path": "src/a.js", + "grants": [] + }, + "expected": false + }, + { + "name": "parent-traversal", + "kind": "path", + "input": { + "path": "src/../secret", + "grants": [ + "src" + ] + }, + "expected": false + }, + { + "name": "independent-acceptance", + "kind": "acceptance", + "input": { + "reviewerAuthorized": true, + "reviewer": "reviewer-a", + "authors": [ + "author-a" + ], + "requiredCriteria": [ + "criterion-a" + ], + "verifiedCriteria": [ + "criterion-a" + ] + }, + "expected": true + }, + { + "name": "refuse-acceptance-reviewer", + "kind": "acceptance", + "input": { + "reviewerAuthorized": true, + "reviewer": "author-a", + "authors": [ + "author-a" + ], + "requiredCriteria": [ + "criterion-a" + ], + "verifiedCriteria": [ + "criterion-a" + ] + }, + "expected": false + }, + { + "name": "refuse-acceptance-reviewerAuthorized", + "kind": "acceptance", + "input": { + "reviewerAuthorized": false, + "reviewer": "reviewer-a", + "authors": [ + "author-a" + ], + "requiredCriteria": [ + "criterion-a" + ], + "verifiedCriteria": [ + "criterion-a" + ] + }, + "expected": false + }, + { + "name": "refuse-acceptance-verifiedCriteria", + "kind": "acceptance", + "input": { + "reviewerAuthorized": true, + "reviewer": "reviewer-a", + "authors": [ + "author-a" + ], + "requiredCriteria": [ + "criterion-a" + ], + "verifiedCriteria": [] + }, + "expected": false + }, + { + "name": "duplicate-launch", + "kind": "claim", + "input": { + "events": [ + { + "operation": "launch" + }, + { + "operation": "launch" + } + ] + }, + "expected": [ + true, + false + ] + }, + { + "name": "audit-failure-before-effect", + "kind": "claim", + "input": { + "events": [ + { + "operation": "audit-failed" + }, + { + "operation": "launch" + } + ] + }, + "expected": [ + false + ] + }, + { + "name": "idle-is-not-reaped", + "kind": "claim", + "input": { + "events": [ + { + "operation": "launch" + }, + { + "operation": "engine-idle" + }, + { + "operation": "launch" + } + ] + }, + "expected": [ + true, + false + ] + }, + { + "name": "uncertain-effects-block-replacement", + "kind": "claim", + "input": { + "events": [ + { + "operation": "launch" + }, + { + "operation": "uncertain-effects" + }, + { + "operation": "launch" + } + ] + }, + "expected": [ + true, + false + ] + }, + { + "name": "recovery-needs-audit", + "kind": "claim", + "input": { + "events": [ + { + "operation": "launch" + }, + { + "operation": "audit-failed" + }, + { + "operation": "verified-stopped-and-reconciled" + }, + { + "operation": "launch" + } + ] + }, + "expected": [ + true, + false + ] + }, + { + "name": "recovery-invalidates-old-input", + "kind": "claim", + "input": { + "events": [ + { + "operation": "launch" + }, + { + "operation": "uncertain-effects" + }, + { + "operation": "verified-stopped-and-reconciled" + }, + { + "operation": "launch" + }, + { + "operation": "input", + "generation": 1 + }, + { + "operation": "input", + "generation": 2 + } + ] + }, + "expected": [ + true, + true, + false, + true + ] + } + ] +} diff --git a/docs/plans/foundation-v1-candidate/semantic-model.py b/docs/plans/foundation-v1-candidate/semantic-model.py new file mode 100644 index 00000000..9e2f4913 --- /dev/null +++ b/docs/plans/foundation-v1-candidate/semantic-model.py @@ -0,0 +1,66 @@ +"""Author-only executable examples of proposed rules, using synthetic facts. + +Not an authenticator, reference resolver, sandbox, process observer, or runtime +validator. Input facts are fixture assumptions, never evidence of real state. +""" + + +def evaluate(case): + kind, data = case['kind'], case['input'] + if kind == 'reference': + target = data['target'] + return bool(target and not data['pruned'] and all( + target[key] == data['reference'][key] + for key in ('kind', 'id', 'scope', 'revision', 'digest') + )) + if kind == 'permission': + if not data['authenticated'] or not data['intentCurrent']: + return False + required = ['agent', 'project', 'workspace', 'execution'] + if data['assigned']: + required += ['mission', 'task'] + elif data['operation'] not in ['work.read', 'file.read']: + return False + layers = data['layers'] + return all(name in layers and layers[name] is not None + and data['operation'] in layers[name] for name in required) + if kind == 'path': + path = data['path'].split('/') + if any(part in ('', '.', '..') for part in path): + return False + return any(grant is None or path[:len(grant.split('/'))] == grant.split('/') + for grant in data['grants']) + if kind == 'acceptance': + return (data['reviewerAuthorized'] and data['reviewer'] not in data['authors'] + and bool(data['requiredCriteria']) + and set(data['requiredCriteria']) == set(data['verifiedCriteria'])) + if kind == 'claim': + # Read events as externally supplied observations. This never observes a process. + active, uncertain, audit, generation = False, False, True, 1 + answers = [] + for event in data['events']: + op = event['operation'] + if op == 'audit-failed': + audit = False + elif op == 'audit-restored': + audit = True + elif op == 'uncertain-effects': + uncertain = True + elif op == 'verified-stopped-and-reconciled': + if audit: + active, uncertain = False, False + generation += 1 + elif op == 'engine-idle': + pass # Not proof that commands/processes have stopped. + elif op == 'launch': + allowed = audit and not active and not uncertain + answers.append(allowed) + if allowed: + active = True + elif op == 'input': + answers.append(audit and active and not uncertain + and event['generation'] == generation) + else: + raise ValueError(op) + return answers + raise ValueError(kind)