Skip to content

test(harness): add YAML nil-vs-empty unmarshaling semantics tests - #2129

Merged
ggallen merged 1 commit into
fullsend-ai:mainfrom
ggallen:worktree-pr7-yaml-semantics-tests
Jun 10, 2026
Merged

test(harness): add YAML nil-vs-empty unmarshaling semantics tests#2129
ggallen merged 1 commit into
fullsend-ai:mainfrom
ggallen:worktree-pr7-yaml-semantics-tests

Conversation

@ggallen

@ggallen ggallen commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds internal/harness/yaml_semantics_test.go pinning gopkg.in/yaml.v3 unmarshaling behavior for all Harness fields where nil-vs-empty semantics matter for base composition (PR 4) and forge merging (PR 1)
  • Tests exercise raw yaml.Unmarshal (no Validate(), no Load()) to document the library's contract, not harness validation logic
  • Covers slices (Skills, Plugins, Providers, AllowedRemoteResources), struct slices (HostFiles, APIServers), maps (RunnerEnv, APIServer.Env), pointer-to-structs (ValidationLoop, Security and all nested configs), and pointer-to-bools (all *bool fields in the security tree)

PR 7 of the ADR-0045 implementation plan. No dependencies — parallel with all other PRs.

Test plan

  • go test ./internal/harness/ -run TestYAMLSemantics -v — all 47 subtests pass
  • make go-test — full suite passes
  • make lint — clean

🤖 Generated with Claude Code

@fullsend-ai-review

fullsend-ai-review Bot commented Jun 10, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 4:10 PM UTC · Completed 4:17 PM UTC
Commit: 4ed6da4 · View workflow run →

@fullsend-ai-review

fullsend-ai-review Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review

Findings

No findings.

Previous run

Review

Findings

No findings.

Previous run (2)

Review

Findings

Low

  • [dead-code] internal/harness/yaml_semantics_test.go:20 — The sliceCase struct type is declared inside TestYAMLSemantics_Slices but never used. The test uses a different anonymous struct for the fields variable (with different field names and signatures). This is dead code from an earlier iteration of the table-driven test design.
    Remediation: Remove the unused sliceCase type declaration (lines 20–24).

  • [test-inadequate] internal/harness/yaml_semantics_test.go:297 — 5 SandboxHooks *bool fields (SecretRedactPostTool, UnicodePostTool, ContextSuppressPostTool, CanaryPreTool, CanaryPostTool) have zero test coverage in the file. 3 HostScanners *bool fields (ContextInjection, SSRFValidator, SecretRedactor) are checked for nil-when-absent in TestYAMLSemantics_NestedPointerStructs but not tested for explicit true/false unmarshaling in TestYAMLSemantics_PointerBools. The sandbox_hooks/empty_is_non_nil_zero subtest only asserts nil on Tirith, SSRFPreTool, and ToolAllowlistPreTool, omitting the other 5 *bool fields. Since all *bool fields share identical yaml.v3 semantics, practical risk is negligible — but the PR claims coverage of "all Harness fields where nil-vs-empty semantics matter."
    Remediation: Either add the missing *bool fields to TestYAMLSemantics_PointerBools and the sandbox_hooks/empty_is_non_nil_zero nil assertions, or soften the PR description to "representative fields" rather than "all fields."

Comment thread internal/harness/yaml_semantics_test.go Outdated
Comment thread internal/harness/yaml_semantics_test.go
@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Jun 10, 2026
@ggallen
ggallen force-pushed the worktree-pr7-yaml-semantics-tests branch from fe15fd8 to 5d20c6f Compare June 10, 2026 16:26
@fullsend-ai-review

Copy link
Copy Markdown

🤖 Review · Started 4:27 PM UTC
Commit: 4ed6da4 · View workflow run →

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

Site preview

Preview: https://ff192726-site.fullsend-ai.workers.dev

Commit: ed2d3d0abc9a57d7c99944a0b4a388cc08f30ee5

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge and removed ready-for-merge All reviewers approved — ready to merge labels Jun 10, 2026
@fullsend-ai-review

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 4:27 PM UTC · Completed 4:32 PM UTC
Commit: 4ed6da4 · View workflow run →

@ralphbean ralphbean left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. One minor note inline.

Comment thread internal/harness/yaml_semantics_test.go
Pin gopkg.in/yaml.v3 unmarshaling behavior for all Harness fields
where nil-vs-empty semantics matter for base composition and forge
merging (ADR-0045). Tests exercise raw yaml.Unmarshal without
Validate() to document the library's contract across slices, maps,
pointer-to-struct, and pointer-to-bool fields.

PR 7 of the ADR-0045 implementation plan.

Signed-off-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Greg Allen <gallen@redhat.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Jun 10, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 8:09 PM UTC · Completed 8:15 PM UTC
Commit: ed2d3d0 · View workflow run →

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge and removed ready-for-merge All reviewers approved — ready to merge labels Jun 10, 2026
@ggallen
ggallen added this pull request to the merge queue Jun 10, 2026
Merged via the queue into fullsend-ai:main with commit 1f0d66c Jun 10, 2026
12 checks passed
@ggallen
ggallen deleted the worktree-pr7-yaml-semantics-tests branch June 10, 2026 20:45
@fullsend-ai-retro

fullsend-ai-retro Bot commented Jun 10, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 8:48 PM UTC · Completed 8:54 PM UTC
Commit: ed2d3d0 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #2129 — test(harness): add YAML nil-vs-empty unmarshaling semantics tests

This PR followed a healthy workflow with good outcomes across all optimization lenses:

  • Review quality: The review bot caught two valid issues on the first pass (dead code and incomplete *bool field coverage). Human reviewer ralphbean added genuine value by suggesting explicit-null semantics tests — a nuanced edge case the bot missed. All feedback was actionable.
  • Rework rate: Two rounds of fixes (one for bot findings, one for human suggestion) — reasonable for the scope.
  • Token cost: Three review agent runs (~614 KB total artifacts). The second and third runs found no issues, which is expected after fixes were applied.
  • Time to resolution: ~4.5 hours from open to merge, with most time spent waiting for human review (~3.5 hours). Agent interactions were fast (7 minutes per review run).

No new proposals filed. All potential improvement areas are already covered by existing open issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge All reviewers approved — ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants