Skip to content

Console: catch up to class and translation-unit work (unit files, pinned compiler, tiers, no auto-PR for projects that publish elsewhere) - #17

Merged
tangosdev merged 3 commits into
mainfrom
console/fix1
Oct 16, 2026
Merged

tangosdev merged 3 commits into
mainfrom
console/fix1

Conversation

@tangosdev

Copy link
Copy Markdown
Owner

Console was built for a pile of unmatched functions: one AI per batch, one plain-C file per function, a rolling per-agent PR. sm64ds-decomp has moved on. Every function is matched, the work is real C++ classes folded into translation units, the canonical compiler is 2004/b56, and one integrator publishes. Console still assumed the old shape in five places. These are the small fixes that need no schema redesign and no new mode. The decomp half is a separate tooling PR (tangos.json).

What was wrong

  1. A promoted unit is named for its class (d_a_obj_foo.cpp) and owns many functions. The stranded sweep and the auto-PR attribution find a function's file by basename, so a unit was invisible to both.
  2. The ready-made match call guessed src/<name>.c and trusted whatever version default the descriptor had.
  3. The preflight passed whenever tools/mwccarm/ existed. A machine with only the 1.2 builds went green and then failed every verify call.
  4. The Atlas showed one progress number. The decomp publishes three (stats.tiers).
  5. Console opens a per-agent PR for matched files. For class and unit work the repo says the integrator publishes.

Change

  • srcFiles.ts inverts the atlas's per-function srcPath (which the decomp's chaos_db_ci.py takes from its own srcpath resolver) into file to functions. A file that owns several functions is a unit.
    • Sweep: a unit is reported once and left to the repo's whole-unit check; a bucketed single-function file is found by its real path instead of its name.
    • Attribution: a unit is never claimed, snapshotted or put in a per-agent PR.
    • Ready match calls: take the file from the map, use the descriptor's default compiler, and add a note when the file is a unit (prove it with tubuild_verify) or when a new file's directory is srcpath's call.
    • A file the atlas does not know falls back to the old basename rule, so function-per-file repos behave as before.
  • matchConventions.autoPr: false locks the Push toggle ("Push: locked", tooltip explains) and stops every auto-PR path for the project. Absent keeps today's behaviour, so PictoChat is untouched. Local verification, banking and the recovery branch are unaffected. Declared in the schema and TangosMatchConventions. The manual "open a PR from my commits" button is the operator's own action and is not changed.
  • Work guide and draft-source policy: "write C++" and "the integrator publishes, commit locally and hand over the exact commit" when the descriptor's language starts with C++ and autoPr is false; one extra class-first step (let mangle spell names, place with srcpath, prove a unit with tubuild_verify) when those tools exist. A descriptor that says nothing gets the old text unchanged.
  • Preflight: the pin is the version default of the match tool. When tools/<compiler>/<pin>/ is missing the compiler item fails, lists what is installed, repeats the descriptor's setup text, and blocks scheduling. No pin, or a compiler on PATH: checked as before.
  • Atlas: when stats.tiers is present, two more bars (Converted, Linked) with their own denominators, and the first bar reads "Matched". Repos without tiers look the same as before.

Deliberate divergences

  • Auto-PR is off by descriptor key, not off for everyone. The old function-match flow still makes sense for repos that have unmatched work (PictoChat), so it stays the default.
  • The unit files are skipped, not handled. Console does not try to prove, commit or publish a unit; the repo's own tools do, and publishing stays with the integrator.
  • Not done here (see the scoping note): schema fields like workUnit / languageMode / gates, a unit scheduler and next_unit, role presets for producer / verifier, per-function tier and TU-state colouring in the Atlas, detectSrcLayout / detectLanguage for nested layouts in generated descriptors.

Verification

  • npm run typecheck -w console clean; npm run console:build builds.
  • npx tsx scripts/verify-unitfiles.mts <tangos.json> <chaos-db.json> (new): 56 checks, all pass. Covers the file map (unit, function, unknown, backslash paths), the basename fallback, autoPr and language detection, the ready call with and without an atlas (including a plain-C descriptor staying .c with its own version), both work guides, the class step numbering, and the compiler pin with a temp tools folder. With the two paths it also loads the real refreshed descriptor and a real chaos-db (417 multi-function unit files found, stats.tiers present).
  • npx tsx scripts/verify-gitsafe.mts: still passes.
  • node schema/validate.mjs over the refreshed sm64ds descriptor and the pictochat descriptor: ok.
  • Ran the built app against a fresh sm64ds-decomp worktree (isolated user-data dir): preflight "Compiler (mwccarm 2004/b56): pinned build present", "Push: locked", Atlas bars Matched 100.0% / Code 100.0% / Converted 38.4% (4,376 / 11,386) / Linked 93.5% (10,595 / 11,328 units), Encyclopedia with the Class / TU group, and the match card with version = 2004/b56. Then over MCP, read-only: 62 tools listed, srcpath on four symbols (a folded unit gives one file for two methods), match on AngleDiff with 2004/b56 gives MATCH, tiers, mangle, tubuild_inspect.
  • One thing seen while testing, not changed here: running match through Console appends a row to the repo's config/match_attempts.jsonl (attempt-tree logging is on in the descriptor). Fine for matching, noisy for a read-only look; worth revisiting when unit mode lands.

A chaos-db can publish stats.tiers (the decomp's chaos_db_ci.py already does).
When it is there the header shows two more bars, Converted and Linked, with
their own denominators (source-owned functions, matched units) and the
MATCHED bar is relabelled. Repos without tiers look exactly as before.
The compiler check passed when tools/<compiler>/ existed at all, so a machine
holding only the older builds went green and then failed every verify call the
repo hands out. The pin is the default of the match tool's version arg; when
tools/<compiler>/<pin>/ is missing the item fails, names what is installed,
repeats the repo's setup text and blocks scheduling. Descriptors with no
version default, or a compiler found on PATH, are checked as before.
…rojects that publish elsewhere

- srcFiles.ts inverts the atlas's per-function srcPath (the decomp's own srcpath
  answer) into file -> functions. The stranded sweep and the auto-PR attribution
  used to find a function's file by basename, so a promoted unit (named for its
  class, owning many functions) was invisible. Now a file that owns several
  functions is recognised as a unit: the sweep reports it once and leaves it to
  the repo's whole-unit check, and attribution never claims or PRs it. Bucketed
  single-function files are found by their real path.
- Ready-made match calls take the file from the same map, use the descriptor's
  default compiler, and tell the agent when the file is a unit (prove it with
  tubuild_verify) or when a new file's directory is srcpath's call.
- matchConventions.autoPr: false locks the Push toggle and stops every auto-PR
  path for that project. Absent keeps today's behaviour. Documented in the
  schema and types.
- The work guide and draft-source policy say C++ when the descriptor's language
  starts with C++, say that the integrator publishes when autoPr is off, and add
  a class-first step when the unit tools exist. A descriptor that says nothing
  gets the old text unchanged.
- scripts/verify-unitfiles.mts covers the above (and loads a real descriptor and
  atlas when given paths).
@tangosdev
tangosdev merged commit d367f55 into main Oct 16, 2026
1 check passed
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