You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 314365b
Browse filesBrowse the repository at this point in the historyBrowse files
fix(project): preference-create 404 not 500; explicit node wiring
Two real bugs, both caught by the httpapi exerciser's automatic
per-route bad-ID probe, not by typecheck:
1. ProjectPreference.patch's create path (no expectedRevision) relied
on the project_preference table's FK constraint to reject a
nonexistent project, wrapped in Effect.orDie -- so a bad project ID
crashed with an unhandled SQLite FOREIGN KEY error (500) instead of
a typed 404. Added an explicit existence check with a new
ProjectPreference.ProjectNotFound error, mapped to the same 404 the
other project routes already use.
2. Extending ProjectV2's interface (this ticket) and adding
SessionGoal/SessionLedger (TKT-317, #7) together pushed past
whatever threshold makes AppNodeBuilder's transitive auto-discovery
of a new global .node's own dependencies unreliable -- confirmed
via clean-dev isolation before attributing anything (dev alone:
227/0; my branch before this fix: crashes and "Service not found"
errors in three separate full-app composition sites). Explicit
node listing needed in:
- packages/server/src/routes.ts (v2 API, used by cli/sdk-next)
- packages/opencode/src/server/routes/instance/httpapi/server.ts
(the V1 HttpApiApp -- what test:httpapi actually runs against;
SessionGoal/SessionLedger gap here is pre-existing from #7, not
from this PR, but blocks this PR's own gate, so fixed here per
Ethan's ruling rather than serialized on its own ticket)
- packages/opencode/src/effect/app-runtime.ts (the CLI/TUI runtime
-- the same gap here is invisible to any HTTP-shaped test, since
nothing exercises it that way; found by enumeration, not by a
failing test)
Per Ethan's follow-up ask: enumerated every AppNodeBuilder/LayerNode
.group assembly site in the repo (grep in FORK.md's new section),
distinguished the five full-app composition sites (need every global
node) from location-services.ts (a different category -- per-location
services, global nodes don't belong) and everything else (narrow,
single-feature builds). Documented in FORK.md so the next new global
.node has a checklist instead of a minefield.
Fixing #2 unmasked a third, unrelated issue: v2.session.goal.get now
reaches its assertion instead of crashing first, and fails it in
test:httpapi's mode=effect only ("a session with no goal set should
report no data") -- coverage and auth modes both pass. Not caused by
this diff (unrelated code, TKT-317's), filed as feedback anomalyco#145 and
recorded as a new named exception in FORK.md's known-red table,
matching the TKT-305 convention exactly.
Full validation after all of the above: bun typecheck 30/30. Core
1126/0 (new: a regression test asserting patch-on-nonexistent-project
fails typed, not crashed). App 722+41/0, unchanged. Full opencode
suite 3257/1/22/1, the 1 is the documented umask caveat, unchanged.
test:httpapi 227/0 in mode=coverage and mode=auth, 226/1 in
mode=effect (the newly-filed, newly-named exception above) -- was
221/6 (all crashes) before this commit. lint 4865/1 against a
freshly-verified clean-dev-with-Gemma's-merge baseline of 4864/1 (not
the stale 4859/4860 figures from before her PR landed) -- a 1-count
difference already inside the noise band FORK.md documents as not
meaningful, confirmed by checking each of the touched files' findings
against clean dev individually: all pre-existing, none new.
0 commit comments