Skip to content

Project improvements: docs, TODO #6 fix, GazeCRAP pipeline wiring - #9

Merged
jflowers merged 10 commits into
unbound-force:mainfrom
jflowers:project-improvements
Feb 23, 2026
Merged

jflowers merged 10 commits into
unbound-force:mainfrom
jflowers:project-improvements

Conversation

@jflowers

Copy link
Copy Markdown
Collaborator

Summary

  • README overhaul: Add 4 missing commands (quality, schema, docscan, self-check), 7 missing flags, P3/P4 tiers to the side effect table, 4 missing packages to architecture section, and explicit Apache 2.0 license
  • Fix TODO Bridge AST-to-SSA name gap to reach 90% mapping accuracy (SC-003) #6 (AST-to-SSA bridge): Replace SSA register name matching with types.Object identity bridging for assertion-to-side-effect mapping. Accuracy jumps from 0% to 73.8% (31/42 assertions)
  • Wire quality pipeline into CRAP command: Both runCrap() and runSelfCheck() now compute contract coverage via buildContractCoverageFunc(), enabling GazeCRAP scores when test quality data is available
  • Spec relocation: Move specs/ from .specify/specs/ to project root, update all 17 cross-references
  • AGENTS.md: Add documentation validation gate to task completion workflow
  • Housekeeping: go mod tidy for Go 1.24+ indirect dep pruning

Changes by commit

Commit Type Description
docs: update README docs Add missing commands, flags, architecture packages, P3/P4 tiers
chore: go mod tidy chore Prune indirect deps for Go 1.24+
refactor: move specs/ refactor Relocate specs to project root, update 17 refs across 12 files
docs: add documentation validation gate docs Mandate doc impact assessment before marking tasks complete
fix: bridge AST-to-SSA name gap fix Core TODO #6 fix -- types.Object identity bridging + closure traversal
feat: wire quality pipeline feat buildContractCoverageFunc() for GazeCRAP in runCrap + runSelfCheck
docs: update GazeCRAP limitation docs Reflect pipeline wiring in README Known Limitations

Testing

  • Full test suite passes: go test -race -count=1 -short ./... (all 10 packages)
  • Mapping accuracy test (TestSC003_MappingAccuracy): 0% to 73.8% with 70% regression ratchet
  • Pre-existing flaky timing test (TestSC005_PackageAnalysisPerformance) occasionally fails on slow runs -- not related to these changes

TODO #6 Technical Details

Problem: matchAssertionToEffect() matched AST variable names (got, err) against SSA register names (t0, t1) -- these domains never intersect.

Fix: Three-part approach:

  1. AST assignment discovery: findAssignLHS() locates the AssignStmt containing the target call via position range checking
  2. Object identity mapping: Maps each LHS identifier's types.Object (from TypesInfo.Defs) to the corresponding return value side effect by index position
  3. Assertion matching: Resolves assertion expression identifiers via TypesInfo.Uses and matches by types.Object identity

Bonus: FindTargetCall now traverses MakeClosure instructions, supporting table-driven tests with t.Run sub-tests.

Remaining gap (11/42 unmapped): Helper function assertions and testify field-access patterns. These require parameter-to-argument tracing and selector expression decomposition -- tracked for future improvement.

…tails

Add documentation for quality, schema, docscan, and self-check commands.
Add missing flags for analyze (--classify, --interactive, --verbose,
--config, threshold overrides) and crap (--gaze-crap-threshold).
Add P3/P4 tiers to side effect table, missing internal packages to
architecture section, and explicit Apache 2.0 license reference.
Specs are project artifacts that should be visible at the top level,
not buried inside the .specify dotfile directory. Updates all 17
references across AGENTS.md, reviewer agents, doc-classifier agent,
and spec files themselves.
…orce#6)

Replace SSA register name matching with types.Object identity
bridging. The mapping engine now finds the AST assignment statement
containing the target call and maps LHS identifiers to return value
side effects by index position. Assertion expressions are matched
via TypesInfo.Uses object identity.

Also adds closure traversal in FindTargetCall to support table-driven
tests with t.Run sub-tests.

Mapping accuracy: 0% -> 73.8% (31/42). Remaining unmapped assertions
are in helper functions and testify field-access patterns.
Add buildContractCoverageFunc() that runs the quality pipeline
(analyze -> classify -> assess) across all target packages and
builds a ContractCoverageFunc callback for crap.Options.

Both runCrap() and runSelfCheck() now attempt to compute contract
coverage before CRAP analysis. If the quality pipeline fails for
any package (no tests, config errors), those packages are silently
skipped and classic CRAP is used as fallback.

