Task: Delete legacy codegen profile system (facet_catalogue.org, core.py profile path)
Table of Contents
This page documents a task in the Retire legacy codegen profile system; add junction support to physical-space codegen story. It captures the goal, current status, acceptance, and any notes or results.
Goal
Delete System 1 as described in the parent story's Analysis section:
projects/ores.codegen/library/facet_catalogue.org(idA8145FD7-0651-40FD-857E-BC37C9320020) — the entire file._load_profiles_from_org()inprojects/ores.codegen/src/codegen/core.py(around line 520-577) and every function/branch reachable only from it or from the--profileCLI flag (both thecompass codegen generate --profilepath and the deprecated--profileflag oncompass codegen entity generate— checkprojects/ores.compass/src/compass_codegen*.pyfor the--profileargparse wiring and remove it too, or leave the flag parsing in place but make it a hard error pointing at--addressif removing the flag entirely is too disruptive for muscle memory; use judgement here, the story's real requirement is deleting the dead resolution code, not necessarily the CLI flag string itself).get_cpp_junction_template_mappings()incore.py(~line 1094) — this is dead code reachable only through System 1 (see story Analysis). Do not delete it as part of this task, though — the next task (Add junction to model_types on ores.cpp.domain/generator/repository.org) needs to look at it as reference for what fields a junction needs mapped, since it is the only existing (if untested) attempt at junction C++ template mapping in the codebase. Leave it in place for that task to consume/replace, and note in this task's Result whichever way it went so the next task doesn't waste time rediscovering it.
Do this deletion first, before starting the junction-support tasks — the story's explicit ordering rationale: deleting first, then building new junction support on the clean system, means any breakage the deletion causes is diagnosed against a system with no new in-progress junction changes to confound the diagnosis.
After deleting, regenerate a handful of existing entities across a few
different components (e.g. one from ores.refdata, one from
ores.trading, one from ores.marketdata) via compass codegen entity
generate <name> and diff against git HEAD — expect zero diff. If
anything differs, that's this task's own regression, not an acceptable
side effect (see the parent story's Acceptance).
Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Retire legacy codegen profile system; add junction support to physical-space codegen |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-07-13 |
Acceptance
facet_catalogue.orgis deleted._load_profiles_from_org()and its exclusive call chain are deleted fromcore.py.get_cpp_junction_template_mappings()is explicitly left in place (noted above) for the follow-on junction-support tasks to consume.- Regenerating a sample of existing entities across a few components produces zero diff against HEAD.
- Any script/doc that referenced
--profileorfacet_catalogue.orgeither still works (if the flag is kept as a hard-error shim) or is updated to use--address— full sweep of every such reference is the separateSweep docs/skills/recipestask, but this task must not leave the build itself broken (e.g. a CI script invoking--profiledirectly) — grep for--profileacrossprojects/ores.compass,.github/workflows, and any Makefile/shell wrapper before deleting, and fix those specific call sites as part of this task even though the broader doc sweep is separate.
Plan
- Grepped
_load_profiles_from_org=/=load_profiles=/=facet_catalogueacrossprojects/ores.codegenandprojects/ores.compass: confirmedload_profiles()(and its exclusive helpers_load_profiles_from_org(),_parse_facet_table(), plus the_FACET_HEADING_RE=/=_FACET_PROP_KEY_RE=/ =_unlink_org=/=_ORG_ID_LINK_REsymbols only they used) has zero callers anywhere in the tree — dead since whenever System 2 replaced it. - Grepped
--profileinprojects/ores.compass: the only live--profilesurfaces are (a) the already-deprecated flag oncompass_codegen_entity.py(help text already says "DEPRECATED (use –address)" — nothing to fix), and (b) thecompass codegen generate/regeneratesubcommands'--profileflag incompass.py, which feedsgenerate.py'sresolve_targets()→ its own_PROFILE_TO_FACETSbackward-compat shim (a different, still-live mechanism, unrelated tofacet_catalogue.org=/=_load_profiles_from_org— migrating its callers to--addressis task B11's job, not this one). So this task's acceptance criterion ("fix those specific call sites") had nothing to fix: deleting the dead code doesn't touch any working--profilecall site. - Deleted
load_profiles(),_load_profiles_from_org(),_parse_facet_table(), and their exclusive helper symbols fromcore.py. Leftget_cpp_junction_template_mappings()(~line 1011) untouched, per this task's Goal. - Did not delete
facet_catalogue.orgitself. A grep for inboundid:links to its file id (A8145FD7-0651-40FD-857E-BC37C9320020) turned up ~80 files acrossdoc/,projects/ores.codegen/library/templates/, andprojects/modeling/— real blast radius requiring careful content-porting and link-repointing, which is exactly what task B10 ("Retire facet_catalogue.org file + legacy literate facet/group docs", moved into this story from "Resolve codegen model unification blockers" — see below) is already scoped and equipped to do properly. Narrowed B10's own doc to reflect that its Python-deletion half is done here; it now owns only the file + link work. - Verified via
compass codegen entity generate: regeneratedbook(refdata) with both a narrow--address ores.cpp.domainand the full default supported set — zero diff both times. Attempted the same forfloating_index_type(trading) andmarket_fixing(marketdata) and got real diffs/untracked files — but confirmed by stashing this task's change and regenerating the same two entities against unmodifiedHEADthat the exact same drift is present there too. Pre-existing, unrelated to this deletion; filed as a backlog capture (audit_marketdata_cpp_drift.org) rather than fixed ad hoc, since the "Refactor ores.codegen C++ generation" story already owns this class of drift with its own audit-then-apply methodology. - Discovered mid-task that a different story, "Resolve codegen model
unification blockers", had two BACKLOG tasks (B10, B11) essentially
duplicating this task and task 5's scope. Reconciled per user
instruction: moved that story's 8 remaining BACKLOG tasks (B4, B6,
B7, B9, B10, B11, the
_table.orgcontent migration, and table-type retirement) into this story viacompass task move, then closed the donor story DONE with a* Resultexplaining the merge. See this story's own* Decisionsfor the reconciliation notes on B10/B11.
Notes
Test Scenarios
Manual QA scenarios (scaffolded via compass add test_scenario, run
through the QA Validation Runner panel) that verify this task. Link
new ones here as they're created; the scenario doc itself links back
via its "Verifies task" field.
| Scenario | State | Notes |
|---|---|---|
PRs
| PR | Title |
|---|---|
| #1584 | [codegen] Delete dead legacy profile-resolution code |
Review
| Comment summary | File | Decision | Notes |
|---|---|---|---|
Result
load_profiles()=/=_load_profiles_from_org()=/=_parse_facet_table()
and their exclusive helper regexes/functions are deleted from
core.py (confirmed zero live callers before deletion).
get_cpp_junction_template_mappings() is left in place for the next
task. facet_catalogue.org itself is intentionally not deleted —
its ~80 inbound id: links make that a separate, properly-scoped
piece of work, now owned by task B10 in this same story (moved in from
"Resolve codegen model unification blockers", which this task also
triggered merging in full — see the parent story's * Decisions).
Regenerating book (refdata) confirmed byte-identical output before
and after the deletion, at both a narrow --address and the full
supported set. Pre-existing drift found while sampling
floating_index_type=/=market_fixing was verified unrelated (present
on unmodified HEAD too) and filed as a backlog capture rather than
fixed here. No --profile call site needed fixing: the only working
--profile surfaces route through a separate, still-live shim in
generate.py that this task's deletion doesn't touch.