Repository navigation
Conversation
The semantic lookup found the artifacts source only by a local_path ending in .gstack-brain-worktree. A source registered elsewhere never got the related-from-memory block, and the override that gstack-gbrain-source-wireup and gstack-gbrain-sync accept was not read. When GSTACK_BRAIN_SOURCE_ID is set, use that source if it is registered and return null if it is not, the precedence gstack-gbrain-sync uses; unset, keep the worktree match. The search stays scoped. Also corrects the doc comment that said the caller searches unscoped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Thank you, @exGeni. The gap is real on main at 1d3c63c: |
|
Thank you for this. We're picking up the idea. A maintainer agent working through a batch of fixes (our tracking thread GSTA-804) will first reproduce the problem on current main. If it reproduces, the agent rebuilds the fix on main with you credited as co-author, because we don't merge outside branches directly, and we'll close this PR with a link when it lands. If it no longer reproduces, we'll close this and say what changed. |
|
Thank you! We rebuilt this change on current main in #4685, which is now merged, with you credited as co-author, so I'm closing this PR. Outside PRs get rebuilt rather than merged directly as part of our security process for code that runs. |
Users can now set
GSTACK_BRAIN_SOURCE_IDto pointgstack-decision-search --semanticat a registered artifacts source outside~/.gstack-brain-worktree, and its matching memory hits are appended to the decisions. Issue: #4327.Why (in your own words)
The semantic lookup found the curated-memory source only by a
local_paththat ends in.gstack-brain-worktree. A source that holds the same artifacts repo elsewhere, such as a clone on a machine that is also the brain host, was never found, and the block was silently absent.gstack-gbrain-source-wireupandgstack-gbrain-syncalready acceptGSTACK_BRAIN_SOURCE_ID, but the semantic lookup did not read it.This change gives the variable the precedence
gstack-gbrain-sync.ts:274-275uses:resolveMemorySourceIdreturns that id if a source with it is registered, andnullotherwise.The search stays scoped. An unregistered id degrades to the file results, never to an unscoped search, so the design
test/gstack-decision-semantic.test.tspins still holds. The doc comment that said "the caller then searches unscoped" is corrected, and the module header and thesemanticRecallcomment now describe the named source.Live evidence
The two new tests fail on
mainand pass on this branch. Output trimmed to the result lines:On a real install whose artifacts source is a host-side clone, run from this branch's checkout (the decision text and slugs are replaced):
Scope
lib/gstack-decision-semantic.ts: two lines inresolveMemorySourceId, and the three comments that describe how the source is found;test/gstack-decision-semantic.test.ts;test/gstack-decision-bins.test.ts: its--semantichelper drops an inheritedGSTACK_BRAIN_SOURCE_ID, which would otherwise bypass the shim's worktree source on a developer machine that exports it;changelog.d/semantic-source-id.md.bun test test/*decision*.test.ts: 235 pass, 1 skip, 0 fail, both with the variable unset and withGSTACK_BRAIN_SOURCE_ID=zzzexported);bun run typecheck:test(no new diagnostics);bun run typecheck;bin/gstack-prose-linton the fragment.GSTACK_BRAIN_SOURCE_IDnow gives no related block, where it used to be ignored in favor of the worktree source. This matchesgstack-gbrain-sync.ts:275.derive_source_idyields without a setting (option 2 in the issue);GSTACK_BRAIN_WORKTREE, which the semantic lookup still does not read.Liveness proof (required for external contributors)
Checklist
GSTACK PRtyped live into a real surface) or PR author is@garrytan(owner exemption)🤖 Generated with Claude Code