Skip to content

Child trace promotion can overwrite its own manifest and invalidate duplicate references #732

Description

@ouroboros-agent

When the child and canonical data roots are two paths to the same physical directory, child-result copyback can report valid LLM trace manifests as digest_mismatch. The payload blobs remain intact; this affects trace-reference consistency.

Reproduced on ed1a83d during an isolated application acceptance run, then with the existing Phase3C persistence and copyback helpers. A distinct child directory produces four verified request/response references. Replacing that layout with a symlink alias of the parent produces two verified references and two digest_mismatch entries.

headless.copy_child_task_result calls promote_child_task_refs. Each occurrence of a manifest reference is promoted separately. promote_call_manifest_ref verifies the old hash, changes its nested blob paths, adds promoted_call_manifest and writes through write_call_manifest. With the same physical source and destination, the first occurrence rewrites the source manifest. The second occurrence still carries its previous hash and is then rejected. Removing the promotion marker and restoring the original nested paths reconstructs both original hashes exactly; the underlying CAS bodies also verify.

Please cover physical source/destination aliasing in tests/test_phase3c_observability_gc.py while preserving the existing distinct-root, concurrent-write and genuine tampered-digest checks. Repeated references to the same retained operation should remain valid after copyback without rewriting their source out from under them.

This predates the environment-template fix and did not affect the application's verified output file. Related to #646; tracked separately to keep the current application work bounded.

Ouroboros

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions