Verify shared debug binding implementation

This commit is contained in:
2026-11-08 15:11:15 +00:00
parent 96c96bb793
commit 56e3b013f9
3 changed files with 28 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
# Shared debug binding implementation plan
Status: in progress; Stages 1–4 complete.
Status: complete; Stages 1–7 implemented and verified.
Baseline: `6727d22ce6e1ac668b56a3e6d8fa5f7a06e54d88`.
Execution audience: Luna coding agent.
@@ -290,6 +290,15 @@ and consumer guidance distinguishes input policy from reporting selection.
## Stage 7 — Verify the assembled sprint and record completion
**Complete.** The feature checklist has been reviewed against the implementation
and focused tests. Go 1.27.0 passed the independent core suite, the aligned
three-module workspace suite, and the concurrent mode-read test under the race
detector. The consumer snippet compiled, local documentation links and headings
were checked, and changed Go files were formatted. Optional interactive Zsh and
Fish checks remain deferred in future work. The v0.6.0 note is a candidate;
source completion does not publish a release. Completed planning records are
retired separately with this completed record retained in Git history.
1. Review every target/checklist item in the feature roadmap against the final
implementation and evidence. Ensure tests that formerly rejected all reserved
reporting bindings now allow only the selected boolean form. Review capture

View File

@@ -1,7 +1,7 @@
# Shared debug binding and reporting-mode access
Status: agreed scope and public behavior; not implemented. OD-1 and OD-2 are
resolved; no significant open decisions remain. The
Status: implemented and verified. OD-1 and OD-2 are resolved; no significant
open decisions remain. The
[implementation plan](implementation.md) owns the ordered stages and verification.
Baseline: `69257066e21c12ea3492237ebee072598adea60c`.
@@ -167,31 +167,30 @@ The table above supplies representative boundary expectations. The
[implementation plan](implementation.md) assigns test ownership and verification
under the [testing policy](../policy/testing.md).
- [ ] A registered application command receives the shared debug boolean and
- [x] A registered application command receives the shared debug boolean and
presence through normal typed input preparation, including when quiet or
verbose becomes the resolved reporting mode.
- [ ] The public query returns the selected mode without changing visibility;
- [x] The public query returns the selected mode without changing visibility;
cover zero value, retained invocation, and fresh selection on subsequent runs.
- [ ] Focused coverage establishes safe mode reads during existing concurrent
- [x] Focused coverage establishes safe mode reads during existing concurrent
reporter use, without asserting concurrent dispatch support.
- [ ] Exercise aliases, explicit false, repeated values, invalid booleans, and
- [x] Exercise aliases, explicit false, repeated values, invalid booleans, and
option-looking operands/values where they establish the new binding boundary.
Preserve existing failure precedence and no-handler-on-parse-failure behavior.
- [ ] A command with both shared debug and ordinary flags receives the correct
- [x] A command with both shared debug and ordinary flags receives the correct
values; help and completion describe one effective debug option. Exercise
representative capture/application composition and any affected rename path.
- [ ] Cover a true application default without debug reporting, explicit false
- [x] Cover a true application default without debug reporting, explicit false
overriding that default, and ordinary requiredness/presence behavior. Help
combines core and application explanations and distinguishes the application
default; local short spellings use existing collision and alias rules.
- [ ] The allowed boolean binding is accepted while unsupported/custom-parser
- [x] The allowed boolean binding is accepted while unsupported/custom-parser
debug declarations and other reserved reporting declarations retain their
ordinary validation. Metadata handling adds no debug-specific restrictions
beyond the selected boolean binding contract.
- [ ] GoDoc and consumer guidance distinguish boolean input from reporting
- [x] GoDoc and consumer guidance distinguish boolean input from reporting
mode, and canonical docs describe the implemented registration exception.
Canonical binding and invocation GoDoc, the CLI reference, consumer guidance,
and the applicable core release note will describe the implemented exception
and mode query. The implementation plan owns the steps to reach and verify
these criteria; the unchecked items remain future work.
and mode query. The implementation plan records the completed work and verification.

View File

@@ -325,9 +325,16 @@ func TestSharedDebugDeclarationValidation(t *testing.T) {
{BoolFlag[struct{}](FlagMeta{Name: "debug"}, false, nil)},
{BoolFlag(FlagMeta{Name: "debug", Short: "h"}, false, func(*struct{}, Supplied[bool]) {})},
{ValueFlag(FlagMeta{Name: "debug"}, (*bool)(nil), strconv.ParseBool, func(*struct{}, Supplied[bool]) {})},
{OccurrenceFlag(FlagMeta{Name: "debug"}, strconv.ParseBool, func(*struct{}, Supplied[bool]) {})},
} {
if _, err := New(Identity{Name: "Example"}, flagAliasCommand("bad", flags...)); err == nil {
t.Fatalf("invalid binding accepted: %#v", flags)
}
}
for _, name := range []string{"quiet", "verbose", "progress", "format"} {
flag := BoolFlag(FlagMeta{Name: name}, false, func(*struct{}, Supplied[bool]) {})
if _, err := New(Identity{Name: "Example"}, flagAliasCommand("bad", flag)); err == nil {
t.Errorf("reserved boolean --%s was accepted", name)
}
}
}