Skip to content

fix: prevent sentinel whitespace drift on regeneration#52

Open
aommi wants to merge 8 commits into
mainfrom
fix/sentinel-whitespace-drift
Open

fix: prevent sentinel whitespace drift on regeneration#52
aommi wants to merge 8 commits into
mainfrom
fix/sentinel-whitespace-drift

Conversation

@aommi

@aommi aommi commented May 9, 2026

Copy link
Copy Markdown
Owner

Fix the known .lstrip("\n") pitfall in write_managed_section().

Root cause: line 80 concatenates block (which ends with \n) with existing[end_idx + len(SENTINEL_END):] without normalizing the overlapping newline. Every regeneration appended an extra blank line after <!-- amk:end -->.

Confirmed in the wild during jane-interview-coach bootstrap (PR aommi/jane-interview-coach#4).

Fix: strip leading \n from suffix before concatenation — same approach documented in agent-memory-kit-management skill pitfalls.

aommi added 8 commits May 5, 2026 01:20
… (MCP-T5)

Closes MCP parity gaps — all 8 pipeline capabilities now have MCP tools.

Package actions (3 new helpers):
- generate_answers_for_job(): form answer drafting with append semantics
- critique_package_for_job(): recruiter review, strongest-model selection
- generate_questions_for_job(): per-stage STAR questions, append mode

MCP tools: answer_questions(job_id, questions), critique_package(job_id),
generate_questions(job_id, stage, count)

CLI refactored: critique/questions are thin wrappers; answer delegates to helper.
Critique model constants (_CRITIQUE_MODELS) centralized in package_actions.

Tests: 14 new (job_not_found, package_missing, config_error, success for each tool).
Parity guard updated to 8 pairs. Full suite: 275P/12S — no regressions.

Docs: README tools table + example prompts, architecture/MCP.md surface table.
Supersedes earlier Python-engine-extraction approach. Key decisions:
- Pipeline orchestrator IS a skill (markdown), not Python code
- Deterministic tools (scrape, clean, render, assemble) keep execution sharp
- Eval gate: 20 real URLs with measured consistency before shipping
- Fallback: thin Python orchestrator only if eval gate fails
- Removed obsolete V1 and V2 execution plans
Moved to docs/planning/two-product-strategy/:
- TWO_PRODUCT_STRATEGY.md (pitch)
- TWO_PRODUCT_EXECUTION.md (plan)
- applycling-two-products.pptx (10-slide deck)
- build_deck.js (deck builder)
- REVIEW.md (external agent review)
- RESPONSE.md (my response to review)
- README.md (directory summary + open questions)

5 unresolved questions captured for next session.
Normalize suffix after sentinel block — strip overlapping newline
between block's trailing \n and post-sentinel content.

Confirmed in the wild during jane-interview-coach bootstrap.
Same fix applied there in PR #4.
- Copy latest generate.py, adapters/, templates/, eval/ from agent-memory-kit
- Regenerate AGENTS.md with candidates.md/rejected.md + Stage→Graduate flow
- Add memory/candidates.md and memory/candidates.rejected.md (tracked)
- Add candidates paths to project.yaml memory.files
- All checks pass — no drift
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.

1 participant