a4_sy_orchestration/ CLI, entry points, top-level orchestrators
↑
a3_og_features/ Feature modules (combine composites into capabilities)
↑
a2_mo_composites/ Stateful classes (clients, registries, stores)
↑
a1_at_functions/ Pure stateless functions (validators, parsers)
↑
a0_qk_constants/ Constants, enums, TypedDicts. Zero logic.
Compose upward, never downward. A pure function never depends on a stateful class. A CLI command orchestrates everything below it but invents nothing new.
- One tier per file. A pure function → a1. A class with state → a2. A CLI entry point → a4. Split if in doubt.
- Never import upward.
a1cannot import froma2–a4.a0cannot import anything. - Compose, don't rewrite. Before writing new logic, check whether the building block already exists. If it does, import it.
- Small, focused files. One responsibility per file.
- Every new file gets a module docstring:
"""Tier a1 — pure helpers.""".
src/atomadic_forge/
├── a0_qk_constants/ # tier_names, forge_types, lang_extensions,
│ # auth_constants, recipe schemas, *_types.py
├── a1_at_functions/ # classify_tier, scout_walk, cherry_pick, wire_check,
│ # certify_checks, body_extractor, import_repair,
│ # js_parser, llm_client, provider_resolver,
│ # code_signature, intent_similarity,
│ # research_note_distiller, exported_api_check,
│ # trust_gate_response, recipes, mcp_protocol,
│ # commandsmith_*, emergent_*, synergy_*
├── a2_mo_composites/ # manifest_store, plan_store, lineage_chain_store,
│ # receipt_signer, forge_auth_client,
│ # cost_circuit_breaker, hierarchical_memory,
│ # cross_agent_intent_deduplicator
├── a3_og_features/ # forge_pipeline (run_auto/run_recon/run_cherry/run_finalize),
│ # emergent_feature, synergy_feature, commandsmith_feature,
│ # demo_runner + demo_packages/ (static showcase presets),
│ # mcp_server, lsp_server, setup_wizard,
│ # dedup_engine, agent_hire_protocol,
│ # forge_enforce, forge_evolve, forge_loop, forge_plan_apply
├── a4_sy_orchestration/ # cli.py — Typer app with `auto` flagship
└── commands/ # Per-verb Typer modules (specialty surfaces)
tests/ mirrors the same shape. pyproject.toml declares a layered
import-linter contract — tox -e import-linter (or just running the
contracts directly) blocks CI on any violation.
Forge classifies Python AND JavaScript / TypeScript source. Two small modules carry the language layer; everything downstream stays language-agnostic:
a0_qk_constants/lang_extensions.py— canonical extension sets (PYTHON_EXTS = {.py},JAVASCRIPT_EXTS = {.js, .mjs, .cjs, .jsx},TYPESCRIPT_EXTS = {.ts, .tsx}) + the purelang_for_pathlookup. Adding a language is a one-line change here.a1_at_functions/js_parser.py— pure regex + brace-walker that extracts what the rest of the pipeline needs from JS/TS without a Node dependency: ES6 / dynamic / CommonJS imports, top-level exports (includingexport default { fetch, scheduled }Worker shape), cheap effect / state signals, and aclassify_js_tierthat honours explicitaN_*placement first, then infers from surface signals.
scout_walk.iter_source_files walks every recognised extension in one
pass and skips vendored / build / cache directories
(node_modules, dist, build, coverage, .next, .nuxt,
.wrangler, .turbo, plus the Python equivalents). wire_check
classifies each file by the tier directory it lives in and dispatches
to a Python-AST or JS-regex import scanner. certify_checks recognises
JS test conventions (*.test.*, *.spec.*, __tests__/) alongside
the Python tests/test_*.py shape.
The behavioural pytest runner and the runtime-import smoke check remain Python-only — they're the +55 score components that prove "the package actually does what its tests say." JS / TS packages are scored on the +45 polyglot-aware structural axes (docs, tests-present, tier layout, upward-import discipline).
target_repo
│
▼
[a1] scout_walk.harvest_repo → scout report (.atomadic-forge/scout.json)
│
▼
[a1] cherry_pick.select_items → cherry manifest (.atomadic-forge/cherry.json)
│
▼
[a3] forge_pipeline.run_finalize
├─ copy each picked symbol's source file into a{N}/<slug>.py
├─ emit STATUS.md
├─ [a1] wire_check.scan_violations
└─ [a1] certify_checks.certify
│
▼
output/ STATUS.md + tier tree + .atomadic-forge/assimilate.json
forge emergent scanwalks the tier tree, builds a typed signature graph, and surfaces composition chains viafind_chains+rank_chains.forge synergy scanwalkscommands/, buildsFeatureSurfaceCards, and detects 5 synergy kinds (json_artifact, in_memory_pipe, phase_omission, shared_schema, shared_vocabulary).forge commandsmith syncregenerates the auto-loadedcommands/_registry.py- per-command Markdown + smoke results.
forge certify produces a CertifyResult with four mechanical checks:
- Documentation: README.md OR ≥2 docs/*.md
- Tests: tests/test_.py OR tests/_test.py present
- Tier layout: ≥3 tier directories present
- Import discipline: zero upward-import violations
Score = 100 - 25 per failed check. Each check has a detail block with
the evidence used.
Every --apply writes to .atomadic-forge/lineage.jsonl — append-only
JSON Lines with timestamp + artifact name + relative path. This is the
trail an auditor follows; the cryptographic signing chain is on the
roadmap (0.2) and the schema (atomadic-forge.<x>/v1) already names what
it'll sign.