Skip to content

PROTOTYPE (do not merge): learnings in a trail-opencore memory service - #597

Draft
rushabhnagda11 wants to merge 1 commit into
mainfrom
feat/opencore-bridge
Draft

rushabhnagda11 wants to merge 1 commit into
mainfrom
feat/opencore-bridge

Conversation

@rushabhnagda11

Copy link
Copy Markdown

Prototype for discussion. Not for merge. It's here so the proposal about how trail-code and trail-opencore connect has code to point at.

What it does

A repo's learnings are retained as trail-opencore evidence and recalled by meaning for a prompt or a diff.

  • src/cloud/opencore.ts
    • One learning becomes one evidence: kind: document, source_id = trail-code:<repo key>:<path>, one item per ## section (speaker = author, occurred_at = date).
    • Grants: repo:<key>.
    • Recall maps each block back to its learning via /history/{evidence_id}.
    • No model calls: answerability, verify_answer and rerank are all off.
  • Hidden trail opencore push [dir] and trail opencore recall [query] [dir] [--diff [base]]. recall prints the offline findNotes match next to opencore's, for comparison.
  • Off unless TRAIL_OPENCORE_URL and TRAIL_OPENCORE_TOKEN are set. trail check, trail ask and the hooks don't change. Personal learnings are never sent.

Tried locally

Against a local opencore (origin/main, no changes) with three learnings written by trail note:

  • Retain is idempotent: 3 retained, then 3 reused.
  • Three paraphrased prompts: opencore found the right learning for all 3; the offline match found 0.
  • An unrelated prompt gets no_relevant_evidence.
  • --diff brings back the "Tried and ruled out" section the change goes against.
  • A token for another repo's principal sees no_evidence.

Tests

  • test/opencore-bridge.test.ts: 6 pass, using a fake fetch.
  • Full suite: 1404 of 1407 pass. The 3 failures (graft-to-trail, hosts-trail, upkeep-hooks) also fail on a clean main on this machine.

Not in scope

  • Server-side retain from the workspace sync.
  • Recall inside ask or the hooks.
  • Edited learnings (revisions).
  • Branch learnings policy.

🤖 Generated with Claude Code

PROTOTYPE for discussion (todo #12: trail-code and trail-opencore have no
connection). A repo's learnings are retained as opencore evidence, one per
learning, granted to the repo, and recalled by meaning for a prompt or a
diff. Hidden `trail opencore push|recall`, off unless TRAIL_OPENCORE_URL and
TRAIL_OPENCORE_TOKEN are set. The offline path (check, ask, hooks) is
unchanged. Not for merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
github-actions Bot added a commit that referenced this pull request Oct 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🌱 graft blast radius

Nothing outside this diff depends on it. 2 areas changed; no indexed dependents at depth 2.
Tests: 1 area updated its tests.
Tag: @anirudhkumar-nanonets — CLI · @shhdwi — CLI

Who knows this code — 2 people across 2 areas
Area Who knows it
CLI · changed @anirudhkumar-nanonets — 54 commits, last today · @shhdwi — 25 commits, last today
Learning Path Persistence · changed only you — nobody else has touched these files

Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no @ has no GitHub handle in its commit email — tag them by hand, or add a .mailmap entry. A suggestion from history, not a CODEOWNERS rule.

Test signal per changed area — 1 ✓ · 1 –

Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.

  • – CLI — no function, method or class changed here
  • ✓ Learning Path Persistence — 7 of 11 reached · 1 test file changed here: test/opencore-bridge.test.ts
    • not reached: call, flush, slugOf, waitForJobs

graft blast · origin/main...HEAD · depth 2 · 3 changed files

Open the interactive graph → — click an area to see its dependent symbols at file:line.

This branch has not been deployed

No deployments
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