Skip to content

fix(artifacts): address the PR 109 review findings - #145

Merged
bryantderosier merged 2 commits into
j5/mainfrom
crews/01-artifacts-pr109-findings
Sep 21, 2026
Merged

bryantderosier merged 2 commits into
j5/mainfrom
crews/01-artifacts-pr109-findings

Conversation

@bryantderosier

@bryantderosier bryantderosier commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

The artifact review on #109 left a few findings I carried on my crews branch; this PR is only those, so they can be reviewed on their own.

The artifact change subscription moves out of upstream's WebSocket method table into a J5 RPC group merged beside the persona group, with its scopes and handlers spread from J5-owned modules, which keeps another upstream method off the shared table. The artifact HTTP route reports not-found through a typed reason instead of matching an error string. The Artifacts page now holds its own environment connection, waits for it before fetching, and re-reads a preview only when that file changed or I press Refresh. Listing sorts before it truncates and keeps the size guard that fails fast on an absurd directory. FORK.md case 33 describes what actually exists.

Built with Claude Fable 5.1 in Claude Code.

🤖 Generated with Claude Code

Closes #201.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 effective changed lines (test files excluded in mixed PRs). labels Sep 15, 2026
@bryantderosier
bryantderosier added this pull request to stack #153 September 15, 2026 21:36
@bryantderosier
bryantderosier force-pushed the crews/01-artifacts-pr109-findings branch from e77a3f2 to 7283567 Compare September 15, 2026 21:44
@bryantderosier bryantderosier self-assigned this Sep 15, 2026
@bryantderosier
bryantderosier force-pushed the crews/01-artifacts-pr109-findings branch from 7283567 to 45b082b Compare September 15, 2026 22:25

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed with a second independent pass (GPT-6-Astra); the two of us converged on the same list. The transport split itself is right: the cheap change notification rides the socket, the file bodies ride HTTP, and the J5 RPC group is a genuine reduction over the inline handler it replaces. The upstream touch points are one import plus one additive entry each, which is fine.

Blocking: apps/web/src/j5/artifacts/artifactClient.ts hand-rolls HTTP auth and has no relay refresh-and-retry.

The DPoP branch signs a proof with whatever token the prepared connection already holds. On a T3 Connect connection the relay token expires without closing the socket, so the artifact change stream keeps flowing while every list and read returns 401, including on Refresh. Direct, Tailscale, and SSH are unaffected because those use cookies or a static bearer token. This predates this PR, but this is the PR that rewrote the page's connection handling and case 33, and case 34 already records that J5 reads go through the shared authenticated transport. executeJ5Request in packages/client-runtime/src/j5/http.ts (built on executeAuthenticatedEnvironmentHttpRequest) resolves the token at request time and refreshes once on rejection; routing the two artifact requests through it should be a small change and would let this client drop its own bearer/DPoP branches.

Fix before merge: the preview still re-reads on every directory change (inline comment on ArtifactsPage.tsx).

Comment: the page tests assert source strings and could not have caught the above (inline comment on the test).

Reviewed by Claude Fable 5.1 in Claude Code, with an independent pass by GPT-6-Astra in Codex.

Comment thread apps/web/src/j5/artifacts/ArtifactsPage.tsx Outdated
Comment thread apps/web/src/j5/artifacts/ArtifactsPage.test.ts Outdated
@bryantderosier
bryantderosier force-pushed the crews/01-artifacts-pr109-findings branch from 45b082b to 931b9ba Compare September 16, 2026 11:32
@bryantderosier

Copy link
Copy Markdown
Collaborator Author

Both fixes are in 931b9ba05. The artifact client now goes through executeJ5Request, so the credential is resolved per request and a rejected relay token is refreshed once; the local bearer and DPoP branches are gone. The preview re-reads only when its own file changes or I press Refresh, with the revision computation extracted and tested directly. The stack is rebased onto main with #144 underneath it.

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the fix at 931b9ba05. Approving.

Reviewed by Claude Fable 5.1 in Claude Code.

@bryantderosier
bryantderosier force-pushed the crews/01-artifacts-pr109-findings branch from 931b9ba to 0acd5c1 Compare September 17, 2026 15:01
@github-actions github-actions Bot added size:XL 500-999 effective changed lines (test files excluded in mixed PRs). and removed size:L 100-499 effective changed lines (test files excluded in mixed PRs). labels Sep 21, 2026
bryantderosier and others added 2 commits September 21, 2026 11:07
The artifact change subscription moves out of upstream's WebSocket method table into a J5 RPC
group merged beside the persona group, with its scopes and handlers spread from J5-owned modules.
The artifact HTTP route reports not-found through a typed reason instead of matching an error
string, the Artifacts page holds its own environment connection and re-reads a preview only when
that file changed or the person asks, and listing sorts before it truncates while keeping the size
guard that fails fast on an absurd directory.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* feat(artifacts): add file management controls

* fix(artifacts): move actions into document header

* fix(artifacts): address deletion review findings

* test(artifacts): exercise connection-gated loading

* fix(artifacts): delete files permanently and preserve current state

---------

Co-authored-by: Bryant Derosier <bryant.derosier@firsthorizon.com>
@bryantderosier
bryantderosier force-pushed the crews/01-artifacts-pr109-findings branch from 69750aa to be70fbf Compare September 21, 2026 15:07
@bryantderosier
bryantderosier merged commit 4aa3c09 into j5/main Sep 21, 2026
20 checks passed
@bryantderosier
bryantderosier deleted the crews/01-artifacts-pr109-findings branch September 21, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Artifacts: carry the PR #109 review findings to closure

3 participants