The coverage lookup uses compound keys (shortPkg:qualifiedName) to
disambiguate across packages. Multiple tests exercising the same
target use the maximum coverage value.
Add .markdownlint.json and .yamllint.yml config files so markdownlint
and yamllint run with project-appropriate rules instead of overly strict
defaults. Fix unlabeled fenced code blocks (MD040) in AGENTS.md and
README.md, and exclude specs/ planning docs from markdownlint.
Revive flagged the parameter as unused. It was passed through from
MapAssertionsToEffects but never referenced in the function body.
golangci-lint already covers Go linting comprehensively. Revive ran in
per-file mode causing false positives for package-comments (Go only
requires one package doc comment, not one per file). Removing it
aligns CI with the local 'golangci-lint run' command documented in
AGENTS.md.
@jflowers
jflowers merged commit d5a2f6a into unbound-force:main Feb 23, 2026
3 checks passed
jflowers added a commit to jflowers/gaze that referenced this pull request Aug 12, 2026
- Fix skipped test data missing from report pipeline quality JSON:
  BuildPackageSummary only aggregates report-level data, so
  SkippedTests/SkippedTestNames are now set post-hoc in
  runQualityStep and propagated through ReportSummary (#2, unbound-force#5)
- Add combined threshold test for --min-contract-coverage +
  --max-over-specification both set on empty results (#1)
- Add divergence edge case test: SkippedTests > len(SkippedTestNames)
  verifies defensive guard prevents out-of-bounds (unbound-force#3)
- Extract shared MaxSkippedTestDisplay constant from quality package,
  replacing duplicate magic 20 in main.go and report.go (unbound-force#6)
- Move totalTestFuncs computation inside text format branch where
  it is actually used (unbound-force#8)
- Wrap WriteJSON/WriteText errors with context per CS-006 (unbound-force#9)
- Filed follow-up issue unbound-force#219 for multi-package mixed BDD+normal
  scenario test (unbound-force#4)
jflowers added a commit to jflowers/gaze that referenced this pull request Aug 13, 2026
- Fix skipped test data missing from report pipeline quality JSON:
  BuildPackageSummary only aggregates report-level data, so
  SkippedTests/SkippedTestNames are now set post-hoc in
  runQualityStep and propagated through ReportSummary (#2, unbound-force#5)
- Add combined threshold test for --min-contract-coverage +
  --max-over-specification both set on empty results (#1)
- Add divergence edge case test: SkippedTests > len(SkippedTestNames)
  verifies defensive guard prevents out-of-bounds (unbound-force#3)
- Extract shared MaxSkippedTestDisplay constant from quality package,
  replacing duplicate magic 20 in main.go and report.go (unbound-force#6)
- Move totalTestFuncs computation inside text format branch where
  it is actually used (unbound-force#8)
- Wrap WriteJSON/WriteText errors with context per CS-006 (unbound-force#9)
- Filed follow-up issue unbound-force#219 for multi-package mixed BDD+normal
  scenario test (unbound-force#4)
jflowers added a commit that referenced this pull request Aug 13, 2026
- Fix skipped test data missing from report pipeline quality JSON:
  BuildPackageSummary only aggregates report-level data, so
  SkippedTests/SkippedTestNames are now set post-hoc in
  runQualityStep and propagated through ReportSummary (#2, #5)
- Add combined threshold test for --min-contract-coverage +
  --max-over-specification both set on empty results (#1)
- Add divergence edge case test: SkippedTests > len(SkippedTestNames)
  verifies defensive guard prevents out-of-bounds (#3)
- Extract shared MaxSkippedTestDisplay constant from quality package,
  replacing duplicate magic 20 in main.go and report.go (#6)
- Move totalTestFuncs computation inside text format branch where
  it is actually used (#8)
- Wrap WriteJSON/WriteText errors with context per CS-006 (#9)
- Filed follow-up issue #219 for multi-package mixed BDD+normal
  scenario test (#4)
em-redhat pushed a commit to em-redhat/gaze that referenced this pull request Sep 1, 2026
- Fix skipped test data missing from report pipeline quality JSON:
  BuildPackageSummary only aggregates report-level data, so
  SkippedTests/SkippedTestNames are now set post-hoc in
  runQualityStep and propagated through ReportSummary (unbound-force#2, unbound-force#5)
- Add combined threshold test for --min-contract-coverage +
  --max-over-specification both set on empty results (unbound-force#1)
- Add divergence edge case test: SkippedTests > len(SkippedTestNames)
  verifies defensive guard prevents out-of-bounds (unbound-force#3)
- Extract shared MaxSkippedTestDisplay constant from quality package,
  replacing duplicate magic 20 in main.go and report.go (unbound-force#6)
- Move totalTestFuncs computation inside text format branch where
  it is actually used (unbound-force#8)
- Wrap WriteJSON/WriteText errors with context per CS-006 (unbound-force#9)
- Filed follow-up issue unbound-force#219 for multi-package mixed BDD+normal
  scenario test (unbound-force#4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant