Skip to content

fix: normalise git_remote fallback so --include-unattributed guard fires (#2353) - #2360

Open
vryahn wants to merge 1 commit into
garrytan:mainfrom
vryahn:fix/2353-unattributed-guard
Open

fix: normalise git_remote fallback so --include-unattributed guard fires (#2353)#2360
vryahn wants to merge 1 commit into
garrytan:mainfrom
vryahn:fix/2353-unattributed-guard

Conversation

@vryahn

@vryahn vryahn commented Jul 27, 2026

Copy link
Copy Markdown

Problem

buildTranscriptPage stores the raw git remote ("" when resolution fails) in page.git_remote, while the frontmatter and slug already apply the "_unattributed" fallback. The skip guard compares against the fallback string:

if (!args.includeUnattributed && page.git_remote === "_unattributed") {

"" === "_unattributed" is always false, so the branch is dead: unattributable sessions import despite the default policy, and the skipped (unattrib) counter always reads 0.

Fix

Normalise once at the source (bin/gstack-memory-ingest.ts), matching what buildArtifactPage already does:

git_remote: remote || "_unattributed",

Test

Regression test in test/gstack-memory-ingest.test.ts: an unattributable session (cwd with no resolvable remote) run without --include-unattributed is skipped, reported as skipped (unattrib): 1, and never reaches the gbrain staging dir.

  • Verified the new test fails on main without the fix and passes with it.
  • Full test/gstack-memory-ingest.test.ts suite: 24 pass, 0 fail (bun 1.3.14, macOS).

The issue's optional suggestion (recovering attribution from the encoded transcript path) is left as a follow-up — this PR only fixes the dead guard.

Fixes #2353

🤖 Generated with Claude Code

…res (garrytan#2353)

buildTranscriptPage stored the raw git remote ("" on resolution failure)
in page.git_remote while the frontmatter and slug already used the
"_unattributed" fallback. The skip guard compares page.git_remote
against "_unattributed", so unattributable sessions always imported
and the skipped (unattrib) counter always read 0.

Normalise once at the source, matching what buildArtifactPage already
does. Adds a regression test: an unattributable session run without
--include-unattributed is skipped, counted, and never reaches the
gbrain staging dir.

Fixes garrytan#2353

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@trunk-io

trunk-io Bot commented Jul 27, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

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

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.

--include-unattributed is inert: the skip guard compares "" against "_unattributed", so unattributable sessions always import

1 participant