Skip to content

feat: intake formalise mode — retroactively header the backlog#33

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/intake-formalise
Jul 8, 2026
Merged

feat: intake formalise mode — retroactively header the backlog#33
Jammy2211 merged 1 commit into
mainfrom
feature/intake-formalise

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Adds intake formalise — retroactive conception for the backlog. It selects the census records with missing header fields and inserts the derived Field: value lines in place: Type:/Target: from the taxonomy folder (authoritative), Difficulty:/Autonomy:/Priority: via the same sizing-faculty path used at conception, Status: formalised. Every existing line survives byte-verbatim — including CRLF files, read newline-preserving and written back with their own endings. Work-type disagreements between the body classifier and the folder become re-home suggestions; the mode never moves or deletes a file.

Renamed from the repair codename: raw prompts are intended word-vomit awaiting conception, not defects — and formalise is the verb the agent already stamps (Status: formalised).

Closes #32.

API Changes

CLI surface only — no Python API consumed downstream.

  • bin/pyauto-brain intake formalise [prefix] — dry-run proposes per prompt; --apply writes; optional path-prefix (bug/) scopes the run; --json supported; re-runs are no-ops.

See full details below.

Test Plan

  • Fixture Mind: partial header (fields land inside the leading block, Repos:/Milestone: untouched), headerless with heading, headerless word-vomit (derived # title), complete file byte-identical, CRLF file byte-preserved, prefix filter, idempotent re-run.
  • Live Mind: 83/83 proposals reviewed dry-run, applied; diff insertion-only (17 missing-trailing-newline fixups); 36 re-home suggestions reported, none acted on; census hygiene 77 → 0.
  • Regression: classify / ideas / census / dashboard unchanged; bash -n + py_compile clean.
Full API Changes (for automation & release notes)

Removed

  • None.

Added

  • _intake.py::formalise(mind, prefix="", apply=False) — census-driven selection; writes only under --apply.
  • _intake.py::_derive_fields(text, work_type, target) — folder-authoritative header derivation via the sizing faculty.
  • _intake.py::_insert_fields(text, add, has_header, title) — byte-verbatim insertion (partial block / below heading / derived title), line-ending preserving.
  • _intake.py::emit_formalise(result) — terminal report incl. re-home suggestions.
  • intake.shformalise subcommand routed; help updated.

Migration

  • None — existing modes unchanged. The fixed repairformalise naming only affected docs (repair never shipped).

🤖 Generated with Claude Code

https://claude.ai/code/session_016ttFH96vcXuCVZfSBZEytf

formalise (once codenamed repair; renamed because raw prompts are
intended word-vomit awaiting conception, not defects) selects census
records with missing header fields and inserts the derived lines in
place: Type/Target from the taxonomy folder (authoritative),
Difficulty/Autonomy/Priority via the same sizing-faculty path used at
conception. Every existing line survives byte-verbatim — including CRLF
files, which are read newline-preserving and written back with their
own endings. Work-type disagreements become re-home suggestions; files
are never moved or deleted. Optional path-prefix scopes the run;
dry-run proposes, --apply writes; re-runs are no-ops.

Closes #32.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ttFH96vcXuCVZfSBZEytf
Copilot AI review requested due to automatic review settings July 8, 2026 11:40
@Jammy2211 Jammy2211 merged commit 396d1e6 into main Jul 8, 2026
@Jammy2211 Jammy2211 deleted the feature/intake-formalise branch July 8, 2026 11:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an intake formalise mode to the Intake (Conception) Agent to retroactively insert missing prompt header fields for backlog prompts flagged by the census, while keeping the taxonomy folder authoritative and avoiding any file moves. It also updates the Intake CLI help and documentation to reflect the new subcommand and the rename from the previous “repair” codename.

Changes:

  • Add formalise implementation in the Intake agent to derive missing header fields via the same sizing-faculty path used at conception and optionally write them in-place under --apply.
  • Wire formalise into the intake.sh front door and extend help output.
  • Update Intake docs (skill + agent docs + taxonomy) to document formalise, its guarantees, and its CLI surface.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
skills/intake/intake.md Documents the new intake formalise CLI mode in the skill command.
agents/conductors/intake/intake.sh Adds formalise to help text and subcommand routing.
agents/conductors/intake/INTAKE_TAXONOMY.md Documents the formalise mode semantics and insertion rules.
agents/conductors/intake/AGENTS.md Updates the Intake agent mode table and run examples to include formalise.
agents/conductors/intake/_intake.py Implements field derivation, insertion, application, and reporting for formalise.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +515 to +517
first = next((i for i, ln in enumerate(lines) if ln.strip()), 0)
if lines and lines[first].lstrip().startswith("#"):
lines[first + 1:first + 1] = [""] + field_lines
Comment on lines +554 to +557
if "formalised retroactively" not in new:
nl = "\r\n" if "\r\n" in new else "\n"
new = new.rstrip("\r\n") + nl + nl + stamp + nl
path.write_text(new, encoding="utf-8", newline="")
Comment on lines +564 to +566
"generated": _dt.date.today().isoformat(),
"scanned": c["total"],
"formalised": len(proposals),
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.

feat: intake formalise mode — retroactively header the backlog

2 participants