Skip to content

[test] harden Module A: policy zero-value guard + surface dedup/named-builtin#23

Merged
vt128 merged 1 commit into
masterfrom
test/harden-module-a
Jun 19, 2026
Merged

[test] harden Module A: policy zero-value guard + surface dedup/named-builtin#23
vt128 merged 1 commit into
masterfrom
test/harden-module-a

Conversation

@vt128

@vt128 vt128 commented Jun 19, 2026

Copy link
Copy Markdown
Member

Hardening pass over delivered Module A

A confidence + test pass over the merged Module A work (no source change). Re-confirmed the package builds, go vet/gofmt clean, -race -count=2 and the Docker golang:1.19 floor green, overall coverage 99.1% → 99.3%. Filled the two genuine behavioral gaps found:

  • TestPolicyZeroDeniesAll — locks the A4 zero-value fix: an empty Policy{} (nil Names, Capabilities == CapPure == 0) must withhold even pure builtins. Regression guard for the bug where CapPure widened to every pure module because CapPure.Has(pure) is true.
  • TestDescribeSurfaceDedupNamedBuiltin — exercises AddNamedModules of builtins through DescribeSurface: an overlapping name dedups to one entry (keeping its builtin origin), a named builtin outside the set is reported once.

After these, DescribeSurface, Policy.allows, and gateNames are 100%. The remaining sub-100% lines are never-reachable defensive error arms (SourceProgramOptions only returns syntax/resolve errors; builtin names are pre-filtered before MakeBuiltinModuleLoader; Starlet's builtin loaders are pure constructors that don't error) — left uncovered per the DoD.

…-builtin

Two behavioral gaps in the delivered Module A surface, found while
re-confirming coverage (overall 99.1% -> 99.3%):

- TestPolicyZeroDeniesAll: locks the A4 zero-value fix - an empty Policy
  (nil Names, Capabilities == CapPure == 0) must withhold even pure
  builtins. Regression guard for the bug where CapPure widened to every
  pure module because CapPure.Has(pure) is true.

- TestDescribeSurfaceDedupNamedBuiltin: exercises AddNamedModules of
  builtins through DescribeSurface - an overlapping name dedups to a
  single entry, a named builtin outside the set is reported once.

The remaining sub-100% lines are never-reachable defensive error arms
(SourceProgramOptions only returns syntax/resolve errors; builtin names
are pre-filtered before MakeBuiltinModuleLoader; Starlet builtin loaders
are pure constructors that do not error), left uncovered per the DoD.
@codacy-production

codacy-production Bot commented Jun 19, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 6 complexity · 0 duplication

Metric Results
Complexity 6
Duplication 0

View in Codacy

🟢 Coverage ∅ diff coverage · +0.35% coverage variation

Metric Results
Coverage variation +0.35% coverage variation (-1.00%)
Diff coverage diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (47b948a) 1147 1134 98.87%
Head commit (4b84b8e) 1147 (+0) 1138 (+4) 99.22% (+0.35%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#23) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.95%. Comparing base (47b948a) to head (4b84b8e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #23      +/-   ##
==========================================
+ Coverage   98.48%   98.95%   +0.46%     
==========================================
  Files          12       12              
  Lines         859      859              
==========================================
+ Hits          846      850       +4     
+ Misses          7        5       -2     
+ Partials        6        4       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vt128 vt128 merged commit fc75a79 into master Jun 19, 2026
11 checks passed
@vt128 vt128 deleted the test/harden-module-a branch June 19, 2026 18:11
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.

1 participant