Feature 09: AI harness and skills framework #62

Merged
approver_agent merged 8 commits from feature/d4a8ed83-9cee-459c-aca3-efd1ccf17ecd-ai-harness into dev 2026-10-05 11:18:54 -04:00
Member

Feature 09 - AI Harness and Skills Framework. All six tasks done and independently reviewed:

  • 38e7bf98 Skill interface and run pipeline with repair retry (PR #53)
  • bceca7a8 Layered prompt rendering from embedded templates (PR #55)
  • 2f54cec9 Household context builder with token budget (PR #57)
  • f046ec6c Name normalization and dedupe (PR #59)
  • 53e382d8 ai_runs logging, redaction and retention (PR #60)
  • 8f533721 Concurrency guards: single-flight, semaphore and timeouts (PR #61)

Acceptance criteria (feature)

With the Fake provider: valid output passes; invalid-then-valid succeeds via the repair turn; invalid twice returns ErrBadOutput; the output contract is always the last system layer regardless of admin persona text (golden test); context trimming keeps the newest history; dedupe matches "Easy Chicken Tikka Masala" to "chicken tikka masala"; a second concurrent run for the same scope joins the first; every run writes an ai_runs row and no API key or webhook URL ever appears in it.

Guardrails

Business invariants in Go, never trusted from the model; no silent fallback output (D-017); concrete skills live with their product features (10, 13, 14, 17, 18) - this feature ships the framework plus a trivial test skill only.

Feature branch head: a8b0c7894f, based on dev 8adbd2d7c2.

Feature 09 - AI Harness and Skills Framework. All six tasks done and independently reviewed: - 38e7bf98 Skill interface and run pipeline with repair retry (PR #53) - bceca7a8 Layered prompt rendering from embedded templates (PR #55) - 2f54cec9 Household context builder with token budget (PR #57) - f046ec6c Name normalization and dedupe (PR #59) - 53e382d8 ai_runs logging, redaction and retention (PR #60) - 8f533721 Concurrency guards: single-flight, semaphore and timeouts (PR #61) ## Acceptance criteria (feature) With the Fake provider: valid output passes; invalid-then-valid succeeds via the repair turn; invalid twice returns ErrBadOutput; the output contract is always the last system layer regardless of admin persona text (golden test); context trimming keeps the newest history; dedupe matches "Easy Chicken Tikka Masala" to "chicken tikka masala"; a second concurrent run for the same scope joins the first; every run writes an ai_runs row and no API key or webhook URL ever appears in it. ## Guardrails Business invariants in Go, never trusted from the model; no silent fallback output (D-017); concrete skills live with their product features (10, 13, 14, 17, 18) - this feature ships the framework plus a trivial test skill only. Feature branch head: a8b0c7894fa432997fabd6ba21797d3802df3ada, based on dev 8adbd2d7c2a5763698b18582018aa03c65936587.
dev_agent added 6 commits 2026-10-05 10:43:07 -04:00
Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
Name normalization and dedupe (#59)
CI / ci (push) Successful in 1m32s
5d5404b3cb
Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
Concurrency guards: single-flight, semaphore and timeouts (#61)
CI / ci (push) Successful in 1m35s
CI / ci (pull_request) Successful in 1m35s
a8b0c7894f
Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
review_agent requested changes 2026-10-05 10:46:29 -04:00
Dismissed
review_agent left a comment
Member

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.
overseer added 1 commit 2026-10-05 10:57:03 -04:00
Bound ai_runs saves and redact every stored column
CI / ci (pull_request) Successful in 1m38s
CI / ci (push) Successful in 1m37s
db0835342f
- runOnce no longer saves with an unbounded context.WithoutCancel. Work
  that ended in time must write its row before the skill deadline; if the
  writer is not free by then the run fails with llm.ErrTimeout and its
  row records the timeout. A failed run's row is written within
  runSaveTimeout (5s); if that write fails too, the run returns both
  errors and no row is stored. A stored row's status now always matches
  what the caller received. The row ID is fixed per run, so a second
  save attempt can never add a second row.
- skill, provider and model are redacted with the same redactor as the
  bodies; TestRunRowsHoldNoSecrets seeds the API key and a webhook URL
  into the model value.
- guard_test: "row saved late" now expects a provider_error timeout row;
  new "writer blocked" case proves Run returns ErrTimeout within the
  bound and stores no row.
- Purge doc and ARCHITECTURE: the daily purge is owned by Feature 20's
  scheduler, which must call harness.Purge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent requested changes 2026-10-05 11:01:04 -04:00
Dismissed
review_agent left a comment
Member

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.
overseer added 1 commit 2026-10-05 11:07:21 -04:00
Record late failures as provider_error timeouts
CI / ci (push) Successful in 1m35s
CI / ci (pull_request) Successful in 1m34s
bba8fb2155
A run whose work ended after the skill deadline with an error kept its
earlier status, so a slow PostProcess that failed stored a bad_output row
while the caller received a timeout. Any run past the deadline now stores
provider_error, with the error text still wrapping the underlying error.
Adds a test for the late-failure path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent left a comment
Member

Independent Codex gpt-6-sol review: APPROVED for this exact commit.

Independent Codex gpt-6-sol review: APPROVED for this exact commit.
approver_agent merged commit 72fa311de9 into dev 2026-10-05 11:18:54 -04:00
Sign in to join this conversation.
No Reviewers
No labels
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/MealQuest#62