Skip to content

[backend] CorpusBackend cascade-layout: corpus_backend._agent_root vs instance_root divergence in bundle rendering #307

@dep0we

Description

@dep0we

Context

PR 3 of the CorpusBackend arc (#65) wired corpus_backend into AtomicAgent and the bundle rendering path with the IRON RULE 5-assertion regression suite at tests/test_corpus_migration_regression.py. The v1.0 IRON RULE tests cover the 166 direct-construction sites for byte-identity. They do not cover the cascade-layout path, where corpus_backend._agent_root may diverge from the instance_root used by bundle.py during rendering. This gap means cascade-with-corpus usage is untested and undocumented.

Evidence

atomic_agents/bundle.py -- bundle rendering references instance_root for path resolution. corpus_backend._agent_root is set at construction time, which in cascade layout may point to a different path than the bundle's instance_root. The IRON RULE tests do not include a cascade fixture. Surfaced as A7 in PR 3 Round 1 adversarial review (cascade-layout corpus_backend._agent_root divergence; deferred to PR 4 backlog).

Proposed fix

Add a cascade-layout fixture to the IRON RULE test suite. Confirm whether corpus_backend._agent_root and instance_root must agree in cascade layout, and document the contract in docs/deployment/programmatic.md under a "Cascade layout and CorpusBackend" callout. If divergence is intentional (per-agent scoping mirroring the existing PersonaBackend cascade discipline), document the operator expectation explicitly so cascade operators know which path drives bundle rendering.

Acceptance criteria

  • At least one test covers cascade-layout AtomicAgent construction with a corpus_backend whose _agent_root differs from the cascade instance_root.
  • docs/deployment/programmatic.md documents the expected behavior for cascade-with-corpus.
  • uv run pytest -q passes with zero regressions.

Source

PR 3 of #65 (PR #304), Round 1 adversarial finding A7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendProtocol-pattern backend abstractions (memory, logs, locks, etc.)developer-experienceFriction for operators and third-party authors

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions