Skip to content

Break SDL↔processor cycle; add ADR-015 layering + size-cap gates - #53

Merged
Brad-Edwards merged 1 commit into
devfrom
38-MOD-001-improve-modularity-break-aces_sdl-aces_processor-cycle-add-policy-gates
May 10, 2026
Merged

Break SDL↔processor cycle; add ADR-015 layering + size-cap gates#53
Brad-Edwards merged 1 commit into
devfrom
38-MOD-001-improve-modularity-break-aces_sdl-aces_processor-cycle-add-policy-gates

Conversation

@Brad-Edwards

Copy link
Copy Markdown
Collaborator

Summary

  • Breaks the aces_sdl ↔ aces_processor circular import. aces_sdl/validator.py imported aces_processor.semantics.{objectives,workflow} while aces_processor.{compiler,manager,planner,models} imported aces_sdl.*. The two SDL-language semantics modules (objectives.py, workflow.py) move from aces_processor/semantics/ to aces_sdl/semantics/; planner.py stays in aces_processor (it reconciles compiled resources, a processor artifact). The aces.core.semantics.{objectives,workflow} compatibility wrappers retarget to the new locations, so the public aces.* surface is unchanged.
  • Adds ADR-015 and the policy gates that enforce it (tools/policy/repo_policy.py, config in tools/policy/adr_policy.yaml): a layering rule (aces_sdl/ may not import aces_processor[...], AST-scanned) and a 600-line cap on non-test source files under implementations/python/packages/, with a draining allowlist (tools/policy/oversized_allowlist.yaml) that must stay a subset of a code-anchored initial set and that can only be drained by actually splitting a file (not by editing the allowlist away). Malformed policy config (including an unparseable / non-mapping adr_policy.yaml) and out-of-tree changed/allowlist paths surface as structured failures (policy-config-malformed, policy-path-unsafe) rather than tracebacks; the config-wide reconciliation runs even on deletion-only diffs.
  • Adds the MOD-001 ("Codebase Modularity And Layering") requirement (a new modularity-initiative phase in tools/policy/requirement_order.yaml) as the Ground Control anchor for issue improve-modularity #3's modularity work — this PR is the cycle-break + size-cap-gate part; the 14 file splits are improve-modularity #3's child issues, which drain oversized_allowlist.yaml one entry at a time (the tracker closes when it's empty). Also: CHANGELOG 0.14.0, ADR-015 added to the index + toctree, and a docs/api/{sdl,processor}-semantics.rst split.

Review context

The gc_codex_review loop ran 4 verification passes past its cap (cycles 17–20, 5/3/3/3 findings) — every finding is dispositioned with a code fix + test or a documented design decision; all four dispositions are recorded as comments on #38. Notable: cycle-19's "move validate_workflow_step_result to the processor for layering purity" fix broke a compat surface, so it was reverted in cycle-20's pass (the function is pure and doesn't violate the layering rule wherever it lives); cycle-20's "add owning-package re-export shims" was declined per ADR-009/010 (the aces.* namespace is the one stable shim layer — see ADR-015 §1). nox -s verify is green (hygiene · policy · lint · contracts · 809 tests + 50 new policy-tool unit tests · docs).

Test plan

  • nox -s verify passes locally
  • 50 unit tests in implementations/python/tests/test_repo_policy_tools.py cover: the layering rule (all four import shapes + prefix-boundary + out-of-scope); the size cap (over/under/allowlisted/test-excluded/non-Python); the drain rule (subset of the code constant; config cannot grow the locked set; premature drain rejected; legitimate drain passes); the stale-allowlist-entry rule (below cap / missing / replaced by an out-of-tree symlink); required ADR-015 config blocks; malformed config including a parse-broken / non-mapping adr_policy.yaml; the unsafe-path chokepoint; and config-wide checks running on an empty changed list (deletion-only PRs)
  • aces.core.semantics.* namespace imports still resolve (no test changes needed); full pytest sweep (809 passed) exercises the moved modules via validator.py, compiler.py, manager.py
  • CI green on this PR
  • SonarCloud quality gate

Closes #38. Refs #3.

…gates

Moves the SDL-language semantics modules (objectives.py, workflow.py) from
aces_processor/semantics/ to aces_sdl/semantics/, breaking the circular import
that ran through aces_sdl/validator.py -> aces_processor.semantics.*. planner.py
stays in aces_processor (it reconciles compiled resources — a processor
artifact). The aces.core.semantics.* compatibility wrappers retarget to the new
locations; the public aces.* surface is unchanged.

Adds ADR-015 and the policy gates that enforce it (tools/policy/repo_policy.py):
- layering rule: aces_sdl/ may not import aces_processor[...] (AST scan)
- 600-line cap on non-test source files under packages/, with a draining
  allowlist (tools/policy/oversized_allowlist.yaml) that must stay a subset of
  a code-anchored initial set (_ADR015_INITIAL_OVERSIZED_FILES) and that must
  actually be drained by splitting the file, not just edited away
- config-wide reconciliation runs even on deletion-only diffs
- malformed policy config (incl. an unparseable/non-mapping adr_policy.yaml)
  and out-of-tree changed/allowlist paths surface as structured failures
  (policy-config-malformed, policy-path-unsafe) rather than tracebacks

Adds the MOD-001 ("Codebase Modularity And Layering") requirement
(modularity-initiative phase in requirement_order.yaml) as the anchor for
issue #3's modularity work, plus CHANGELOG 0.14.0 and the
docs/api/{sdl,processor}-semantics.rst split.

Refs #38, #3.
@Brad-Edwards
Brad-Edwards merged commit 8f5bd06 into dev May 10, 2026
3 checks passed
@Brad-Edwards
Brad-Edwards deleted the 38-MOD-001-improve-modularity-break-aces_sdl-aces_processor-cycle-add-policy-gates branch May 10, 2026 06:05
Brad-Edwards added a commit that referenced this pull request Jun 15, 2026
- Convert validator.py (4,139 lines) into a package of <=600-line per-seam mixin modules (core, runtime families, relationships, content/objectives, workflows, sections) behind an API-stable SemanticValidator re-export (#42).
- Pure refactor: methods moved verbatim; no validation behavior, diagnostics, pass ordering, exception type, or public-API change. The #38 cycle break (PR #53) is the satisfied ordering prerequisite.
- Adapt the error-vs-advisory boundary lint (test_sdl_diagnostic_boundary) to scan the package and aggregate methods across the composed mixins; its rules and synthetic negative-path fixture are unchanged, so the IMP-3/#505 control keeps full teeth. Rationale recorded on the issue.
- Remove validator.py from tools/policy/oversized_allowlist.yaml; repoint the F821 forward-ref per-file-ignore to validator/_sections.py.
- Repoint stale validator.py references in the semantic-coverage matrix (-> validator/__init__.py) and specs/formal prose (-> package) to the new layout.
@Brad-Edwards Brad-Edwards mentioned this pull request Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant