Skip to content

Rail: graph-stamped unique_source_id powers the Stakwork lineage link - #5072

Open
tomsmith8 wants to merge 3 commits into
masterfrom
feat/rail-unique-source-id
Open

Rail: graph-stamped unique_source_id powers the Stakwork lineage link#5072
tomsmith8 wants to merge 3 commits into
masterfrom
feat/rail-unique-source-id

Conversation

@tomsmith8

@tomsmith8 tomsmith8 commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #5070 (merged while the first commit was in flight — cherry-picked, then revised as the unique_source_id semantics were pinned down).

The topology

Per recursion iteration:

cron → recursion StakworkRun (hive row, projectId = PARENT orchestrator)
         └─ spawns a child workflow (new project id = the actual eval re-runner)
              └─ writes EvalTrigger/Output, stamping unique_source_id = the CHILD's id

So the graph stamp is true per-attempt identity — of the child re-runner — while hive's run rows only ever carry the parent's project id. The two id spaces never meet, which dictates the design:

  • The stamp powers the super-admin Stakwork link: every rail row opens the exact Stakwork execution that produced that attempt (better than any parent-level link)
  • The stamp is never a status/report join key — a projectId match against hive rows would be coincidence, not identity. Status / run type / report state join exclusively on result.evalTriggerRef
  • The parent orchestrator still surfaces as the in-flight run-only row while the loop is executing

Mechanics

  • The fix-chain walker now carries edge properties through (the stamp appears on edges for the concept writer)
  • Resolution order: output node → owning trigger node → touching edges; unique_source_id before legacy project_id (same precedence the proposed-fixes route established)

Testing

Hook + walker suites: the stamp never wears a coincidentally-matching run's status/report (pinned), the link survives with no run row at all, edge-property resolution, plus existing evalTriggerRef join coverage.

jarvis-backend stamps unique_source_id (the Stakwork project id) on
nodes at dispatch — the proposed-fixes route already reads it with
project_id as legacy fallback. That is the graph->run key concept
attempts were missing: they carry no evalTriggerRef anywhere, so the
rail could only show em-dashes for them.

- The walker now carries edge properties through (some writers stamp
  unique_source_id on edges rather than nodes)
- Charted rows resolve a graph project id (output node -> owning
  trigger node -> touching edges, unique_source_id before project_id)
  and use it as a second join key against all three run lists, giving
  concept attempts real status, run type, and report state when a run
  row exists
- When no run row exists at all, the graph-stamped project id still
  powers the super-admin Stakwork link, so every attempt is openable
Field data shows the stamp can be the ROOT PARENT's Stakwork project
(the orchestrating dispatch), not the re-runner that produced the
specific attempt. Joining status/report on it would let a rerun row
wear the parent run's outcome — including its report link, which would
be factually wrong on that row.

The graph-stamped project id now powers ONLY the super-admin Stakwork
link (lineage: the project that orchestrated the attempt). Status,
run type, and report state join exclusively on result.evalTriggerRef,
the one key that is per-attempt by construction.
@tomsmith8 tomsmith8 changed the title Rail: join concept attempts to runs via graph-stamped unique_source_id Rail: graph-stamped unique_source_id powers the Stakwork lineage link Aug 19, 2026
@github-actions

Copy link
Copy Markdown

Test environment is now live.

View it at: https://hive-preview-3.sphinx.chat

Database expires at: Aug 19, 2026, 11:34 PM UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant