Skip to content

Phase 3: refactor — typed Decision, RBAC extraction, dead code removal#110

Merged
had-nu merged 1 commit into
mainfrom
phase-3-refactor
Jul 17, 2026
Merged

Phase 3: refactor — typed Decision, RBAC extraction, dead code removal#110
had-nu merged 1 commit into
mainfrom
phase-3-refactor

Conversation

@had-nu

@had-nu had-nu commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Changes

Decision typing:

  • Added model.Decision type with DecisionAllow, DecisionBlock, DecisionWarn constants
  • Replaced all raw "allow"/"block"/"warn" string comparisons on gating decision fields with typed constants across pkg/releasegate, pkg/statestore, pkg/report, cmd/evaluate, cmd/art14, cmd/aggregate, pkg/accept, and main.go

Dead code removal:

  • Removed deprecated exitcodes.Tampered alias (use IntegrityFailure instead)
  • Moved cmd/gen-sbom/ to tools/gen-sbom/ (standalone utility, not part of the wardex binary)

RBAC extraction:

  • Extracted duplicated RBAC profile override logic from main.go and evaluate_helpers.go into shared config.ApplyProfile

Verification

  • Full go build ./...: clean
  • Full go vet ./...: clean
  • Full go test ./...: 35 packages, 0 failures

@had-nu
had-nu force-pushed the phase-3-refactor branch from 5492a93 to 304d873 Compare July 17, 2026 11:36
- Add model.Decision type with DecisionAllow/Block/Warn constants
- Replace all raw string comparisons on Decision fields with typed constants
  (pkg/releasegate, pkg/statestore, pkg/report, cmd/evaluate,
   cmd/art14, cmd/aggregate, pkg/accept, main.go)
- Remove deprecated exitcodes.Tampered alias
- Move cmd/gen-sbom/ to tools/gen-sbom/
- Extract duplicated RBAC profile logic into config.ApplyProfile
- Replace inline RBAC blocks in main.go and evaluate_helpers.go with shared helper

Signed-off-by: hadnu <andre_ataide@proton.me>
@had-nu
had-nu force-pushed the phase-3-refactor branch from 304d873 to 4deda2f Compare July 17, 2026 11:41
@had-nu
had-nu merged commit 4333128 into main Jul 17, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant