Skip to content

v0.42.30.0 feat(operations): make idea_lineage MCP/agent-callable (lift local-only)#1830

Merged
garrytan merged 1 commit into
garrytan:masterfrom
davidNbreslauer:codex/idea-lineage-skill
Jun 8, 2026
Merged

v0.42.30.0 feat(operations): make idea_lineage MCP/agent-callable (lift local-only)#1830
garrytan merged 1 commit into
garrytan:masterfrom
davidNbreslauer:codex/idea-lineage-skill

Conversation

@davidNbreslauer

@davidNbreslauer davidNbreslauer commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Lifts the idea_lineage operation from local-only to HTTP/OAuth MCP / agent-callable, mirroring find_trajectory's remote posture. Two substantive commits:

Engine federation (feat(engine))

  • getBacklinks, getTimeline, searchTakes, searchTakesVector now accept the federated sourceIds[] array in BOTH engines (postgres + pglite), predicate mirroring findTrajectory (array path wins over scalar; neither = no filter).
  • searchTakes/searchTakesVector gained real source_id isolation — previously they filtered only by attributed-holder allow-list, which is not a source boundary (cross-source take leak for federated callers).
  • getTimeline's 8-case branch collapsed to one composed query.

Op remote lift (feat(operations))

  • Dropped localOnly + the runtime ctx.remote reject; one validated sourceScopeOpts scope threaded to all five gather channels.
  • Trajectory channel threads remote = ctx.remote === true → world-visibility facts only for remote callers (fixes a hardcoded remote:false that would have exposed private facts).
  • Global contradiction trend is omitted for remote callers (can't prove per-finding source scope yet — fail-closed).
  • source argument validated against ctx.auth.allowedSources for remote callers (cross-source IDOR closed); local CLI keeps the free override.
  • Phase-2 gather uses Promise.allSettled → a failed channel degrades to an empty bucket + partial/errors flags instead of erroring the whole op; wire schema_version 1 → 2.

Scope was set via /plan-ceo-review (Approach A, SELECTIVE EXPANSION) and locked by /plan-eng-review. Target surface is HTTP/OAuth MCP only — NOT added to the subagent allow-list (deferred, see TODOS).

Test Coverage

  • New: engine-parity cross-source exclusion tests for getBacklinks/getTimeline/searchTakes on both engines (real Postgres + PGLite); searchTakesVector source-isolation; op-level remote cases (IDOR reject, contradictions-omitted-for-remote, Promise.allSettled partial-on-failure, local-path-unchanged); schema_version 1→2 regression.
  • bun run verify: 30/30 checks green (typecheck, jsonb-pattern, key-files-current-state, progress-to-stdout, eval-glossary, test-isolation, all guards).
  • All test files touched by this change + the merge resolution: green (195 pass; the one reported failure was a 5s timeout under 12-file concurrency on the pre-existing idea_lineage parity test — confirmed passing in isolation: 15/15).
  • NOTE: the full local unit suite (~890 files / 4 shards) was not run to completion in the ship environment (killed at ~20% after 39 min). CI runs the full suite on this PR.

Pre-Landing Review

  • CEO Review (/plan-ceo-review): CLEAN — SELECTIVE EXPANSION, Approach A.
  • Eng Review (/plan-eng-review): CLEAN — 1 finding (DRY of the federated predicate, resolved: inline + comment, no fragment helper per postgres.js composition limits).
  • Outside voice (independent subagent): caught three real gaps the section review missed, all resolved into this PR — searchTakes had no source filter (now fixed), marking find_contradictions localOnly would have broken a shipped op + the skill (reversed — left untouched, root fix deferred), and "remote-callable" ≠ "subagent-callable" (scoped to HTTP MCP).

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped. (operations-descriptions.ts is tool-description text, not an LLM prompt template.)

Plan Completion

Plan: ~/.claude/plans/system-instruction-you-are-working-tingly-moler.md. All build tasks complete (T1–T10 + D-E1). 3 P3 follow-ups deferred to TODOS.md.

TODOS

  • Marked complete: Make idea_lineage remote/federated-callable (the P3 this PR delivers).
  • Filed (P3): source-scope the cached contradiction trend; subagent allow-list access for idea_lineage; per-remote cost caps.

Test plan

  • bun run verify — 30/30 green
  • Affected + merge-touched suites green (engine-parity 15/15 in isolation; operations-idea-lineage 47/47)
  • Full unit suite — runs in CI on this PR (infeasible to complete in the ship environment)

🤖 Generated with Claude Code

@mvanhorn

mvanhorn commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

cool idea!

@garrytan garrytan changed the title feat(skills): add idea-lineage thinking skill v0.42.27.0 feat(skills): add idea-lineage thinking skill Jun 7, 2026
@garrytan

garrytan commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Thanks for this @davidNbreslauer — built on top of it in #1940, which adds a first-class idea_lineage op (CLI + MCP), a feature-recovery eval, and routing/test hardening, shipping as v0.42.27.0. Your original skill is credited in the CHANGELOG. Superseded by #1940.

@garrytan garrytan changed the title v0.42.27.0 feat(skills): add idea-lineage thinking skill v0.42.30.0 feat(operations): make idea_lineage MCP/agent-callable (lift local-only) Jun 7, 2026
@garrytan garrytan merged commit f8d4ce6 into garrytan:master Jun 8, 2026
mgunnin added a commit to mgunnin/gbrain that referenced this pull request Jun 8, 2026
* upstream/master:
  v0.42.32.0 fix(sync): coerce non-string frontmatter titles + bounded auto-skip failure ledger (garrytan#1939) (garrytan#1956)
  v0.42.31.0 feat(links): open link_source provenance + link-add/link-rm/link-sources (garrytan#1941) (garrytan#1957)
  feat(skills): add idea-lineage (garrytan#1830)

# Conflicts:
#	src/core/content-sanity.ts
#	src/core/markdown.ts
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.

3 participants