Skip to content

xtask: stop committing modules.json and modules.mmd while keeping live boundary checks #1945

Done

Description

@eric8810

What needs tracking?

xtask check currently requires docs/architecture/rust-agent/generated/modules.json (58,183 lines, 1.6 MiB) and modules.mmd (5,301 lines, 100 KiB) to stay byte-identical in Git.

Observed cost vs. value

  • High merge-conflict churn: In the last 100 commits on main, modules.json was touched 42 times and modules.mmd 19 times. Adding even a single internal module or test module (e.g. 936c95d80) mutates the 1.6 MiB snapshot, causing repeated merge conflicts across parallel PRs, unnecessary rebases, and extra CI reruns.
  • Zero readers: Neither modules.json nor modules.mmd is referenced by any design or architecture document, and a 5,301-line Mermaid diagram cannot be rendered readably.
  • Zero added enforcement: xtask/src/modules.rs (Graph::check_boundaries) computes the AST/Cargo dependency graph fresh in memory on every xtask check run and asserts all boundary rules directly — it does not read the committed modules.* files.

Proposed change

  1. Stop committing fine-grained internal graphs and unused intermediate JSON snapshots (modules.json, modules.mmd, and unreferenced .json snapshots under docs/architecture/rust-agent/generated/), and remove staleness diffs for them from xtask check.
  2. Keep 100% of live boundary enforcement (cargo metadata + syn AST check_boundaries() in xtask check). Keep on-demand graph emission (e.g. xtask graph --out <dir>) for local inspection or debugging without committing the output.
  3. Retain committed high-value artifacts that downstream code or documentation actually consume:
    • npm/branch-services.d.ts (public TypeScript plugin contract)
    • docs/architecture/rust-agent/generated/catalog.md (153 lines, referenced by 15+ design docs; changes only when public services/capabilities change)
    • docs/architecture/rust-agent/generated/crates.mmd (171 lines, 0 touches in last 100 commits, readable crate overview)

Related: #1933 (separating static checks from workspace-coupled xtask), #1938 / #1940 (ADR 025 D2).

References or acceptance criteria

  • Remove modules.json, modules.mmd (and unused intermediate .json snapshots) from docs/architecture/rust-agent/generated/ and stop diffing them in xtask check.
  • Verify xtask check still executes all crate and module boundary rules (check_boundaries()) directly from source on every run.
  • Keep npm/branch-services.d.ts, catalog.md, and crates.mmd committed and freshness-checked, while allowing on-demand local generation of detailed module graphs into a scratch/output path.
  • Update AGENTS.md, docs/architecture/README.md, and scripts/ci-changes.mjs (if affected) to match.

Activity

  1. self-assigned this
    on Nov 20, 2026
  2. zerob13 commented on Nov 20, 2026

    @zerob13
    Collaborator

    Removing modules.json and modules.mmd addresses the recurring graph conflicts. #1946 keeps the live crate and module boundary rules and adds an on-demand command for those graphs.

    The acceptance criteria also cover unused intermediate JSON snapshots. #1946 still generates crates.json and instances.json, and xtask check still requires crates.json to be current. I would scope this issue to the two module snapshots and track the other snapshots separately if needed. If the broader acceptance criteria still apply, please keep this issue open when #1946 merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions