fix(architecture): straighten near-axis routes and constrain nested boundary frames (fixes #74) - #291
Open
SomSamantray wants to merge 1 commit into
Open
Conversation
…oundary frames (tt-a1i#74) Auto-routed connections with facing explicit sides and a perpendicular offset below 16px now render as one straight segment whenever the aligned route honors endpoint sides, keeps corner clearance, and clears all components. This removes the winding outside-channel doglegs that showcase previously approved. A new showcase-gated composition rule (composition/boundary-frame-clearance) rejects strictly-nested boundary frames whose edges sit less than 8px inside their containing frame (or cross it), with per-edge supported fixes. Standard and absent-profile documents are unchanged, and cross-cutting boundary scopes remain valid. Adds near-axis and boundary-composition regression tests, re-pads affected checked-in showcase examples, and regenerates gallery/delta/MCO artifacts and archify.zip.
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.
Problem and value
Fixes #74.
architecturediagrams can passvalidate --quality showcase(9/9, 0 errors) while visually broken in two ways:Because Archify's value is "agents author JSON, Archify compiles deterministically, and
showcasereceipts gate quality", both defects ship a green receipt for a visually broken artifact. This change makes the router emit the straight route when it is clear, and makesshowcasereject coincident/sub-8px nested frames with a stable machine-readable diagnostic.Scope
alignFacingPorts(architecture renderer) now aligns unspread explicit-side facing pairs whose perpendicular offset is below the 16px automatic-port-alignment delta, so a clear straight segment renders as a 2-point route. All preserved classes (both endpoints spread, explicitvia/channel/labelAt/non-autoroute, non-facing sides, offset >= 16px, blocked straight path) keep today's behavior.composition/boundary-frame-clearance: for strictly-nested boundary pairs (onewrapsset a strict subset of the other), any inner edge inset below 8px (or negative, i.e. crossing the containing frame) over an overlapping span is an error diagnostic with per-edgesupportedFixes(pad guidance on pad-adjustable left/right edges; member-movement guidance on top/bottom edges).archify/test/near-axis-routing.test.mjs(9 cases) andarchify/test/boundary-composition.test.mjs(11 cases).standardand absent-profile documents (the rule is gated to the effectiveshowcaseprofile, authored or forced).deployment-ownership-gated membership contract, all other diagram types, schemas, and the viewer.Stability impact
standardreceipts are unchanged. Ashowcasedocument with strictly-nested boundaries under the 8px inset now fails with an actionable diagnostic instead of silently passing.archify.zipregenerated from source.archify.zipwas rebuilt with the canonical Node 22 toolchain.deliver/validatereturn non-zero withdiagnostics[]entries (stable code, evidence,supportedFixes). Rollback is a revert of this commit; no migrations.Tests run
CLI repro checks (issue #74):
node bin/archify.mjs validate architecture <fixture> --quality showcase --json->ok: true, 2-point route.ok: falsewith onlycomposition/boundary-frame-clearancediagnostics.Visual evidence
Change is visual (routing and boundary-frame geometry). Automated evidence:
visual-checkondocs/gallery/artifacts/production-deployment.architecture.htmlanddocs/cases/mco-runtime.architecture.html:ok: true, readabilitypassat 1440x900 / 1600x1000 / 1920x1080 / 2048x1320 (contact sheets generated).examples/checkout-platform-delta.htmlreports vertical overflow, but byte-for-byte identically on baselinemain(a pre-existing tall delta-compare page; geometry unchanged by this PR).visual review: passed (automated)for the regenerated architecture artifacts; a human perceptual pass remains outstanding.Generated artifacts
Regenerated from source after the geometry changes (no hand edits):
archify.zip(canonical Node 22 build)docs/gallery.html,docs/gallery/manifest.json,docs/gallery/artifacts/production-deployment.architecture.html,docs/gallery/sources/production-deployment.architecture.jsondocs/assets/archify-live-proof.gif,docs/assets/archify-live-proof.jsondocs/cases/mco-runtime.architecture.html,experiments/mco-showcase/mco-runtime.html(byte-reproduced against the pinnedmcorepository revision via--repo-root)examples/checkout-platform-delta.html,examples/checkout-platform-delta.receipt.jsonUnapplied review findings
Review findings that need maintainer judgment were left unapplied and are listed below so they can be resolved on this PR (each is self-contained; none blocks the change above).
P1 — archify/renderers/architecture/render-architecture.mjs:410 — Equal-membership coincident frames still pass showcase (the boundary gate only fires for strict-subset memberships; two boundaries with identical
wrapsand identical pad render coincident frame rects and receive a green receipt).Suggested fix: under the effective showcase profile, also measure frame insets for pairs whose memberships are equal (not only strict subsets); report coincident or sub-8px edges with the same
composition/boundary-frame-clearancecode, and let equal membership with an adequate pad difference (real nesting) still pass.P2 — archify/renderers/architecture/render-architecture.mjs:358 — Shared-extreme bottom-flush guidance is unachievable (a frame's bottom edge is
maxY + boundaryExtraBottom, pad-independent; when both frames share their bottom-most member, moving that member moves both bottom edges together and the inset is invariant, so the "move the extreme wrapped member" supported fix cannot reach the 8px floor).Suggested fix: detect when the offending top/bottom extreme is a member shared by both frames and reword the supported fix to name the required membership change (add an exclusive member beyond the extreme, or remove the member from the nested
wraps), or suppress the top/bottom check for that shared-extreme case.P2 — archify/renderers/architecture/render-architecture.mjs:910 — Near-axis straightening can flip previously-green docs red by moving a connection label onto an obstacle (the straight two-point route pins the label in the corridor the old outside dogleg kept clear).
Suggested fix: when a straightened candidate's default label rect collides with a component or boundary title, fall back to the deterministic dogleg for that connection, or auto-place the label at the first clear offset; at minimum add a test with an obstacle adjacent to the straight corridor of a labeled near-axis pair.
P3 — archify/renderers/architecture/render-architecture.mjs:357 — Top-edge fix guidance omits the pad remedy above the 22px title-label floor.
Suggested fix: make the top-edge fix string conditional (offer pad guidance when the containing top pad exceeds the floor, member guidance otherwise) or document the floor interaction in the message.
P2 — archify/test/near-axis-routing.test.mjs:80 — Horizontal-facing (right/left) near-axis straightening is untested (all fixtures drive top/bottom pairs).
Suggested fix: add a right/left-facing near-axis repro asserting a 2-point shared-horizontal-axis route, plus a blocked horizontal corridor variant asserting the deterministic dogleg is kept.
P2 — archify/test/boundary-composition.test.mjs:76 — Authored-showcase profile path for the boundary gate is untested (every firing test forces the profile via CLI
--quality showcaseon docs with no authoredmeta.quality_profile).Suggested fix: add a doc with
meta.quality_profile: 'showcase'on a flush nested pair validated with no--quality(expect failure), and one forcing--quality standardover an authored-showcase flush doc (expect pass).P3 — archify/test/boundary-composition.test.mjs:376 — Crossing-frame negative-inset branch is untested.
Suggested fix: add a crossing test (inner pad >> outer clearance) asserting negative
insetPx, the crossing message, and correct per-edge supported fixes; if guidance is wrong for pad-induced crossing, correct the fix-selection for negative insets.Checklist
npm testinarchify/.