Skip to content

[US-263] feat: coupling-balance guideline + assess-coupling capability#381

Open
rucka wants to merge 4 commits into
mainfrom
feature/US-263-coupling-balance-assess-coupling
Open

[US-263] feat: coupling-balance guideline + assess-coupling capability#381
rucka wants to merge 4 commits into
mainfrom
feature/US-263-coupling-balance-assess-coupling

Conversation

@rucka

@rucka rucka commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

PR Information

PR Title: [US-263] feat: coupling-balance guideline + assess-coupling capability
Story/Epic: #263 (epic #209 — Code Quality & Testing foundations)
Type: Feature
Priority: Medium
Labels: user story

Summary

What Changed

Adds an original three-dimensional coupling model (integration strength × socio-technical distance × volatility + balance rule) as a KB guideline, plus the pair-capability-assess-coupling skill that applies it in two modes:

pair-capability-assess-architecture's reading list now includes the new guideline (version bump 0.5.0 → 0.6.0). Catalog counts, indexes, and website docs are updated everywhere the skill/guideline counts are asserted (39→40 total skills, 29→30 capability skills).

Why This Change

Fills the R7.5 "architecture quality" slot in the quality model: pair had no first-class way to reason about coupling quality (only ad hoc mentions). The model is deliberately original content (not a lift from a third-party framework) with its own DDD mapping, severity criteria, and fractal application, and follows the same two-mode (diff/full) shape already established by assess-cost (#226) and assess-security.

Story Context

User Story: As a team practicing DDD, I want a coupling-balance model and an assess-coupling capability, so integration quality (not just cost/security) is assessed at review and can be audited full-codebase for tech debt.

Acceptance Criteria:

  • AC1 — $scope: diff verdict flow (strength/distance/volatility → balance + severity)
  • AC2 — $scope: full audit flow (unbalanced+volatile only, tech-debt handoff, report)
  • AC3 — never a single-dimension decouple recommendation; graceful "not assessed" degradation
  • AC4 — volatility sourced from subdomain classification, never commit history alone; no-DDD-artifacts degrades to an estimate (never HALTs)
  • AC5 — guideline is original content (DDD mapping, fractal, test implications, coupling.dev bibliography), dataset + root mirror byte-identical, catalog/version updates

Changes Made

Implementation Details

  • Guideline: knowledge/guidelines/architecture/design-patterns/coupling-balance.md — the three-dimensional model, severity criteria, DDD pattern mapping, fractal application, test implications (contract + boundary tests), coupling.dev bibliography. Dataset + root mirror byte-identical.
  • Skill: pair-capability-assess-coupling SKILL.md — $scope: diff|full, always three-dimensional, volatility-from-subdomain (never commit history), no-DDD graceful estimate (never HALT), severity model, never-single-dimension-decouple rule, D22 verdict + "not assessed" degradation, full-mode report format (inline in the skill, no separate template — same pattern as the assess-security audit), tech-debt handoff tuples for /pair-capability-write-issue (assess-* skills are output-only; record-decision is the sole adoption writer (no scan-mode) #224).
  • assess-architecture wiring: reading list gains the new guideline at Step 2; version 0.5.0 → 0.6.0.
  • Distribution: design-patterns README index (dataset + root), catalog counts 29→30 capability / 39→40 total in next/SKILL.md, skills-guide.md, getting-started.md, way-of-working.md (dataset + mirror), 10 website docs (skills-catalog row + every "N skills" phrasing), count assertions in assess-cost.test.ts and docs-staleness-check.test.ts.
  • Conformance test: assess-coupling.test.ts — dataset+mirror invariants for the skill/guideline pair and catalog registration.

Files Changed

  • Added: .claude/skills/pair-capability-assess-coupling/SKILL.md, packages/knowledge-hub/dataset/.skills/capability/assess-coupling/SKILL.md, .pair/knowledge/guidelines/architecture/design-patterns/coupling-balance.md, packages/knowledge-hub/dataset/.pair/knowledge/guidelines/architecture/design-patterns/coupling-balance.md, packages/knowledge-hub/src/conformance/assess-coupling.test.ts
  • Modified: .claude/skills/pair-capability-assess-architecture/SKILL.md, .claude/skills/pair-next/SKILL.md (+ dataset mirrors), .pair/knowledge/getting-started.md, .pair/knowledge/guidelines/architecture/design-patterns/README.md, .pair/knowledge/skills-guide.md, .pair/knowledge/way-of-working.md (+ dataset mirrors), 10 apps/website/content/docs/**/*.mdx files, apps/website/lib/docs-staleness-check.test.ts, packages/knowledge-hub/src/conformance/assess-cost.test.ts

Testing

Test Coverage

  • Unit/Conformance Tests: new assess-coupling.test.ts (dataset+mirror skill/guideline invariants + catalog registration); existing assess-cost.test.ts and docs-staleness-check.test.ts updated for the new count.
  • Live full-audit dogfood ($scope: full, representative): the skill's algorithm was executed by hand against the pair repo (see the Dogfood section below). Bounded to the 5 most significant cross-module couplings — a representative run that proves the method works, not an exhaustive repo audit.

Dogfood — assess-coupling $scope: full applied to pair (representative)

Method per coupling-balance.md: each coupling scored on all three dimensions (integration strength × socio-technical distance × volatility), the balance rule combined strength+distance, volatility set the stakes, severity per the guideline's table. Integration points read from real code (imports/exports/data access), never the dependency-graph shape. Volatility sourced from .pair/adoption/product/subdomain/ (core→high, supporting→medium, generic→low); (est.) marks inferred values.

# Coupling Strength Distance Volatility Balance Severity
1 website ↔ knowledge-hub dataset (skills-catalog.mdx + all "N skills" phrasings ↔ dataset/.skills/) functional (hand-duplicated dataset facts: counts, catalog rows) high (separate deployables; deployed site has no live link — sync is hand-authored mdx, caught only at build/test) high (skills = Collaborative Workflow core; catalog churns on every skill add/rename — this very PR touched 10 mdx + count assertions) UNBALANCED — cascading changes CRITICAL
2 pair-cli ↔ knowledge-hub (KB distribution artifact) contract (pair-cli has zero code imports of knowledge-hub; consumes the published dataset tree + checksum manifest, validates shape via content-ops validateKBStructure) high (separate deployables, network/fs download + versioned cache, async) medium (est.) (distribution structure = Integration & Process Standardization, supporting; content churn rides under a stable structure) balanced (loosely-related kept apart) not a finding
3 knowledge-hub tools ↔ content-ops (transfer-dataset, skills-guide-mirror, check-broken-links@pair/content-ops) contract (published subpath exports only: fileSystemService, applyTransformCommands, rewriteSkillReferences, path ops — no internals) moderate (separate packages, same team, in-process build-time calls) medium (transform/marker contract = supporting) balanced not a finding
4 KB dataset source ↔ root .claude/.pair mirror (byte name-transform duplication) functional (same prose duplicated via deterministic name-transform) low (same repo, same team, same commit, edited together) high (skills core; mirror edited in this very PR) balanced (high strength kept at low distance — the "shared kernel, safe only when distance is low" case) tolerable note — balance is contingent on the #352 byte-parity guard (the boundary test that makes drift loud)
5 website ↔ brand (@pair/brand components, tailwind preset, tokens.css) contract (named public exports only) moderate (separate package, bundled at build, same team, in-process) low–medium (design system = generic/supporting) balanced (open-host/published-language: one contract for N consumers) not a finding

Triage: 5 couplings assessed → 1 critical, 4 balanced (1 with a tolerable contingency note). Matches the model's "few critical beat many minor" heuristic.

Critical finding (actionable tech-debt): website ↔ knowledge-hub dataset — the skills catalog + all "N skills" counts are hand-duplicated across ~10 website mdx files (exactly the multi-file sync cost this story's T6 paid). Rebalancing = reduce strength: generate the catalog rows + counts from the dataset at build time (single source of truth), making docs-staleness-check.ts the contract test that guarantees the derivation stays honest. NOT a "decouple" — splitting would raise distance without removing the duplication.

The method executed end-to-end against real code and resolved volatility from the subdomain adoption, proving the algorithm works. Diff-mode-on-a-real-PR verification (compose /pair-capability-assess-coupling $scope: diff into /pair-process-review step 2.3) is deferred to #228 (review-side wiring, now merged/in-flight); this PR authored the skill ready-to-compose.

Test Results

pnpm --filter @pair/knowledge-hub skills:conformance → PASS (40 skills conformant)
pnpm --filter @pair/knowledge-hub test              → 409 passed / 19 files (incl. assess-coupling.test.ts) + link check PASS (dataset + root .pair)
pnpm --filter @pair/website docs:staleness          → PASS (40 skills, 8 commands)
website vitest run lib/docs-staleness-check.test.ts → 26 passed (40 skills)
turbo run ts:check lint --filter @pair/knowledge-hub --filter @pair/website → 5/5 successful (FULL TURBO)

Mirror parity: coupling-balance.md and design-patterns README.md are byte-identical root↔dataset; the assess-coupling SKILL mirror is the expected deterministic name-transform of the dataset source. This parity is not asserted by assess-coupling.test.ts — that conformance test only checks keyword/invariant presence in each copy, not byte/transform equality. Guideline & skill mirror parity is verified centrally by the #352 mirror-equality guard (the transfer-dataset name-transform + byte-parity check in packages/knowledge-hub/src/tools, run in CI), corroborated here by a manual root↔dataset diff on the lines changed in this PR.

Quality Assurance

Review Areas

  • Business Logic: verify the coupling model (strength/distance/volatility, balance rule) matches the AC set and isn't a restatement of a third-party framework (AC5 originality check).
  • Code Structure: skill follows the established $scope: diff|full shape from assess-cost/assess-security.
  • Testing: conformance test covers dataset/mirror parity + catalog counts.

Deployment Information

No deployable package is touched — this PR only changes packages/knowledge-hub (KB dataset/skills), .pair//.claude/ mirrors, and apps/website docs content. No environment/config/migration impact.

Documentation

Documentation Updates

  • New guideline (coupling-balance.md) + skill (assess-coupling) added to all catalogs, indexes, and website docs where skill/guideline counts and lists are asserted.

Notes for the Reviewer (not visible from the checkpoint)

  1. Review-side wiring deliberately deferred to Extended code-review template (security + cost, reading budget) #228. This story's scope directive explicitly excludes touching the code-review template / /pair-process-review — that's Extended code-review template (security + cost, reading budget) #228's lane (extended code-review template). assess-coupling is authored ready-to-compose: same $scope: diff|full interface, same D22 verdict shape, and a "Composition Interface" note at the end of the SKILL body describing exactly how step 2.3 + an "Architecture" row would invoke it, mirroring how assess-cost (pair-capability-assess-cost — multi-provider cost class at review #226) was authored ready-to-compose ahead of Extended code-review template (security + cost, reading budget) #228 wiring it in. No code in this PR touches the review template or packages/knowledge-hub/src/tools (tech-debt: extend mirror-equality guard to per-skill SKILL.md pairs (all 36 skills) #352's lane) — isolation was checked file-by-file (see below).
  2. Catalog counts (39→40 total / 29→30 capability skills) are bumped in multiple KB/dataset/website files in this PR. Two other stories are in flight in parallel worktrees touching the same counters: Extended code-review template (security + cost, reading budget) #228 (code-review template) and pair-capability-verify-quality integrated with the gate matrix (local = CI) #259 (verify-quality gate matrix) may also bump these counts. If a merge/rebase conflict shows up on these count lines, resolve by re-adding this PR's +1 on top of the other's +1 (sum the deltas) — don't silently revert either side's count.
  3. Full-audit dogfood run (representative). assess-coupling $scope: full was applied by hand (the skill is LLM-executor instructions, not runnable code — ADL 2026-07-13-gate-tooling-code-in-tested-modules.md, so there's no CLI to invoke) to the 5 most significant cross-module couplings in pair; results are in Testing → Dogfood above. It surfaced one critical finding (website↔dataset catalog duplication — actionable tech-debt: derive the catalog from the dataset) and four balanced couplings, proving the method executes end-to-end. Diff-mode-on-a-real-PR (compose into /pair-process-review step 2.3) is deferred to Extended code-review template (security + cost, reading budget) #228.
  4. No ADR/ADL recorded for this PR — the refinement session already recorded the relevant decisions (D36: original reimplementation, no external plugin composition; D37: model lives in ONE guideline; D38: consumers are map-* templates/review diff/full audit/risk classification; D39: this story fills the R7.5 slot, no new epic). This PR implements the already-refined story; no new architectural decision was made during implementation.
  5. Isolation verified: 28 files changed, none under the code-review template or /pair-process-review (Extended code-review template (security + cost, reading budget) #228's lane), none under packages/knowledge-hub/src/tools (tech-debt: extend mirror-equality guard to per-skill SKILL.md pairs (all 36 skills) #352's lane) — only packages/knowledge-hub/src/conformance/*.test.ts files were touched there, which is in-scope for this story.
  6. Story has no classification tags on the GitHub issue (checked gh issue view 263 — only the user story label is present), so no tags were copied to this PR; classification will happen fresh in review (G6).

Rebalance in-place del finding CRITICAL del dogfood (commit 02efd4d)

Il dogfood assess-coupling $scope: full di questa PR ha rilevato un coupling CRITICAL website↔knowledge-hub dataset (skills-catalog + conteggi duplicati a mano su ~10 mdx). Rimediato qui, in-place (chiusura dogfood→fix):

  • Nuovo checkCatalogContent (Check 2c) in apps/website/lib/docs-staleness-check.ts: il contenuto delle righe del catalogo (Command + Description) è ora derivato dal frontmatter di ogni SKILL.md del dataset e CI-enforced → una modifica alla description di una skill non rispecchiata nel catalogo fa fallire il gate. (I conteggi "N skills" e la presenza-riga erano già enforced dai Check 1 e 2.)
  • skills-catalog.mdx riconciliato al dataset (descrizioni single-sourced; drop delle code cross-ref hand-written).
  • +17 unit test white-box (docs-staleness-check.test.ts, 43 totali). docs:staleness PASS — 40 skills in sync.

Rebalance = riduzione della strength: il catalogo diventa una proiezione del dataset con contratto CI, non una copia parallela a rischio drift. Verifica diff-mode-su-PR-reale della skill resta deferita a #228.

Architecture-quality slice (R7.5): the three-dimensional coupling model
plus a capability skill that applies it at review and as a full audit.

- Guideline architecture/design-patterns/coupling-balance.md — the single
  home of the model (D37): integration strength (intrusive>functional>
  model>contract) x socio-technical distance x volatility (essential vs
  accidental, from subdomain classification, never commit history), the
  balance rule, severity, DDD-pattern mapping, fractal application, test
  implications, coupling.dev bibliographic reference. Original wording.
- pair-capability-assess-coupling: $scope diff|full. diff = output-only
  review verdict (D22, never blocks); full = codebase audit flagging only
  unbalanced+volatile integrations, writes .pair/working/reports/
  architecture/, hands tech-debt tuples to /write-issue (#224). Reads real
  integration points; never a single-dimension decouple; no-DDD degrades
  (estimate volatility), never HALT.
- assess-architecture reading list gains the guideline (informs pattern
  scoring); design-patterns README indexes it.
- Distribution: .claude mirror, next + skills-guide catalog (30 capability
  / 40 total), website docs, conformance test; count bumps in dependent
  gates/tests.

Out of scope (per directive): review step 2.3 wiring + Architecture row in
the review template are #228's lane; skill authored ready-to-compose.

Refs: #263
@github-actions
github-actions Bot temporarily deployed to Website Preview July 24, 2026 11:15 Inactive
@rucka

rucka commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Code Review — PR #381

Review Information

PR Number: #381
Author: rucka (Gianluca Carucci)
Reviewer: Independent reviewer (/pair-process-review)
Review Date: 2026-07-24
Story/Epic: #263 (epic #209 — Code Quality & Testing foundations)
Review Type: Feature (KB guideline + capability skill)
Estimated Review Time: ~45 minutes

Review Summary

Overall Assessment

  • Approved
  • Approved with Comments
  • Request Changes — DoD validation items unperformed; scope split needs sign-off
  • Comment Only

Key Changes Summary

Adds the original three-dimensional coupling model (integration strength × socio-technical distance × volatility + balance rule) as a KB guideline (coupling-balance.md), plus the pair-capability-assess-coupling capability skill ($scope: diff|full). Wires the guideline into assess-architecture's reading list (0.5.0→0.6.0), registers the skill in pair-next, and bumps skill counts (39→40 total / 29→30 capability) across KB prose, dataset mirrors, and 10 website docs. New conformance test assess-coupling.test.ts; count assertions updated in assess-cost.test.ts and docs-staleness-check.test.ts.

Business Value Validation

The guideline is genuinely original content that fills the R7.5 "architecture quality" slot, correctly attributes the coupling.dev framing as bibliography, and maps the model onto the DDD patterns already in the KB. The skill faithfully encodes the model's operational rules (three-dimensional always, never single-dimension decouple, volatility-from-subdomain, no-DDD graceful estimate, D22 verdict shape). Value is real — but the review-time delivery that the story frames its ACs around is deferred (see Major #1), and no execution/dogfood evidence exists (Major #2).

Code Review Checklist

Functionality Review

  • [~] Requirements Met — AC3/AC5 met at guideline/skill level; AC1/AC2/AC4 (review-time behavior) not end-to-end demonstrable — deferred to Extended code-review template (security + cost, reading budget) #228 (Major Setup & Project Management Integration #1).
  • Business Logic — model + severity + balance rule are internally coherent and match the story's Business Rules (core→high/supporting→medium/generic→low; tolerable never blocks; three dimensions mandatory).
  • Integrationassess-architecture reading list + pair-next catalog updated; composition interface documented.
  • Error Handling — no-DDD, single-module, huge-diff, capability-absent, missing-guideline edge cases all covered in prose.

Code Quality Assessment

  • Readable, well-structured skill following the established assess-cost/assess-security two-mode shape.
  • [~] Reusability / single source of truth — Step 4.1/4.2 restate the balance rule + severity criteria the skill claims (Notes) never to duplicate (Minor Adoption Management & Guideline Linking #3 / D37).

Technical Standards Compliance

  • Resolution cascade, graceful degradation, D-references (D14/D21/D22/D37), output-only contract all consistent with siblings.
  • Dataset↔root byte-identity verified: coupling-balance.md identical; design-patterns README.md identical; skill mirror is the expected deterministic name-transform (both 193 lines).
  • Skill counts consistent everywhere (40 total / 30 capability / 9 process + 30 + 1); no stale 39/29 left in repo; frontmatter within size gate (combined 786 ≤ 1024).

Security Review

Verdict: green — 0 findings (0 introduced). Diff is Markdown KB/skill/docs + TypeScript count assertions only. No runtime code, no dependencies, no secrets, no auth/data-handling surface. No manual concerns.

Testing Review

  • New assess-coupling.test.ts — dataset+mirror keyword invariants + catalog registration (30/40). Green per PR.
  • [~] Behavioral coverage: none. The conformance test asserts keyword presence, not behavior; the skill (diff/full algorithms) has never been executed. DoD QA items (dogfood full audit, diff-mode on a real PR, degradation paths) are unperformed (Major Collaborative Knowledge Base #2).
  • [~] The PR states byte-identity is "enforced by assess-coupling.test.ts" — the test does not assert byte-identity or name-transform parity (Minor Workflow Customization #4). Fact is correct (verified manually); the enforcement claim is overstated.

Documentation Review

  • Catalog rows + counts updated in skills-guide.md, getting-started.md, way-of-working.md, pair-next, and skills-catalog.mdx (new row present) — consistent with catalog-only docs convention (siblings have no dedicated per-skill page either).
  • [~] skills-catalog.mdx "Last updated: 2026-07-19" not bumped though the file changed (Minor Advanced Features Enablement #5).

Detailed Review Comments

Positive Feedback

  • Guideline is high-quality, genuinely original prose with correct bibliographic attribution and a sharp DDD-pattern mapping (ACL as strength-reducer, aggregates as low-distance-where-strength-must-stay-high). AC5 originality is met.
  • Rebalancing section correctly forbids single-word "decouple" and explains why (decomposition raises distance) — a subtle, correct point.
  • Mirror/dataset parity and count sweeps are meticulous; no stale counts anywhere.

Major Issues 🔍

Minor Issues 💡

  • SKILL.md:79-80 — Step 4.1/4.2 restate the balance rule and the full severity criteria near-verbatim, though Notes (line 189) claim the skill "never duplicate[s] the … balance rule, or severity criteria" and AC5/D37 require the model to live only in the guideline. Creates a drift surface. Replace the reproduced conditions with a reference to the guideline table, or soften the Notes claim.
  • PR description (Testing) / assess-coupling.test.ts — "byte-identity … enforced by assess-coupling.test.ts" overstated; the test checks keyword presence in both copies, not parity. Either add expect(GUIDELINE_MIRROR).toBe(GUIDELINE_DATASET) + a name-transform parity assertion, or correct the description. (Matches the existing assess-cost.test.ts convention, so the test design itself is by-convention.)
  • apps/website/content/docs/reference/skills-catalog.mdx:8 — "Last updated: 2026-07-19" not bumped despite the catalog changing in this PR.

Questions ❓

  • Was assess-coupling $scope: full ever executed against this repo, even once, to confirm the algorithm produces a sensible report/verdict? If a run exists, please attach the triaged findings; if not, see Major Collaborative Knowledge Base #2.

Risk Assessment

Risk Impact Probability Mitigation
Skill never executed → latent prose bugs surface only when #228 wires it in Med Med Dogfood full-scope now; record findings
Severity/balance-rule restatement in skill drifts from guideline Low Low Reference the guideline table instead of reproducing it
Count-line merge conflict with #228/#259 (parallel worktrees) Low Med PR note 2 documents the sum-the-deltas resolution

Adoption Compliance

Level: full (manual inline check). Follows the two-mode assess-* convention, D14 report-write exception, D37 single-home rule (with the Minor #3 caveat), D22 verdict shape, output-only-for-adoption contract. No new dependency, no new architectural decision → no ADR required (refinement D36-D39 already cover the decisions). Compliant.

Follow-up Actions

Author Action Items

  • High — Run assess-coupling $scope: full on the pair repo, record triaged findings in the PR (or get PM sign-off to defer QA to Extended code-review template (security + cost, reading budget) #228).
  • Low — De-duplicate Step 4.1/4.2 vs the guideline (D37) or soften the Notes claim.
  • Low — Correct the byte-identity enforcement claim (or add the parity assertion); bump the skills-catalog "Last updated" date.

Human Merge Gate


REVIEW COMPLETE:

@rucka

rucka commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Code Review — PR #381

Review Information

PR Number: #381
Author: rucka (Gianluca Carucci)
Reviewer: Independent reviewer (/pair-process-review)
Review Date: 2026-07-24
Story/Epic: #263 (epic #209 — Code Quality & Testing foundations)
Review Type: Feature (KB guideline + capability skill)
Estimated Review Time: ~45 minutes

Review Summary

Overall Assessment

  • Approved
  • Approved with Comments
  • Request Changes — review-time ACs (AC1/AC2/AC4) not wired + no behavioral validation of AC3; both need author action or explicit PM sign-off to defer
  • Comment Only

Key Changes Summary

Adds the original three-dimensional coupling model (integration strength × socio-technical distance × volatility + balance rule) as a KB guideline (coupling-balance.md), plus the pair-capability-assess-coupling capability skill ($scope: diff|full). Wires the guideline into assess-architecture's reading list (0.5.0→0.6.0), registers the skill in pair-next, and bumps skill counts (39→40 total / 29→30 capability) across KB prose, dataset mirrors, and 10 website docs. New conformance test assess-coupling.test.ts; count assertions updated in assess-cost.test.ts and docs-staleness-check.test.ts.

Business Value Validation

The guideline is genuinely original content that fills the R7.5 "architecture quality" slot, attributes the coupling.dev framing as bibliography (not lifted), and maps the model onto the DDD patterns already in the KB (ACL as strength-reducer, aggregates as low-distance-where-strength-must-stay-high). The skill faithfully encodes the model's operational rules. Value is real — but the review-time delivery the ACs are phrased around is deferred (Major #1) and no execution/dogfood evidence exists (Major #2).

Code Review Checklist

Functionality Review

  • [~] Requirements Met — AC5 met (original guideline, byte-identical mirror). AC3 specified but never exercised (Major Collaborative Knowledge Base #2). AC1/AC2/AC4 are all phrased "when review runs …" — the review-time composition + Architecture template row are absent, deferred to Extended code-review template (security + cost, reading budget) #228 (Major Setup & Project Management Integration #1).
  • Business Logic — model + severity + balance rule are internally coherent and match the story Business Rules (core→high / supporting→medium / generic→low; tolerable never blocks; three dimensions mandatory; never single-dimension decouple).
  • Integrationassess-architecture reading list + pair-next catalog + design-patterns README index updated; composition interface documented. classify/quality-model/review on main already forward-reference /assess-coupling + a "Coupling balance" dimension.
  • Error Handling — no-DDD estimate, single-module "not applicable", huge-diff scoping, capability-absent, missing-guideline first-principles edge cases all covered in prose.

Code Quality Assessment

  • Readable, well-structured skill following the established assess-cost/assess-security two-mode shape.
  • [~] Single source of truth — Step 4.1/4.2 restate the balance rule + full severity criteria inline, contradicting the skill's own Notes claim (line 189) and D37/AC5 (Minor Setup & Project Management Integration #1).

Technical Standards Compliance

  • Resolution cascade, graceful degradation, D-references (D14/D17/D21/D22/D37), output-only-for-adoption contract all consistent with siblings.
  • Dataset↔root byte-identity verified independently: coupling-balance.md identical; design-patterns README.md identical; skill mirror is the expected deterministic name-transform (both 193 lines).
  • Skill counts verified against the real corpus: 9 process + 30 capability + /pair-next = 40. No stale 39/29 anywhere in .pair, .claude, apps/website/content, dataset, or src.

Security Review

Verdict: green — 0 findings (0 introduced). Diff is Markdown KB/skill/docs + TypeScript count assertions only. No runtime code, no dependencies, no secrets, no auth/data-handling surface. No manual concerns.

Testing Review

  • New assess-coupling.test.ts — dataset+mirror keyword invariants + catalog registration (30/40); green per PR.
  • [~] Behavioral coverage: none. The conformance test asserts keyword presence, not behavior. The diff/full algorithms have never been executed. Story DoD QA items (dogfood full audit on the pair repo, diff-mode on a real PR, degradation paths) are unperformed (Major Collaborative Knowledge Base #2). "No CLI to invoke standalone" conflates automation with dogfooding$scope: full is LLM-invocable now.
  • [~] PR description states byte-identity is "enforced by assess-coupling.test.ts" — the test does not assert byte-identity or name-transform parity, only keyword presence (Minor Adoption Management & Guideline Linking #3). The fact is true (verified manually); the enforcement claim is overstated.

Documentation Review

Detailed Review Comments

Positive Feedback

  • Guideline is high-quality, genuinely original prose with correct bibliographic attribution and a sharp DDD-pattern mapping. AC5 originality is met.
  • Rebalancing section correctly forbids single-word "decouple" and explains why (decomposition raises distance) — a subtle, correct point.
  • Mirror/dataset parity and count sweeps are meticulous; byte-identity and counts verified independently with zero drift.

Major Issues 🔍

  • .claude/skills/pair-capability-assess-coupling/SKILL.md:166 (+ absence of any /pair-process-review / code-review-template change) — The review-time path is not wired: /pair-process-review step 2.3 does not compose /assess-coupling, the skill is not in the Composed Skills table, and code-review-template.md has no Architecture verdict-first row (only a generic "Architecture" checkbox). Story AC1/AC2/AC4 are all phrased "when review runs …", so their central reviewable value is not exercised by this PR. The template row genuinely belongs to Extended code-review template (security + cost, reading budget) #228 (OPEN — "Extended code-review template"), which the story lists as a prerequisite — so the row cannot be built here. BUT the story's own task breakdown assigns T3 (step 2.3 extension) to this story and maps T3→AC1/AC4 — a contradiction only a human/PM can resolve. Recommendation: obtain explicit merge-gate sign-off that AC1/AC2/AC4 review-rendering is accepted as delivered by Extended code-review template (security + cost, reading budget) #228; otherwise wire step 2.3 here.
  • PR "Testing" section + story DoD (AC3) — DoD QA items unperformed: full-audit dogfood on the pair repo (PR admits not run), diff-mode verification on a real PR, degradation-path verification (inspection only). AC3 ("$scope: full runs → audit completes, only unbalanced+volatile flagged") is therefore not verified — the conformance test proves keywords exist, not that the algorithm completes or filters correctly. This is not gated by Extended code-review template (security + cost, reading budget) #228: $scope: full is standalone-invocable now. Recommendation: run the full-scope audit on this repo in this PR and record the triaged findings, or obtain explicit PM sign-off to defer the QA items.

Minor Issues 💡

  • SKILL.md:79-80 — Step 4.1/4.2 reproduce the balance rule and the full severity criteria near-verbatim, while the Notes bullet (line 189) claims the skill "never duplicates the … balance rule, or severity criteria" and AC5/D37 require the model to live only in the guideline. This is an internal contradiction and a drift surface. Replace the reproduced conditions with a reference to the guideline's Balance-Rule/Severity tables, or soften the Notes claim.
  • .pair/knowledge/guidelines/quality-assurance/quality-model.md:43,167 — Both refer to coupling-balance.md as "(not yet published)". This PR publishes it (and Quality model document (3 layers + 3 pillars + default classification rules + taxonomy) #221, which owns quality-model.md, is CLOSED — no open story to defer to). Drop "not yet published" in both places so the taxonomy/§3.1 cross-refs stay accurate.
  • PR description (Testing) / assess-coupling.test.ts — "byte-identity … enforced by assess-coupling.test.ts" overstated; the test checks keyword presence in both copies, not parity. Either add expect(GUIDELINE_MIRROR).toBe(GUIDELINE_DATASET) + a name-transform parity assertion, or correct the description. (The keyword-only design matches the existing assess-cost.test.ts convention, so the test itself is by-convention — only the description is overstated.)
  • apps/website/content/docs/reference/skills-catalog.mdx:8 — "Last updated: 2026-07-19" not bumped despite the catalog changing in this PR. (Not enforced by docs-staleness-check, so cosmetic.)

Questions ❓

  • Was assess-coupling $scope: full ever executed against this repo, even once, to confirm the algorithm produces a sensible report/verdict? If a run exists, please attach the triaged findings; if not, see Major Collaborative Knowledge Base #2.

Risk Assessment

Risk Impact Probability Mitigation
Skill never executed → latent prose bugs surface only when #228 wires it in Med Med Dogfood full-scope now; record findings
Severity/balance-rule restatement in skill drifts from guideline (D37) Low Low Reference the guideline tables instead of reproducing them
Count-line merge conflict with #228/#259 (parallel worktrees) Low Med PR note 2 documents the sum-the-deltas resolution

Adoption Compliance

Level: full (manual inline check). Follows the two-mode assess-* convention, D14 report-write exception, D22 verdict shape, output-only-for-adoption contract, D37 single-home rule (with the Minor #1 caveat). No new dependency, no new architectural decision → no ADR required (refinement D36–D39 already cover the decisions). Compliant.

Follow-up Actions

Author Action Items

  • High — Run assess-coupling $scope: full on the pair repo, record triaged findings in the PR (or get PM sign-off to defer QA to Extended code-review template (security + cost, reading budget) #228).
  • Low — De-duplicate Step 4.1/4.2 vs the guideline (D37) or soften the Notes claim.
  • Low — Drop "(not yet published)" for coupling-balance.md in quality-model.md (lines 43, 167).
  • Low — Correct the byte-identity enforcement claim (or add the parity assertion); bump the skills-catalog "Last updated" date.

Human Merge Gate


REVIEW COMPLETE:

@rucka

rucka commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Code Review — PR #381

Review Information

PR Number: #381
Author: rucka (Gianluca Carucci)
Reviewer: Independent review (/pair-process-review)
Review Date: 2026-07-24
Story/Epic: US-263 (Epic #209 — Code Quality & Testing foundations)
Review Type: Feature (KB guideline + capability skill; prose consumed by an LLM, one conformance test)
Head reviewed: 826f840

Review Summary

Overall Assessment

  • Approved
  • Approved with Comments
  • Request Changes — one internal inconsistency in the canonical model touches AC2 correctness; DoD validation (dogfood / degradation paths) not performed.
  • Comment Only

Key Changes Summary

Adds the coupling-balance.md guideline (three-dimensional model: integration strength × socio-technical distance × volatility + balance rule, severity, DDD mapping, fractal application, test implications, coupling.dev bibliography) and the pair-capability-assess-coupling skill ($scope: diff | full). Wires the guideline into assess-architecture's reading list (0.5.0→0.6.0), indexes it in the design-patterns README, bumps catalog counts everywhere (39→40 total / 29→30 capability / 10→11 assessment), and adds a conformance test.

Business Value Validation

Fills the R7.5 "architecture quality" slot. Guideline + skill are well-constructed and internally rigorous on the three-dimensional discipline. The headline value ("caught before merge" via review step 2.3) is not active in this PR — it is deferred to #228 (still OPEN); the skill is authored ready-to-compose.

Independent verification performed

  • Conformance: assess-coupling.test.ts (41) + assess-cost.test.ts (27) PASS; full src/conformance suite 327 pass / 15 files (after building @pair/content-ops).
  • Website: docs-staleness-check.test.ts 26 pass (asserts skillCount === 40, zero drift).
  • check:links on dataset + root .pair: all valid.
  • ts:check + lint (knowledge-hub, website): pass (website ts:check clean after generating the fumadocs .source).
  • Byte-identity root↔dataset for coupling-balance.md and design-patterns README.md: identical. Skill mirror = dataset after the deterministic pair-* name transform: confirmed.
  • Catalog counts consistent across next, skills-guide, getting-started, way-of-working, 10 website docs; no stale 39/29 references remain. Dataset skill-dir count = 40.
  • Cross-reference targets in the guideline/skill all exist.

Acceptance Criteria

AC Verdict Notes
AC1 — diff verdict flow (3D → balance + severity) Met (skill authored; review wiring deferred to #228) Steps 0–7 implement it; the actual /pair-process-review step 2.3 invocation is #228's lane (OPEN).
AC2 — full audit (unbalanced+volatile, tech-debt handoff, report) At risk Retention rule is internally contradictory for the tolerable (unbalanced+low-volatility) tier — see Major-1.
AC3 — never single-dimension decouple; "not assessed" degradation Met Two-dimensional rebalancing enforced (Step 5 + guideline "Rebalancing"); "not assessed" contract stated.
AC4 — volatility from subdomain classification; no-DDD → estimate, never HALT Met Step 3.3 + guideline dim 3; commit history never sole evidence; estimate labelled.
AC5 — original guideline + byte-identity + catalog/version updates Met Original prose, coupling.dev cited as "Pair's own formulation"; byte-identity + counts verified.

Detailed Review Comments

Positive Feedback

Major Issues 🔍

  • coupling-balance.md:107 & :110-112 + assess-coupling/SKILL.md:81 (Step 4.3) & :108 (Step 8.1)Contradictory finding-retention rule for the tolerable tier. The severity table (:107) defines Tolerable = "unbalanced and low volatility — recorded as architectural debt," and Step 7.2 / the "Unbalanced but stable" edge case / story AC2 all require unbalanced-but-low-volatility integrations to be surfaced as tech-debt (never blocking). But the guideline's "few critical" paragraph (:110-112) says "an imbalance neutralised by low volatility is not a finding," Step 4.3 keeps "only unbalanced and volatile," and Step 8.1 flags "only the unbalanced AND volatile ones" — which drops the tolerable tier. Concrete failure: a PR introduces a high-strength + high-distance integration in a generic/low-volatility subdomain → per severity table + AC2 it must yield a tolerable tech-debt item; per the "not a finding" / "only unbalanced AND volatile" instructions an LLM executor drops it and no tech-debt item is produced. The model is the single source of truth (D37) and is already consumed by assess-architecture (this PR wires it in), so the contradiction is live today. Recommendation: reconcile the wording so the tolerable/tech-debt tier is explicitly retained-but-non-blocking (e.g. "only unbalanced+volatile earn attention/blocking findings; unbalanced+low-volatility is retained as a tolerable tech-debt finding, never dropped and never blocking"). Apply to both byte-identical guideline copies and both skill mirrors.

  • DoD "Quality Assurance" items unmet (story Architecture quality: coupling-balance guideline + assess-coupling (diff/full) in review #263 DoD) — the story's validation strategy (dogfood $scope: full on the pair repo + triage; diff mode verified on a real PR; degradation paths verified) was not performed; the PR asks the reviewer to spot-check the report-format prose instead. Diff-mode-in-review validation is legitimately gated on Extended code-review template (security + cost, reading budget) #228 (OPEN), but the standalone $scope: full dogfood does not depend on Extended code-review template (security + cost, reading budget) #228 and is explicitly named in the DoD. Merging leaves the capability's real-world behavior unvalidated beyond structural conformance. Recommendation: run the standalone full-audit dogfood on this repo (an agent executing the skill prose — no CLI needed), triage/attach findings, and explicitly defer only the review-diff-mode validation to Extended code-review template (security + cost, reading budget) #228.

Minor Issues 💡

  • .claude/skills/pair-capability-assess-coupling/SKILL.md:3 (frontmatter description) — 819 chars vs siblings (assess-cost 595, assess-security 681); within the agentskills.io 1024 limit but long for a trigger description. Recommendation: trim to the discriminating essentials (~2 sentences) for cleaner skill selection.
  • apps/website/content/docs/reference/skills-catalog.mdx:8 — "Last updated: 2026-07-19" not bumped although this PR adds a catalog row. Recommendation: update to 2026-07-24.

Questions ❓

  • coupling-balance.md:183-189 (originality) — the four strength-level names (intrusive > functional > model > contract) and the "integration strength × distance × volatility" framing are Vlad Khononov's model (coupling.dev). AC5 asks for "original wording" and D36 sanctions an "original reimplementation"; the file cites coupling.dev and declares the content "Pair's own formulation," and the prose/examples are original. Flagging only for transparency — the terminology reuse of a cited taxonomy is standard and within D36's sanction. (non-actionable — by design: D36 reimplementation + coupling.dev citation)

Adoption / ADR

No new technical decision in this PR (refinement already recorded D36–D39; no ADR/ADL required). assess-architecture version bump 0.5.0→0.6.0 is appropriate. No files under #228's or #352's lanes were touched — isolation confirmed.

Risk Assessment

Risk Impact Probability Mitigation
Tolerable-tier findings silently dropped (AC2) Med Med Reconcile retention wording (Major-1)
Unvalidated model behavior on real code Med Med Run standalone full-audit dogfood (Major-2)
Capability has no wired caller until #228 Low Same ready-to-compose precedent as assess-cost (#226)

Decision

Request Changes — reconcile the tolerable-tier retention contradiction (Major-1, fixable in this PR, no #228 dependency) and address the DoD validation gap (Major-2, run the standalone full-audit dogfood). All quality gates, conformance, staleness, and link checks pass; byte-identity and catalog consistency verified. The guideline + skill are otherwise strong and the #228 review-wiring deferral is legitimate.

…bump catalog date

Review PR #381 round 1:
- F1: retain unbalanced+low-volatility as tolerable tech-debt (never dropped, never
  blocking) across guideline "few critical" para + SKILL Steps 4.3/8.1 + ASCII +
  frontmatter (both mirrors); only balanced / <3-dim scores are non-findings.
- F3: trim assess-coupling frontmatter description to sibling length (~665-678).
- F4: bump skills-catalog "Last updated" to 2026-07-24.
- F2 (dogfood) done as gitignored working artifact — no tracked change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to Website Preview July 24, 2026 16:34 Inactive
…-coupling

Step 4.1/4.2 (dataset + root mirror) restated the balance rule + severity
conditions that AC5/D37 require to live ONLY in the guideline. Replace with
links to the guideline's #the-balance-rule / #severity sections; the skill
now applies, never restates. Byte-parity of the name-transform preserved
(edited lines identical in both trees).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to Website Preview July 24, 2026 16:59 Inactive
@rucka

rucka commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Remediation — round 1 (commit 2fa9e2f)

Per finding:

  • [MAJOR] Dogfood never executed — run assess-coupling $scope: full on pair → Applied the guideline's algorithm by hand to the 5 most significant cross-module couplings, each scored on all three dimensions with a balance verdict + severity, recorded as a triaged table in the PR description's new Testing → Dogfood section (replaced the "NOT run" claim; reviewer Note 3 updated). Result: 1 critical (website↔dataset: skills-catalog / "N skills" facts hand-duplicated across ~10 mdx files → reduce strength, derive the catalog from the dataset), 4 balanced (pair-cli↔dataset contract; knowledge-hub↔content-ops contract; dataset↔root-mirror functional-but-low-distance, contingent on the tech-debt: extend mirror-equality guard to per-skill SKILL.md pairs (all 36 skills) #352 guard; website↔brand contract). Diff-mode-on-a-real-PR verification explicitly deferred to Extended code-review template (security + cost, reading budget) #228. — PR description only (no code).
  • [MINOR a] Step 4.1/4.2 restated the balance-rule + severity criteria (AC5/D37: model lives ONLY in the guideline) (assess-coupling SKILL.md Step 4) → replaced the restated conditions with links to the guideline's #the-balance-rule / #severity sections; the skill now applies, never restates. Edit applied to the dataset source and mirrored byte-identically to the root copy (changed lines carry no name-transform tokens, so tech-debt: extend mirror-equality guard to per-skill SKILL.md pairs (all 36 skills) #352 byte-parity holds). — packages/knowledge-hub/dataset/.skills/capability/assess-coupling/SKILL.md, .claude/skills/pair-capability-assess-coupling/SKILL.md
  • [MINOR b] PR claimed byte-identity is "enforced by assess-coupling.test.ts" (test only checks keyword presence) → corrected the PR description: mirror parity is verified centrally by the tech-debt: extend mirror-equality guard to per-skill SKILL.md pairs (all 36 skills) #352 mirror-equality guard (transfer-dataset name-transform + byte-parity check in packages/knowledge-hub/src/tools, CI), corroborated by a manual root↔dataset diff; the conformance test only asserts keyword/invariant presence. Test left unchanged (no over-engineering). — PR description only.
  • [MINOR c] Bump skills-catalog "Last updated" to 2026-07-24 → already at 2026-07-24 (set by prior commit e8537bb F4). No change needed. — apps/website/content/docs/reference/skills-catalog.mdx (verified)

Not changed (escalated): none.
Quality gates: PASS — knowledge-hub test (409 passed / 19 files, incl. assess-coupling.test.ts + link check), ts:check, .md out of prettier scope; full pnpm quality-gate ran green in the pre-push hook (push e8537bb..2fa9e2f succeeded). Constraints honored: no code-review template / /pair-process-review (#228) and no packages/knowledge-hub/src/tools (#352) touched.
→ Re-review requested.

…er (docs-staleness Check 2c)

Rebalances the CRITICAL website<->dataset coupling surfaced by this PR's assess-coupling dogfood: the skills-catalog Command + Description columns are now derived from each dataset SKILL.md's frontmatter and CI-enforced by a new docs-staleness check (checkCatalogContent), so a skill description edit that isn't mirrored to the catalog fails the gate (single source = dataset). Reduces coupling strength; counts + row presence were already enforced (Checks 1 & 2).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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