You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gaze init appends a second version marker instead of replacing the existing one #279
insertMarkerAfterFrontmatter (internal/scaffold/scaffold.go:111) unconditionally inserts <!-- scaffolded by gaze <version> --> after the YAML frontmatter. It never checks for or removes an existing <!-- scaffolded by gaze ... --> marker, so running gaze init again with a different build leaves BOTH markers in the file.
Repro
gaze init with a dev build → files get <!-- scaffolded by gaze dev -->.
gaze init (or --force) with a v1.8.0 build → files get <!-- scaffolded by gaze v1.8.0 --> inserted next to the dev marker instead of replacing it.
Evidence
snake-eyes .opencode/ scaffolded files (gaze-test-generator.md, gaze-fix.md, speckit.testreview.md, references/doc-scoring-model.md, references/example-report.md) each contain both <!-- scaffolded by gaze dev --> and <!-- scaffolded by gaze v1.8.0 -->.
Suggested fix
In insertMarkerAfterFrontmatter (or a pre-pass in Run), detect an existing <!-- scaffolded by gaze ... --> line and replace it in place instead of inserting a new one. Add a regression test that re-scaffolds over an already-scaffolded file and asserts exactly one marker remains.
funcTestInsertMarkerAfterFrontmatter_ReplacesExistingMarker(t*testing.T) {
content:= []byte("---\ntitle: test\n---\n<!-- scaffolded by gaze dev -->\n# Agent\n")
newMarker:="<!-- scaffolded by gaze v1.8.0 -->\n"result:=insertMarkerAfterFrontmatter(content, newMarker)
count:=strings.Count(string(result), "<!-- scaffolded by gaze")
ifcount!=1 {
t.Errorf("expected exactly 1 marker, got %d", count)
}
if!strings.Contains(string(result), "v1.8.0") {
t.Error("expected new version marker, not found")
}
ifstrings.Contains(string(result), "gaze dev") {
t.Error("old marker should have been replaced")
}
}
Related context
The handleToolOwnedFile path already compares content via bytes.Equal and overwrites on diff — but by the time it compares, the new content already has the new marker appended (without removing the old one from the existing file content read from disk). The fix belongs in insertMarkerAfterFrontmatter itself so that both the tool-owned overwrite path and the --force path produce clean single-marker output.
Labels: Bug label already applied; adding good-first-issue since the fix is well-scoped to a single function with a clear suggested approach.
Next steps:
/fs-code — agent creates a PR to implement this issue
/fs-code <your instruction> — agent implements with your specific guidance
Activity
fullsend-ai-triage commentedon Sep 23, 2026
🤖 Finished Triage · ✅ Success · Started 8:19 PM UTC · Completed 8:23 PM UTC
Commit:
6075877· View workflow run →Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $0.91
fullsend-ai-triage commentedon Sep 23, 2026
Proposed test case
Related context
The
handleToolOwnedFilepath already compares content viabytes.Equaland overwrites on diff — but by the time it compares, the new content already has the new marker appended (without removing the old one from the existing file content read from disk). The fix belongs ininsertMarkerAfterFrontmatteritself so that both the tool-owned overwrite path and the--forcepath produce clean single-marker output.Labels: Bug label already applied; adding good-first-issue since the fix is well-scoped to a single function with a clear suggested approach.
Next steps:
/fs-code— agent creates a PR to implement this issue/fs-code <your instruction>— agent implements with your specific guidancefullsend-ai-coder commentedon Sep 23, 2026
🤖 Finished Code · ✅ Success · Started 8:24 PM UTC · Completed 8:31 PM UTC
Commit:
6075877· View workflow run →Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.62
fix(#279): replace existing version marker instead of appending
fix(#279): remove stale version markers from scaffold assets
test(#279): add non-force re-scaffold regression case
fix(#279): exclude embedded assets from markdownlint
docs(#279): add retroactive openspec change for duplicate marker fix
Merge pull request #280 from unbound-force/agent/279-fix-duplicate-ma…