Skip to content

fix(catalog): exclude workspaces from raw preimages - #425

Merged
schickling-assistant merged 1 commit into
mainfrom
schickling-assistant/2026-09-02-fix-raw-workspace-projection
Sep 2, 2026
Merged

fix(catalog): exclude workspaces from raw preimages#425
schickling-assistant merged 1 commit into
mainfrom
schickling-assistant/2026-09-02-fix-raw-workspace-projection

Conversation

@schickling-assistant

Copy link
Copy Markdown
Contributor

Problem

Raw-preimage projection recorded each live agent .workspace directory as a typed workspace fact. Snapshot materialization therefore recreated .workspace in the prepared declaration tree, even though it is runtime-only state.

Goal

Keep runtime workspace directories out of raw snapshot/digest/apply projections while preserving the live workspace during repair.

Decisions

  • Leave canonical runtime-directory exclusion in the shared bundle collector.
  • Stop synthesizing typed workspace facts from invalid declaration bytes; raw mode cannot establish those semantics safely.
  • Keep all other bundle paths under the existing structural projection rules rather than broadly ignoring unknown directories.

Verification

Before the source fix, the focused legacy-profile regression failed because agents/host/worker/.workspace existed in the raw snapshot.

After:

nix develop -c cargo test --test catalog_apply raw_preimage -- --nocapture
running 7 tests
test result: ok. 7 passed; 0 failed; 52 filtered out

This lane includes the raw hard-link, CAS, envelope, resume, invalid-profile, and mutable-state cases. The updated legacy-profile case also verifies the live workspace file survives raw apply.

Complexity

No new complexity; this deletes raw workspace discovery and reuses the existing structural exclusion.

Concerns

PR #424 overlaps the raw-preimage transaction and regression files, so merge ordering may require a small semantic rebase.

Friction & bottlenecks

The Nix shell emitted an ignored permission warning for its local trace sink; it did not affect compilation or test execution.

Follow-ups

None.

References

Refs #424.

Posted on behalf of @schickling
field value
agent_identity dev3.direct.omp.5wtg9j4p
session dev3.5wtg9j4p
agent_persona generalist
agent_supervisor unavailable
agent_tool OMP
agent_tool_version 18.0.11
agent_runtime OMP 18.0.11
tooling_profile dotfiles@2161b9c

agent-identity: dev3.direct.omp.5wtg9j4p
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.0.11
agent-runtime: OMP 18.0.11
tooling-profile: dotfiles@2161b9c
@schickling-assistant
schickling-assistant merged commit 95788fb into main Sep 2, 2026
2 checks passed
schickling-assistant added a commit that referenced this pull request Sep 3, 2026
…427)

`.workspace` is runtime-only: the agent owns its contents, nothing declares
them, and #425 made the raw preimage capture none of them. The apply side kept
requiring every declared workspace fact to already exist in the prepared plane,
so the exact repair path the raw preimage exists for became unreachable: a
prepared plane built from a raw snapshot has no such directory, and
`digest --prepared` failed with

    inspect prepared workspace fact <prepared>/agents/<host>/<id>/.workspace
    Caused by: No such file or directory (os error 2)

Admission now tolerates an absent directory and keeps every other rule: a
directory that IS there must still be a real, empty one, so prepared state
cannot smuggle runtime bytes through the declaration plane. The fact itself
stays in the projection, so `materialize_projection` republishes it as an empty
directory and the applied catalog still satisfies the live invariant that a
declared workspace fact is present.

The relaxation is uniform across prepared planes rather than raw-only:
`catalog digest --prepared` has no raw mode, so the deployer's
digest-then-apply sequence cannot express the distinction, and an absent empty
directory carries no information the CAS does not already cover — the declared
fact is hashed either way.

Regression test covers the deployer's shape end to end: raw-snapshot an invalid
live plane whose declared workspace is runtime-only, publish valid declaration
bytes into that snapshot, and bind the apply to the opaque preimage. Without
this fix it reproduces the error above verbatim.

The existing workspace-fact test loses its "missing" case, which asserted the
contract this fixes. Its remaining "nonempty" rejection is unchanged.

agent-identity: dev3.direct.omp.quzh99p3
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.1.2
agent-runtime: OMP 18.1.2
tooling-profile: dotfiles@9323c3a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant