Parent PRD
#1
What to build
Implement run-scoped artifact identity for subagent outputs. Subagents should continue writing logical names such as context.md, while the framework stores those artifacts under a unique namespace keyed by the subagent run id. Repeated writes to the same logical artifact name within a single subagent run should update that run-scoped artifact rather than creating ambiguous sibling files. This slice should cover the end-to-end artifact identity path needed by the parent PRD's solution and implementation decisions.
Acceptance criteria
- A subagent can write a logical artifact name like
context.md and the stored artifact path is namespaced by the unique subagent run id.
- Repeated writes to the same logical artifact name within one subagent run update the same run-scoped artifact identity rather than creating versioned siblings.
read_artifact(...) can resolve the stored namespaced artifact correctly using the surfaced artifact name.
- Pure tests cover artifact namespace resolution and duplicate-write behavior.
Implementation approach
- Pass
PI_ARTIFACT_RUN_ID and PI_ARTIFACT_SESSION_DIR env vars to subagent processes
write_artifact uses these to store under <parentSessionDir>/artifacts/<runId>/
read_artifact searches run-scoped directories in addition to session-scoped ones
- Pure tests for namespace resolution and duplicate-write idempotency
Parent PRD
#1
What to build
Implement run-scoped artifact identity for subagent outputs. Subagents should continue writing logical names such as
context.md, while the framework stores those artifacts under a unique namespace keyed by the subagent run id. Repeated writes to the same logical artifact name within a single subagent run should update that run-scoped artifact rather than creating ambiguous sibling files. This slice should cover the end-to-end artifact identity path needed by the parent PRD's solution and implementation decisions.Acceptance criteria
context.mdand the stored artifact path is namespaced by the unique subagent run id.read_artifact(...)can resolve the stored namespaced artifact correctly using the surfaced artifact name.Implementation approach
PI_ARTIFACT_RUN_IDandPI_ARTIFACT_SESSION_DIRenv vars to subagent processeswrite_artifactuses these to store under<parentSessionDir>/artifacts/<runId>/read_artifactsearches run-scoped directories in addition to session-scoped ones