Skip to content

feat(board): flag library config keys not in use anymore #174

Description

@Jammy2211

Human request (2026-09-26, verbatim)

do all of those but not the Eyes one which is tomrorow

Overview

Bundle cockpit-followups, member nerves-unused-keys (siblings: gut-void-sibling-reach, start-dev-heart-gate). Epic organ-cockpit.

Member 1 — nerves-unused-keys (PyAutoNerves, feature/nerves-unused-keys)

Context: the Nerves board (scripts/board.py, 1137 lines) flags drift (workspace keys no library defines). The
human asked for the other direction: library YAML keys no library code reads.

  1. SOURCES gains the package source dir per library (autofit/, autoarray/, …); the workflow's sparse
    pattern fetches <pkg>/**/*.py too (still blob-filtered; measure the clone size).
  2. collect() → scan_lookups(pkg_dir): regex over .py for conf.instance["a"]["b"]… chains (string
    subscripts only; a non-literal subscript ends the chain as a wildcard), conf.instance.dict[...], and the
    helper calls that read whole sections (visualize_config, prior_config, conf.instance.get(...) if it
    exists — the agent greps autonerves/conf.py + the libraries for every accessor and lists them). Result: a
    set of read key-paths and wildcard prefixes per library.
  3. Classification per library YAML key path (settings files only; priors exempt — looked up by class name):
    used (exact path read anywhere in the stack — a key in PyAutoFit's general.yaml read by PyAutoLens counts),
    section-read (a prefix of it is read wholesale / wildcarded), unused (no reference). Cross-library
    reads count because autonerves merges layers.
  4. Render: an unused chip on the key in the repo page, per-file counts, an index section "possibly unused
    config keys" grouped by library with GitHub links; state.json gets ONE info item per library ("N possibly
    unused keys") — never yellow (untrusted scan). board.json/key index carry the class.
  5. Tests: fixture library with the three lookup styles, a wildcard chain, a cross-library read and one
    unreferenced key; existing 16 tests keep passing. README/AGENTS: the classification and its limits.
    Witness: the real index lists ≥1 unused key with library + file link; a referenced fixture key is not listed; the
    PR body carries the false-positive review of PyAutoFit general.yaml for the human.

Claims / branches

PyAutoNerves, PyAutoGut, PyAutoBrain all on clean main; all claimed by eyes-organ-order (disjoint files; Nerves
and Gut AGENTS.md get new sections — merge-safe), Brain also by cosmos-web-ring-greeting. Shared worktree
cockpit-followups with per-repo member branches (rename after worktree_create), parallel-claim: recorded.

Execution (Fable session)

Three issues (one per repo) → three active.md entries → worktree → three Opus subagents in parallel (different
repos), progress files + one Monitor → ship each: Heart YELLOW → ask ack once for the bundle → merge on green →
member 2: dispatch gut_board.yml; member 1: dispatch nerves_board.yml; member 3: nothing to deploy → verify →
close-out per member → then file + run workspace-config-cleanup using the unused-keys output.

Verification

  • Nerves: pytest test_autonerves -q; real collect → count of unused keys per library (report), state: ok.
  • Gut: pytest tests -q; void-plan on the real ledger shows the 8 sibling names with their repos; YAML parses.
  • Brain: pytest tests/test_heart_feed.py tests/test_policy_seams.py -q; bin/heart_feed.py against the live
    feed prints the current status and exits accordingly.
  • Firewall --root <wt> OK for all three.

Original Prompt

Click to expand starting prompt

Organ cockpit: Nerves board flags config keys not in use anymore

Type: feature
Target: PyAutoNerves
Repos:

  • PyAutoNerves
    Difficulty: medium
    Autonomy: safe
    Priority: normal
    Status: formalised
    Consequence: glance
    Witness: the board's index lists at least one unused key with its library and file link, and a deliberately referenced key in the fixture is not listed; the scan's false-positive rate on PyAutoFit general.yaml is reviewed by the human on the PR.
    Review-minutes: 3
    Unattended: ready
    Filed: 2026-09-26
    Epic: organ-cockpit

The human, on shipping the Nerves board (PyAutoNerves#172, 2026-09-26): 'build into the board a flag that a config is drifted or not in use anymore?'. The drift flag exists (workspace keys no library defines → orphan rows + yellow feed items). This prompt adds the other direction: library YAML keys that no library code reads.

  1. In PyAutoNerves scripts/board.py collect: scan each library's Python source (the sparse clone must therefore also fetch the package's .py files, or a second sparse pattern) for config lookups — conf.instance["a"]["b"]..., conf.instance.dict[...], prior_config / visualize_config helpers and the autoconf-era get_config patterns — and build the set of key paths the code reads, including partial reads where the code indexes a whole section. Mark each library YAML key path as used / possibly-used (section read wholesale) / unused (never referenced). Prior files are exempt (looked up dynamically by class name).
  2. Render: an 'unused' chip on the key, a per-file count, an index section 'possibly unused config keys' grouped by library with the GitHub link, and a state.json info item per library summarising the count (never yellow — a false positive must not colour the feed until the scan is trusted).
  3. Tests: hermetic fake library with three lookup styles and one unreferenced key.

Out of scope: deleting anything; workspace files (covered by the drift flag).

Witness: the board's index lists at least one unused key with its library and file link, and a deliberately referenced key in the fixture is not listed; the scan's false-positive rate on PyAutoFit general.yaml is reviewed by the human on the PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SbKQQHRRgm2b69aT9t7771

Activity

Jammy2211 commented on Sep 26, 2026

@Jammy2211
CollaboratorAuthor

Checkpoint (2026-09-26, end of session)

Built and committed locally, not pushed, no PR: 079b182 on feature/nerves-unused-keys in the bundle worktree ~/Code/PyAutoLabs-wt/cockpit-followups/PyAutoNerves. Tests 206 passed (board 21, 5 new). AST scan of conf.instance lookups; real tree: used/section-read/unused = Fit 58/45/8, Array 43/84/1, Galaxy 51/190/1, Lens 17/50/58 (57 = the dead DynestyStatic/DynestyDynamic block in non_linear.yaml), CTI 26/46/8; feed items are info only. False-positive review list for PyAutoFit general.yaml is in the agent report and will go in the PR body.

Heart is YELLOW (three pre-existing organism-map drift reasons); shipping waits on the human's acknowledgement. Resume tomorrow: /ship_library for the bundle cockpit-followups (push + PR + merge on green), then dispatch the board workflow where one exists, then /prm.

Jammy2211 commented on Sep 27, 2026

@Jammy2211
CollaboratorAuthor

Library PR Created

  • PR: Nerves board: flag library config keys no library code reads (#174) #175 (label pending-release, head 079b182)
  • Tests: test_autonerves: 206 passed
  • API changes: none to autonerves. The additions are the board script and workflow only: a per-key usage class in board.json, and info items in state.json.
  • Heart YELLOW (85) acknowledged by the human. The reasons are manifest drift and stale release validation, none in this repo.
  • False-positive review pending (human): PyAutoFit general.yaml output.log_level, output.log_to_file, output.log_file, output.search_internal and profiling.repeats may be read dynamically. The dead 57-key Dynesty block in Lens non_linear.yaml is a follow-up candidate.

Next: a human reviews and merges via /prm, then dispatches nerves_board.yml. No workspace follow-up.

added a commit that references this issue on Sep 27, 2026

Jammy2211 commented on Sep 27, 2026

@Jammy2211
CollaboratorAuthor

Shipped

Merged in #175 (merge eb27da2, 2026-09-27).

The Nerves board now flags library config keys that no library code reads: a conf.instance lookup scan classifies each key as used / section-read / unused, reported as info items only. nerves_board.yml has been dispatched so the published board carries the new section.

Pending release: PyAutoNerves@#175 (cleared by /review_release on a published release).

Follow-up: orphan workspace config keys the board flags are filed as a Mind prompt (workspace config cleanup).

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

Metadata

Metadata

Assignees

No one assigned

    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