Skip to content

feat(#297): harness templates by topology — TS NextJS / Python FastAPI / Go data pipeline#346

Merged
atlas-apex merged 2 commits into
devfrom
feature/GH-297-topology-templates
May 20, 2026
Merged

feat(#297): harness templates by topology — TS NextJS / Python FastAPI / Go data pipeline#346
atlas-apex merged 2 commits into
devfrom
feature/GH-297-topology-templates

Conversation

@atlas-apex

Copy link
Copy Markdown
Collaborator

Summary

  • topologies/<name>/ v1 ships 3 framework-curated bundles — TypeScript NextJS web app, Python FastAPI service, Go data pipeline. Each is a self-contained directory tree with VERSION, README.md, curated handbooks/{architecture,language,domain}/*.md, a stack-appropriate golden-paths/*.yml CI pipeline, and a stack-specific AgDR template. Adopters pick a topology at /handover time and get a pre-curated governance surface instead of reassembling 6+ primitives by hand on every onboarding.
  • /handover topology pick is early-flow + default-skip — added after the project-naming step. Default is "Skip / custom" so existing /handover callers see zero behaviour change. On pick, the bundle instantiates into the project's handbooks/ + .github/workflows/ + docs/agdr/ (as drafts, not commits — operator commits when satisfied). Acts as the variety-reduction lever from Ashby's Law: narrows the agent's output space to a stack the framework has opinions about, which makes the harness more achievable.
  • /update topology drift detection/update scans adopter-instantiated bundles' VERSION against upstream topologies/<name>/VERSION and offers operator-approved per-file diff on drift. Default is skip-manual-sync; the operator stays in control of which upstream changes apply to their already-customised bundle.
  • AgDR-0048-topology-templates records the design call — body-H1 only (no YAML frontmatter, per the live framework convention since markdownlint MD025 trips on YAML title + body H1). Covers path-mirroring vs frontmatter-registry vs config-block (chosen: path-mirroring), the 3 starter-topology pick + Ashby's-Law angle, VERSION-file drift detection (vs git-tag / hash comparison), the early-flow /handover integration shape, and the v1 framework-curated-only scope (adopter-authored topologies explicitly deferred to v2.1 to keep the maintenance surface honest).
  • Smoke test at .claude/skills/handover/tests/test_topology_pick.sh — 10 assertions covering per-topology bundle inventory (5 required axes each), AgDR shape (body-H1, canonical "In the context of" one-liner), and the integration-claim references in CLAUDE.md + /update SKILL.md. Wave 1 invariants all pass (skill count stays at 53 — this PR extends /handover + /update, no new slash command).
  • CLAUDE.md QUICK REFERENCE row — one line for topologies/ so adopters discovering the framework see it in the index. The full skill table is unchanged.

Testing

  • bash .claude/skills/handover/tests/test_topology_pick.sh — 10/10 PASS
  • bash .claude/hooks/tests/test_token_efficiency_wave1.sh — 4/4 invariants PASS (53 skills catalogued, ≤25 words/row, ≤200 chars/description, ≤600 chars SessionStart banner)
  • Verify each topology dir: find topologies/<name> -type f | wc -l returns the expected count (8 for go-data-pipeline, 13 for python-fastapi + typescript-nextjs)
  • Pick a topology end-to-end: cd /tmp && mkdir test-adoption && cd test-adoption && /handover --topology typescript-nextjs — bundle should land at handbooks/ + .github/workflows/nextjs-ci.yml + docs/agdr/agdr-typescript-nextjs.md (all drafts)
  • Verify drift detection: bump a topologies/typescript-nextjs/VERSION, run /update, the skill should flag the drift + offer per-file diff

Closes #297

Glossary

Term Definition
Topology A common service shape (web app, API service, data pipeline) that adopters use repeatedly across projects — picked at /handover time
Harness template The bundle of feedforward guides + feedback sensors pre-configured for one topology — handbooks + AgDR templates + CI + Rex domain knowledge
Ambient affordances Properties of the codebase (strong typing, clear module boundaries, framework conventions) that make it more harnessable. Topology templates choose stacks with high ambient affordances.
Variety reduction (Ashby's Law) Committing to a topology narrows the agent's output space to what the stack supports, which makes a comprehensive harness more achievable per Ashby's Law (a regulator must have at least the variety of the system it regulates)
Path-mirroring discovery Bundle convention — topologies/<name>/handbooks/architecture/foo.md lives at the path that mirrors where it'd land in an adopter's project after instantiation. No central manifest, no frontmatter; the directory layout IS the manifest.
Framework-curated vs adopter-authored v1 ships only framework-curated topologies (3 starters); adopter-authored topologies (their own service shapes registered for re-use) are deferred to v2.1 to keep the maintenance surface honest
Drift detection /update compares adopter-instantiated bundles' VERSION against upstream topologies/<name>/VERSION. On mismatch, offers operator-approved per-file re-instantiation diff. Default skip — manual sync.
AgDR-0048 The Agent Decision Record documenting this design — body-H1 only, no YAML frontmatter, matches the live convention shipping with AgDR-0044/0045/0046

…I / Go data pipeline

Ships v1 of `topologies/<name>/`, the path-mirrored bundle convention
adopters opt into via `/handover --topology <name>` to get a pre-curated
governance surface instead of reassembling it by hand on every onboarding.

What lands:

- **`topologies/typescript-nextjs/`, `topologies/python-fastapi/`,
  `topologies/go-data-pipeline/`** — 3 starter shapes. Each ships
  `VERSION`, `README.md`, curated `handbooks/{architecture,language,domain}/*.md`
  (8-9 files each), a stack-appropriate `golden-paths/*.yml` CI pipeline,
  and an `agdr-<stack>.md` template prompting stack-specific decisions.
- **`/handover` topology pick** — early-flow question after project
  naming, defaults to "Skip / custom" (no behaviour change for adopters
  who don't pick). On pick, instantiates the bundle into the project's
  `handbooks/` + `.github/workflows/` + `docs/agdr/` (drafts, not
  commits).
- **`/update` topology drift detection** — scans adopter-instantiated
  bundles' VERSION against upstream framework's `topologies/<name>/VERSION`,
  offers operator-approved per-file diff on drift. Default skip — manual sync.
- **AgDR-0048** — body-H1 only (no YAML frontmatter). Records the path-
  mirroring vs frontmatter-registry vs config-block choice, the 3
  starter-topology pick + Ashby's-Law variety-reduction rationale, the
  VERSION-file drift detection (vs git-tag / hash comparison), the
  early-flow `/handover` integration shape, and the v1 framework-curated-
  only scope (adopter-authored topologies deferred to v2.1).
- **Smoke test** at `.claude/skills/handover/tests/test_topology_pick.sh` —
  10 assertions covering bundle inventory (each topology has the 5
  required axes), AgDR shape (body-H1 only, canonical "In the context of"
  one-liner), and integration claims (`CLAUDE.md` + `/update` SKILL.md
  mention topology).
- **CLAUDE.md** — adds one line to the QUICK REFERENCE table for
  `topologies/`. Skill table unchanged (no new slash command — extends
  existing `/handover` + `/update`).

Why this matters:

- Adopters today reassemble the same governance surface every project
  onboarding — 6+ primitives wired up by hand each time. This is the
  exact "reassembly fatigue" failure mode harness-engineering literature
  flags.
- Committing to a topology also narrows the agent's output space
  (Ashby's Law) — fewer valid actions = more achievable harness.
- v1 scope is deliberately narrow (3 framework-curated topologies, no
  composition, no adopter-authored shapes) to ship something maintainable
  rather than an unmaintainable registry of 50.

Closes #297
CI markdownlint failure on initial #346 push. Line 44 introduced
a bulleted list directly after "Per-record fixed costs are huge:"
without a blank line separator. MD032 requires blank lines around
all lists. One-line fix.

Refs #297

@atlas-apex atlas-apex left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: PR #346

Commit: ae7f982694876ed4f67fb51d4c6ac38988e5f9b6

Summary

P2/v2.0-candidate feature: ships topologies/<name>/ as a path-mirrored convention so adopters can opt into a pre-curated governance surface (handbooks + AgDR templates + CI pipeline + Rex domain knowledge) at /handover time instead of reassembling 6+ primitives by hand. v1 ships three categorically different starters — TypeScript NextJS, Python FastAPI, Go data pipeline — with /handover extended for early-flow topology pick (default-skip) and /update extended for VERSION-based drift detection. Total +3873/-1 across 42 files.

Checklist Results

  • Architecture & Design: Pass
  • Code Quality: Pass
  • Testing: Pass
  • Security: Pass
  • Performance: Pass (advisory class — no runtime code)
  • PR Description & Glossary: Pass (8 terms, narrative bullets)
  • Technical Decisions (AgDR):Pass — AgDR-0048-topology-templates linked + comprehensive
  • Adopter Handbooks: Pass — architecture/clean-architecture-layers.md (always-load, advisory) + framework-internal handbooks would apply if relevant; no violations in the touched files

Issues Found

None blocking.

Suggestions (nits — non-blocking)

  1. /update drift-detection prompt — per-file default phrasing is contradictory. .claude/skills/update/SKILL.md § 8c says "Default per file is n (skip — operator owns the change)" but the prompt shape immediately below shows [Y/n/d/s] with [Y]es — copy framework version as the upper-case (canonical-default) option. Pick one: either flip the prompt to [y/N/d/s] to match the prose default, or update the prose to say "Default per file is Y (copy framework version) — but the project-level default is N (skip the whole step)". The current shape will trip operators reading the prose vs reading the bracketed default.

  2. AgDR-0048 § Consequences off-by-one on handbook count. "The three v1 starter topologies ship with 9 handbooks total (3 architecture + 3 language + ~3-4 domain per topology — see file inventory in the PR)". The actual count is 8 per topology (2 architecture + 3 language + 3 domain) and 24 handbooks total. The parenthetical math (3+3+3=9) is right but the actual per-topology architecture count is 2, not 3 (go-data-pipeline ships clean-architecture-layers.md + pipeline-stages.md; python-fastapi + typescript-nextjs each ship clean-architecture-layers.md + migration-safety.md). Cosmetic — doesn't affect any decision.

  3. AgDR-0048 minor wording — "see file inventory in the PR" is a backward reference to the originating PR. After merge, that pointer is stale. Consider phrasing it as "see each topology's README.md" (which lists the bundle contents).

Handbook Findings

None — the diff touches topologies/ (a new convention dir) + skill / AgDR / config files. None of those paths are covered by an existing public handbook's paths: glob, and there are no false-positives from the always-load architecture handbooks (this PR neither violates clean-architecture layering nor ships a migration).

Notable strengths

  • AgDR-0048 quality is exemplary. Body-H1 only, canonical "In the context of..." one-liner present, six decisions (A through F) each with options + chosen + rationale. The Ashby's-Law variety-reduction framing is load-bearing for the WHY and clearly explained.
  • Path-mirroring vs frontmatter / config-block / JSON manifest comparison (option A) clearly documents why the chosen layout wins — consistency with handbooks/ and custom-templates/ discovery conventions (AgDR-0023).
  • Handbooks are first-class. Each handbook follows the standard shape (rule → why → Rex flags → sample finding → NOT-a-violation → standard pattern). Security-critical handbooks (migration-safety.md for Prisma + Alembic, jwt-validation.md, session-handling.md) correctly carry the ENFORCEMENT: blocking marker at the top.
  • Async-correctness handbook (python-fastapi) captures the load-bearing FastAPI gotchas — sync session inside async handler, missing await, asyncio.run inside loop, fire-and-forget GC. The mixed-sync/async migration recipe is a real teaching moment.
  • Batch-size-tuning handbook (go-data-pipeline) is unusually concrete — explicit knob ranges, throughput math (Postgres COPY 200x faster, Kafka batched 500x faster), worked Go example with proper mutex + timer reset. Adopters get a real reference, not a generic platitude.
  • /handover integration is zero-regression by design. Default is "Skip / custom" (pick 4), --topology <name> CLI flag is a power-user override, instantiation step 5.5 uses rsync --ignore-existing / cp -n so adopters' edits are never overwritten. The .draft.md extension on the seeded AgDR template avoids spurious AgDR-required hook firings.
  • /update drift detection is non-blocking + per-file (matches the deprecated-config-key offer's shape from AgDR-0032 and step 8b). Bulk replace was explicitly rejected for the right reason (adopters edit topology handbooks in-project).
  • Smoke test coverage is thorough. 10 logical assertion families × 3 topologies = ~40 individual assertions executed in the for-loop. Covers per-topology bundle inventory (VERSION/README/handbooks-by-axis/CI/template), AgDR-0048 shape (body-H1 + one-liner), CLAUDE.md integration, /update integration, README cross-references, AND the paths: frontmatter convention for every domain handbook. The semver regex ^[0-9]+\.[0-9]+\.[0-9]+$ rejects pre-release suffixes — fine for v1.
  • Wave 1 invariants preserved. Skill count unchanged at 53 (this extends /handover + /update, no new slash command). New CLAUDE.md QUICK REFERENCE row is 12 words (cap is 25). Description frontmatter on extended skills not increased past the 200-char cap. The topologies/README.md adds a fourth navigation surface (alongside handbooks/, templates/, golden-paths/) consistent with the framework's discovery-by-convention pattern.
  • MD032 fix-up at HEAD (ae7f982) is one line (blank before list in batch-size-tuning.md); markdownlint check is green at this SHA. No regression elsewhere.
  • CI all green at this SHA: Verify Ticket ID, lychee, markdownlint-cli2, site-counts drift detection.
  • Forward-compatibility hooks documented. v2.1 expansion path (adopter-authored <private_repo>/custom-topologies/<name>/) is explicit in AgDR-0048 § A's "Chosen" note and the topologies/README.md "Out of scope" section. The 5+ adopter-request gate before adding a fourth starter topology is a sensible variety-management discipline.

Verdict

APPROVED

Ship it. The three nits above are documentation polish that can land in a follow-up. The PR delivers a coherent v1 of harness-templates-by-topology with serious thought put into the variety-reduction angle, drift handling, and zero-regression integration.

Approval marker

My sandbox blocked the marker write. Please run on Rex's behalf:

printf 'ae7f982694876ed4f67fb51d4c6ac38988e5f9b6\n' > .claude/session/reviews/346-rex.approved

(Bare 40-char SHA + newline, no labels — verified with od -c should show \n then * for the second line.)


🤖 Reviewed by Rex (Code Reviewer Agent)
📌 Reviewed commit: `ae7f982694876ed4f67fb51d4c6ac38988e5f9b6`

@atlas-apex atlas-apex merged commit df85020 into dev May 20, 2026
4 checks passed
@atlas-apex atlas-apex deleted the feature/GH-297-topology-templates branch May 20, 2026 15:38
me2resh added a commit that referenced this pull request Jun 5, 2026
…I / Go data pipeline (#346)

* feat(#297): harness templates by topology — TS NextJS / Python FastAPI / Go data pipeline

Ships v1 of `topologies/<name>/`, the path-mirrored bundle convention
adopters opt into via `/handover --topology <name>` to get a pre-curated
governance surface instead of reassembling it by hand on every onboarding.

What lands:

- **`topologies/typescript-nextjs/`, `topologies/python-fastapi/`,
  `topologies/go-data-pipeline/`** — 3 starter shapes. Each ships
  `VERSION`, `README.md`, curated `handbooks/{architecture,language,domain}/*.md`
  (8-9 files each), a stack-appropriate `golden-paths/*.yml` CI pipeline,
  and an `agdr-<stack>.md` template prompting stack-specific decisions.
- **`/handover` topology pick** — early-flow question after project
  naming, defaults to "Skip / custom" (no behaviour change for adopters
  who don't pick). On pick, instantiates the bundle into the project's
  `handbooks/` + `.github/workflows/` + `docs/agdr/` (drafts, not
  commits).
- **`/update` topology drift detection** — scans adopter-instantiated
  bundles' VERSION against upstream framework's `topologies/<name>/VERSION`,
  offers operator-approved per-file diff on drift. Default skip — manual sync.
- **AgDR-0048** — body-H1 only (no YAML frontmatter). Records the path-
  mirroring vs frontmatter-registry vs config-block choice, the 3
  starter-topology pick + Ashby's-Law variety-reduction rationale, the
  VERSION-file drift detection (vs git-tag / hash comparison), the
  early-flow `/handover` integration shape, and the v1 framework-curated-
  only scope (adopter-authored topologies deferred to v2.1).
- **Smoke test** at `.claude/skills/handover/tests/test_topology_pick.sh` —
  10 assertions covering bundle inventory (each topology has the 5
  required axes), AgDR shape (body-H1 only, canonical "In the context of"
  one-liner), and integration claims (`CLAUDE.md` + `/update` SKILL.md
  mention topology).
- **CLAUDE.md** — adds one line to the QUICK REFERENCE table for
  `topologies/`. Skill table unchanged (no new slash command — extends
  existing `/handover` + `/update`).

Why this matters:

- Adopters today reassemble the same governance surface every project
  onboarding — 6+ primitives wired up by hand each time. This is the
  exact "reassembly fatigue" failure mode harness-engineering literature
  flags.
- Committing to a topology also narrows the agent's output space
  (Ashby's Law) — fewer valid actions = more achievable harness.
- v1 scope is deliberately narrow (3 framework-curated topologies, no
  composition, no adopter-authored shapes) to ship something maintainable
  rather than an unmaintainable registry of 50.

Closes #297

* fix: add MD032 blank line before list in batch-size-tuning handbook

CI markdownlint failure on initial #346 push. Line 44 introduced
a bulleted list directly after "Per-record fixed costs are huge:"
without a blank line separator. MD032 requires blank lines around
all lists. One-line fix.

Refs #297

---------

Co-authored-by: me2resh <ahmed.abdelaliem@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants