Repository navigation
feat(artifacts): add shared planning artifacts - #109
Conversation
3fdb78d to
3df42cc
Compare
bryantderosier
left a comment
There was a problem hiding this comment.
Read-only code and security review of commit c2aa3d90d4cd82fdc0f091fc095b73c46124f845 against 28f26f6c670bedae06f93a31fe83a595936b521f.
Three medium-priority findings are detailed inline:
- [P2] Automatic plan export can select an obsolete revision. The projection orders plans by random IDs, while finalization uses
findLast()without excluding superseded plans. A completed run can overwrite sharedartifacts/plan.mdwith an old draft. - [P2] Artifact previews remain stale after reconnection. A fresh watcher subscription emits revision
0, which the page ignores. Changes made while disconnected are not reloaded until another filesystem event or manual refresh. - [P2, security] Rejected artifact writes can create directories outside storage. Parent directories are created before resolved-path containment is checked. An existing escaping directory symlink allows directory creation at its external destination before the write is rejected. This establishes directory creation, not arbitrary file overwrite.
Validation: 121 existing tests passed across 10 focused suites in an isolated snapshot of the reviewed commit. Additional focused reproductions against the finalization service and artifact page confirmed findings 1 and 2. An isolated reproduction of the filesystem sequence confirmed finding 3. Browser and live-provider behavior were not exercised. No high or critical security issue was confirmed.
Reviewed with GPT-6 in the Codex harness, with parallel correctness, security, and fork-boundary reviewers.
|
Fork-boundary refactor recommendations for reviewed commit These recommendations are separate from the three correctness/security findings. The aim is to keep artifact behavior in J5-owned modules and leave small, explicit integration points in upstream T3 files, consistent with
I would prioritize items 1, 2, and 5 for the largest reduction in upstream implementation changes. Keep necessary shared RPC/auth contracts, route registration, and generated route-tree entries in their integration layers. The goal is fewer and smaller upstream diff hunks, with future artifact work and its tests concentrated in J5-owned files; that should make upstream merges easier to review and resolve. Reviewed with GPT-6 in the Codex harness. |
|
Fork-boundary follow-up: 2b8fa93 adopts recommendations 1 and 2. The redundant turn-start preparation observer and its upstream orchestration integration were removed, and plan lookup moved into the J5 artifact finalization observer while restoring the upstream observer contract. I am deferring recommendations 3–6 in this PR: they are broader file/module relocations with no behavior change, and would add substantial review churn after the correctness fixes. They remain reasonable candidates for a separate boundary-focused cleanup. |
What Changed
artifacts/plan.md.list_artifacts,read_artifact, andwrite_artifacttools, including read access in Claude read-only sessions.artifacts/...references in chat as distinct Artifact chips and opens them directly in the Artifacts pane.Why
Planning output was easy to lose in chat history or scatter around a repository. Thread-scoped storage also prevented agents from sharing it, while a repository-local directory required Git exclusion and could collide with tracked files. Server-owned project storage makes artifacts durable across threads and agents without touching repository contents or Git configuration.
UI Changes
Before, generated planning documents had no dedicated navigation or preview surface. After, Artifacts can be opened from the sidebar or alongside a thread in the right panel; artifact references in chat are visually distinct and open the selected document there; selected previews update as files change; and HTML renders in a transparent empty-sandbox iframe.
Integrated verification was completed against the desktop-backed web client for the full-page artifacts flow.
Verification
Checklist
Built with GPT-5.6 Sol in the Codex harness through T3 Code.