Commit Graph
942 Commits
Author SHA1 Message Date
ZacharyZhang-NY 0235bc9b0d fix(renderer): remove app hook dependency suppressions 2026-04-22 19:14:06 -04:00
ZacharyZhang-NY a7934d2111 refactor(ipc): split company operation handlers 2026-04-22 19:11:45 -04:00
ZacharyZhang-NY 9d38ec20f1 fix(ipc): expose classified handler codes 2026-04-22 19:07:08 -04:00
ZacharyZhang-NY 1883d9d9d3 fix(errors): warn on raw stringify fallback 2026-04-22 19:04:53 -04:00
ZacharyZhang-NY ee1ea4fd8c test(db): cover agent hierarchy cycles 2026-04-22 19:02:54 -04:00
ZacharyZhang-NY bbf7ab91e2 fix(renderer): preserve desktop result errors 2026-04-22 19:00:53 -04:00
ZacharyZhang-NY 7793f2da35 fix(connectors): guard pi provider resolution 2026-04-22 18:58:30 -04:00
ZacharyZhang-NY 0d9f4f15eb refactor(automation): register workflow actions 2026-04-22 18:54:31 -04:00
ZacharyZhang-NY 8bf2299092 test(prompt): lock cacheable system prefix 2026-04-22 18:45:02 -04:00
ZacharyZhang-NY 8148877b4a fix(runtime): preserve inbound correlations for active runs 2026-04-22 18:43:05 -04:00
ZacharyZhang-NY dca148a125 fix(prompt): render skills without pi shape casts 2026-04-22 18:39:56 -04:00
ZacharyZhang-NY 9f35dc7446 fix(runtime): erase pi tool array type safely 2026-04-22 18:37:03 -04:00
ZacharyZhang-NY 710448a75f fix(preload): keep zod out of sandbox bundle 2026-04-22 18:31:24 -04:00
ZacharyZhang-NY fa006524c2 refactor(runtime): centralize lifecycle constants 2026-04-22 16:58:36 -04:00
ZacharyZhang-NY e540cbb2a6 refactor(service-graph): replace late bindings with event hub 2026-04-22 16:55:20 -04:00
ZacharyZhang-NY 9e712f2746 refactor(ipc): generate preload forwarders from registry 2026-04-22 16:49:02 -04:00
ZacharyZhang-NY 7478769bfe chore(lint): remove stale task dual-write guard wording 2026-04-22 16:40:32 -04:00
ZacharyZhang-NY 612a760152 fix(runtime): move team building policy into tools 2026-04-22 16:38:59 -04:00
ZacharyZhang-NY 473486aa61 refactor(runtime): unify run attempt policy 2026-04-22 16:33:41 -04:00
ZacharyZhang-NY 58a4be7fe7 test(eval): enforce SOP prompt coverage 2026-04-22 16:28:50 -04:00
ZacharyZhang-NY 775598ef4c fix(db): make task row state authoritative 2026-04-22 16:24:57 -04:00
ZacharyZhang-NY ebcc15c68d fix(runtime): derive unattributed cost from usage status 2026-04-22 16:18:03 -04:00
ZacharyZhang-NY f107415f4f fix(browser): execute social actions through cdp 2026-04-22 16:14:09 -04:00
ZacharyZhang-NY fb6d2a0d77 fix(runtime): tokenize context compaction budget 2026-04-22 16:00:12 -04:00
ZacharyZhang-NY 3aaa64ddfd refactor(runtime): enforce source file size boundaries 2026-04-22 15:56:09 -04:00
ZacharyZhang-NY 212e03219d fix(artifacts): classify projection filesystem errors 2026-04-22 15:48:00 -04:00
ZacharyZhang-NY eefb515aa2 fix(runtime): classify run usage status 2026-04-22 15:41:19 -04:00
ZacharyZhang-NY d971ca7929 chore(reference): remove pi mono snapshot 2026-04-22 15:32:43 -04:00
ZacharyZhang-NY e3eb45b08d fix(landing): sync first-run narrative 2026-04-22 15:30:10 -04:00
ZacharyZhang-NY f8ed2aa666 fix(landing): derive platform support from release assets 2026-04-22 15:15:10 -04:00
ZacharyZhang-NY 1453a8fa95 fix(renderer): preserve desktop error codes 2026-04-22 15:00:35 -04:00
ZacharyZhang-NY eec26a09a3 fix(release): execute d1 migrations without shell 2026-04-22 14:52:54 -04:00
ZacharyZhang-NY cb315f308d fix(eval): run replay harness in verify 2026-04-22 14:47:31 -04:00
ZacharyZhang-NY f90fb037f9 docs(runtime): separate pi dependency boundary 2026-04-22 14:39:19 -04:00
ZacharyZhang-NY feffd72b98 fix(runtime): run pi tools sequentially 2026-04-22 14:37:35 -04:00
ZacharyZhang-NY 64842a9185 fix(runtime): guard pi stream setup failures 2026-04-22 14:36:16 -04:00
ZacharyZhang-NY 5155136937 fix(api): require api server callbacks 2026-04-22 14:27:49 -04:00
ZacharyZhang-NY 529bb109db fix(runtime): preserve tool result facts in compaction 2026-04-22 14:22:28 -04:00
ZacharyZhang-NY 6dfa1a851d fix(runtime): compact context inside worker 2026-04-22 14:19:46 -04:00
ZacharyZhang-NY 33c6ede381 fix(runtime): fail runs on context input errors 2026-04-22 14:13:59 -04:00
ZacharyZhang-NY 43583ef30b fix(runtime): gate cofounder checkpoints 2026-04-22 14:05:26 -04:00
ZacharyZhang-NY 7a1dd647aa fix(api): make task updates transactional 2026-04-22 14:00:24 -04:00
ZacharyZhang-NY 19f8494d09 fix(db): make filesystem lock intent explicit 2026-04-22 13:51:41 -04:00
ZacharyZhang-NY 0785c9ba47 fix(db): make task checkout atomic 2026-04-22 13:38:54 -04:00
ZacharyZhang-NY dffeccf3e2 update 2026-04-22 13:19:43 -04:00
ZacharyZhang-NY aba2dac3c5 fix(docs): stop leaking backend reason codes to the open-file toast
The previous toast pasted result.error.message straight into the UI,
so a failed open rendered
  "Couldn't open CEO-WEEK2-DAY1-SUMMARY.md: workspace_id=null
  task_id=null run_id=61669170-180b-4cb3-99d2-eb925ca9717c — none led
  to a workspace with a local_path"
to the operator. That text is a developer log line, not user feedback.

Drop the passthrough — the toast now simply reads
  "Couldn't open <filename>"
and the diagnostic details live only in the IPC return payload (which
a devtools or automated caller can still read). The resolver's five
reason codes and their detail strings remain intact in the main
process; they just no longer surface to the UI.
2026-04-21 14:58:39 -04:00
ZacharyZhang-NY 9fba8dd6c3 fix(projector): stop writing null workspace_id on work_products
Two sites in upsertFilesystemArtifact leaked null workspace_ids
into the work_products table and produced the orphan rows the read
path now has to heal:

1. Create path unconditionally forwarded ctx.workspaceId, which was
   null whenever a run was created without a workspace binding
   (historically cognitive runs, or runs that lost their link through
   the observationPath regression fixed in 1f2f977).

2. Update path passed {workspaceId: ctx.workspaceId} as part of the
   patch. updateWorkProduct treats any key present in patch as "write
   this value", so a run touching a previously-well-linked row with
   ctx.workspaceId=null would clobber the existing workspace_id back
   to null — actively destroying data.

Resolve both at the projector layer:

  - Add workspacesMod.findWorkspaceIdByLocalPath(companyId, localPath)
    as a reverse-lookup. workspacePath is the argument the projector
    is already walking; it came from some workspace row's local_path,
    so finding that row by path is deterministic.
  - Compute resolvedWorkspaceId = ctx.workspaceId ?? reverseLookup(...)
    once, and use it for both the identity lookup
    (findWorkProductByExternalId) and the subsequent write.
  - On the update path, only include workspaceId in the patch when
    resolvedWorkspaceId is non-null. Null now means "no info — leave
    the existing column alone" instead of "clobber to null".

Together with the read-path heal in cfb8ba5 this closes the loop:
new files never enter the table with a null workspace_id if we can
possibly resolve it, old files keep their links, and truly unlinkable
rows still fall back to the observation workspace on open.

Typecheck and build:verify clean.
2026-04-21 14:52:38 -04:00
ZacharyZhang-NY cfb8ba5dc1 fix(docs): heal orphan work_products by falling back to observation workspace
Work-product rows written before the artifact projector tracked
workspace_id end-to-end can lose the link through all three joins:
workspace_id is NULL, task_id is NULL, and the row's run exists but
its runs.workspace_id is also NULL. Those orphans were readable in
the DocumentCenter (the listing doesn't need a workspace root) but
could not be opened — resolveWorkProductTarget returned null and the
toast now reports workspace_unresolved.

Add a fourth resolution tier in resolveWorkProductTarget: if the
three-step chain yields nothing, look up the company's observation
workspace (primary first, then oldest) and check whether the
external_id resolves to a real file inside that root. If it does,
return that absolute path and the row opens. If the file isn't
there, the error falls through with an extended detail line naming
the observation root that was tried, so the operator sees exactly
why the heal also failed.

This is deterministic — exactly one fallback workspace — and
side-effect-free on the read path: the row itself is left alone,
no stealth write-back. A follow-up commit will stop the projector
from writing NULL workspace_id in the first place.

Typecheck and build:verify clean.
2026-04-21 14:51:06 -04:00
ZacharyZhang-NY 390f76fa76 fix(docs): split work-product open errors into actionable reasons
The previous handler folded every null target into one error code
("WORK_PRODUCT_NOT_FOUND: Work product not found or its workspace
is unresolved"). When a user couldn't open a file we had no way to
tell whether the row was archived, the provider/external_id was
empty, the workspace had no local_path, or the external_id escaped
the root.

Widen resolveWorkProductTarget's return from (target | null) to
(target | error) where error carries one of five reasons:

  not_found             row missing for id+company
  archived              status == "archived" tombstone
  no_target             provider != filesystem and no url
  workspace_unresolved  all three workspace_id / task_id / run_id
                         lookups returned no local_path
  path_escape           external_id is absolute or steps outside root

Each reason includes the concrete detail (ids checked, paths tried)
so the toast on the renderer side tells the user exactly which slot
is null without having to open the DB.

The IPC handler maps each reason to its own failure code and passes
the detail through, so WorkProductRow's toast now reads e.g.
"workspace_id=null task_id=null run_id=null — none led to a
workspace with a local_path" instead of a generic unresolved.

Typecheck and build:verify clean.
2026-04-21 14:45:59 -04:00
ZacharyZhang-NY 9f43549606 fix(docs): surface work-product open failures with a toast
Clicking a Files & Deliverables row fired openWorkProduct and then
discarded the result with \`void\`. When the main process could not
resolve the target — archived work product, missing workspace root,
path outside the managed root, or \`shell.openPath\` reporting no
associated app for the file type — the renderer stayed silent and
the row looked like a dead button. The user had no way to know why
"clicking" did nothing.

Await the result in WorkProductRow and route non-ok responses through
addToast with tone="danger". The caller sees the underlying failure
(OPEN_PATH_FORBIDDEN / OPEN_PATH_FAILED / WORK_PRODUCT_NOT_FOUND /
the shell's own message) and can act on it. No backend change — the
handler already returned structured errors; this just stops dropping
them.

Typecheck and build:verify clean.
2026-04-21 14:42:00 -04:00