T-1 — Externalize the extraction prompt and business config out of the build #10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Labels:
enhancement,blocker:migrationDepends on: nothing. Can land during or immediately after cutover.
Blocks: T-2.
Problem
extraction_system_promptis a ~1.5 KB string inconfig.toml:24. TheContainerfilecopiesconfig.tomlinto the image at/etc/constructionbot/config.toml. Every prompt change therefore requires afull release container build and redeploy.
Constitution rule V mandates re-running the Morella corpus on every change to
the prompt, model, or field mapping. So the highest-frequency loop in the
project — extraction calibration against the ≥80%/≤2-edits target — is coupled
to the slowest loop in the project.
This gets worse under dynamic-nix, not better. Nix derivations are hermetic
by design; a config file baked into the derivation is even harder to hot-swap
than one baked into an image layer. Externalizing config is therefore a
migration prerequisite, not a nice-to-have.
Scope
Move runtime-tunable values out of the image and into the
app_settingstable(the mechanism already exists — migration
0012, plus the/settingspage andits
frontend.rshandlers).Move:
extraction_system_promptdiscipline_mapplan — this ticket should land after those mappings are settled, or carry
them as-is and let the settled values be a data edit rather than a deploy)
spec hintsKeep in
config.toml(genuinely build-time / environment-shaped):procore_base_url,procore_token_url,company_id,project_idlisten, timezone, mailbox addressAcceptance criteria
extraction uses the new prompt. No rebuild, no redeploy, no container restart.
sage::prompt_id()still derives from the effective prompt text, soper-extraction prompt attribution survives — the
prompt_idstored on anextraction row identifies which prompt produced it.
tests/extraction_corpus.rs) reads the effective prompt fromthe same source the worker does, so a calibration run measures what production
will actually use.
config.tomlsupplies the seed/default on an empty table.
back to the config default rather than sending an empty prompt.
--check-configstill validates.Verification
extraction row carries a new
prompt_id.confirm scores differ.