Tevrin — Specification (0.9.0)
2026-11-30 (amended; first written 2026-11-29) · Ben Fielder · 0.9.0, built on 0.8.0. Earlier versions: docs/0.1.0/SPEC.md … docs/0.8.0/SPEC.md. Stack: STACK.md. Sources:
- Ben’s brief (2026-11-29): build the job application pipeline described in the research notes,
docs/0.7.0/tevrin-engine-extraction.md§”What could be built on the engine afterwards” #4 (job scout → fit scorer → CV tailor → fact-checker → cover letter writer → tracker; “the fact-checker matters most”; “a person reviews and sends each application. Nothing goes out automatically”). - The interview answers in §10. Ben asked for “0.8.1”. A new pack is a feature, so by FR-229 it is a minor version, and Ben chose 0.9.0 with the scheduled removal of the 0.8.x compatibility names (D-0.9.0-1).
- Ben’s second brief (2026-11-30), after build PR #68 (M74–M77) merged: add three more packs to 0.9.0, the content studio (#7), the forecasting desk (#2) and the market research desk (#1) from the same research notes, using
docs/0.8.0/session-notes.md§7 for their order and engine needs. The second interview’s answers are D-0.9.0-16 to D-0.9.0-19. These packs are built on branchbuild/tevrin-0.9.0-packs(FR-393 onwards, M78–M81), and the release moves to M82.
How this spec relates to 0.1.0–0.8.0. 0.9.0 is an increment on 0.8.0. Everything in the earlier specs stays in force unless this document amends it (amendments are listed in §3.0). New requirements continue from FR-368, domain rules from §4.78, decisions use
D-0.9.0-n, and milestones continue from M74. Earlier tests stay green unless an amendment changes what they assert. When one does, update the test and name the amendment in it.
1. Overview
0.9.0 does three things. The first two were built in PR #68. The third was added on 2026-11-30:
- It retires the 0.8.x compatibility names. The old
aidenames that 0.8.0 read “until 0.9.0” (§4.77) stop working. Old names that live in data Tevrin can’t rewrite (stored artifacts, audit records, commits in users’ repos, external platforms) are kept for good (§4.85). - It ships the second product pack: job applications (
Tevrin.Pack.Careers). One run takes one job posting and does the following:- the job scout structures the posting;
- the fit scorer maps its requirements to evidence in the master CV;
- a deterministic score and threshold veto end poor fits early;
- the CV tailor writes a tailored CV in which every line cites master CV items;
- the fact-checker (deterministic traceability rules, then a validator agent) rejects anything it can’t trace back;
- the cover letter writer drafts a letter, checked the same way;
- a person reviews the rendered application, sends it themselves, and marks it sent;
- the tracker records the application. Later outcomes (interview, offer) grade the fit scorer’s predictions.
A second pipeline,
job-digest, summarises recent applications on a schedule. Nothing leaves Tevrin: the pack registers no external handler and no tool. - It ships three more packs (§3.5–§3.8), each testing a different shape of agent arrangement, on top of a small set of generic engine additions (§3.5):
- Content studio (
Tevrin.Pack.Studio, the editorial loop): it turns pasted sources into a YouTube script with title and thumbnail concepts. The researcher quotes sources verbatim, the writer cites facts, and a fact-checker rejects untraceable claims. The editor can send work back to research or writing, under a revision cap for the whole run. Three title and thumbnail variants go to a person to pick. Nothing is published. - Forecasting desk (
Tevrin.Pack.Forecasting, ensemble forecasting): it reads a Polymarket binary market through a read-only adapter. Three forecasters with different prompts estimate the probability in isolation, without seeing each other or the market price. A deterministic aggregator combines them and flags disagreement. A daily follow-up checks for resolution and scores every forecaster, the desk and the market itself (Brier). A weekly calibration report compares them. Nothing is bet. - Market research desk (
Tevrin.Pack.Markets, adversarial debate): it takes one ticker with prices from Alpaca’s read-only market data. Bull and bear analysts write cases in parallel, then rebut each other. The portfolio manager proposes a paper decision, which deterministic risk limits and a risk-manager veto check. Follow-ups after 1, 5 and 20 days grade the call from real prices, and a post-mortem writes lessons into each agent’s feedback store. Nothing is traded: there is no order code, paper or live.
- Content studio (
Success means:
- Every §4 worked example is a unit test, and the §4.80 example runs end to end on the Fake provider.
- A fabricated claim (a new employer, a changed date or metric, an unsupported skill) never reaches the review gate. Either the run retries with findings, or it escalates.
- The pack is YAML, schemas, prompts, and its guards and handlers (pure code). The engine changes it needs are generic and listed in §3.2 (research step 6: “any time you have to change engine code, you’ve found a gap”).
- The engine UI renders both pipelines with no careers-specific frontend code.
- After 0.9.0, no allowlist entry has a removal version at or below the current version (FR-370).
- The studio, forecasting and markets packs follow the same rule: YAML, schemas, prompts, and pure guards and handlers, plus host adapters for market data. Each engine change is generic and listed in §3.5. Each pack’s §4 examples run end to end on the Fake provider with fake market data.
- An untraceable script claim, a forecaster that sees another’s output or the market price, and a decision over the risk limits never reach a person or a record.
In scope: retiring the compatibility names (§3.1); generic engine additions (§3.2, §3.5); the careers pack with two pipelines (§3.3); the studio, forecasting and markets packs (§3.6–§3.8); release housekeeping (§3.4).
Out of scope:
- Finding jobs automatically: no web search, no URL fetching, no job-board or RSS feeds (D-0.9.0-2). Postings arrive by paste, upload or signed webhook.
- Sending anything: no email, no portal submission, no external tracker (Sheets, Notion) (D-0.9.0-4).
- PDF or DOCX export: the application is Markdown, for copying or downloading as
.md. - Batch runs (one run scoring many postings) and child runs (D-0.9.0-3).
- Publishing, betting and trading: no YouTube upload, no image generation (thumbnails are text briefs), no Polymarket orders, no Alpaca orders (paper or live), and no broker account access (D-0.9.0-18).
- Fetching web pages or news: the studio’s sources and the desks’ news are pasted, uploaded or sent by webhook (D-0.9.0-17). The only outbound calls are the two read-only market data adapters (§3.7, §3.8).
- Multi-outcome Polymarket markets (only binary Yes/No markets), and asset classes other than US equities and ETFs on Alpaca’s data feed.
- Other packs from the research notes (the QA lab, on-call triage and the agent economy), packaging, a CLI, and runtime definition upload. These stay out, as in 0.8.0.
2. Users and permissions
Roles are unchanged: project Viewer, Contributor and Owner, plus instance admins. A careers project is one person’s job search, so the project owns its runs (as D-0.8.0-2).
| Action | Who | Unauthorised |
|---|---|---|
| Start a run, submit a posting or submission input, retry a stage | Contributor and up | 403 FORBIDDEN; 404 NOT_FOUND for a project they can’t see |
Add a version of the master CV, contact details, search profile, channel_profile, desk_profile or portfolio |
Contributor and up | 403 FORBIDDEN |
| Lock a version of those artifacts | Owner (D-0.8.0-19) | 403 FORBIDDEN |
Decide application_approval, publish_approval, variant_select, decision_review and escalation gates |
Owner, in every approval mode (engine gate decisions, as 0.8.0) | 403 FORBIDDEN |
| Record or change a declared outcome (FR-374) | Contributor and up | 403 FORBIDDEN |
| Cancel or roll back a run; manage schedules and webhooks | Owner | 403 FORBIDDEN |
| Read runs, artifacts, outcomes and digests | Viewer and up | 404 NOT_FOUND |
Auth is unchanged, apart from the retired legacy forms (FR-368): only tevrin_pat_… tokens and the tevrin.auth cookie authenticate.
3. Functional requirements
3.0 Amended earlier requirements
| Earlier | What changes | Where |
|---|---|---|
| 0.8.0 §4.77 and the FR-325/FR-326 “read both” rules | Rows marked “until 0.9.0” end. Names held in stored or external data are kept for good instead (§4.85) | FR-368, FR-369 |
| 0.8.0 FR-329 allowlist | Entries with removal 0.9.0 are deleted or changed to never, and a new check refuses expired entries |
FR-370 |
| 0.8.0 FR-353 outcome scoring | Adds a declared-metric request form, and a recorded declared metric replaces the run’s earlier score for it | FR-373, FR-374, §4.83 |
0.8.0 FR-357 from_runs |
Optional with_outcomes: true |
FR-376 |
| 0.8.0 FR-350 validator agents | Guards run before validator agents. A guard rejection skips the validator agents for that attempt | FR-377 |
0.8.0 FR-347 routes, FR-344 veto to: |
The re-entered agent gets the reason as feedback, as D-0.9.0-9 does for gate on_reject |
FR-393 |
| 0.8.0 FR-354 follow-ups (agent stages only, fixed durations) | Handler follow-up stages, and repeating follow-ups (every, for) |
FR-394 |
0.8.0 FR-280 StageHandlerResult |
A handler may return declared outcome values, which the engine records | FR-395 |
| 0.9.0 §4.83, FR-373 (outcome targets are agent stages, not fan-out or variants) | Fan-out stages (one score per branch), handler stages and variants stages (the selected variant) may be targets. Scores carry a branch label | FR-396, §4.86 |
0.8.0 FR-351 writes_feedback (one agent) |
Takes a list | FR-397 |
3.1 Retire the compatibility names (M74)
| ID | Requirement | Layer |
|---|---|---|
| FR-368 | Stop reading the retired names (§4.85, “removed” rows): - aide_pat_… API tokens no longer authenticate (401 UNAUTHENTICATED);- aide.* cookies and sign-in properties, and the aide:token_id claim, are ignored;- aide-approval-link/v1 links fail verification;- the Git host OAuth state names from before 0.8.0 are no longer read; - aide_merges input gives 400 VALIDATION;- .aide-fake/fail-* and aide-fake:fail markers are ignored;- browser storage keys aide.* are no longer migrated;- outgoing webhooks stop sending X-AIDE-* headers;- commits stop carrying the AIDE-Step-Id trailer.Config: ConnectionStrings:Aide, AIDE_DATA_DIR, AIDE_IMPORT_ROOT and AIDE_E2E are no longer read. If one of them is set and its Tevrin name isn’t, the API fails to start with one log line naming the old and new names, so a missed rename can’t quietly lose the database |
backend + frontend + deploy |
| FR-369 | Keep reading names held in data Tevrin can’t rewrite (§4.85, “kept” rows): aide-plan and aide-stack-profile blocks in stored artifacts; AIDE-Step-Id in existing commits; the aide-system actor in audit records; aide_merges inside stored event payloads; aideDeploymentId Vercel metadata; and aide-preview Railway environments in users’ accounts. These readers are kept, with tests |
backend |
| FR-370 | Allowlist cleanup. Every allowlist entry with removal 0.9.0 is deleted or changed to never with a reason (§4.85). The tests-folder entry narrows to the kept names. Tests of old forms being read become tests of them being refused (FR-368) or still read (FR-369). check-aide-names.py fails when an entry’s removal version is at or below the version in Directory.Build.props |
backend + CI |
| FR-371 | Upgrade notes. .railway/railway.ts drops the old variable it still listed. A docs page, Upgrading to 0.9.0, lists what stops working and what to do (recreate API tokens, sign in again, rename ConnectionStrings__Aide, update webhook receivers that check X-AIDE-*). The changelog entry has a Breaking highlight that names what stops working and links the upgrade page (D-0.9.0-15) |
deploy + docs |
FR-368–FR-371 acceptance
- Given a token starting
aide_pat_, when it calls/api/me, then 401. Given atevrin_pat_token, then 200. - Given a browser holding only
aide.auth, when it loads/api/me, then 401, and notevrin.authis set. - Given only
ConnectionStrings__Aideset, when the API starts, then it exits non-zero, and the log namesConnectionStrings__Tevrin. Given both set, then it starts with the Tevrin value. - Given
PUTproject settings withmergeStrategy: "aide_merges", then 400VALIDATION. - Given an outgoing notification webhook, then its request has
X-Tevrin-*headers and noX-AIDE-*. - Given a stored 0.7.0 plan with an
aide-planblock, then its steps still parse (FR-369). - Given an audit record with actor
aide-system, then it still lists as the system actor (FR-369). - Given an allowlist entry with removal
0.9.0while the version is 0.9.0, thencheck-aide-names.pyfails and names the entry (FR-370).
3.2 Engine additions (M75)
These are generic. Each is tested on an engine fixture as well as the careers pack. New definition fields are left out of the canonical JSON when unused, so existing hashes don’t change.
| ID | Requirement | Layer |
|---|---|---|
| FR-372 | Project artifacts in the engine UI. The Pipeline tab gains a Project artifacts section listing every scope: project artifact the project’s pipelines declare. Each shows its versions and statuses, and which version is newest locked. It offers:- add version (Contributor), with the FR-362 schema form or JSON editor, or a file upload (JSON, or text for Markdown artifacts); - lock (Owner); - diff between versions, with the existing diff view. It uses the existing endpoints (§6), and the coach’s athlete_profile gets it for free |
frontend |
| FR-373 | Declared outcomes. A pipeline-level block outcomes: [{ metric, title, kind: probability_brier \| number, target: { stage }, prediction?: { artifact, path } }]:- target.stage must be an agent stage with an output;- prediction.artifact must be that stage’s output (DEF_OUTCOME_TARGET);- probability_brier needs prediction, and number must not have one (DEF_OUTCOME_KIND);- metric names are unique ( DEF_OUTCOME_METRIC).The definition DTO carries the block |
backend |
| FR-374 | Record a declared outcome. POST /api/pipeline-runs/{runId}/outcomes also takes { metric, value, observedAt?, note? } for a declared metric. The engine resolves the target and the prediction (§4.83), stores the score with source user:<id>, and marks the run’s previous score for that metric superseded. It errors as follows:- an undeclared metric, or a value outside {0, 1} for probability_brier, gives 400 VALIDATION;- a run with no completed target stage gives 409 OUTCOME_TARGET_MISSING.Active and completed runs both accept outcomes. The 0.8.0 free-form request is unchanged |
backend + data |
| FR-375 | Outcomes panel. A run of a pipeline with declared outcomes shows an Outcomes panel. Each metric has its title, its current value (yes, no or not recorded) and a change control (Contributor), plus the prediction and score when recorded | frontend |
| FR-376 | from_runs with outcomes. from_runs: { …, with_outcomes: true } adds outcomes: [{ metric, value, prediction?, score, observedAt }] to each list item: the current (not superseded) score per declared metric. Handlers get it in RunsInputFact, and agents get it in {{<ARTIFACT>_RUNS}} |
backend |
| FR-377 | Guards before validator agents. On each attempt, a stage’s validate: guards run first, in declared order. If any guard returns findings, the attempt is rejected with those findings, and validator agents aren’t called for it. Validator agents run, in declared order, only when every guard passes. Their findings join the same feedback. If the engine already does this, FR-377 is a test (fixture fixture-factcheck gains a guard) |
backend |
FR-372–FR-377 acceptance
- Given a Contributor on a careers project with no master CV, when they add a version through the schema editor, then it lists as a draft. An Owner locks it, and it shows as newest locked. A Viewer sees the list with no add or lock controls (FR-372).
- Given a definition whose outcome targets a handler stage, then the validator gives
DEF_OUTCOME_TARGETatoutcomes[0].target.stage(FR-373). - Given §4.83’s example, then recording
interview = 1stores score 0.09. Recordinginterview = 0afterwards stores 0.49 and supersedes the first (FR-374). - Given a run vetoed at
scout(noassess), wheninterviewis recorded, then 409OUTCOME_TARGET_MISSING(FR-374). - Given
fixture-trendswithwith_outcomes: true, then each list item carries its runs’ current outcomes (FR-376). - Given a stage whose guard rejects attempt 1, then no validator agent run is recorded for attempt 1. Attempt 2 passes the guard, and the validator agent runs (FR-377).
3.3 Careers pack (M76, M77)
| ID | Requirement | Layer |
|---|---|---|
| FR-378 | The pack project is backend/src/Tevrin.Pack.Careers (pack id careers). It references only Tevrin.Engine.Domain and holds:- Definitions/job-application.pipeline.yaml and Definitions/job-digest.pipeline.yaml;- JSON schemas and prompts (embedded); - key constants ( CareersAgents, CareersArtifacts, CareersGates, CareersGuardNames, CareersHandlerNames);- CareersPack : IPipelinePack;- its guards and handlers, as pure code over input records. Tevrin.Api adds CareersPipelineRegistration, which binds the guards and handlers and implements their inputs source (the pattern of CoachPipelineRegistration). The architecture tests cover the new pack (it references no other pack or host assembly, and no engine assembly references it). Tests live in backend/tests/Tevrin.Pack.Careers.Tests |
backend |
| FR-379 | Artifacts (schemas in §5.1): - project scope, approval required, pinned at run start (FR-352): master_cv (JSON), candidate_contact (JSON), search_profile (JSON);- inputs: job_posting (JSON, auto_lock), submission (JSON, auto_lock);- stage outputs, JSON, auto_lock: job, fit_assessment, fit, tailored_cv, cover_letter, application_record;- for review: application_pack (Markdown, approval required).candidate_contact is read only by the render handler and is never an agent input (§8) |
backend |
| FR-380 | The pipeline job-application. It is engine-controlled with concurrency: { runs: many }. Triggers: manual, and webhook (input job_posting). Approval modes: strict and advisory (default advisory); there is no autonomous mode (D-0.9.0-4). Stages, in order:1. scout: agent job-scout; inputs job_posting, search_profile; output job. It has requires: [{ input: job_posting }, { guard: careers.master-cv-valid }] and veto: [{ guard: careers.duplicate-posting }] → on_veto: { end: vetoed }.2. assess: agent fit-scorer; inputs job, master_cv, search_profile; output fit_assessment. It has validate: [{ guard: careers.fit-evidence }] and on_invalid: { retry_with_feedback: true, max_attempts: 3, then: escalate }.3. score: handler careers.fit-score; inputs job, fit_assessment, search_profile; output fit. It has veto: [{ guard: careers.fit-threshold }] → on_veto: { end: vetoed }.4. tailor: agent cv-tailor; inputs master_cv, job, fit, search_profile; output tailored_cv. It has validate: [{ guard: careers.cv-traceability }, { agent: cv-fact-checker }], the same on_invalid, and feedback: { inject: true, limit: 20 }.5. letter: agent cover-letter-writer; inputs master_cv, job, fit, tailored_cv, search_profile; output cover_letter. It has validate: [{ guard: careers.letter-traceability }, { agent: letter-fact-checker }], the same on_invalid and the same feedback.6. render: handler careers.render-application; inputs tailored_cv, cover_letter, candidate_contact, job, fit; output application_pack.7. review: gate application_approval, modes [strict, advisory], approving application_pack, with on_reject: { to: tailor, max_iterations: 4 } (it counts the first tailoring, so three rejections rerun it).8. track: handler careers.track; inputs job, fit, job_posting, submission; output application_record. It has requires: [{ input: submission }].Declared outcomes (FR-373): interview and offer, both probability_brier and targeting assess, with predictions fit_assessment.interviewProbability and fit_assessment.offerProbability. The definition passes the §4.49 validator |
backend |
| FR-381 | careers.master-cv-valid guard (a requires-guard on scout). The pinned master_cv has a valid, unique id on every item (§4.80 M1, for a missing, malformed or duplicate id). The pinned candidate_contact has a name (M2) and at least one of email or phone (M3). An unmet check fails the stage with its reasons, before any agent runs |
backend |
| FR-382 | careers.duplicate-posting veto (§4.78). It vetoes when another run in the project, started in the last 180 days and not cancelled, has a posting with the same identity, unless job_posting.allowDuplicate is true. The finding names the other run |
backend |
| FR-383 | Fit evidence, score and threshold (§4.79): - the careers.fit-evidence guard checks that fit_assessment covers every job requirement exactly once, and that every evidence id exists in the pinned master CV;- the careers.fit-score handler computes fit deterministically (score, band, counts, deal breakers);- the careers.fit-threshold veto ends the run when the score is below search_profile.minFitScore, or a deal breaker is hit, unless job_posting.ignoreFitThreshold is true |
backend |
| FR-384 | careers.cv-traceability guard (§4.80, rules T1–T7). It returns one finding per broken instance, as rule: message with the JSON path, e.g. T5: experience[0].bullets[1] states "45%", which isn't in its sources (acme-a2: "cut build time by 40%") |
backend |
| FR-385 | Fact-checker (validator agent, FR-350). It gets the stage output, the pinned master CV, the job and the source rules. It returns findings with path, claim and reason. Severity error is for a claim its cited sources don’t support, an inflated one (scope, seniority, ownership, numbers) or a misattributed one. Severity warning is for phrasing that’s weaker or vaguer than the source allows. Two agent keys, cv-fact-checker and letter-fact-checker (agent keys are unique per pipeline), share one prompt, careers.fact-checker, which receives {{STAGE_ID}} from a host context provider (D-0.9.0-13) |
backend |
| FR-386 | careers.letter-traceability guard (§4.81, rules L1–L4) |
backend |
| FR-387 | careers.render-application handler. It produces application_pack (Markdown) in a fixed layout (§4.82): a review summary (company, title, fit score and band, the posting URL, warnings carried from the fact-checker), then the CV, then the cover letter, with contact details merged from candidate_contact. It is deterministic: the same inputs give the same bytes |
backend |
| FR-388 | Review and nothing sent. application_approval shows application_pack. A reject comment goes back to tailor as feedback, and letter and render rerun after it. The pack registers no tools and no external handlers. A test asserts this, and that no stage in either definition lists tools:. The review copy says the person sends the application themselves |
backend |
| FR-389 | careers.track handler. After approval, the run waits on the submission input (waiting_on_input, shown as Mark sent in the engine UI). The handler then writes application_record (§5.1) with status applied or not_sent, and the run ends completed |
backend |
| FR-390 | The pipeline job-digest is engine-controlled. Triggers: manual, and schedule (e.g. 0 8 * * 1). Stages:1. stats: handler careers.digest-stats; input from_runs: { pipeline: job-application, artifact: application_record, window: 30d, status: completed, with_outcomes: true }; output digest_stats (§4.84);2. write: agent digest-writer; input digest_stats; output digest (Markdown).It has no gates |
backend |
| FR-391 | Pack docs. A docs-site guide, Job applications pack, covers: - both pipelines and every artifact schema; - writing a master CV with item ids, and locking it; - the fit score and threshold, the traceability rules (with a fabricated-claim example), and the review and mark-sent flow; - recording outcomes; - starting a run from the UI, the API and a signed webhook (with a bookmarklet-style example); - scheduling the digest. It states plainly that nothing is sent automatically |
docs |
FR-378–FR-391 acceptance (Fake provider)
- Given the pack, then it references only
Tevrin.Engine.Domain, and the architecture tests fail if it references a pack or a host assembly (FR-378). - Given no locked
master_cv, when a run starts, then 409SOURCE_ARTIFACT_MISSINGnaming “Master CV” (FR-379, FR-352). - Given a master CV with id
acme-a1used twice, thenscoutfails before any agent runs, withM1: id "acme-a1" is used 2 times(FR-381). - Given §4.78’s example, then the second posting’s run ends
completedwith outcomevetoedafter onejob-scoutrun. WithallowDuplicate: true, it continues (FR-382). - Given §4.79 example A, then
fit.scoreis 50, and the run is vetoed with findingF1. Given example B, then the score is 94 (bandstrong), andtailorruns (FR-383). - Given §4.80’s worked example, then:
tailorattempt 1 is rejected by T3 and T5, and no fact-checker run is recorded for it (FR-377);- attempt 2 passes the guard, and the fact-checker rejects “led” with an
errorfinding; - attempt 3 passes both;
letter,renderand theapplication_approvalgate follow (FR-384, FR-385).
- Given three tailor attempts that all fail, then one escalation gate is pending, and
letterhasn’t run. - Given the gate is rejected with “drop the Kotlin line”, then
tailorreruns with that comment in its feedback, andletterandrenderfollow. Three rejections each rerun them, and a fourth is refused bymax_iterations: 4and fails the run, as engineon_rejectcaps do (FR-388). - Given the gate is approved, then the run is
waiting_on_inputforsubmission. When{ status: sent, sentAt, channel: portal }is submitted, thenapplication_record.statusisappliedand the run iscompleted(FR-389). - Given
renderruns twice on the same inputs, then the twoapplication_packcontents have the same hash, and the contact email appears in the pack but in no recorded agent prompt (FR-387, §8). - Given §4.84’s example, then
digest_statsequals the expected JSON, anddigest-writergets it (FR-390). - Given both definitions served by MSW, then the Pipeline tab, Project artifacts, Mark sent, the Outcomes panel and the replay render with no careers code in
src/engine/(FR-372, FR-375).
3.4 Release housekeeping (M82; it was M78 before the 2026-11-30 amendment)
| ID | Requirement | Layer |
|---|---|---|
| FR-392 | Version 0.9.0 in the three version sources. A changelog entry with a Breaking list (FR-371). Its title, “Job applications pack”, becomes “Four new packs” when M81 lands, and its highlights name the studio, forecasting and markets packs. The Pipelines and packs guide gains outcomes: and with_outcomes, plus the §3.5 additions. CLAUDE.md, STACK.md and the layout gain Tevrin.Pack.Careers, Tevrin.Pack.Studio, Tevrin.Pack.Forecasting and Tevrin.Pack.Markets, with their test projects (CI runs each test project, and the Dockerfile copies each csproj). At release: docs/history/0.9.0.md, with SPEC and PROGRESS moved to docs/0.9.0/ |
frontend + docs + CI |
FR-392 acceptance: given the release commit, then scripts/ci/check-version.sh 0.9.0 passes, the docs site builds with the five new guides (job applications, content studio, forecasting desk, market research desk, market data), and the link check passes.
3.5 Engine additions for the three packs (M78)
These are generic, each tested on an engine fixture as well as by its pack. Unused fields stay out of the canonical JSON, so existing hashes don’t change (pin them, as AgentBindingHashTests does). Every new name a definition can reference is added to PipelineDefinitionResolver.MissingNames.
| ID | Requirement | Layer |
|---|---|---|
| FR-393 | Feedback on backward moves. When a route (FR-347) or a veto on_veto: { to } (FR-344) moves a run back, the agent of the re-entered stage gets the reason as feedback on its next attempt, as D-0.9.0-9 does for an entry gate’s on_reject. For a route, the reason is the routing output’s optional top-level route_reason string, cut to 4,000 characters. The engine adds no schema, so a pack whose routing artifact has a strict schema declares route_reason itself. For a veto, it’s the veto findings, one per line. A route with no route_reason gives Sent back by <stage> with no reason. |
backend |
| FR-394 | Handler and repeating follow-ups. (1) A follow-up stage may be a handler stage with an output, as well as an agent stage. (2) A follow-up entry may repeat: followups: [{ stage, every: <duration>, for: <duration> }], instead of after:. The first check is due every after completed_at. A handler that returns Waiting is queued again for the next due time. Completed stops it. Failed keeps the next check due, and three consecutive failures stop it (followup_failed). When the next check would fall after completed_at + for, it stops, and the stage execution records followup_expired (§4.88). Only handler stages repeat. every is ≥ 1h, and for is between every and 400d. The output label is followup:<every>#<n> (n counts from 1). Validator code: DEF_FOLLOWUP_REPEAT (a repeat on an agent stage, both after and every, or bad durations). Cancelling the run cancels the pending check (§4.88) |
backend |
| FR-395 | Outcomes recorded by a handler. StageHandlerResult gains Outcomes: [{ metric, value, observedAt?, note? }]. When the handler completes, the engine records each one as a declared outcome of the run (FR-374 and §4.86 rules, superseding included), with source stage:<stageId>. An undeclared metric or a bad value fails the stage with VALIDATION. A missing target or prediction is skipped and logged as OUTCOME_TARGET_MISSING on the stage execution, without failing the stage. Handlers in main-flow stages and follow-ups can both do this. Handlers also get the run’s current declared scores as OutcomesFact (§4.86) |
backend |
| FR-396 | More outcome targets (amends FR-373 and §4.83; rules in §4.86). target.stage may now be: a fan-out stage, scored once per branch, from each branch’s own output; a handler stage with a JSON output, which scores the output artifact version (no agent run); or a variants stage, which scores the selected variant. Conversation, map and parallel group stages are still refused (DEF_OUTCOME_TARGET). Scores gain branch (the fan-out agent key or sample label; null otherwise). Data: a new migration adds outcome_scores.branch (nullable varchar(100)), and replaces the partial unique index with one on (pipeline_run_id, metric, coalesce(branch, '')) where declared and not superseded. API: OutcomeScoreDto adds branch. with_outcomes items carry branch on each outcome. UI: the Outcomes panel shows one row per branch under a fan-out metric, and the change control records the metric once for all of them |
backend + data + frontend |
| FR-397 | writes_feedback takes a list: writes_feedback: [{ agent, from }…] writes entries for several agents from one output (the single-object form still loads, and hashes as before). An agent key may appear once (DEF_DUPLICATE_ID). writes_feedback is allowed on agent follow-up stages |
backend |
FR-393–FR-397 acceptance (engine fixtures, Fake provider)
- Given
fixture-editorialwhose editor returns{ route: "research", route_reason: "Source s2 is from 2019; find newer data" }, then the researcher’s next attempt has that text in its feedback, and the revision count is 1 (FR-393). - Given a veto
to: proposewith findingsK1: size 8% > 5%, then the proposer’s next prompt holdsK1: size 8% > 5%(FR-393). - Given a repeating follow-up
{ stage: check, every: 1d, for: 3d }whose fake handler returnsWaitingtwice and thenCompleted, then it runs on days 1, 2 and 3 with labelsfollowup:1d#1to#3, and nothing is queued after that. If it always returnsWaiting, then the third check is the last, and the execution recordsfollowup_expired(FR-394). - Given an agent stage in a repeating follow-up, then
DEF_FOLLOWUP_REPEATatfollowups[0].every(FR-394). - Given a handler that returns
{ metric: "hit", value: 1 }for a declaredprobability_briermetric targeting a fan-out stage with 3 branches predicting 0.6, 0.8 and 0.3, then 3 current scores are stored (0.16, 0.04, 0.49), each with its branch and sourcestage:<id>(FR-395, FR-396). - Given a handler stage target with prediction 0.5, when
hit = 0is recorded, then the score is 0.25, and it targets the output artifact version (FR-396). - Given a variants stage target where v2 was selected, then the score uses v2’s prediction (FR-396).
- Given
writes_feedback: [{ agent: a, from: la }, { agent: b, from: lb }], thenaandbeach get one entry per string (FR-397).
3.6 Content studio pack (M79)
| ID | Requirement | Layer |
|---|---|---|
| FR-398 | The pack project is backend/src/Tevrin.Pack.Studio (pack id studio), with Definitions/content-studio.pipeline.yaml, schemas, prompts, key constants (StudioAgents, StudioArtifacts, StudioGates, StudioGuardNames, StudioHandlerNames), StudioPack : IPipelinePack, and its pure guards and handler. It references only Tevrin.Engine.Domain. Tevrin.Api/Pipelines/StudioPipelineRegistration.cs binds them. Tests are in backend/tests/Tevrin.Pack.Studio.Tests. The architecture tests cover it. Veto guards get no stage facts, so studio.repeat-topic, forecasting.market-open and markets.universe read their artifacts through a host inputs source, as careers.duplicate-posting does |
backend |
| FR-399 | Artifacts (§5.2): project scope channel_profile (JSON, approval required, pinned); input content_brief (JSON, auto_lock); stage outputs topic, research_notes, script, edit_review and package (JSON, auto_lock); for review, production_pack (Markdown, approval required) |
backend |
| FR-400 | The pipeline content-studio is engine-controlled, with concurrency: { runs: many }. Triggers: manual, and webhook (input content_brief). Modes: strict and advisory (default advisory). It has limits: { revisions: 3, then: escalate }. Stages:1. scout: agent topic-scout; inputs content_brief, channel_profile, and from_runs: { pipeline: content-studio, artifact: topic, window: 365d }; output topic. It has requires: [{ input: content_brief }] and veto: [{ guard: studio.repeat-topic }] → on_veto: { end: vetoed }.2. research: agent researcher; inputs content_brief, topic; output research_notes. It has validate: [{ guard: studio.research-grounding }], on_invalid: { retry_with_feedback: true, max_attempts: 3, then: escalate } and feedback: { inject: true, limit: 10 }.3. write: agent script-writer; inputs topic, research_notes, channel_profile; output script. It has validate: [{ guard: studio.script-traceability }, { agent: script-fact-checker }], the same on_invalid and the same feedback.4. edit: agent editor; inputs topic, research_notes, script, channel_profile; output edit_review, with routes: [research, write].5. package: agent packager; inputs topic, research_notes, script, channel_profile; output package. It has variants: { count: 3, select: gate }, validate: [{ guard: studio.package-rules }] (each variant is checked), and on_invalid: { retry_with_feedback: true, max_attempts: 2, then: fail }.6. render: handler studio.render; inputs topic, script, research_notes, package, content_brief; output production_pack.7. review: gate publish_approval, modes [strict, advisory], approving production_pack, with on_reject: { to: write, max_iterations: 3 }.Declared outcomes: views_7d and ctr_pct (number, target package, which is the selected variant). Escalations and the revision cap follow FR-348 |
backend |
| FR-401 | studio.repeat-topic veto and studio.research-grounding guard (§4.89, rules V1 and R1–R4). content_brief.allowRepeat: true skips V1 |
backend |
| FR-402 | studio.script-traceability guard (§4.90, rules S1–S6) and script-fact-checker (a validator agent, FR-350). The fact-checker gets the script, the research notes and the source texts. It returns error findings for a claim its fact ids don’t support, or one that overstates them (certainty, scale, causation, recency), and warning findings for loaded or vague wording. Guards run first (FR-377) |
backend |
| FR-403 | Editor routes. edit_review holds route (continue, research or write), route_reason, scores (hook, clarity, accuracy and pacing, 1–5) and notes. A route back reruns that stage with route_reason as feedback (FR-393), and the stages after it follow. The fourth backward move in a run (routes plus gate rejections) is refused by limits.revisions: 3, and an escalation gate is raised (FR-348) |
backend |
| FR-404 | Title and thumbnail variants. packager makes 3 variants of package (§5.2). A variant_select gate shows them side by side, and the Owner picks one. Only the chosen variant reaches render. studio.package-rules checks P1–P3 (§4.91) on each variant |
backend |
| FR-405 | Render and nothing published. studio.render writes production_pack deterministically, in the §4.92 layout: the script with section timings, the chosen title, the thumbnail brief, the description, and a source list mapping each fact id to its source. publish_approval shows it. The pack registers no tools and no external handlers, and a test asserts it. The review copy says the person publishes the video themselves |
backend |
| FR-406 | Pack docs. A docs-site guide, Content studio pack, covers the pipeline, every artifact, writing a content brief with source ids, the grounding and traceability rules (with an example of a rejected claim), editor routes and the revision cap, picking a variant, recording views_7d and ctr_pct, and starting runs from the UI, the API and a webhook. It states that nothing is published or fetched |
docs |
FR-398–FR-406 acceptance (Fake provider)
- Given no locked
channel_profile, when a run starts, then 409SOURCE_ARTIFACT_MISSINGnaming “Channel profile” (FR-399). - Given §4.89’s example, then
researchattempt 1 is rejected withR2andR3, and attempt 2 passes (FR-401). - Given §4.90’s example, then
writeattempt 1 is rejected by S1 and S3 with no fact-checker run. On attempt 2, the fact-checker rejects “proves”, and attempt 3 passes (FR-402). - Given an editor that routes to
researchand then towrite, then the stages rerun in order with their reasons as feedback. Given a fourth backward move, then an escalation gate is pending, andpackagehasn’t run (FR-403). - Given 3 package variants where v2 breaks P1, then v2 is retried with feedback. When the Owner picks v3 at
variant_select, thenproduction_packholds v3’s title (FR-404). - Given the same inputs twice, then
production_packhas the same hash (FR-405). - Given a topic matching a run from 200 days ago, then the run ends
vetoedwithV1. Given 400 days, then it continues (FR-401).
3.7 Forecasting desk pack (M80)
| ID | Requirement | Layer |
|---|---|---|
| FR-407 | The pack project is backend/src/Tevrin.Pack.Forecasting (pack id forecasting), with Definitions/forecast.pipeline.yaml and Definitions/forecast-calibration.pipeline.yaml, schemas, prompts, key constants, ForecastingPack, pure guards and handlers, and an interface it declares for market data (IPredictionMarketSource: GetMarketAsync(slug) returning question, rules, end date, outcomes, Yes price, volume, closed and resolution). It references only Tevrin.Engine.Domain, and tests are in backend/tests/Tevrin.Pack.Forecasting.Tests |
backend |
| FR-408 | The Polymarket adapter (host; Tevrin.Infrastructure/MarketData/Polymarket/). It implements IPredictionMarketSource over Polymarket’s public, read-only market data API, needing no key:- GET requests only, to the configured base URL (MarketData:Polymarket:BaseUrl), with a 10 s timeout, 2 retries on 5xx or timeout, and a 2 MB response cap;- it maps a market slug, or a polymarket.com/event/… or /market/… URL, to the market;- unknown gives MARKET_DATA_NOT_FOUND, and other failures MARKET_DATA_UNAVAILABLE (stage errors, §6).Field mapping is tested against recorded JSON fixtures. No test calls the real API. There is no order, wallet or auth code |
backend |
| FR-409 | Artifacts (§5.3): input forecast_request (JSON, auto_lock); outputs market (question, rules and dates, no price), market_price, news_brief, forecast (per branch), consensus (JSON, auto_lock), and forecast_brief (Markdown, auto_lock). There is no project-scope artifact |
backend |
| FR-410 | The pipeline forecast is engine-controlled, with concurrency: { runs: many }. Triggers: manual, and webhook (input forecast_request). Modes: advisory and autonomous (default autonomous; it has no gates, because nothing is acted on). Stages:1. snapshot: handler forecasting.market-snapshot; input forecast_request; output market (§4.93). It has requires: [{ input: forecast_request }] and veto: [{ guard: forecasting.market-open }] → on_veto: { end: vetoed }.2. price: handler forecasting.market-price; input forecast_request; output market_price (§4.93). It’s a separate stage so that the price is its own artifact, which the forecasters never get.3. news: agent news-analyst; inputs market, forecast_request; output news_brief. It has validate: [{ guard: forecasting.news-grounding }] and on_invalid: { retry_with_feedback: true, max_attempts: 3, then: escalate }.4. forecast: agents forecaster-base-rate, forecaster-news and forecaster-skeptic (each bound under agents: with its own prompt, and model if set); fan_out: { agents: [those three] }; inputs market, news_brief (not market_price); output forecast. It has on_invalid: { retry_with_feedback: true, max_attempts: 2, then: fail }.5. combine: handler forecasting.combine; aggregate: { from: forecast, disagreement: { guard: forecasting.spread } }; input market_price; output consensus (§4.94).6. brief: agent desk-writer; inputs market, market_price, news_brief, consensus; output forecast_brief.Follow-ups: [{ stage: resolve, every: 1d, for: 400d }], where resolve is handler forecasting.resolve (§4.95).Declared outcomes, all probability_brier: forecasters (target forecast, path probability, one score per branch), desk (target combine, path probability) and market (target price, artifact market_price, path yesPrice) |
backend |
| FR-411 | forecasting.market-snapshot and forecasting.market-price handlers, and the forecasting.market-open veto. The handlers read the market through IPredictionMarketSource via the host inputs source. The veto ends the run when the market is closed (O1), isn’t binary Yes/No (O2), or ends within 24 hours of the run’s start (O3) |
backend |
| FR-412 | forecasting.news-grounding guard. forecast_request.news is a list of pasted items { id, title?, text, publishedAt? } (0–30). Every news_brief.facts[i] cites an existing item id (N1), quotes it verbatim (N2, the §4.89 R2 rule), and has no number that isn’t in its quote (N3). With no items, facts must be empty and the brief says so |
backend |
| FR-413 | Forecaster isolation. Each forecaster’s prompt holds only market and news_brief. A test asserts that no forecaster prompt contains the Yes price (as a decimal or a percentage) or another branch’s output, and the engine’s fan-out isolation check (FANOUT_ISOLATION_BROKEN) applies. Each forecast holds probability (0.01–0.99), confidence (low, medium or high), reasoning, keyFactors[], and baseRate? |
backend |
| FR-414 | forecasting.combine handler and forecasting.spread guard (§4.94). Combine is deterministic: the mean, spread, edge against the market price, and the disagreement flag. The guard adds a warning when the spread is ≥ 0.25. It never fails the stage (FR-346 disagreement) |
backend |
| FR-415 | forecasting.resolve follow-up (§4.95). Daily, it reads the market. While it’s unresolved, it returns Waiting. When resolved Yes or No, it records forecasters, desk and market with value 1 or 0 (FR-395) and completes. A void or 50/50 resolution records nothing, notes void and completes. After 400 days it expires (FR-394). A data failure on one day fails that check only, and the next day is still due |
backend |
| FR-416 | The pipeline forecast-calibration is engine-controlled. Triggers: manual, and schedule (e.g. 0 9 * * 1). Stages:1. stats: handler forecasting.calibration-stats; input from_runs: { pipeline: forecast, artifact: consensus, window: 400d, status: completed, with_outcomes: true }; output calibration_stats (§4.96);2. write: agent calibration-writer; output calibration_report (Markdown).It has no gates |
backend |
| FR-417 | Pack docs. A docs-site guide, Forecasting desk pack, covers both pipelines, the artifacts, the three forecasters and why they don’t see the market price, combine and the spread warning, resolution and Brier scores, the calibration report, starting from the UI, the API and a webhook, and the data source. It states that the desk only reads public market data and never bets | docs |
FR-407–FR-417 acceptance (Fake provider, fake market source)
- Given a closed market, then the run ends
vetoedwithO1after no agent runs (FR-411). - Given §4.94’s example, then
consensusequals the expected JSON, and the spread warning is on the stage execution (FR-414). - Given the three forecaster prompts of a run, then none holds
0.48or48%(the Yes price), and each holds only its own instructions (FR-413). - Given a market that resolves Yes on day 3, then checks 1 and 2 return
Waiting, and check 3 recordsforecasters(3 rows, one per branch),deskandmarketscores and completes. Prompt comparison shows the meanforecastersscore for each forecaster key (FR-415, FR-396). - Given §4.96’s example, then
calibration_statsequals the expected JSON (FR-416). - Given the adapter fixtures, then the slug, a
/event/URL and a/market/URL map to the same market. A 404 givesMARKET_DATA_NOT_FOUND, and three 503s giveMARKET_DATA_UNAVAILABLE(FR-408).
3.8 Market research desk pack (M81)
| ID | Requirement | Layer |
|---|---|---|
| FR-418 | The pack project is backend/src/Tevrin.Pack.Markets (pack id markets), with Definitions/market-research.pipeline.yaml, schemas, prompts, key constants, MarketsPack, pure guards and handlers, and a declared interface IPriceHistorySource: GetDailyBarsAsync(symbol, from, to) and GetAssetAsync(symbol) (name, exchange, tradable, class). It references only Tevrin.Engine.Domain, and tests are in backend/tests/Tevrin.Pack.Markets.Tests |
backend |
| FR-419 | The Alpaca market data adapter (host; Tevrin.Infrastructure/MarketData/Alpaca/). It implements IPriceHistorySource over Alpaca’s market data API (daily bars, IEX feed by default) and asset lookup:- GET only, to the configured data and asset base URLs, with the key id and secret from config (MarketData:Alpaca:KeyId, MarketData:Alpaca:SecretKey, MarketData:Alpaca:Feed), and the same timeout, retry and size rules as FR-408;- the asset lookup uses the paper API host only; - with no keys configured, the stage fails with MARKET_DATA_UNAVAILABLE and the message “Alpaca market data isn’t configured”.A test asserts the adapter has no order, position or account-write call, and that its HTTP client only targets the configured data and asset hosts. Fixture-based tests only |
backend |
| FR-420 | Artifacts (§5.4): project scope desk_profile and portfolio (JSON, approval required, pinned); input research_request (JSON, auto_lock); outputs price_snapshot, scan, bull_case, bear_case, bull_rebuttal, bear_rebuttal, proposal, decision_record, grade and postmortem (JSON, auto_lock) |
backend |
| FR-421 | The pipeline market-research is engine-controlled, with concurrency: { runs: many }. Triggers: manual, and webhook (input research_request). Modes: strict, advisory and autonomous (default advisory). Stages:1. snapshot: handler markets.price-snapshot; input research_request; output price_snapshot (§4.97). It has requires: [{ input: research_request }] and veto: [{ guard: markets.universe }] → on_veto: { end: vetoed }.2. scan: agent scanner; inputs research_request, price_snapshot, desk_profile; output scan. It has validate: [{ guard: markets.case-grounding }] and on_invalid: { retry_with_feedback: true, max_attempts: 3, then: escalate }.3. cases: parallel with branches bull (agent bull-analyst → bull_case) and bear (agent bear-analyst → bear_case), both with inputs scan, price_snapshot, research_request, the same validate and on_invalid (then: fail inside the group), and feedback: { inject: true, limit: 10 }; on_branch_failure: fail.4. rebuttals: parallel with branches bull_rebut (agent bull-rebuttal, prompt markets.rebuttal; inputs bull_case, bear_case, price_snapshot; output bull_rebuttal) and bear_rebut (agent bear-rebuttal, the same prompt, the mirror; output bear_rebuttal). Agent keys are unique per pipeline, so the rebuttals have their own keys, and {{SIDE}} comes from a host context provider (as D-0.9.0-13). Both have the case-grounding validate.5. propose: agent portfolio-manager; inputs scan, the four cases and rebuttals, price_snapshot, desk_profile, portfolio; output proposal. It has validate: [{ guard: markets.risk-limits }], on_invalid: { retry_with_feedback: true, max_attempts: 3, then: escalate }, veto: [{ agent: risk-manager }] → on_veto: { end: vetoed }, and feedback: { inject: true, limit: 10 }.6. review: gate decision_review, modes [strict], approving proposal, with on_reject: { to: propose, max_iterations: 3 }.7. record: handler markets.record; inputs proposal, price_snapshot, research_request; output decision_record.Follow-ups: [{ stage: grade, every: 1d, for: 45d }, { stage: postmortem, after: [32d] }]. grade is handler markets.grade (§4.100), and postmortem is agent post-mortem with writes_feedback: [{ agent: bull-analyst, from: lessons.bull }, { agent: bear-analyst, from: lessons.bear }, { agent: portfolio-manager, from: lessons.pm }] (FR-397).Declared outcomes: return_1d, return_5d, return_20d (number, target record) and direction_20d (probability_brier, target propose, path upProbability) |
backend |
| FR-422 | markets.price-snapshot handler and markets.universe veto (§4.97). The snapshot holds the asset, the last 60 daily bars, the last close, 20- and 50-day simple moving averages, 20-day realised volatility and the 52-week range (from 252 bars when available). The veto ends the run when the symbol isn’t tradable or isn’t a US equity or ETF (U1), is on desk_profile.restricted (U2), or has fewer than 20 bars (U3) |
backend |
| FR-423 | markets.case-grounding guard (§4.98, rules C1–C3) on scan, the cases and the rebuttals. Each claim with a number cites price:<field> or a pasted news id, and the number must match |
backend |
| FR-424 | Risk limits and the risk manager (§4.99 K1–K5). markets.risk-limits is a validate guard, so the PM revises its size with the findings. risk-manager is a veto agent that sees the proposal, both cases, both rebuttals and the limits. It vetoes a thesis that ignores the strongest bear point or depends on one event. A veto ends the run vetoed, with its findings logged as the decision not taken |
backend |
| FR-425 | Record and nothing traded. markets.record writes decision_record (action, symbol, entry close and date, size, stop, horizon, upProbability, rationale summary, run id). The pack registers no tools and no external handlers, and no code in the pack or the adapter places, changes or reads orders or positions (a test asserts this). The UI copy says decisions are paper records only |
backend |
| FR-426 | markets.grade follow-up (§4.100). Daily for up to 45 days, the handler reads bars after the entry date through the source. It records return_1d, return_5d and return_20d (trading days) as each is reached, and not again (FR-395, OutcomesFact). At 20 bars it records direction_20d and completes. A source failure fails that check only (§4.88) |
backend |
| FR-427 | Post-mortem and feedback. At 32 days, post-mortem gets the decision record, the four cases and rebuttals, the grades and {{OUTCOME_SCORES}}. It returns { summary, calledRight: bool, lessons: { bull[], bear[], pm[] } } (≤ 3 lessons each, ≤ 300 characters each), and the lessons become feedback entries for those agents (FR-351, FR-397). Later runs inject them |
backend |
| FR-428 | Pack docs. A docs-site guide, Market research desk pack, covers the pipeline, the artifacts, desk_profile and portfolio, the debate shape, risk limits and the veto, grading and post-mortems, feedback, starting runs, and the data source. It states that decisions are paper records, nothing trades, and nothing is financial advice |
docs |
| FR-429 | Market data configuration. MarketDataOptions (validated at start-up, keys optional), the .railway/railway.ts variables (the Alpaca key id and secret as secret references, set by Ben), deploy/railway/variables.md, deploy/k8s/overlays/local/secrets.env.example, and a docs page, Market data, which covers creating Alpaca data keys and the Polymarket base URL. The keys never reach a prompt, a log or a stored payload (SecretRedaction gains the Alpaca header names) |
deploy + backend + docs |
FR-418–FR-429 acceptance (Fake provider, fake price source)
- Given a symbol on
desk_profile.restricted, then the run endsvetoedwithU2and no agent runs (FR-422). - Given the bull and bear branches, then neither prompt holds the other’s case, and both rebuttal prompts hold both cases (FR-421).
- Given §4.98’s example, then the scan’s attempt 1 is rejected with
C2, and attempt 2 passes (FR-423). - Given §4.99’s example, then
proposeattempt 1 is rejected withK1andK2, and attempt 2 (size 4%) passes. When the risk manager vetoes, the run endsvetoed(FR-424). - Given strict mode, then
decision_reviewis pending beforerecord. Given advisory mode, then there’s no gate (FR-421). - Given §4.100’s example, with bars arriving one per weekday, then the checks record
return_1d1.5 at bar 1,return_5d−2.8 at bar 5, andreturn_20d8.0 withdirection_20d0.1225 at bar 20, then complete. Weekend checks returnWaitingand record nothing. No metric is recorded twice (FR-426). - Given the 32-day post-mortem with two bull lessons, then
bull-analysthas two new feedback entries, and the next run’s bull prompt holds them (FR-427). - Given no Alpaca keys, then
snapshotfails withMARKET_DATA_UNAVAILABLEand the configuration message (FR-419). - Given the API log of a run with keys configured, then neither key value appears (FR-429).
4. Domain rules
4.78 Posting identity and duplicates
A posting’s identity is its normalised url when present, else lower(trim(company)) + "|" + lower(trim(title)) from the scout’s job. To normalise a URL:
- lower-case the scheme and host, and drop a leading
www.; - drop the fragment, the query parameters
utm_*,ref,sourceandtrk, and a trailing/; - sort the remaining query parameters.
The veto compares with every other non-cancelled run in the project that started before this one (ties broken by run id), within 180 days of this run’s start, so the first of two concurrent runs isn’t vetoed by the second. Runs that were vetoed count too, so a repeat of a poor fit is caught as well.
Example: https://www.Example.com/jobs/123/?utm_source=li&b=2&a=1#apply and https://example.com/jobs/123?a=1&b=2 have the same identity → D1: same posting as run <id> started 2026-11-20.
4.79 Fit score
Each job.requirements[i] has a kind (must weighs 3, nice weighs 1). Each fit_assessment match is met (1), partial (0.5) or missing (0).
score = round_half_up(100 × Σ(weight × match) / Σ weight).- Bands: ≥ 75 is
strong, 60–74good, 40–59weak, < 40poor. Anymustthat ismissingcaps the band atweak(the score is unchanged). - Evidence (
careers.fit-evidence):- E1: every requirement id appears exactly once;
- E2: every
met/partialhas at least one evidence id; - E3: every evidence id exists in the pinned master CV.
- Threshold (
careers.fit-threshold): a veto whenscore < minFitScore(default 60), ordealBreakersHitisn’t empty.- Findings:
F1: fit 50 is below your threshold 60,F2: deal breaker "no relocation": <reason>. ignoreFitThreshold: trueskips both checks.
- Findings:
Example A: musts r1 met, r2 partial, r3 missing; nices r4 met, r5 missing.
- Σw = 11, and Σ = 3 + 1.5 + 0 + 1 + 0 = 5.5 → 50, band
weak. - With threshold 60 → veto with F1.
Example B: musts r1 and r2 met; nices r3 met, r4 partial.
- Σw = 8, and Σ = 7.5 → 93.75 → 94, band
strong.
4.80 CV traceability (careers.cv-traceability)
Master CV ids. Every item in master_cv (role, achievement, education, certification, project, skill) has an id matching ^[a-z][a-z0-9-]{0,39}$, unique across the CV (M1). Sources in outputs are master CV ids.
Rules for tailored_cv (§5.1):
| Rule | Check |
|---|---|
| T1 | Every bullet, summary sentence and skill has at least one source |
| T2 | Every source id exists in the pinned master CV |
| T3 | Each experience[i] has a roleId that is a master role, and its employer, title, start and end equal that role’s |
| T4 | A bullet’s sources are achievements of its own role, or skills |
| T5 | Every number in a text appears among the numbers of its sources’ texts and metrics |
| T6 | Each skill name equals (case-insensitive, trimmed) a master skill name, or a skill tag of a cited achievement |
| T7 | Each education[i] equals its source’s institution, qualification and dates, and each certifications[i] its source’s name, issuer and date. No entry exists without a source |
Numbers (T5, L1). A number is a run of digits with an optional decimal part, after removing thousands separators (1,200 → 1200). Currency symbols, % and words around it are ignored, and k/m suffixes aren’t expanded. So £1.2m gives 1.2, which must appear as 1.2 in a source, and years count. The check is on the set of values.
Worked example (§3.3 acceptance). Master role acme (Acme Ltd, Senior Engineer, 2021-03 to 2024-06) with achievement acme-a2: “Contributed to the CI migration, cutting build time by 40%”.
- Attempt 1: title “Lead Engineer” (T3) and the bullet “Cut build time by 45%” citing
acme-a2(T5) → rejected, and the fact-checker doesn’t run. - Attempt 2: title fixed, and the bullet “Led the CI migration, cutting build time by 40%”. The guard passes. The fact-checker returns an
error: “‘Led’ overstates ‘contributed to’” → rejected. - Attempt 3: “Helped migrate CI, cutting build time by 40%” → passes.
4.81 Cover letter (careers.letter-traceability)
cover_letter is { greeting, paragraphs: [{ text, sources: [] }], signOff }. A source is a master CV id or job:<requirementId>. A paragraph with no sources may make no claim about the candidate; the fact-checker enforces that (FR-385).
- L1: numbers, as T5, against cited master CV sources.
- L2: every source exists (a master CV id, or a requirement id of the run’s
job). - L3: the letter names
job.companyat least once, and names no other employer from the master CV as the company being applied to. The check is an exact, case-insensitive match against master role employers, only where the employer name directly follows “join”, “joining”, “apply to”, “applying to”, “role at”, “position at”, “opportunity at” or “team at” (D-0.9.0-14). So “At Acme Ltd I led…” passes, and “I’m excited to join Acme Ltd” fails when Acme Ltd is a past employer and notjob.company. - L4: 150–450 words in total (whitespace-split, over greeting, paragraphs and sign-off).
4.82 Application pack layout
# Application: <title>, <company>
> Fit <score> (<band>) · <posting url or "no URL"> · Review before sending: Tevrin sends nothing.
> Fact-checker warnings: <n> (listed below, or "none")
---
# <name>
<headline>
<email> · <phone> · <location> · <links joined by " · ">
## Summary / ## Experience / ## Education / ## Certifications / ## Skills
---
# Cover letter
<greeting> … <signOff>
<name>
Empty sections are left out. Dates render as Mar 2021 – Jun 2024, or – present when there is no end date. Line endings are \n, and there is no trailing whitespace.
4.83 Declared outcomes
- Target: the agent run that produced the newest current output of
target.stagein the run: not superseded, invalidated, rejected or corrupted. So after a rollback invalidates it, and before the stage runs again, recording gives 409.target.stagemay not be a fan-out, variants, map or conversation stage (DEF_OUTCOME_TARGET). - Prediction: the value at
prediction.pathin that agent run’s output artifact. A missing value, or one outside [0, 1], gives 409OUTCOME_TARGET_MISSING. - Score: the Brier score (§4.74).
- Replacement: recording a metric again supersedes the earlier score for that run and metric (it is kept, with
superseded_at). Prompt-comparison means andwith_outcomesuse only current scores.
Example: interviewProbability 0.7. Record interview = 1 → 0.09. Then record interview = 0 → 0.49, and the 0.09 row is superseded.
4.84 Application status and digest stats
Status of a record, taken from the first rule that matches:
not_sent(application_record.status);offer, whenoffer = 1;interviewing, wheninterview = 1;rejected, wheninterview = 0;no_response, whensentAtis ≥ 21 days before the stage time;applied.
digest_stats:
windowDays;countsby status;sent(every status butnot_sent);responseRate = (interviewing + offer + rejected) / sent, rounded to 2 decimal places (0 when nothing was sent);meanFitof sent records, rounded to 2 decimal places (null when nothing was sent);meanFitInterviewed(records withinterview = 1), or null when there are none;brier.interview: the mean current score, or null;applications: newest first, each{ company, title, status, fitScore, sentAt }.
Example (stage time 2026-12-28):
- Records:
- A sent 12-01, fit 80, interview = 1;
- B sent 12-02, fit 70, interview = 0;
- C sent 12-20, fit 65, no outcomes;
- D sent 11-30, fit 90, interview = 1, offer = 1;
- E
not_sent, fit 62.
- Statuses: A interviewing, B rejected, C applied (8 days), D offer, E not_sent.
- Stats: sent 4; responseRate 3 / 4 = 0.75; meanFit (80 + 70 + 65 + 90) / 4 = 76.25; meanFitInterviewed (80 + 90) / 2 = 85.
4.85 Compatibility names after 0.9.0 (amends §4.77)
| Name | 0.9.0 | Why |
|---|---|---|
aide_pat_… tokens, aide.* cookies and sign-in properties, aide:token_id, Git host OAuth state names |
removed | Transient or user-recreatable. Users recreate tokens and sign in again (FR-371) |
aide-approval-link/v1 |
removed | Links expire after 72 hours |
ConnectionStrings:Aide, AIDE_DATA_DIR, AIDE_IMPORT_ROOT, AIDE_E2E |
removed; the API fails to start if one is set without its new name | So a missed rename is loud |
aide_merges as API input |
removed (400) | Input form only |
X-AIDE-* outgoing headers, written AIDE-Step-Id trailer |
removed | Sent or written values only |
.aide-fake failure markers, aide.* browser storage keys |
removed | Test markers; preferences reset once |
aide-plan and aide-stack-profile blocks, AIDE-Step-Id in existing commits, the aide-system audit actor, aide_merges in stored payloads, aideDeploymentId, Netlify aide: build titles and aide previews hook titles, aide-preview environments |
kept (never) |
Locked artifacts, audit records and users’ repositories and platforms can’t be rewritten (rule 9) |
Every row 0.8.0 already marked never or “next pack version” |
unchanged |
4.86 Outcome targets and branches (engine, amends §4.83)
| Target stage | Scored output | Agent run | branch |
|---|---|---|---|
| Agent stage | Newest current output | Its producer | null |
| Fan-out stage | Each branch’s newest current output | Each branch’s producer | The agent key, or sample-<n> for count: |
| Handler stage | Newest current output version | none: the score targets the artifact version | null |
| Variants stage | The selected variant | Its producer | null |
- A fan-out metric is recorded once, and one score is stored per branch that has a current output. Branches without one are skipped. If every branch is skipped, the result is 409
OUTCOME_TARGET_MISSING. - Recording a fan-out metric again supersedes every current row of it in that run.
- Handlers get the run’s current declared scores as
OutcomesFact(metric, branch, value, score), so a repeating handler can skip metrics it has already recorded (FR-395).
Example: a fan-out with predictions 0.6, 0.8 and 0.3. Recording hit = 1 stores 0.16, 0.04 and 0.49, each with its agent key as branch.
4.87 Feedback on backward moves (FR-393)
The feedback a re-entered agent gets is one block. Its first line names the cause: Sent back by <stage> (route) or Vetoed at <stage>. A gate rejection keeps the D-0.9.0-9 wording. The reason follows: route_reason, or the veto findings one per line. The block comes before any validate findings, as gate feedback already does, and it stays with the re-entered stage’s retries until the stage completes (D-0.9.0-24).
4.88 Repeating follow-ups (FR-394)
- Check n is due at
completed_at + n × every, not counted from when the previous check ran, so delays don’t drift. - The last check is the largest n with
n × every ≤ for. Waitingqueues the next check.Completedstops.Failedrecords the failure, and the next check stays due. Three consecutive failures stop it withfollowup_failed.- A check that’s missed (the worker was down) runs once when the worker is back, and later due times don’t change.
- Cancelling the completed run cancels the pending check, and a check that’s running when the run is cancelled queues nothing after it. This amends 0.8.0 FR-354: a completed run whose only follow-up is running can now be cancelled (before, it gave
RUN_NOT_ACTIVE).
Example: completed_at 2026-12-01 10:00Z, every: 1d, for: 3d. The checks are due on 12-02, 12-03 and 12-04 at 10:00Z. If the third returns Waiting, the execution records followup_expired, and nothing more is queued.
4.89 Studio: repeat topics and research grounding
Repeat (V1). The slug of topic.workingTitle: lower-case, characters other than a-z0-9 turned into -, repeated - collapsed, ends trimmed. V1 vetoes when a from_runs topic from the last 365 days has the same slug, unless content_brief.allowRepeat. For example, “Is a Lifetime ISA worth it in 2027?” and “is a lifetime ISA worth it in 2027” share is-a-lifetime-isa-worth-it-in-2027 → V1: same topic as run <id> started 2026-06-03.
Grounding (research_notes.facts[], each { id, claim, sourceId, quote }). To normalise text: collapse whitespace, make curly quotes and dashes straight, and lower-case it.
- R1: ids are
f1,f2, … and unique; there are 3–60 facts. - R2:
sourceIdis acontent_brief.sources[].id, and the normalisedquote(10–500 characters) is a substring of that source’s normalised text. - R3: every number in
claim(the §4.80 number rule) is among the numbers inquote. - R4: every claim is 1–400 characters.
Example: source s1 reads “UK CPI inflation fell to 2.3% in April 2024, the ONS said.”
- Attempt 1:
f1claims “Inflation fell to 2.1% in April 2024”, quoting “inflation fell to 2.3%” →R3: f1 states "2.1", which isn't in its quote.f2quotes “inflation dropped sharply” →R2: f2's quote isn't in source s1. - Attempt 2: “UK CPI inflation fell to 2.3% in April 2024”, quoting “CPI inflation fell to 2.3% in April 2024” → passes.
4.90 Studio: script traceability (studio.script-traceability)
script is { hook: { text, factIds }, sections: [{ id, heading, broll?, lines: [{ kind: claim | opinion | transition | cta, text, factIds }] }], outro: { text, factIds } }. The hook counts as a claim line.
| Rule | Check |
|---|---|
| S1 | Every claim line cites at least one fact id |
| S2 | Every fact id exists in research_notes |
| S3 | Every number in a claim line is among the numbers in its cited facts’ claims |
| S4 | An opinion, transition or cta line has no number, so a figure is always a cited claim |
| S5 | Runtime: total words ÷ channel_profile.wordsPerMinute (default 150) is within ±20% of the target (content_brief.targetMinutes, else channel_profile.defaultMinutes, default 8) |
| S6 | No channel_profile.bannedPhrases entry appears (case-insensitive) |
S3 and S4 ignore numbers in window lengths (a number directly followed by -day, ` days, -week, weeks, -month, months, -year or years`).
Example (fact f1 = “UK CPI inflation fell to 2.3% in April 2024”):
- Attempt 1: the claim line “Inflation is under control now” cites nothing →
S1: sections[0].lines[2]. “It fell to 2.1%” citesf1→S3: … states "2.1", which isn't in its facts (f1). The guard rejects, and the fact-checker isn’t called. - Attempt 2: the numbers are fixed, and “This proves rates will be cut” is a
claimcitingf1. The fact-checker returnserror: “‘proves’ claims a cause; f1 reports a figure”. - Attempt 3: “Some economists expect that to make rate cuts likelier” becomes an
opinionwith no number → passes. - Runtime: 1,230 words at 150 wpm is 8.2 minutes, inside 6.4–9.6 for a target of 8. 1,500 words is 10 minutes →
S5: runtime 10.0 min is outside 6.4–9.6.
4.91 Studio: package rules (studio.package-rules)
package is { title, thumbnailText, thumbnailBrief, description, factIds }.
- P1:
titleis 20–70 characters;thumbnailTextis 1–5 words;thumbnailBriefis at most 500 characters;descriptionat most 1,000. - P2: every number in
title,thumbnailTextanddescriptionis among the numbers of the facts infactIds(S3’s window exception applies). - P3: no banned phrase (S6).
Example: the title “Inflation Hit 2% — What It Means for Your Savings” with factIds: [f1] → P2: title states "2", which isn't in its facts (f1).
4.92 Studio: production pack layout
# <title>
> Runtime ~<m:ss> at <wpm> wpm · Review before publishing: Tevrin publishes nothing.
> Fact-checker warnings: <n> (listed below, or "none")
## Thumbnail
**<thumbnailText>**: <thumbnailBrief>
## Description
<description>
## Script
### 0:00 Hook
<hook text> [f1, f3]
### <m:ss> <heading>
<each line> [<fact ids>] (opinion, transition and cta lines have no brackets)
_B-roll: <broll>_
### <m:ss> Outro
## Sources
- f1: "<quote>" (<source title>, <url or "no URL">, <publishedAt or "undated">)
Each section’s time is the words before it ÷ wpm, rounded down to whole seconds. Only facts the script cites are listed, in id order. Line endings are \n, and there is no trailing whitespace.
4.93 Forecasting: market snapshot (forecasting.market-snapshot, forecasting.market-open)
forecast_request.market may be a market slug, polymarket.com/market/<m>, polymarket.com/event/<e>/<m>, or polymarket.com/event/<e>. An event with exactly one market resolves to that market. An event with several gives O2: event <e> has 4 markets; give a market slug.
market:{ slug, question, rules, endDate, outcomes, closed, resolution: yes | no | void | null }.rulesis Polymarket’s description text. It’s untrusted, so prompts put it in a data block.market_price:{ yesPrice, volume, fetchedAt }, whereyesPriceis the Yes outcome’s price (0–1).- Veto:
O1:closed;O2: outcomes other than exactly["Yes", "No"];O3:endDatewithin 24 hours of the run’s start.
4.94 Forecasting: combine (forecasting.combine)
With branch probabilities pᵢ in agent order (base-rate, news, skeptic), using decimal arithmetic and rounding half up to 3 places:
probability= mean(pᵢ);spread= max − min;edge=probability−yesPrice;stance:above_marketwhen edge ≥ 0.05,below_marketwhen ≤ −0.05, elsein_line;disagreement= spread ≥ 0.25;branchesis[{ agent, probability, confidence }].
The spread guard’s warning is S1: forecasters disagree by <spread> (<min>–<max>).
- Example A: 0.62, 0.55 and 0.71, with a Yes price of 0.48 → probability 0.627, spread 0.160, edge 0.147,
above_market, no warning. - Example B: 0.30, 0.72 and 0.50 → probability 0.507, spread 0.420 →
S1: forecasters disagree by 0.42 (0.30–0.72).
4.95 Forecasting: resolution (forecasting.resolve)
market read |
Result |
|---|---|
Not closed, or closed but resolution null |
Waiting |
yes / no |
Record forecasters, desk and market with value 1 / 0. Completed |
void (refunded, or settled at 50/50) |
Record nothing, output { resolution: void }. Completed |
Example A, resolved Yes: the forecasters score 0.1444, 0.2025 and 0.0841, the desk (0.627) scores 0.139129, and the market (0.48) scores 0.2704.
4.96 Forecasting: calibration stats (forecasting.calibration-stats)
Only items with current scores count as resolved. Means use decimal arithmetic and round half up to 4 places.
resolvedandunresolvedcounts;forecasters: per agent key,{ n, meanBrier };deskandmarket:{ n, meanBrier };skill= 1 − desk mean ÷ market mean, from the unrounded means, to 3 places (null when n = 0 or the market mean is 0);buckets: the desk predictions in tenths ([0.0, 0.1)…[0.9, 1.0]), each{ n, meanPrediction, hitRate }. Empty buckets are left out.
Example: run A (above, Yes), run B (0.20, 0.35 and 0.10, desk 0.217 and market 0.30, resolved No), and run C (unresolved):
- Counts: resolved 2, unresolved 1.
- Forecasters: base-rate (0.1444 + 0.04) / 2 = 0.0922; news (0.2025 + 0.1225) / 2 = 0.1625; skeptic (0.0841 + 0.01) / 2 = 0.04705 → 0.0471.
- Desk: (0.139129 + 0.047089) / 2 = 0.093109 → 0.0931.
- Market: (0.2704 + 0.09) / 2 = 0.1802.
- Skill: 1 − 0.093109 / 0.1802 = 0.483.
- Buckets:
[0.6, 0.7)n 1, hit rate 1.0;[0.2, 0.3)n 1, hit rate 0.0.
4.97 Markets: price snapshot and universe (markets.price-snapshot, markets.universe)
From the daily bars up to the run’s start (up to 252 of them, requested over 380 calendar days):
lastCloseandasOfcome from the last bar;sma20andsma50(null with fewer bars) are rounded to 2 places;vol20= the standard deviation of the last 20 daily log returns × √252 × 100, to 1 place;high52wandlow52wcover the available bars;- the derived fields
pctFromSma20,pctFromSma50,pctFrom52wHighandreturn20dare percentages to 1 place; - the last 60 bars are kept as
bars.
Universe veto:
U1: the asset isn’t tradable, or its class isn’tus_equity;U2: the symbol is indesk_profile.restricted;U3: there are fewer than 20 bars.
Example: 20 closes rising from 100 to 119 by 1 → sma20 109.50, and return20d = (119 / 100 − 1) × 100 = 19.0.
4.98 Markets: case grounding (markets.case-grounding)
scan, the cases and the rebuttals hold points: [{ text, refs }]. A ref is price:<field> (a numeric price_snapshot field) or news:<id> (a research_request.news item).
- C1: every ref exists.
- C2: every number in a point’s text is among its refs’ numbers (a field’s value at its stored precision, and the news item’s text). The S3 window exception applies.
- C3: every point has at least one ref. A rebuttal point may also cite
case:<n>(the n-th point of the other side’s case), which adds that point’s numbers.
Example: pctFromSma50 is 7.2. The point “Trades 9% above its 50-day average” citing price:pctFromSma50 → C2: points[0] states "9", which isn't in its refs. “Trades 7.2% above its 50-day average” passes, because “50-day” is a window.
4.99 Markets: risk limits (markets.risk-limits)
proposal:{ action: buy | short | hold | avoid, sizePct, stopPct?, horizonDays, upProbability, conviction (1–5), thesis, invalidation, rationale }.desk_profile:maxPositionPct(default 5),maxSectorPct(25),allowShort(false),minConviction(3) andrestricted[].portfolio:{ positions: [{ symbol, sector, valuePct }] }.research_request: carriessymbol,sector?,news[]andnotes?.
| Rule | Check (buy and short only, except K4) |
|---|---|
| K1 | sizePct + the existing valuePct of the same symbol ≤ maxPositionPct |
| K2 | When sector is given: the sector’s existing valuePct + sizePct ≤ maxSectorPct |
| K3 | stopPct is 1–25 |
| K4 | hold and avoid have sizePct 0. Conviction below minConviction must be hold or avoid |
| K5 | short needs allowShort |
Example: limits 5 and 25. The portfolio holds AAPL (tech, 3%) and MSFT (tech, 18%). The request is NVDA, sector tech.
- Attempt 1: buy 8%, stop 10 →
K1: size 8% is over the 5% limitandK2: tech would be 29%, over 25%. - Attempt 2: buy 4% → tech is 25% → passes.
4.100 Markets: grading (markets.grade)
The bar count is the number of trading days, counting daily bars dated after entryDate.
- The schedule:
graderepeats (every: 1d, for: 45d, FR-394), andreturn_<k>is the close of the k-th bar after the entry date, for k = 1, 5 and 20. Using bars rather than calendar days skips weekends and holidays (D-0.9.0-20). - On each check, the handler reads the bars and
OutcomesFact. - What it records:
- for each k reached and not yet recorded, it records
return_<k>= round_half_up((close_k ÷ entryClose − 1) × 100, 2); - at k = 20, it also records
direction_20dwith value 1 whenreturn_20d> 0, else 0, and completes; - before that, it returns
Waiting.
- for each k reached and not yet recorded, it records
- Output:
gradeholds{ barsAfterEntry, returns }. - The post-mortem is
after: [32d]. Ifreturn_20disn’t recorded by then, it runs with what exists and says so.
Example: an entry close of 100.00; bar 1 closes 101.50, bar 5 closes 97.20, and bar 20 closes 108.00. The records are 1.5, −2.8 and 8.0. direction_20d is 1, and with upProbability 0.65 its score is (0.65 − 1)² = 0.1225.
5. Data
One additive migration: outcome_scores gets superseded_at (nullable timestamptz), metric_declared (bool) and note (nullable varchar(2000), returned on the score), with a partial unique index (pipeline_run_id, metric) where metric_declared and superseded_at is null. There are no other schema changes. Careers data lives in the engine’s artifacts, pipeline_runs, agent_runs, stage_executions and outcome_scores.
5.1 Careers artifact schemas (summary; the JSON Schemas in the pack are authoritative)
| Artifact | Shape (required fields in bold) |
|---|---|
master_cv |
person { **name**, headline?, location? }, summary?: [{ **id**, **text** }], roles [{ **id**, **employer**, **title**, **start** (YYYY-MM), end?, location?, **achievements** [{ **id**, **text**, skills?: [], metrics?: [] }] }], education[], certifications[], projects[], skills [{ **id**, **name**, years? }] |
candidate_contact |
name, email?, phone?, location?, links?: [] (one of email or phone is required, FR-381) |
search_profile |
minFitScore (0–100, default 60), targetRoles[], locations[], workMode: any \| remote \| hybrid \| onsite, salaryFloor?, currency?, mustHaves[], dealBreakers[], locale (default en-GB), tone? |
job_posting |
text (1–50,000 chars), url?, company?, title?, source?, allowDuplicate (false), ignoreFitThreshold (false) |
job |
company, title, location?, workMode?, salary? { min?, max?, currency?, period? }, closingDate?, requirements [{ **id** (r1…), **text**, **kind** }] (minItems 1), responsibilities[], keywords[], applyUrl?, summary |
fit_assessment |
matches [{ **requirementId**, **match**, evidence: [ids], note? }], strengths[], gaps[], dealBreakersHit [{ rule, reason }], interviewProbability, offerProbability (0–1), reason |
fit |
score, band, counts { met, partial, missing }, mustMissing[], dealBreakersHit[] |
tailored_cv |
headline, summary: [{ text, sources }], experience [{ **roleId**, **employer**, **title**, **start**, end?, **bullets** [{ **text**, **sources** }] }], education[], certifications[], skills [{ **name**, **sources** }] |
cover_letter |
greeting, paragraphs [{ **text**, **sources** }], signOff |
submission |
status sent \| not_sent, sentAt (required when sent), channel?: email \| portal \| recruiter \| referral \| other, notes? (≤ 2,000) |
application_record |
status, company, title, url?, fitScore, band, sentAt?, channel?, notes?, runId |
digest_stats |
as §4.84 |
Retention follows the engine defaults. Personal data stays in the project, and deleting the project deletes it.
M78 migration (FR-396, additive; the M75 migration isn’t edited): outcome_scores.branch (nullable varchar(100)). It drops ux_outcome_scores_pipeline_run_id_metric_current and creates ux_outcome_scores_run_metric_branch_current on (pipeline_run_id, metric, coalesce(branch, '')) where metric_declared and superseded_at is null. It also adds stage_executions.outcome_notes (nullable jsonb) for skipped-metric warnings (D-0.9.0-25). There are no other schema changes. The three new packs keep their data in the engine tables, as careers does. Repeating follow-ups use the existing delayed jobs (run_after).
5.2 Studio artifact schemas (summary)
| Artifact | Shape (required in bold) |
|---|---|
channel_profile |
channelName, audience, pillars[], tone?, wordsPerMinute (100–220, default 150), defaultMinutes (1–60, default 8), bannedPhrases[], locale (default en-GB) |
content_brief |
idea?, sources [{ **id** (^s[0-9]{1,3}$), **title**, url?, publishedAt?, **text** (1–50,000) }] (1–20; total ≤ 200,000 chars), targetMinutes?, allowRepeat (false) |
topic |
workingTitle, angle, audienceQuestion, keyQuestions (2–8), whyNow? |
research_notes |
facts [{ **id**, **claim**, **sourceId**, **quote** }], openQuestions[] |
script |
as §4.90 |
edit_review |
route, route_reason?, scores { hook, clarity, accuracy, pacing } (1–5), notes[] |
package |
as §4.91 |
5.3 Forecasting artifact schemas (summary)
| Artifact | Shape |
|---|---|
forecast_request |
market (a slug or URL), news [{ **id** (^n[0-9]{1,3}$), title?, **text** (≤ 20,000), publishedAt? }] (0–30), notes? |
market, market_price |
as §4.93 |
news_brief |
facts [{ **id**, **claim**, **newsId**, **quote** }], keyUncertainties (1–8), baseRateHints[] |
forecast |
probability (0.01–0.99), confidence, reasoning (≤ 4,000), keyFactors (1–8), baseRate? |
consensus |
as §4.94 |
forecast_brief |
Markdown |
calibration_stats |
as §4.96; calibration_report is Markdown |
5.4 Markets artifact schemas (summary)
| Artifact | Shape |
|---|---|
desk_profile, portfolio |
as §4.99 |
research_request |
symbol (^[A-Z.]{1,10}$), sector?, news[] (as §5.3), notes? |
price_snapshot |
as §4.97, plus asset { symbol, name, exchange, class, tradable } |
scan |
setup, catalysts, keyQuestions, points (§4.98) |
bull_case, bear_case |
thesis, points (2–10), risks, targetPct? |
bull_rebuttal, bear_rebuttal |
points (1–8), concessions |
proposal |
as §4.99 |
decision_record |
action, symbol, entryClose, entryDate, sizePct, stopPct?, horizonDays, upProbability, summary, runId |
grade |
as §4.100; postmortem as FR-427 |
6. API
There are no new routes. The contract and client are regenerated for the additive changes.
| Method | Route | Change | Errors | Auth |
|---|---|---|---|---|
| POST | /api/pipeline-runs/{runId}/outcomes |
Also takes { metric, value, observedAt?, note? } for declared metrics (FR-374) |
VALIDATION → 400, OUTCOME_TARGET_MISSING → 409, CONFLICT → 409 (a concurrent record), DEFINITION_UNAVAILABLE → 409, NOT_FOUND → 404 |
Contributor |
| GET | /api/pipeline-runs/{runId}/outcomes |
Items add supersededAt and declared, and branch (FR-396) |
as 0.8.0 | Viewer |
| GET | definition DTO | Adds outcomes |
Viewer | |
| (all) | legacy auth and inputs | Retired forms refused (FR-368) | UNAUTHENTICATED → 401, VALIDATION → 400 |
Project-scope artifacts use the 0.8.0 routes /api/projects/{id}/pipelines/{pipelineId}/artifacts/{key}…. Runs, inputs, webhooks and schedules use the 0.8.0 routes.
Error codes
| Code | Status | Meaning | User-facing copy |
|---|---|---|---|
OUTCOME_TARGET_MISSING |
409 | The run has no prediction to score for this outcome | “This run didn’t get far enough to record that outcome.” |
MARKET_DATA_UNAVAILABLE |
— (stage error) | A market data adapter isn’t configured, timed out or failed after retries | “Market data couldn’t be loaded. Check the market data settings, then retry the stage.” |
MARKET_DATA_NOT_FOUND |
— (stage error) | The market or symbol doesn’t exist at the source | “That market or symbol wasn’t found.” |
Stage errors aren’t HTTP responses. They’re the errorCode of a failed stage execution or job, shown in the timeline, and the frontend maps their copy in the same place (rule 4). New validator codes: DEF_OUTCOME_TARGET, DEF_OUTCOME_KIND, DEF_OUTCOME_METRIC and DEF_FOLLOWUP_REPEAT. Guard and veto findings aren’t error codes. They show on stage executions as in 0.8.0.
7. Pages and UI
| Route | Change | States |
|---|---|---|
/projects/[projectId]/pipeline |
Project artifacts section (FR-372); the Outcomes panel on a run (FR-375); submission as Mark sent, from the input’s title (FR-362) |
loading · empty (“Add a version of {artifact} to start runs”, from the definition’s title) · error · forbidden (actions hidden by role) |
/gates |
application_approval renders application_pack Markdown with the existing viewer |
as 0.8.0 |
| Account → API tokens | No aide_pat_ handling |
as today |
/projects/[projectId]/pipeline (M78) |
Outcomes panel rows per fan-out branch (FR-396); repeating follow-ups in the timeline as “Check |
as above |
/gates |
publish_approval renders production_pack; variant_select shows the 3 packages; decision_review shows proposal. Each gate’s copy (“Tevrin publishes nothing”, “Paper decision: nothing is traded”) comes from the gate’s description in the definition, not from frontend code |
as 0.8.0 |
Devices: desktop-first, usable at 360 px. Accessibility: WCAG 2.2 AA. The 0.6.0 design system applies. There is no careers-specific frontend code: everything comes from the definitions and schemas (title/description label the form fields).
8. Non-functional requirements
- Grounding: every factual line in the tailored CV and letter cites master CV ids. The deterministic rules run before the fact-checker. An output that fails either never reaches review.
- Prompt injection:
- posting text is untrusted, so prompts put it in a delimited data block and instruct agents to treat it as data;
- no agent in the pack has tools, so injected instructions can’t act;
- fabrications it induces are caught by T1–T7 and L1–L4.
- Privacy:
candidate_contactnever enters a prompt (a test checks every recorded prompt of the §4.80 run for the email and phone);- prompts and stored payloads go through the existing
SecretRedaction; - the master CV is sent to the configured LLM provider, which the guide states.
- Nothing external: there are no tools, external handlers or outbound HTTP in the pack (FR-388).
- Determinism: guards, the score, the render and the digest stats are pure functions with unit tests from §4.
- Tests:
- no real LLM calls (rule 10);
Tevrin.Pack.Careers.Testsfor every guard and handler;- engine tests for FR-373–FR-377;
- integration tests for outcome recording and the FR-368 refusals;
- Vitest with MSW for FR-372 and FR-375.
- Observability: spans and logs per guard finding count, veto and outcome record, tagged
tevrin.*. - Models: stages follow the project’s LLM settings (as the coach, 0.8.0 Q3).
The studio, forecasting and markets packs (M78–M81):
- Grounding: studio claims trace to verbatim quotes of pasted sources (R1–R4, S1–S6, P1–P3). Desk claims trace to price fields or pasted news (N1–N3, C1–C3). The rules run before any validator agent (FR-377).
- Prompt injection: pasted sources, news and Polymarket’s
rulestext are untrusted, and prompts put them in delimited data blocks. No agent in these packs has tools. The deterministic guards catch numbers an injected text makes up. - Outbound HTTP is only:
- the two adapters (FR-408, FR-419),
GETonly, to configured base URLs; - with a 10 s timeout, 2 retries and a 2 MB cap;
- with no redirects to other hosts.
The pack assemblies make no HTTP calls: they read market data through interfaces the host implements. Architecture tests check that no pack references
System.Net.Http. - the two adapters (FR-408, FR-419),
- No money moves: no order, wallet, position or account-write code exists (FR-408, FR-419 and FR-425 tests). The docs and gate copy say the decisions are paper records and not financial advice.
- Secrets: Alpaca keys come from config only. They’re redacted in logs, never in prompts or payloads, and never committed (rule 6).
- Rate: a forecast run makes at most one market request per stage and one per daily check, and a markets run makes one bars request per stage or check. No polling outside follow-ups.
- Isolation: forecasters see neither each other nor the market price (FR-413), and bull and bear don’t see each other until the rebuttals (FR-421).
- Determinism: every guard, combine, calibration, snapshot calculation, grade and render is a pure function, with unit tests taken verbatim from §4.86–§4.100.
- Tests:
- no real LLM or market data calls; the adapters are tested on recorded JSON fixtures, and the packs on fake sources;
Tevrin.Pack.Studio.Tests,Tevrin.Pack.Forecasting.TestsandTevrin.Pack.Markets.Tests;- engine tests for FR-393–FR-397;
- integration tests for the M78 migration, handler-recorded outcomes and one run of each pipeline end to end;
- Vitest with MSW for the branch rows and the follow-up timeline.
9. Environments
Unchanged: the dev loop, Docker Desktop Kubernetes, and Railway preview and production. No new services or packages.
New for the markets pack (FR-419, FR-429): an Alpaca account with market data API keys. A paper-trading account is enough, because only data and asset lookups are called. Ben creates the keys and sets MarketData__Alpaca__KeyId and MarketData__Alpaca__SecretKey on preview and production, and in the local secrets.env. Without them, everything else works, and market research runs fail at snapshot with MARKET_DATA_UNAVAILABLE. Polymarket’s public API needs no account. MarketData__Polymarket__BaseUrl has a default.
Before the 0.9.0 production deploy, Ben confirms that neither Railway environment sets only ConnectionStrings__Aide (FR-368 fails startup otherwise). This is listed under manual checks.
10. Decisions and assumptions
| ID | Decision | By | Status |
|---|---|---|---|
| D-0.9.0-1 | The version is 0.9.0, not 0.8.1, because a new pack is a feature (FR-229). The 0.8.x compatibility names are retired in it, as §4.77 scheduled | Ben (interview) | agreed |
| D-0.9.0-2 | Postings arrive by paste, upload or signed webhook. The scout structures them and never fetches | Ben (interview) | agreed |
| D-0.9.0-3 | One run per posting, with concurrency: many. No batch or child runs |
Ben (interview) | agreed |
| D-0.9.0-4 | The tracker is in-Tevrin: mark sent, declared outcomes and a digest. Nothing is sent externally, and there is no autonomous mode | Ben (interview) | agreed |
| D-0.9.0-5 | The pack is Tevrin.Pack.Careers, with id careers. It isn’t called “jobs”, to avoid confusion with the job queue (JobTypes, jobs table) |
Claude | assumed |
| D-0.9.0-6 | Fit is scored deterministically from the agent’s requirement matches (§4.79), not by the LLM. The LLM gives only matches, evidence and the probabilities scored by outcomes | Claude | assumed |
| D-0.9.0-7 | Contact details are a separate project-scope artifact read only by the render handler, so they never reach a provider. There is no engine “omit field” feature | Claude | assumed |
| D-0.9.0-8 | Compatibility names in stored or external data are kept for good (§4.85). Transient and wire names are removed. Old tokens aren’t revoked by a migration (no prefix is stored); they just fail | Claude | assumed |
| D-0.9.0-9 | A reject comment on application_approval reaches tailor as feedback. The engine didn’t pass it (M76b), so the engine now gives an agent re-entered by an entry gate’s on_reject the gate’s comment as feedback, for every engine-run pipeline. Mid-stage gates (external_action, tool_approval) are unchanged |
Claude | assumed |
| D-0.9.0-10 | Recording a declared metric again supersedes the earlier score, so a correction doesn’t average with the mistake. Free-form 0.8.0 scores are unchanged | Claude | assumed |
| D-0.9.0-11 | Duplicates are looked for over 180 days, and no_response starts after 21 days |
Claude | assumed (Q2) |
| D-0.9.0-13 | The CV and letter fact-checkers are two agent keys sharing one prompt, not one key bound twice: the engine requires unique agent keys per pipeline, and a pack-side split needs no engine change. Top-level handler stages store StageHandlerResult.Output as a version of the stage’s output artifact (an engine gap found by the pack; 0.8.0 stored it for map and reduce items only) |
Claude (M76a) | assumed |
| D-0.9.0-14 | L3 checks only the phrases that name the company being applied to, so a past employer named as where the candidate worked passes | Claude (M76a) | assumed |
| D-0.9.0-15 | The changelog has one Breaking highlight linking the Upgrading to 0.9.0 page, which holds the full list (the changelog allows 3–6 highlights) | Claude (audit) | assumed |
| D-0.9.0-12 | The root SPEC/PROGRESS describe 0.9.0, on branch build/tevrin-0.9.0. CLAUDE.md’s “no version is being built” line is updated when the build starts |
Claude | assumed |
| D-0.9.0-16 | The studio, forecasting and markets packs join 0.9.0 (not 0.10.0), built on build/tevrin-0.9.0-packs after PR #68. The release moves from M78 to M82, and FR-392 widens to cover them |
Ben (2026-11-30 brief) | agreed |
| D-0.9.0-17 | The content studio makes a YouTube script with 3 title and thumbnail concepts (text briefs). Research comes only from pasted sources, with verbatim quotes, and nothing is fetched | Ben (interview 2) | agreed |
| D-0.9.0-18 | Market data comes from read-only host adapters: Polymarket’s public API for the forecasting desk, and Alpaca’s market data for the markets desk. No betting or trading code at all, paper or live | Ben (interview 2) | agreed |
| D-0.9.0-19 | Bull and bear write cases in parallel, then rebut each other in a second parallel round. The risk manager and the PM see all four | Ben (interview 2) | agreed |
| D-0.9.0-20 | Market grades count trading days (bars after the entry date) through a repeating follow-up, not calendar days, so a Friday decision’s “1 day” is Monday’s close | Claude | assumed |
| D-0.9.0-21 | Forecasters never see the market price. The desk compares with it afterwards (edge), and the market itself is scored as a baseline (skill) |
Claude | assumed |
| D-0.9.0-22 | The engine gaps the packs exposed (FR-393–FR-397) are fixed generically in the engine, as the research notes ask, not worked around in packs. Market data interfaces are declared by each pack and implemented by the host, as the careers inputs source is | Claude | assumed |
| D-0.9.0-24 | (M78a) Backward-move feedback goes before validate findings and stays for the re-entered stage’s retries; gate rejections keep D-0.9.0-9’s text (careers tests assert it). A one-off handler follow-up that returns Waiting records followup_expired. A late repeating check stands for the checks it missed, and the next is the first one not yet due |
Claude (M78a review) | assumed |
| D-0.9.0-23 | The pack ids are studio, forecasting and markets; the pipelines are content-studio, forecast, forecast-calibration and market-research |
Claude | assumed |
| D-0.9.0-25 | (M78b, amends FR-395/FR-396) A follow-up check records its outcomes when it returns Waiting as well as Completed (FR-415 and FR-426 score each check); a main-flow handler records only on Completed, and Failed records nothing. Outcomes are checked before the output is stored, so a VALIDATION failure (an undeclared metric, a bad value, or the same metric twice in one result) leaves no new output. Map-item and reduce handlers may not return outcomes (VALIDATION), and a follow-up stage is not a valid target (DEF_OUTCOME_TARGET). A skipped metric (OUTCOME_TARGET_MISSING) is a warning stored in the new stage_executions.outcome_notes (timeline outcomeNotes), never in veto findings. A fan-out branch with an output but no valid prediction is skipped like a branch with no output. POST …/outcomes on a fan-out metric returns the first branch’s score (shape unchanged); the list returns every branch, and the UI refetches it. {{OUTCOME_SCORES}} and with_outcomes show metric (branch): score |
Claude (M78b review) | assumed |
| D-0.9.0-26 | (M78c, FR-393 UI) The engine timeline and replay return an agent_run item’s stored feedback as feedback (additive), redacted as the replay input is and capped at 8,000 characters. This includes gate-rejection and validate feedback, which users already see elsewhere (it is already on the agent-run DTOs as userFeedback). It is on both the live timeline and replay; the cap bounds a page’s size. The UI shows it as a block on the re-entered attempt, with its first line as the cause |
Claude (M78c) | assumed |
| D-0.9.0-27 | (M79, studio) V1 excludes vetoed runs (a vetoed run would restart the window on every retry) and counts only completed runs that completed within 365 days before this run started. The outro is a claim when it cites facts and a cta when it cites none. R1 fact ids match ^f[1-9][0-9]{0,2}$ and are unique, not necessarily sequential. write doesn’t receive content_brief; it learns the S5 range from the finding. The render also reads channel_profile (words per minute) through the inputs source. The 200,000-character total across sources is enforced by a requires guard studio.brief-limits on scout (JSON Schema can’t sum across items); an over-limit brief fails scout before any agent runs with PHASE_PRECONDITION_FAILED, as careers’ master-cv-valid does. The production pack always renders ## Description and ## Sources, leaving an empty body out |
Claude (M79) | assumed |
| D-0.9.0-28 | (M79b, §7) The engine had no gate description, so it is added: an optional gate.description (at most 500 characters, not blank; otherwise DEF_PARSE), left out of the canonical JSON when unused so existing hashes don’t change, and returned additively as description on PipelineGateDto and PipelineStageGateDto. The UI shows it as plain text wherever an engine gate is shown |
Claude (M79 review) | assumed |
| D-0.9.0-29 | (M80, forecasting) The market artifact has optional eventSlug and eventMarkets, so O2 can name an event’s market count. The resolve check stores a resolution artifact. price and resolve read the slug snapshot stored. The adapter calls /markets/slug/{m}, then /events/slug/{e}; it retries only 5xx and timeouts. A market resolves from its closed prices (1/0 yes, 0/1 no, 0.5/0.5 void) with umaResolutionStatus resolved; the M82 live check confirms this. O3 also vetoes a market that has already ended, and passes one with no end date. A vetoed run schedules no resolve check (D-0.9.0-30); a check that finds no consensus still ends at once, with no request and no outcomes. resolve skips a metric that already has a current score, so a score recorded by hand before settlement wins. FR-412’s “the brief says so” with no news is a prompt instruction, not a guard. MARKET_DATA_* codes live in Tevrin.Engine.Domain for both desks. forecast declares a primary forecaster agent that never runs, because a fan-out stage needs one (the engine’s FR-345 pattern); removing that need is left for a later version. A failed handler stage’s error (CODE: detail, from its newest failed stage.run job, redacted, at most 8,000 characters) is returned on its stage_entered timeline item’s existing error, and the UI maps the code to §6 copy (this also covers FANOUT_ISOLATION_BROKEN) |
Claude (M80 review) | assumed |
| D-0.9.0-30 | (M81, markets; amends FR-354) A run that ends vetoed schedules no follow-ups, so no paid post-mortem or market polling follows a veto (FR-354 predates veto endings). writes_feedback.from may be a dotted path (lessons.bull); an exact top-level name wins. A daily bar counts from 21:00 UTC on its date. vol20 is the sample standard deviation and needs 21 bars; high52w/low52w come from the bars’ highs and lows; return20d compares the last close with the close 19 bars before (§4.97). Bars use adjustment=split, and the grade’s return basis is the split-adjusted entry-date bar when present, else entryClose. C2 matches a number’s absolute value (“fell 2.8%” matches −2.8), so a sign flip isn’t caught. K3 also fires when a buy or short has no stopPct. case:<n> counts from 1. Symbols match ^[A-Z][A-Z.]{0,9}$. The post-mortem’s {{GRADES}} is the grade check with the highest number. FR-429’s options are AlpacaOptions (MarketData:Alpaca, validated at start-up; a blank Feed means iex; the live trading host is refused) and M80’s Polymarket options; missing keys fail the stage, never start-up. The paper-host asset lookup is the only non-data call (FR-419). Only the Alpaca options are validated at start-up; a bad MarketData:Polymarket:BaseUrl fails the stage with MARKET_DATA_UNAVAILABLE (D-0.9.0-29) |
Claude (M81 review) | assumed |
| D-0.9.0-31 | (M74b, M74 review) SecretScanner still detects aide_pat_ values, since another instance on 0.8.x may issue live ones. Detection isn’t reading. The aide_merges input is refused by removing the enum alias from DomainEnumJsonConverter, while stored payloads still read it through EnumStrings (FR-369). backend/entrypoint.sh exits 1 like the API when only AIDE_DATA_DIR is set (FR-368) |
Claude | assumed |
| D-0.9.0-32 | (M74 review) The test-folder allowlist entries still allow the bare word aide and *_aide_* identifiers in any test file, because tests name kept and refused forms in many ways. FR-370’s expiry check and the per-name entries outside tests carry the guarantee |
Claude | assumed |
| D-0.9.0-33 | (M75, amends FR-373, FR-376) An outcome’s target.stage may not be a fan-out or variants stage at M75 (FR-396 later allows fan-out and variants stages), and its prediction artifact must be JSON. with_outcomes reads the current declared scores stored for each run, not that run’s definition. A follow-up’s {{OUTCOME_SCORES}} skips superseded scores. A concurrent declared record gives 409 CONFLICT. Veto guards get no stage-output facts (FactBag.Empty), so careers veto guards read the run’s artifacts through host-implemented inputs sources |
Claude | assumed |
| D-0.9.0-34 | (M75) PipelineArtifactVersionDto.createdBy ({ id, name } | null) is filled on the project-artifact routes only. The diff of project-artifact versions is computed in the browser from the listed contents |
Claude | assumed |
| D-0.9.0-35 | (M76) Careers interpretations: contact checks are M2 (no name) and M3 (neither email nor phone). The duplicate veto counts only runs started before this one, ties by run id. T5 and L1 skip lines citing no existing source, which T1 and T2 already flag. Render takes the posting URL from job_posting.url, else job.applyUrl, and puts the headline under the name. digest_stats.meanFit is null when nothing was sent. Digest applications are ordered by sentAt, unsent ones by run start. When exactly one declared input has no version yet, the Submit input button and dialog take that input’s title, so careers submission shows “Mark sent”. A project-scope key is project-wide, so the fixture CV key is fixture_cv_master |
Claude | assumed |
11. Open questions
| ID | Question | Who | Blocks |
|---|---|---|---|
| Q1 | Are the fit weights (must 3, nice 1), bands and default threshold of 60 right? | Ben | nothing (defaults apply; the threshold is set per profile) |
| Q2 | Are a 180-day duplicate window and 21 days to no_response right? |
Ben | nothing |
| Q3 | Should PDF or DOCX export come next? It would be a render handler variant, not an engine change | Ben | nothing (out of scope for 0.9.0) |
| Q4 | Has the rename runbook run on preview and production, so no environment depends on ConnectionStrings__Aide? |
Ben | the 0.9.0 production deploy (FR-368) |
| Q5 | Alpaca market data keys for preview and production (and which feed: IEX, the free default, or SIP) | Ben | live market research runs only (the build uses fakes) |
| Q6 | Are the defaults right: a disagreement spread of 0.25, a stance band of ±0.05, risk limits of 5% per position and 25% per sector, a minimum conviction of 3, a studio runtime tolerance of ±20% and 150 wpm? | Ben | nothing (defaults apply; most are per-project profile values) |
| Q7 | Should the forecasting desk later take markets from other venues (Kalshi, Metaculus)? It would mean another IPredictionMarketSource adapter, with no pack change |
Ben | nothing (out of scope for 0.9.0) |
| Q8 | Under FR-394, three failed checks in a row end a repeating follow-up, so an outage of three days or more at Polymarket or Alpaca leaves open forecasts unresolved and decisions ungraded. Is that acceptable, or should a market data outage not count towards the limit? | Ben | nothing for the build (the rule applies as specified) |
12. Milestones
- M74 Retire the compatibility names (FR-368–FR-371): refusals, the kept readers, the allowlist cleanup and expiry check, IaC and the upgrade page.
- M75 Engine additions (after M74; FR-372–FR-377): the Project artifacts UI, declared outcomes (definition, API, migration, panel),
with_outcomes, and guard-before-validator ordering, each with fixture tests. - M76 Careers pack: job application (after M75; FR-378–FR-389): the project, schemas, prompts, guards, handlers, definition, host registration, and the §4.79–§4.82 examples end to end.
-
M77 Careers pack: digest and docs (after M76; FR-390, FR-391):
job-digest,digest-stats, and the pack guide. M74–M77 were built and merged in PR #68. The rest is built onbuild/tevrin-0.9.0-packs. - M78 Engine additions for the packs (FR-393–FR-397): backward-move feedback, handler and repeating follow-ups, handler-recorded outcomes, the new outcome targets with their migration and UI rows, and the
writes_feedbacklist. Each comes with fixture tests and pinned hashes. - M79 Content studio (after M78; FR-398–FR-406): the pack, the guards, the render, the pipeline, the §4.89–§4.92 examples end to end, and the guide.
- M80 Forecasting desk (after M78; FR-407–FR-417): the pack, the Polymarket adapter on fixtures, both pipelines, the §4.93–§4.96 examples end to end, and the guide.
- M81 Market research desk (after M78; FR-418–FR-429): the pack, the Alpaca adapter on fixtures, the configuration and IaC, the §4.97–§4.100 examples end to end, and the guide. M79, M80 and M81 don’t depend on each other; build them one at a time, because each touches the shared registration, CI and Dockerfile lists.
- M82 Release 0.9.0 (it was M78; after M81, on Ben’s confirmation; FR-392). Manual checks for Ben:
- Q4 on both Railway environments before production;
- recreate API tokens after the deploy;
- a job-application run from the UI and from a signed webhook, through review, mark sent and an outcome;
- a digest schedule fire;
- a content-studio run through a route back, the variant pick and publish approval;
- a forecast on a live Polymarket market (preview), and a later resolution check;
- with Q5 answered, a market-research run on preview, and the first grade check the next trading day;
- the Docker Desktop redeploy and smoke test.