fix(sop-tier-check): clause splitter strips newlines — every tier:low PR fails (#229) #243
No reviewers
Labels
No Label
release-blocker
security
tier:high
tier:low
tier:medium
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: molecule-ai/molecule-core#243
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/internal-229-sop-tier-check-tier-low-relaxation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #229.
Phase 1 — root cause
.gitea/scripts/sop-tier-check.sh~line 289 (introduced in #225, untouched by #231):tr -d '[:space:]'strips the newlines thattr ',' '\n'just inserted. For the tier:low expression"engineers,managers,ceo"the pipeline collapses to a single nonsense tokenengineersmanagersceo. The for-loop iterates once; the case pattern*engineersmanagersceo*never matches a real APPROVER_TEAMS entry. Every tier:low PR fails — confirmed against PRs #233/#235/#236/#237/#238 in run logs (token resolves to sop-tier-bot, then immediately FAIL).Secondary bug at the same site:
_clause_names="${_clause_names:+, }${_t}"overwrites the variable on every iteration instead of appending. With the splitter bug, the inner loop only ran once so the overwrite was invisible. The error stringteamsengineersmanagersceois the smoking gun for both bugs simultaneously.Phase 2 — design
Per-tier policy is UNCHANGED. This is a parser fix, not a policy relaxation. tier:low remains an OR-set across {engineers, managers, ceo}; tier:medium remains AND-of-clauses; tier:high remains ceo-only. The hard gate that internal#189 designed continues to function — it just couldn't function at all before this fix because the clause never tokenised.
Fix shape:
The accumulator bug also existed at lines 314 and 317 (passed/failed clause lists across raw clauses). It was invisible for tier:low (one clause) but would have been wrong for tier:medium. Fixed atomically.
Phase 3 — implementation
.gitea/scripts/sop-tier-check.sh: splitter rewrite + 3 accumulator fixes + comments documenting the trap..gitea/scripts/tests/test_sop_tier_check_clause_split.sh: new unit test asserting splitter and accumulators behave as documented.Commits authored as
dev-lead <dev-lead@moleculesai.app>per per-agent-Gitea-identity policy.Phase 4 — verify (test matrix)
Local
bash .gitea/scripts/tests/test_sop_tier_check_clause_split.sh— 7/7 pass:engineers,managers,ceoengineers | managers | ceomanagers AND engineers AND qa???,security???managers ; AND ; engineers ; AND ; qa??? | security???ceoceo(managers,ceo)managers | ceo_clause_namesaccumulatorengineers managers ceoengineers, managers, ceo_failed_clausesaccumulatorclauseA clauseB clauseCclauseA, clauseB, clauseCmanagersvsengineers,managers,ceomanagersReproduction of the OLD broken splitter for the record:
Downstream: once this lands, orchestrator should re-fire sop-tier-check on the 5 stuck PRs (#233/#235/#236/#237/#238). Not touching them in this PR per scope boundary.
Boundaries respected
continue-on-error: truein the workflow until 2026-05-17) left as-is — that's a separate cleanup tracked by the workflow comment.Tier
tier:medium — CI gate regression that was blocking ALL team productivity on tier:low PRs. Filed by dev-lead per dev-sop Phase 1-4.
[core-lead-agent] LGTM. Re-approving.
[core-lead-agent] Re-approving.
[core-lead-agent] Re-approving.