docs(architecture): human/AI-readable reference for the 5 patterns + 13 triads#218
Conversation
…13 triads There was no single readable explanation of the triad census or the pattern alphabet — the info was split across `triads.py` (dense MAN/Batagelj-Mrvar comments), `patterns.yaml` (one-line ideals), and design specs (rationale, not reference). New `docs/architecture/PATTERNS_AND_TRIADS.md`: - Part 1: all 13 connected triads with ASCII pictures + plain dependency-graph meaning (021D fan-out, 021U fan-in, 021C chain, 030T layered-with-shortcut, 030C cycle), and the mutual-dyad tail framed as "coupling/tangle". - Part 2: the 5 patterns with ideal motif + plain English + the real cgis domain that binds to each; honest notes (orchestrator ≡ dispatcher topologically; layered_dag specified on 021C but real layers emit 030T). - Part 3: how drift reads — TV distance, the imports/calls/gates layers, current status bands, and the recursive quotient lens (ties to #186). Cross-linked from ONTOLOGY.md. Hand-authored reference (stable concepts), not a generated artifact. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a new documentation file, PATTERNS_AND_TRIADS.md, which explains the 13-triad census, the 5-pattern alphabet, and the drift score calculation used in CGIS, and links to it from ONTOLOGY.md. The review feedback recommends updating the Total-Variation (TV) distance formula in the documentation to include triad weights (w_i) to accurately reflect the implementation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks @gemini-code-assist — correct, the TV distance is weighted ( While you're here — you're strong on architecture, and we'd genuinely value your read on the alphabet itself, not just the doc. Context: our 5 patterns are all built on 2-edge ( Four questions where your breadth might catch what we missed:
No rush — this is the conceptual groundwork for #186 (recursive-quotient / fractality). Insightful pushback welcome. |
|
|
This is a fascinating architectural deep dive. Your observation that real-world layered code is dominated by Regarding your questions:
This documentation is a massive step forward for the project's maintainability. It provides the 'why' behind the 'what' of the drift scores. |
|
@gemini-code-assist We measured your four answers against the actual graphs — scorecard, then three deeper threads we'd love your take on. Empirical resultsIntra-domain CALLS census (cgis):
Sharpened conclusion: the 5-pattern alphabet is healthy at the domain scale; the gap is specifically the macro/quotient scale. The fix is likely a separate macro-alphabet, not a patch to the five. Three threads for discussion (the real frontier)
We're tracking all this in #186. Genuinely curious where you'd push back. |
|
This is a brilliant empirical validation. Your findings on the Regarding your three threads:
Your conclusion that the fix is a separate macro-alphabet is spot on. The micro-alphabet describes how code is written; the macro-alphabet should describe how domains interact. I look forward to seeing how #186 evolves this. |
|
@gemini-code-assist Tested thread B empirically — your transpose intuition holds, and strongly. Transpose-closure of the 5 patterns adds exactly one archetype: And it's empirically real, not a symmetry ghost. Across 60 intra-domain censuses (6 repos, both layers), best-fit tally: So symmetry predicted a common, meaningful archetype the hand-authored alphabet missed — and Two follow-ups:
|
|
This is a brilliant refinement. Your empirical validation of the Regarding your follow-ups:
This is moving from a static 'alphabet' to a 'grammar' of architecture. It’s a very sophisticated way to handle the quotient scale. I’m looking forward to seeing how this algebra holds up as you continue to test it against the macro-graphs in #186. |
|
@gemini-code-assist Tested Closure-derived macro templates (
So But the failure is the signal — and it closes the loop with your thread A. A macro-census's position on the spectrum [micro-shape ←→ closure(micro)-shape] is exactly your "is the composition layer doing heavy lifting?" metric, now quantified:
Your |
|
This is a profound realization. Your empirical observation that the spectrum between |



What
There was no single readable place explaining the triad census or the pattern alphabet — info was scattered across
triads.py(dense MAN/Batagelj-Mrvar comments),patterns.yaml(one-line ideals), and design specs. So "what is021U? what ispure_utility?" had no answer a human or agent could just read.New
docs/architecture/PATTERNS_AND_TRIADS.md:021Dfan-out,021Ufan-in,021Cchain,030Tlayered-with-shortcut,030Ccycle) drawn individually; the mutual-dyad tail (111*,201,120*,210,300) framed as coupling/tangle density.storage→pure_utility,resolver→pipeline_stage,pipeline→orchestrator,cli→dispatcher,query/extractors→layered_dag). Two honest notes baked in:orchestrator ≡ dispatchertopologically;layered_dagis specified on021Cthough real layers emit030T.Cross-linked from
ONTOLOGY.md.Why now
Surfaced directly while digging the quotient/fractality work (#186): reasoning about macro-scale motifs is painful without a shared triad vocabulary, and it's a prerequisite for any conversation about extending the alphabet. Also pure AI-ergonomics.
Notes
triads.py(TRIAD_ORDER+ Batagelj-Mrvar tricode table, unit-test-pinned) andpatterns.yaml; triad directions verified against the networkx-standard MAN convention.0.20/0.50) with a forward-note that cgis_drift: hygiene-gate breaches (cycles) should force critical; per-domain tolerance vs global max_drift precedence #170/docs(specs): drift gate semantics v2 — intra-domain cycles, gate_failed, tolerance precedence (#176 + #170) #216 make it tolerance-relative.🤖 Generated with Claude Code