Repository navigation
Conversation
Co-authored-by: Toshi <toshi-noreply@coinbase.com> J-Engine-Session: toshi:cd9e56ba-97a8-4763-a2a7-447db8a125e0
Collaborator
🟡 Heimdall Review Status
|
Co-authored-by: Toshi <toshi-noreply@coinbase.com> J-Engine-Session: toshi:cd9e56ba-97a8-4763-a2a7-447db8a125e0
Collaborator
Author
Review round 1Reviewers: cbhq-openai/gpt-6.1-sol, anthropic/claude-opus-5-5
🤖 Reply generated with Toshi |
Co-authored-by: Toshi <toshi-noreply@coinbase.com> J-Engine-Session: toshi:cd9e56ba-97a8-4763-a2a7-447db8a125e0
Collaborator
Author
Review round 2Reviewers: cbhq-openai/gpt-6.1-sol, anthropic/claude-opus-5-5
🤖 Reply generated with Toshi |
Collaborator
Author
Review round 3Reviewers: cbhq-openai/gpt-6.1-sol, anthropic/claude-opus-5-5
🤖 Reply generated with Toshi |
jackchuma
marked this pull request as ready for review
October 30, 2026 19:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linear: https://linear.app/coinbase/issue/CHAIN-6506/task-catalog-core-with-task-listing-moved-onto-it
What changed? Why?
Task folder layout and path-safety logic is copied across the Task listing, profile-listing route, install-deps route, and validation service. This PR adds one Task catalog module that owns it, and moves the Task listing onto it. Later PRs add profile listing/loading and migrate the other callers.
src/lib/task-catalog.ts:createTaskCatalog(root)→{ root, listTasks(network), taskDirs(taskId, network) }listTasksreplacesgetUpgradeOptionswith identical output (README title, description, execution status; newest-first).taskDirsreturns{ evmDir, taskDir, signaturesDir, taskOriginDir }(same paths the validation service builds today). It does not require the dirs to exist.defaultTaskCatalog()discovers the contract-deployments root on first use and caches the catalog.TaskCatalogErrorwithkind: 'invalid-id' | 'outside-root' | 'not-found' | 'invalid-profile'. The last two are reserved for the profile slices./api/upgradesusesdefaultTaskCatalog().listTasks; response unchanged.src/lib/deployments.tsnow only re-exports root discovery (shared cache) for callers not yet migrated.GLOSSARY.mddefines Task and Validation profile.Notes to reviewers
Decisions made where the ticket left room:
taskDirsvalidates bothtaskIdandnetworkagainst^[a-zA-Z0-9_-]+$(invalid-id).outside-rootuses a lexical check plus a symlink-aware check: the root and the deepest existing ancestor of each returned path are realpathed, so a Task dir symlinked outside the root is rejected. Symlinks that stay inside the root are allowed. Returned paths stay lexical joins. With valid ids a lexical escape is impossible, so this is the only way to reachoutside-root, and it matches the parent ticket's "never read outside the checkout" story.listTasksvalidatesnetworktoo, and applies the same containment check: a Task whoseconfig/<network>orvalidationsdir resolves outside the root is omitted, and a README candidate that resolves outside the root is skipped in favor of the next one (both log a warning). One bad Task does not fail the whole list; trees with no escaping paths list exactly as before.assertWithinDir).How has it been tested?
src/lib/__tests__/task-catalog.test.ts(real temp-dir fixture trees, no mocks): Task listing tests moved fromdeployments.test.ts, plus README precedence,taskDirslayout,invalid-idfor taskId and network,outside-rootfor symlinks at each layout level and a dangling symlink, internal symlinks allowed, and default root discovery and caching.src/app/api/upgrades/__tests__/route.test.tsruns the route against the real catalog on a fixture root.npm test(199 passed),npm run lint,npx tsc --noEmit,prettier --checkon changed files.