Summary
Follow-up from PR #224 review. Addresses 3 LOW advisory findings and 1 pre-existing test gap, all scoped to internal/scaffold/scaffold_test.go (and one URL in internal/scaffold/assets/dcp.jsonc).
Tasks
1. Extract hardcoded asset count to named constant
The magic number 9 appears across 8+ test assertion sites. Each new embedded asset requires a mechanical find-and-replace.
2. Complete TestRun_CreatesFiles expected file list
The on-disk existence check (line 48-56) enumerates only 7 of 9 files. Missing since before PR #224:
3. Add direct dcp.jsonc overwrite-on-diff coverage
TestRun_OverwriteOnDiff_ToolOwned modifies 2 .md tool-owned files and verifies restoration, but dcp.jsonc is only covered implicitly via count arithmetic.
4. Pin $schema URL (optional)
dcp.jsonc references master branch:
https://raw.githubusercontent.com/Opencode-DCP/opencode-dynamic-context-pruning/master/dcp.schema.json
A pinned commit SHA or version tag would be more stable. However, this is a DCP community convention for editor tooling — defer if upstream doesn't publish tagged releases.
Scope
- Files:
internal/scaffold/scaffold_test.go, optionally internal/scaffold/assets/dcp.jsonc
- Production code changes: None (test-only + optional asset URL)
- Spec required: No — test hygiene, no behavior change
Summary
Follow-up from PR #224 review. Addresses 3 LOW advisory findings and 1 pre-existing test gap, all scoped to
internal/scaffold/scaffold_test.go(and one URL ininternal/scaffold/assets/dcp.jsonc).Tasks
1. Extract hardcoded asset count to named constant
The magic number
9appears across 8+ test assertion sites. Each new embedded asset requires a mechanical find-and-replace.const expectedAssetCount = 9(or similar) inscaffold_test.go9count assertions with the constant2. Complete
TestRun_CreatesFilesexpected file listThe on-disk existence check (line 48-56) enumerates only 7 of 9 files. Missing since before PR #224:
".opencode/agents/gaze-test-generator.md"to the expected list".opencode/commands/gaze-fix.md"to the expected list3. Add direct
dcp.jsoncoverwrite-on-diff coverageTestRun_OverwriteOnDiff_ToolOwnedmodifies 2.mdtool-owned files and verifies restoration, butdcp.jsoncis only covered implicitly via count arithmetic..opencode/dcp.jsoncdcp.jsonccontent matches the raw embedded asset (no marker)4. Pin
$schemaURL (optional)dcp.jsoncreferencesmasterbranch:A pinned commit SHA or version tag would be more stable. However, this is a DCP community convention for editor tooling — defer if upstream doesn't publish tagged releases.
Scope
internal/scaffold/scaffold_test.go, optionallyinternal/scaffold/assets/dcp.jsonc