Repository navigation
docs: two bugs from the phase 1b review, and the measured 1b verdicts - #370
Merged
Merged
Conversation
…verdicts Reviewing cmd/lore and cmd/writ for the issue #365 phase 1b decomposition surfaced two correctness defects. Both are recorded as their own issues and plans rather than folded into behavior-preserving refactoring work, where a semantic change would hide inside an extract-method diff. Issue #368 — lore deploy silently skips a manifest it cannot load. parseLoreDeployConfig logs the failure and continues, so the error return is dead and the //nolint:unparam on it documents a consequence as an intention. "lore deploy @typo.yaml some-package" deploys some-package and exits 0, having fulfilled half the request; "lore deploy @typo.yaml" reports "no packages to deploy", which is the wrong cause. Parsing precedes all deployment, so aborting costs nothing already done. Issue #369 — writ segment matching ignores its own suffix grammar. The grammar is [<project>|common][.<os>][.<distro>][.<arch>][.<custom>...] and segment.go:18 states it, but ParseDirName discards position and Match tests each suffix against one flat set of every dimension's values. So order is never validated (common.arm64.Darwin is accepted), position never selects a dimension, and specificity is a suffix count that cannot rank DISTRO above OS. common.Unix and common.Darwin both measure 1 on a Mac and tie; the tie is then resolved by sort.Slice, which is unstable, so the winner is undefined by contract. The phase 1b verdicts are recorded with measured gocyclo and gocognit for all nine targets. Ruling 5 is added: treatment is decided per function by whether it reads as steps. That produced five treatments rather than one — six extract, one flattens, one keeps an argued suppression, and applyGraphModifications needs no work at all (gocyclo 7, gocognit 8, under both thresholds; its directive suppresses nothing). buildMultiSource is deferred to #369. Its collision predicate at builder.go:280 has zero coverage, confirmed by make cover, and is reachable only through a tie whose winner is undefined. A behavior-preserving refactor of a predicate with no defined behavior is not possible. Phase 1a is marked completed — PR #367, bare nolint directives 18 to 9. Documentation only; no code changes. Issues: #365, #368, #369
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Records two correctness bugs found while reviewing
cmd/loreandcmd/writfor the issue #365 phase 1b decomposition, plus the measured verdicts for all nine phase 1b targets.Both bugs are their own issues and plans rather than folded into phase 1b — a semantic fix hidden inside an extract-method diff is exactly what the #312 discipline forbids.
Issue #368 —
lore deploysilently skips an unloadable manifestparseLoreDeployConfiglogs themanifest.Loadfailure andcontinues, which is why its error return is dead and why the//nolint:unparamon it documents a consequence as though it were an intention.lore deploy @typo.yaml some-package— deployssome-package, exits 0, having fulfilled half the request. CI wrapping this goes green.lore deploy @typo.yaml— reports "no packages to deploy", which is the wrong cause.Parsing completes before any deployment executes, so aborting costs nothing already done.
Issue #369 — writ segment matching ignores its own suffix grammar
The grammar is
[<project>|common][.<os>][.<distro>][.<arch>][.<custom>...]andsegment.go:18states it as the contract.ParseDirNamediscards position;Matchtests each suffix against one flat set of every dimension's values.common.arm64.Darwinis accepted.common.desktop.Darwinmatches withROLE=desktop.common.Unixandcommon.Darwinboth measure 1 on a Mac and tie.sort.Slice, which is unstable — the winner is undefined by contract.Phase 1b verdicts
All nine read in full and measured. Ruling 5 is added — treatment decided per function by whether it reads as steps — which produced five treatments rather than one:
promptForProvider,main,runOnboard,generateManifestextractFromFunction,buildMultiSourcefindPackagesbuildTreeapplyGraphModifications— gocyclo 7, gocognit 8, under both thresholdsbuildMultiSourceis deferred to #369: its collision predicate atbuilder.go:280has zero coverage (make coverreportsbuilder.go:280.45,282.7 1 0) and is reachable only through a tie whose winner is undefined.Phase 1a is marked completed — PR #367, bare
nolintdirectives 18 → 9.Documentation only; no code changes.