Skip to content

feat: Lanham style training + ingestion pipeline extensions#47

Open
ProfessorVR wants to merge 4 commits into
ste-bah:mainfrom
ProfessorVR:ports-lanham-ingest
Open

feat: Lanham style training + ingestion pipeline extensions#47
ProfessorVR wants to merge 4 commits into
ste-bah:mainfrom
ProfessorVR:ports-lanham-ingest

Conversation

@ProfessorVR

Copy link
Copy Markdown

Summary

Three additive commits landing together — both features are offline-only (no LLM, no network for training or chunking):

Commit Scope
feat(lanham) archon-lanham crate — POS-free Lanham prose analyzer + archon-style-train binary
feat(cli) archon style train command wired into the CLI
feat(ingest-ext) archon-ingest-ext crate — token-aware chunker, Marker walker, table gate, layout locator

Feature 1 — archon style train

Trains an Archon output-style from sample prose by running a Lanham rhetorical analyzer over the text, writing a .md profile to ~/.archon/output-styles/. The analyzer is a faithful Rust port of the god-agent lanham-shared.ts, measuring eight rhetorical dimensions without a POS tagger: noun/verb ratio, parataxis/hypotaxis, periodic/running architecture, voice, register markedness (Latinate/Germanic), opacity, tacit patterns (anaphora, chiasmus, antithesis, isocolon, alliteration, polyptoton), and sentence/tone stats.

archon style train [FILES...] [--name NAME] [--genre GENRE] [--out PATH] [--stdout]

Golden-tested byte-for-byte against the TypeScript reference (axes, foundation tokenization, lexical analysis, renderer parity).

Feature 2 — Ingestion extensions (archon-ingest-ext)

Four Rust-native ingestion components, each a port of the god-agent Python reference and golden-tested against the Python output:

Component Purpose
Token-aware chunker 800–1200-token chunks with bbox page lineage
Marker JSON walker Flat block stream from Marker's nested JSON tree
Table gate + serializer Rejects prose/TOC tables; emits [TABLE] chunks; never silently drops content
Layout locator Strips and captures running heads (Bekker numbers, page numbers); fixes a 4-digit Bekker-number miss in the Python _BEKKER_RE

This crate is a standalone, additive workspace member — it is not yet wired into the live archon kb ingest pipeline; the Python-reference golden gate (S-1) remains for wire-in time.

Verification

Built and tested locally on stable (rustc 1.96):

  • cargo test -p archon-lanham -p archon-ingest-ext35 passed, 0 failed
  • cargo build --bin archon — full binary compiles clean
  • archon style train smoke-tested end-to-end (stdin → rendered output-style)
  • cargo fmt -p archon-lanham -p archon-ingest-ext --check — clean
  • cargo clippy — 3 minor advisory lints only (CI clippy is advisory, non-blocking)
  • No new unsafe blocks

Breaking changes

None. Both features are purely additive; the existing archon kb ingest CLI surface and output schema are unchanged.

🤖 Generated with Claude Code

Dalton Salvo and others added 4 commits June 26, 2026 10:52
…nary

POS-free L2 port of the god-agent TypeScript analyzer (lanham-shared.ts).
Axes split into focused submodules (lexical, noun_verb, parataxis, prosody,
opacity, tacit) under a shared foundation; every public function is golden-
tested against the TS reference. Includes the archon-style-train binary and
output-style renderer.
…traction

Token-aware chunking, structural table detection/gating, and marker-based
locator extraction for document ingestion. Unit-tested with a Python parity
fixture (marker_selftest.json).
Register archon-lanham in the workspace and add the `style train` subcommand
that trains an output-style from sample prose via
archon_lanham::train_to_output_style. Extracts StyleAction into its own
cli_args module.
… kb ingest

Source-verified, phased plan (PR1 MVP behind flag -> PR2 Marker routing ->
PR3 flip default + S-1 parity gate) for routing the token-aware chunker into
archon-docs: the synthesized-Block + ChunkOut->PageChunk adapter, the inert
HARD_MAX oversized-split caveat, the injectable ChunkerKind switch, and the
chunk_id/re-embed migration blast radius.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

2 participants