Skip to content

feat: cortex.py library — ledger entry with results-index hash (results-library 5b) #84

Closed

Description

@Jammy2211

Overview

Results-library phase 5b (epic ledger: PyAutoMind draft/feature/autofit/results_library_epic.md). The Cortex ledger records which results a release was built from: a fact-only library entry carrying the results-index hash and the state counts, read straight from a PyAutoFit results index (autofit.results). It follows the precedent of sync-runs (decision 62): cluster and file facts only, never a result or a lesson, never ## Now (decision 60).

Plan

  • New verb cortex.py library <project> <index_dir> [--name NAME] [--dry-run]. It reads the index's index.json and records/*.json and appends:
    - <date> — library — <name>: index <hash12> — <N> results (completed …, failed …, …)
  • The hash matches autofit.export.index_hash: the same sha256 over each record's output path, state and completion time. Cortex computes it from the JSON, with no autofit import.
  • A new entry kind, so docs/schema_decisions.md gains a decision record. It is decide-and-flag in the PR for your ruling.
  • REFERENCE.md documents the verb and the entry. cortex.py check accepts the new kind.
  • Tests mirror tests/test_sync_runs.py.

Tier: judge — merge mode: human /prm

Detailed implementation plan

Affected Repositories

  • PyAutoCortex (primary)

Suggested branch: feature/results-library-p5b-cortex

Implementation Steps

  1. scripts/cortex.py: library_entry(index_dir) (read the manifest and records, compute the hash and counts), record_library(root, key, index_dir, name, today, dry_run) (an atomic ledger append, as in sync_runs), and cmd_library plus its parser.
  2. Ledger schema: allow the entry kind library in the checker.
  3. docs/schema_decisions.md: the new decision (facts only, hash definition, no inference); REFERENCE.md: the verb table and entry format.
  4. tests/test_library.py: a fixture index, the entry text, the hash equal to autofit.export.index_hash on the same records (skipped if autofit is unavailable), a dry run, refusals (missing index, unknown project), and check passing.

Original Prompt

Click to expand

Human: "start phase 5", then chose "5a + 5b now" (2026-11-02).

Activity

  1. Jammy2211 commented on Nov 2, 2026

    @Jammy2211
    ContributorAuthor

    PR Created: #85 — decision 65 (new entry kind library) flagged for ruling. 105 tests pass incl. hash parity with autofit.export.index_hash. Tier judge → human /prm.

  2. Jammy2211 commented on Nov 2, 2026

    @Jammy2211
    ContributorAuthor

    Shipped. PyAutoCortex#85 merged — cortex.py library + entry kind library (decision 65, defaults as flagged in the PR). Cortex ships on merge (no PyPI).

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