feat: curate story-flags into registry + docs (Task 6)
Bootstrap 56 high-signal skeletons; name game_mode/route_branch/scjump_decision_out2, recategorize CONFIG-written globals as non-story. Docs: name-resolution.md registry section, CLAUDE.md canonical+SoT tables + trigger (root, untracked), tools-reference rows. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -151,9 +151,13 @@ def skeleton_toml(ev: dict) -> str:
|
||||
def bootstrap(cands: dict[int, dict], toml_path=None) -> int:
|
||||
toml_path = Path(toml_path) if toml_path else (paths.VM_MAP / "globals.toml")
|
||||
present = set(_gb.load_toml(toml_path)[0]) if toml_path.exists() else set()
|
||||
# only story-flag / ui-toggle / choice-output candidates are worth seeding for curation
|
||||
# Seed only high-signal candidates worth hand-curating: story-flag / choice-output at med
|
||||
# confidence that are NOT near-universal ADV-chrome (those 297-scene globals are engine
|
||||
# scratch, not story state). The low-confidence long tail stays in the candidates JSON.
|
||||
seedable = {a: e for a, e in cands.items()
|
||||
if e["category"] in ("story-flag", "ui-toggle", "choice-output") and a not in present}
|
||||
if e["category"] in ("story-flag", "choice-output")
|
||||
and e["confidence"] == "med" and not e["near_universal"]
|
||||
and a not in present}
|
||||
if not seedable:
|
||||
print(f"bootstrap: nothing new to add ({len(present)} already present).")
|
||||
return 0
|
||||
|
||||
@@ -60,8 +60,11 @@ def test_miner_finds_known_flags():
|
||||
|
||||
def test_bootstrap_is_additive_and_idempotent():
|
||||
import tempfile, pathlib, story_flags
|
||||
# start from a copy of the real toml so curated entries are present
|
||||
src = (paths.VM_MAP / "globals.toml").read_text(encoding="utf-8")
|
||||
# Minimal fixture (one curated entry) so bootstrap always has candidates to add, independent
|
||||
# of how many the real globals.toml already holds.
|
||||
src = ('[meta]\nnote = "fixture"\n\n[[global]]\naddress = "0xa57"\nname = "lily_form_a"\n'
|
||||
'category = "story-flag"\ntype = "int"\nvalue_domain = "{0,1}"\nusage = "curated"\n'
|
||||
'source = "investigation"\nconfidence = "high"\ndepends_on = []\n')
|
||||
with tempfile.TemporaryDirectory() as d:
|
||||
tp = pathlib.Path(d) / "globals.toml"
|
||||
tp.write_text(src, encoding="utf-8")
|
||||
|
||||
Reference in New Issue
Block a user