- TypeScript 92.1%
- JavaScript 4.2%
- Python 3.4%
- Nix 0.3%
| .pi/skills/typesafe-ai | ||
| .plans | ||
| deployment | ||
| docs | ||
| migrations | ||
| scripts | ||
| src | ||
| test | ||
| .envrc | ||
| .gitignore | ||
| .node-version | ||
| AGENTS.md | ||
| alchemy.run.ts | ||
| bun.lock | ||
| bunfig.toml | ||
| default.json | ||
| example.config.json | ||
| example.deployment.json | ||
| flake.lock | ||
| flake.nix | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vitest.config.ts | ||
Job search
CF1-CF4 are a profile-driven inbox in root src/: TypeScript CLI -> authenticated API Worker -> durable Workflow -> independent private Himalayas/Jobicy/Arbeitnow collectors -> D1. Refresh commits normalized pages atomically and records complete, partial or failed coverage. Daily automatic refresh, keyless manual refresh and durable config-triggered requests are implemented. Desired cloud-production API definitions include the 15-minute due-check cron, but only a later owner deployment activates it. Reads never fetch or infer. Cached role/skill/seniority relevance and opt-in Jev assessment are implemented; the default remains disabled. No live model was called here. See manual assessment and offline evidence. CF6 prepares the packaged Node 24 CLI and private release offline; CF5 query expansion is intentionally skipped/unimplemented. No frontend exists. All demos are offline with synthetic jobs. Current design, CF1 evidence, CF2 evidence, CF3 evidence, CF4 evidence, CF6 evidence, automatic refresh evidence, bounded Paid policy/evidence and cloud release/approval gates.
The approved CF1-CF6 plan is checked in. The Clojure T2-T9 roadmap is superseded. Clojure and Babashka are retired. Frozen JSON normalizer expectations remain covered by TypeScript tests; existing local SQLite files are untouched. Legacy T1 replay is an archived reference, not a supported command. No legacy data is imported or dual-written.
Private durable ranking
The supported ranked CLI now uses authenticated API → private Ranker Worker → Jev, with the existing D1 and a separate Ranker-hosted explicit-only Workflow. It starts/joins and watches; backend work survives CLI exit. Confirmed active work joins, while only a later new explicit request may replace a previously reported unknown execution, accepting possible duplicate charges without finishing old history. Free/legacy campaigns select at most32 jobs in14-job batches. NEW Paid campaigns traverse the entire captured stored-job highWater in15-job batches, without a total job/window cap; historical capped campaigns stay capped. Errors and platform limits can leave incomplete coverage. No ranking recovery/cancel interface, automatic model retry or ExplicitRanking schedule. The provider key moves exclusively to Ranker; default remains disabled. See architecture, protocol, bounds, rollback and evidence. No deployment/live check is performed by this implementation.
Job and assessment counts
jobs stats [--profile NAME] makes one read-only GET; omission selects default. It counts all stored shared job records by source, selected factual eligibility and eligible jobs' current assessed/pending/failed-or-uncertain/stale/unassessed/invalid states. A successful low-fit assessment is still assessed, not necessarily a match. No inference, writes, refresh or retry; unknown profiles and unsupported APIs fail closed. jobs stats | jq '{stored:.jobs.total, eligible:.jobs.eligible, assessed:.assessments.current}'. Counts may scan growing D1 tables and cost reads; recorded coverage is not independently verified ranking, lifetime collection, billing/retry proof or a snapshot across requests. Definitions, JSON and consistency.
Named profiles
jobs profile replaces the config command; there is no alias or persistent selection. Apply default first, then optionally add named profiles with jobs profile apply FILE --name NAME. Names are immutable, case-sensitive ASCII ^[a-z][a-z0-9-]{0,31}$; at most three identities, including default and paused profiles. No rename/delete/reset/default-switch is provided. New profiles participate in discovery; updates retain participation. Nondefault documents reject any raw own sources field, even the legacy default value; global source controls belong only to default.
Personal revisions advance on normalized personal changes, including A→B→A. Personal hashes exclude sources; source-only, participation and other-profile edits do not advance that revision. Immutable revision/snapshot associations preserve history. Shared Himalayas discovery unions each participating profile's own query-country pairs, with exact deduplication and sorting, at most16 distinct queries/32 pairs; it never invents cross-profile Cartesian pairs. Cartesian unions retain the original cf1-base-1 hash/plan; other unions use profile-pairs-1. Membership names do not enter acquisition fingerprints. Jobicy and Arbeitnow each stay one shared broad feed.
profile pause NAME removes future discovery contributions, not frozen continuation; resume restores them. Zero participants prevent all new admission, including force, Jobicy and Arbeitnow, while retaining pending work, owners, history and delays. Actual source-off separately forbids new page reservations; already reserved work may settle. Saved plan distinguishes .proposal from actual shared .discovery.
Use results, show and saved plan with --profile NAME for selected views. Explicit selectors, including --profile default, use v3 with no fallback; omitted results/show and ranked selectors retain default v1/v2 adapters. All profiles share source facts and exact semantic cache successes, with truthful originating affiliation for history/stale views. There is one global ranking campaign: same-profile active work joins its frozen revision; a different-profile active/unknown campaign conflicts without admission or provider effects. Direct assess is default-only; assess, refresh, recover and runs reject profile selectors locally. See named-profile offline acceptance and review status; earlier evidence below remains historical.
Cached selected results preserve the v1 payload depth budget inside v3's .data
frame, including canonical nested assessment Scores. Config/request bounds,
profile identity, byte caps and GET-only behavior remain unchanged. See the
offline reproduction and decoder boundary;
this fix does not establish the cause of a production503 or authorize deployment.
Career can use a read-only first-seen window on cached v3 results. The backend restricts the candidate set before relevance pagination and reports whether that window page proves exhaustion. Existing CLI and unfiltered reads are unchanged.
Source-aware discovery
The default profile document optionally adds "sources": {"himalayas": true, "jobicy": true} (both booleans required). Omitted or explicit legacy default means Himalayas on / Jobicy off, with identical original normalized config/plan/hashes. All four combinations work, including both off. Toggles control collection only: stored jobs remain readable/rankable, and no toggle authorizes model work or cancels ranking. Jobicy uses one broad public count20 feed with no profile filters, daily per-source rescans of up to seven publication days under fixed bounds. Volume is unknown; partial traversal is not complete recent/open-listing coverage.
Jobicy deployment transport is a separate permission: optional desired "jobicyTransport":"enabled" is effective only in explicit cloud mode at exact stage production; omitted/default, local and other stages stay disabled. Runtime enablement without transport permission honestly defers pending work, without a failed owner. The Jobicy-only predecessor topology was 4 Workers / 2 existing Workflows / 1 existing D1; the current Arbeitnow extension below makes it5/2/1, exactly one new private Jobicy Worker/artifact/service binding and no new schedule.
Admission chooses at most one eligible source per invocation, least-recently-started first (never-started first, Himalayas tie). Busy/deferred/failed source ownership is independent. Source-off prevents new page reservations once observed; already reserved/in-flight work may settle. Jobicy cursor continuation is private immutable D1 metadata, never checkpoint/public progress, and ambiguous page reservations never resend. New passes reserve through the original deadline+1h and preserve validated received delays. Exact received retry-after-unrepresentable permanently blocks Jobicy only, including across force/config/off-on/recovery/restart; separate owner intervention is required and no reset command exists. Lost acknowledgment alone does not latch that error. Legacy freshness fields mean Himalayas-only; bounded per-source status avoids a mixed-inbox freshness claim.
See source config, metadata migration0009, pacing/coverage/privacy and guarded rollback. Implementation/offline tests are not deployment/live activation, physical timing, billing/CPU/quota or source completeness evidence.
The optional Arbeitnow page-one source adds exactly one private Worker/artifact/binding: current desired topology 5 Workers / 2 existing Workflows / 1 existing D1. Runtime sources.arbeitnow and desired arbeitnowTransport independently default off. One complete <=4MiB keyless page, selecting its first up to250 entries before validation; no page two/retry/resend or completeness claim. Cutoff is explicit partial/selection-limit, independent of real continuation (partial/page-limit); repeated passes may revisit the same prefix. V1/v2 invalid selected rows still reject the entire selection. Separately activated arbeitnow-public-valid-record-prefix-3 imports all valid selected rows atomically, records bounded aggregate rejection counts as partial coverage and never backfills or relaxes URL/security checks. Unexpected/page-wide errors and oversized private/D1 serialization still reject the entire subset; nonempty all-rejected fails no-valid-selected-records, not successful emptiness. Frozen old strict-whole-page history remains unchanged. Native synthetic integration/full-gate status is recorded in the implementation handoff, not a live/deployment acceptance claim. Visible publisher credit/backlink and private personal-use limitations remain. Only the genuinely versioned Arbeitnow acquisition-policy plan changes; other-source/assessment/content/cache identities and all resource ceilings are unchanged. The separately authorized diagnostic does not prove the historical Worker size failure's cause; future >4MiB responses still fail, with distinct closed v2 size diagnostics. V2 also distinguishes closed posting field/reason failures from unexpected normalizer stage/exception-kind failures without field values or private exceptions; legacy invalid-posting history stays unchanged. The single authorized normalization diagnostic found selected rows rejecting the unchanged trusted-publisher URL policy; no URL-security relaxation or historical-incident repair is claimed. jobs stats now requires v4, counts all three sources including zeros, with no downgrade; v3 becomes unavailable after any stored Arbeitnow row.
The normal explicitly approved production release is now bun run release:production --stage production --env-file deployment/cli-env.txt, after a separate bun run build and optional ordinary official plan review. It runs stock Alchemy deploy with its normal approval, then fresh known-account SDK routing verification, then automatically selects this release's valid-record-prefix-3 policy through its own built CLI. A successful combined release needs no separate manual activation. Require an explicit production JOB_INBOX_URL, matching owner app/deployment tokens and normal caller Cloudflare credentials; there is no localhost fallback, --yes or --force. Prerequisites, two read-only SDK operations and partial-success recovery.
The standalone bun run deploy shortcut (or the explicit bun alchemy deploy command) never selects policy; migration/apply/reads do not select it either. Manual jobs source policy arbeitnow and jobs source upgrade arbeitnow --target valid-record-prefix-3 remain inspection/recovery tools. No-target upgrade retains its original v2-only meaning and conflicts after v3 selection. The same one-POST/no-resend semantics preserve historical associations and frozen runs; changed enabled acquisition with participants requests at most one Arbeitnow intent for later normal handling, never inline collection/model/Workflow work or a pacing/ownership bypass. Already-selected release replay writes nothing. Failed verification/activation returns nonzero while preserving successful deployment; inspect rather than blindly rerunning deploy or resending an uncertain POST. Policy, hashes and uncertainty.
Pi project skill
The official TypeSafe/Jev Agent Skill (upstream v0.5.7, revision 65a39f393687675ce170e6094757de20370365b9) is manually vendored, complete and unmodified including its MIT LICENSE, in .pi/skills/typesafe-ai/ for this project and Pi only. No API key is needed to install it or use its documentation guidance.
After merge/pull into your checkout, run /reload (or restart Pi) in that trusted checkout, then /skill:typesafe-ai; grant normal project trust yourself if prompted. Guidance remains subordinate to AGENTS.md; live calls, spending and deployment still require separate authorization. To update, review a new upstream revision and its complete directory, replace the entire vendored subdirectory, and update this pin.
TypeScript development and offline walkthroughs
For public-only task acceptance, use the owned validation runner:
python3 scripts/validate-public.py --expected-branch BRANCH --baseline EXACT_PUBLIC_COMMIT,
with explicit repeated --include-public PATH for new public untracked files.
It preserves pristine source/mutable work/external Bun cache isolation, runs all
native and Nix gates, and removes only its newly owned root after proved child
shutdown. Bounded reports are the default; debug or uncertain roots are retained.
Never import mutable work or the private checkout with path:. Existing host/store
resources are not cleaned. The commands below are ordinary trusted local development:
nix develop
bun install --frozen-lockfile
bun run test:tooling
bun run typecheck
bun run test:unit
bun run test:integration
bun run build
bun run deployment:test
bun run demo --scenario inbox
bun run demo --scenario himalayas
bun run demo --scenario daily
bun run demo --scenario relevance
bun run demo --scenario release
Node 24.18.0 is pinned by the existing Nix inputs and .node-version. The application pins Bun 1.3.13, TypeScript 6.0.3, Alchemy Effect v2 2.0.0-beta.80, Effect/platform-node/effect-vitest 4.0.0, Vitest 5.0.3, tsx 4.23.15, parse5 8.0.1 and workers-types 5.20261003.1. Exact transitive versions/integrities are in bun.lock, including workerd 1.20260918.1. The Nix shell provides exact Bun 1.3.13 directly. No global enable/install is needed. On NixOS the offline wrapper patches only the downloaded project-local workerd loader/rpath, using the shell's pinned libraries. This does not alter the host profile or runtime. Bun is used only for installation and script launching. Scripts explicitly use Node; do not use bun --bun. bunfig.toml disables automatic dotenv loading and uses Bun's built-in shell to avoid ambient login profiles. package.json permits dependency install scripts only for esbuild/workerd.
build produces ignored dist/worker.js, dist/himalayas-worker.js, dist/jobicy-worker.js, dist/arbeitnow-worker.js, dist/ranker-worker.js, executable dist/cli.mjs. Copy only cli.mjs outside the checkout and run node cli.mjs ... with Node 24.18.0, or ./cli.mjs ... with Node 24 on PATH. It bundles its dependencies and needs no source, package.json, node_modules, tsx or sourcemap. It does not include Node itself and does not deploy.
The inbox demo asserts this sequence through the real CLI and application modules, authenticated HTTP and native D1:
profile check FILEvalidates synthetic JSON without API/storage effects.profile apply FILEpersists immutable config/plan, the active pointer and a first/changed-discovery refresh intent. Persistence performs no inline acquisition or inference; this store-only inbox fixture deliberately omits the background kick.plandisplays the default document proposal and actual shared discovery separately.- A test-only control seeds two invented jobs through the actual repository. No production seed endpoint exists.
results,show 1,runsdisplay factual timestamps, unknown labels, unassessed jobs, no refresh coverage andsynthetic_seedprovenance.- Filter-only apply reuses facts immediately; changed acquisition scope durably requests background refresh.
- The first process stops workerd. A new process starts the same local stack/storage and asserts persisted config, identity, monotonic timestamps, jobs and runs.
- Both runtimes close before the wrapper removes its owned disposable storage. Any failed assertion exits nonzero.
The Himalayas demo exercises refresh --key KEY -> results -> show, then repetition with stable IDs, idempotent delivery, short pages, retries and a later-page failure. It asserts that earlier committed pages survive, partial coverage cannot advance successful freshness, and state survives a fresh process. JSON replay has no network fallback or production fixture-selection endpoint.
The daily demo also includes source-named Arbeitnow native100/250-page both-tier integration, exact production bundle copies with no-forwarding synthetic interception, v4 copied CLI, independent latches and restart/recovery evidence (successful execution must be checked in the handoff). The release demo retains populated0010→0012 upgrade/restart after profiles-restart with exact public177e557 predecessor artifacts, then appends populated0012→0013 partial-record upgrade/restart, including explicit-only sticky policy selection with no migration activation; exact785 predecessor artifacts/CLI retain the original0010 phases, with no old API activation after Arbeitnow history. The daily demo adds both-profile native Jobicy private GET/RPC/D1/hosted-Workflow and permissioned copied-CLI proofs, cursor process restart, no-resend/received-delay/block cases and source-qualified cached reads. The following earlier Himalayas measurements remain regression baselines, not a Jobicy cost guarantee. The daily demo also delegates freshly bundled production fetch/waitUntil with synthetic/test-only wrappers and executes the copied permissioned CLI for config-background, keyless, busy and recovery flows. It verifies durable coalescing, native D1 race/collision handling, missed-kick restart and shared invocation accounting. A byte-prefix/hash assertion checks the test introspection copy; appended test exports expose counters and the existing page callback only, and 48 counted native reads prove the kick cannot reset the production service budget. A separate native Paid fixture delegates the same actual Worker/Workflow with truthful synthetic capabilities. The exact four-scope ×20-page ×20-globally-distinct-job workload now completes 80 pages/1,600 synthetic jobs at 965 bindings/6,247 SQL-work statements, versus the captured pre-change 70-page/1,400-job partial cutoff at 985/5,467. A separate 13-page/260-job fixture still exceeds both Free ceilings; larger legal pages with stable cross-scope duplicates exhaust SQL while binding capacity remains. Shared request save/kick budgets, scheduled entry and fresh copied-CLI reads are covered. These are synthetic mechanics, not cloud CPU/accounting/coverage evidence. The daily demo exercises the real unscheduled Workflow with explicit scheduler events, duplicate/manual/forced triggers, interrupted dispatch, actual cancellation and ledger replay. It asserts one owner, no early collection, preserved request/query budgets, no duplicate counters/observations and no successful freshness advancement on partial failure. Fresh processes resume both the original canonical run and a separately admitted nonzero-rotated run after the first cached page step. Strict remaining-page/scope fixtures and durable callback counts prove the first RPC did not repeat. A separate exact fb9 Free-bound own-Workflow probe traverses two frozen rotated scopes, one synthetic job/page each; the original disabled-collector and terminal-reconciliation rollback proofs remain. It also verifies stored state and actual Workflow status. See recovery details.
The relevance demo runs explicit fake assessments, compares authored fixture ranking with ID ordering, inspects typed rubric answers, and proves config/content/version invalidation, cache reuse and zero inference from reads. It exercises potentially billed failures, malformed/model-mismatched responses, timeout, explicit attempt retry, unfinished reservation protection and background catch-up capped at 20 calls. A new process verifies durable state. These fixtures test mechanics, not live relevance quality or prompt-injection resistance.
The release demo additionally stages populated0008→0009 without acquisition and records mixed-source history/delays before exact CF4/fb9 API rollback/restore. Discovery writes/ticks are frozen, supported current config prepares the legacy default, and Jobicy ownership is reconciled before old executors activate; no Jobicy scope is sent to an old Himalayas executor. Ranker host/class/Workflow/binding/metadata and Jobicy records remain. Current source rollback contract. The inherited release phases below remain mandatory regression evidence. The release demo freshly builds and executes the copied CLI with async subprocesses outside the checkout, a stripped environment and Node filesystem permissions that forbid source/dev node_modules access. It checks config/plan → fixture refresh/runs → cached synthetic ranking/results/show, safe source attribution/links, unknown/stale/unassessed evidence, presentation filtering/read purity and partial coverage. The original five independent processes stage actual migrations 0001–0005, add actual 0006, add 0007 to populated state, rotate the owner secret and replace the actual production bundled API with compatible prior CF4 code at eae667edc69eec1cc8b6e1dc29e4f88c8cd05a38. Populated data/all ledgers and unfinished owners survive; packaged CLI recovery through the fixture API cancels its actual unscheduled Workflow only after terminal confirmation. A fresh explicit archived-API refresh runs through its own actual Workflow binding on populated 0007 and finalizes with disabled transport, leaving auxiliary intent intact. The final process restores current code and safely services pending work with the synthetic fixture binding. Production API/collector run separately from test controls; auth/redaction/private routing and disabled Jev are asserted. The collector registers a rejecting handler for upload validation: all HTTP receives an empty 404 without collector/provider I/O. Public ingress stays disabled; acquisition is only through validated RPC. Four additional fresh-process phases prove Paid upgrade/restart, exact fb9bb89dace78cf125e92b0033b01eab9832a6f3 application rollback with explicit Free binding and actual production-binding unfinished-terminal reconciliation, then Paid restoration without schema changes or billed inference replay. fb9 rejects a Paid binding, and its old deployment parser rejects the new selector key even when Free: retain current deployment tooling for app-artifact rollback, or remove the unsupported key when reverting the whole entrypoint. Freeze discovery writes and reconcile unfinished operations; selecting Free does not downgrade the Paid subscription. This is not CF3/schema down-migration or live deployment validation. See CF6 evidence and privacy, backups and future cloud gates.
Tests/demos explicitly use Alchemy Test.make({ dev: true }); the default can deploy to real cloud. Audited stacks contain only emulated Workers, D1 and unscheduled smoke/refresh/explicit-ranking Workflows. The inbox uses a binding-only stub; the Himalayas demo uses the real page adapter/normalizer behind a private fixture collector RPC binding. Tests strip ambient credentials, replace HOME, disable telemetry/Docker discovery and run in a Linux user/network/PID namespace with only loopback. Native TCP/UDP denial probes cover workerd and all descendants; JavaScript guards reject unexpected calls too. Missing namespace support fails rather than falling back to unrestricted or cloud tests. Test-only native configuration is coordinated through genuine fd3 listen acknowledgments (not proxy URL publication); application/admission/first-write races remain concurrent. Fatal native children remain failed validation even when the pinned emulator relaunches them, and secure bounded lifecycle evidence is retained outside owned scratch. Native socket listen is not a lazy-SQLite recovery or cloud guarantee. See actual source measurements and harness boundary. PID namespace exit kills/reaps leftover descendants before cleanup. No secret/profile lookup in the real HOME, live job/model APIs or development database is used.
Deployment
The owner reports that the corrected existing deployment succeeded and authenticated application commands work. Earlier partial deployment and collector upload failures remain reconciliation history. This task did not inspect the cloud. The required baseline already contains production-only Himalayas transport enablement. This compatibility/diagnostics follow-up has not been deployed or activated a schedule; the owner-reported five-job assessment does not establish the deployed revision or failure cause.
The desired declaration enables the existing Himalayas transport only in explicit cloud mode at exact stage production, by supplying the collector-only ALLOW_LIVE_HIMALAYAS=explicitly-approved Worker binding. Default/local production and every other stage omit it; no ambient operator variable enables it. The collector remains private, rejects all HTTP with empty 404 and accepts acquisition only through validated RPC. Tests/demos keep transport offline.
Root alchemy.run.ts exports the normal Stack for installed Alchemy 2.0.0-beta.80. The official CLI owns planning, approval and application; the old programmatic launcher is removed. The owner selected Alchemy's standard plan review and diagnostic logs instead of the former whole-plan rejection and hidden errors. This does not authorize cloud execution.
After separate approval, enter nix develop at the repository root. Supply nonsecret account/stage/ingress/jurisdiction in ignored deployment.local.json, shaped like example.deployment.json, and distinct CLOUDFLARE_API_TOKEN and OWNER_TOKEN in the caller's environment. Direnv can supply these from operator-owned .env.deployment; the entrypoint never opens that file or resolves credentials/accounts from Alchemy profiles. Keep secrets out of arguments and JSON. Optional nonsecret assessmentMode: 'manual' is effective only for explicit cloud mode at exact stage production; omission or 'disabled' stays off. Only effective manual selection requires caller TYPESAFE_API_KEY, distinct from owner and automation tokens, and binds it Redacted to the private Ranker only (including its hosted explicit Ranking Workflow), never API/Collector. Other/local stages neither look up nor bind that key. Do not provision tokens or edit operator settings as part of implementation. Manual procedure, deferred pilot and rollback.
# Optional LIVE account reads and local deployment metadata, not offline checks:
bun run plan
# Standalone LIVE deployment, with Alchemy's normal approval prompt:
bun run deploy
Both shortcuts take no arguments and run bun run build first. They then use the existing bun alchemy plan or bun alchemy deploy with --stage production --env-file deployment/cli-env.txt. No separate plan is required before deploy: review the plan Alchemy presents at its normal approval prompt. Standalone deploy does not run routing verification or select the Arbeitnow policy. The combined release:production command remains separate and requires a build before running it.
The full Alchemy commands are still available after a separate build; always supply the matching explicit stage and the public, variable-free env file if you use them directly. Bare Alchemy defaults to .env discovery and a user-derived stage; those defaults are not the project procedure. Bun's dotenv setting does not disable Alchemy's own loader. The unchanged alchemy package script launches the installed official CLI on Node, clearing Bun's two package-manager hints so beta.80 does not switch back to Bun. It disables telemetry, but adds no CLI wrapper or apply engine. The stack checks built artifacts and migration integrity before evaluation.
Review the entire plan. There is no automatic whole-plan rejection of replacement/deletion; --yes skips Alchemy's approval prompt and is not implicit authorization. Do not approve extra resources or destructive changes without a separate decision. Stage mismatch, adoption and local/cloud mode mismatch still fail. Deployment uses standard Alchemy/SDK HTTP errors and retries, with no custom HTTP wrappers, retry overrides or caller-environment rewriting. A failed deployment may leave partial changes: protect diagnostic logs/state and reconcile before a manually authorized rerun. Application private-payload redaction and no-automatic-retry rules for potentially billed assessments are unchanged.
Standard ignored .alchemy/state/ contains unencrypted secrets and must persist across deployments. Alchemy also initializes user-level profile metadata and writes diagnostic logs under ~/.alchemy/logs/ and project .alchemy/log/. These logs can contain detailed errors and response contents; protect them like state. The CLI performs a cached npm version check. Runtime Worker observability/logpush remain off. Database names in the selected account are reserved for this application, with ordinary same-name D1 reuse and no collision/adoption machinery.
After execution is separately authorized, ordinary local state inspection uses bun alchemy state list --backend local. beta.80's configured state backend evaluates the stack at a placeholder stage, so use the explicit local backend rather than weakening the stack's stage guard. State reads can reveal secrets. Destroy, state deletion, provider bootstrap/token commands and alternate cloud backends are not approved by this guidance.
After build, bun run deployment:inventory FILE prints desired names, bindings and artifact/migration hashes without credentials, state or cloud requests. Its account placeholder is deliberately invalid. Inventory is not a live plan or approval digest. bun run deployment:test runs restricted pure checks and the real official CLI against disposable synthetic inputs in the outbound-denied Linux namespace. It never evaluates the production stack against real settings/state and does not replace Worker/D1 integration tests.
Fixed application profiles retain atomic pages: Free has 50 D1 binding calls/1,000 SQL-work statements; Paid has 1,000 binding calls/10,000 SQL-work statements across the whole refresh Workflow run() invocation, never reset at step.do. Durable ranking uses separately bounded control units and a shared scope for each assessment batch; see exact costs. Both retain 20-result/run windows and 15-job explicit assessments. Deployment selection omitted means explicit Free; only runtime RESOURCE_POLICY omitted retains historical legacy (no binding wrapper/cap, 100-result/run windows, 1,000 SQL-work). Unknown profiles fail closed.
Tobias reports upgrading the existing account to Workers Paid; this task did not inspect billing or apply owner settings. After review, the owner must add "resourcePolicy": "paid" to ignored nonsecret deployment.local.json, then separately authorize the ordinary build/plan/deploy procedure. The public example stays Free. This selector changes application ceilings, not the subscription, D1 billed rows, resource names, migrations, schedules, CPU settings or model activation. Workers Paid is a minimum $5/account/month plus applicable usage, not domain Pro or a fixed total bill. Cloud accounting and executable allowances remain unverified. See policy, native evidence and rollback. Exhaustion records incomplete coverage, without automatic continuation. Collector/Workflow schedules, previews, Worker logs/logpush, imports and pruning remain disabled. Desired cloud production enables Himalayas and keeps the model-free API due-check cron. The separate Ranker cron is conditional on the existing automatic assessment runtime opt-in; inventory is not proof of deployment or policy activation. New durable admissions rotate the starting pair by all prior same-acquisition discovery admissions, with a count CAS; each run stays depth-first and starts pages at1. Busy/replay/recovery do not advance rotation, and failed/partial attempts do not aggregate freshness. This gives starting opportunity, not equal-depth sampling, continuation, complete coverage or a time SLA; later pages can still starve. Unindexed history counts can scan growing history, including busy/not-due checks, without bounded row-cost or latency guarantees. See efficiency/fairness evidence. Cloud CPU/quotas/accounting remain unverified. See deployment details.
TypeScript CLI and API
Run the installed jobs with no arguments for the task-oriented overview, or use help, --help or -h. Start with stored reads; cached ranking starts no assessments, although database reads may cost.
jobs profile list
jobs stats
jobs results
jobs results --ranked --cached
jobs help results
jobs help profile apply
Help groups commands into browsing, profiles, collection and advanced operations. Topic pages put copyable examples before individual argument/option descriptions and essential warnings. Every command has topic help; profile, recover, assess and source also have subcommand help. Plain text goes to stdout, exits 0 and never reads files, validates credentials or calls the API. Unknown topics and extra arguments remain errors on stderr with exit 2. Help references are explicitly repository documentation, not files installed beside the single-file CLI. See CLI help and usage, including development invocations.
Offline commands need no credential:
bun run cli profile check example.config.json
bun run cli plan example.config.json
# Or after build:
node dist/cli.mjs profile check example.config.json
API commands need an explicitly supplied application owner bearer secret in JOB_INBOX_TOKEN, not the Cloudflare automation token. JOB_INBOX_URL supplies the API base URL and defaults to http://localhost:1337 when absent. Do not put tokens in profile/config JSON, command arguments or Git. The Worker receives OWNER_TOKEN as a secret binding. The CLI does not deploy; the disposable demo wires an ephemeral synthetic credential. With an authorized local API already running, the forms are:
bun run cli profile apply FILE [--name NAME]
bun run cli profile list
bun run cli profile show NAME
bun run cli profile pause|resume NAME
bun run cli plan [--profile NAME]
bun run cli results [--profile NAME] [--after ID]
bun run cli show ID [--profile NAME]
bun run cli runs
bun run cli refresh [--force]
bun run cli refresh --key KEY [--force]
bun run cli recover dispatch|cancel RUN_ID
bun run cli results --ranked [--cached] [--profile NAME] [--after OFFSET]
bun run cli assess --jobs ID[,ID] [--retry-attempt UUID] [--key KEY]
bun run cli assess inspect OPERATION_ID
refresh needs no user key. Each CLI invocation generates one internal request key; legacy --key KEY remains compatible and duplicate delivery reuses its stored run. Separate omitted-key HTTP submissions do not replay an already completed request. An active healthy run returns its run ID and "Refresh already in progress", exit0, without queuing a manual successor. Unknown/unacknowledged or terminal-but-unfinished ownership reports needs-recovery, exit1. --force bypasses only per-source daily due/cooldown, never ownership, pacing, recorded delays, Jobicy hourly/block guards or budgets. Production refresh returns the reserved/dispatched run, not a promise that collection has completed. Inspect runs for actual Workflow state and coverage. A reused partial/failed refresh prints its run and returns exit 1. recover dispatch RUN_ID retries only stable-ID dispatch, preserving the original scope, reservations and deadline. recover cancel RUN_ID confirms terminal Workflow state before releasing ownership. Unknown state stays needs-recovery; age alone never permits takeover. Reads and filter changes never invoke acquisition/providers. Collector transports stay disabled in default/local declarations, including emulated production. Explicit cloud production selects the existing Himalayas permission; Jobicy additionally requires desired jobicyTransport:'enabled' and otherwise stays off. After PR review/merge and separately authorized deployment, the owner can follow the bounded manual collection flow. Live requests need separate approval; neither merged code nor deployment proves live validation. HTTP is allowed only on exact localhost/loopback hosts; all other endpoints require HTTPS. Redirects are disabled. Every API read/write authenticates, validates input and returns bounded public errors, never SQL/token/private payloads.
results returns bounded ID-cursor summaries with factual filters and cached assessment labels, without full descriptions. results --ranked is explicitly potentially billed: it starts or joins backend-owned durable work over a finite high-water scope. The private Ranker selects, prepares, batches, assesses and verifies; the CLI watches and displays cached ranking, and exiting does not cancel accepted work. Confirmed active campaigns join. Free/legacy campaigns select≤32 jobs in batches≤14, with32 windows per pass. NEW Paid campaigns use batches≤15 and scan/verify the entire frozen stored-job highWater, without a total assessment/window ceiling; old Paid admissions retain128/128 caps. No five-call whole-command limit applies. This finite traversal does not guarantee completion despite failed/blocked/oversized/uncertain jobs, drift or Cloudflare limits. The unchanged watcher uses≤20 reads≥2s apart,≤170s overall/30s per read; ending observation does not cancel backend work or cost. Later inspection is GET-only, not another ranking POST. Only a later NEW explicit request may replace a previously reported unknown executor; a genuinely new campaign may reattempt current pending/no-error identities even with a possibly active prior holder. Duplicate processing/charges are accepted, bounded to one new attempt/job/invocation, with no automatic POST/verification/background retry. Failed/uncertain attempt statuses, any non-null diagnostic and corrupt metadata remain blockers; successful low-fit/uncertain judgments are reused. First recorded exact success wins atomically with its ownership metadata; other callbacks record only their own historical outcome and cannot overwrite success. Old unfinished operations remain unfinished. Legacy direct assess/exact retry fencing is unchanged. Use results --ranked --cached for the old GET-only, never-infer behavior. Safe request/campaign/batch IDs go to stderr; no ranking recovery command is added; one final JSON on stdout reports coverage, incomplete reasons and ambiguous dispatch. Nonzero means completion was not established. This is finite traversal, not a transactional snapshot; later IDs are outside this invocation. See current durable ranking for accounting, interruption and compatible rollout; v1 orchestration is retained as compatibility reference. The final ranking orders the stored finite scope by match, uncertain, stale, then unassessed, with current fit index descending and ID ties. In ranked mode --after is a scanned offset, at most 10,000, not a job ID. Filtering follows scanning, so excluded jobs can leave short/empty pages. Offset pages are not a snapshot across concurrent content/config changes. show returns the full safe plaintext. Unknown salary/geography/mode defaults to include and remains labeled; explicit include/exclude policies are presentation inputs. Salary compares only matching currency and period with sufficient bounds. No conversions or annualization. Geography/timezone and work mode are distinct. Scripts/styles and terminal controls cannot appear as active output. No absent-job closure or pruning. See config/filter semantics, D1 limits/schema and collection boundary.
Read-only assessment reconciliation
jobs assess inspect OPERATION_ID makes exactly one authenticated GET /v1/assessments/:operationId; the ID must be assess- plus64 lowercase hex digits. No flags, polling, assessment POST fallback or provider enablement is needed. jobs help assess inspect and jobs assess inspect --help are entirely offline. A successful bounded read exits0 even for unfinished/incomplete history; this is not assessment success. Request/not-found/unsupported failures exit1; invalid forms exit2 without API I/O.
The view exposes immutable model/rubric/transport/timestamps, requested job IDs, that operation's recorded attempts and safe recorded summary counts/outcomes. No private input/envelope/expectations, preferences, descriptions, provider judgments or raw errors leave it. Historical attempt status is separate from later cache ownership and from a successful judgment labelled uncertain. Only operation finishedAt establishes that its owner finished. Missing attempts/summary, partial successes, pending state or age prove neither no dispatch nor zero cost nor safe retry; unfinished owners remain truthful and fenced on legacy direct assess/exact retry. A new explicit ranked invocation independently authorizes pending/no-error reattempt, not termination or a no-charge inference. Inspection is observational, not an atomic snapshot, liveness/billing guarantee or recovery mutation, and never resumes ranking.
Ranked failures add at most one ranking.failure with phase, closed client cause, observed numeric HTTP status when available and intended admission request ID (legacy v1 diagnostics used operation/batch). Timeout, transport, HTTP, response-size/utf8/json/schema and interruption describe the client request, not provider cause or charges. ambiguous-submit and conservative accounting/no resend remain unchanged; secondary reads cannot mask the original failure. The owner's reported live incident remains undiagnosed and was not inspected/retried here. Never replay a ranked key via legacy assess while omitting its canonical expectations. Cached-only browsing remains results --ranked --cached. API-first rollout, deployment, any live inspection and spending require separate authorization. See full inspection/diagnostic contract.
Automatic refresh contract
Profile apply/pause/resume atomically updates shared desired acquisition and requests intent only for newly enabled or changed enabled source fingerprints. Himalayas uses the union of participating profiles' own position-country pairs; Jobicy broad-feed acquisition ignores personal edits. Disabling creates no request and preserves pending work. Unchanged/assessment/presentation edits add none. No collector/model I/O occurs in persistence. The post-commit waitUntil hook attempts one bounded admission using the same API request budgets; missed kicks leave intent for a later eligible15-minute check.
Each source has independent ownership,24h due/cooldown, pacing, received delays and intent. The least-recently-started eligible source wins, never-started first/Himalayas tie; pending/force bypass only daily due/cooldown. Jobicy hourly/blocked state, ownership, immutable deadlines and budgets remain mandatory. One invocation admits at most one source-run; unavailable pre-admission transport may defer and allow the other. Busy changes coalesce to latest desired source inputs without rewriting frozen runs. Manual/daily admission claims only its source's covered generation; old-key replay consumes none. Claimed failed work does not tightly auto-retry.
New automatic keys are daily/<source>/<due-slot>; slot1 config keys retain config/N, Jobicy uses config/jobicy/N. Historical identities/Workflow IDs replay unchanged. Unknown owners never age-reclaim. Finalization dispatches no successor. Free/Paid exhaustion retains earlier pages without continuation/completeness claims.
Migration0007 initialized no pending request for existing configs;0009 likewise adds no acquisition, preserving old slot1 state and adding disabled Jobicy slot2 plus immutable per-source inputs. During compatible old-code rollback, freeze discovery-config writes in a maintenance window. Old code neither creates nor services intent. Unexpected old-code discovery edits require owner inspection and an explicit manual refresh after restoration; force only for intentional cooldown bypass. Missing transitions are not fabricated and ambiguous owners are not cleared.
Only a later owner deployment activates the proposed cloud-production API cron. Offline success does not validate current source responses, live cloud CPU/quotas/accounting, live recovery or complete search coverage.
Personal relevance
assess --jobs is an explicit potentially billed bounded operation, not a read (assess inspect is the separate read-only form). The CLI generates one key per invocation; optional legacy --key preserves replay, including exact-attempt retry with a deliberately new key. No operation key belongs in personal config. It snapshots assessment inputs and targets 1-20 job IDs with one idempotency key. Repeated keys reuse their result, including unfinished operations; a changed job-ID envelope is rejected. Cache keys include job ID, content hash, normalizer version, assessment-config hash, rubric and resolved model. Config persistence never populates assessment caches inline. Acquisition-triggered assessment permits synthetic test providers only, never live Jev, even when manual assessment is enabled. Exact older keys can become current again when inputs are restored.
The public Jev contract documents jev-1.13.0, pinned with rubric cf4-fit-1. Exact Ranker binding ASSESSMENT_MODE=manual plus a valid own TYPESAFE_API_KEY permits one fixed-endpoint POST per claimed job through authenticated explicit default /v1/assess or v2/v3 backend ranking admission. Automatic assessment is a separate, default-off backend path. Any holder of the existing API OWNER_TOKEN (the same value as the configured CLI JOB_INBOX_TOKEN), including a client such as Career, can enable or revoke the global policy for potentially billed automatic triggers and scheduled work. It covers all valid saved profiles, with no overall spending cap. There is no separate policy credential or new UI. Owner, cloud and provider secrets remain distinct; API/Collector never receive the provider key. Missing/disabled/unknown mode or invalid key fails closed. Reads, help, config, acquisition, refresh (including its cron), and recovery never call live models. Disabled assessments make zero provider sends and record not-dispatched; enabling does not clear or auto-retry their exact cache rows. For manual-origin rows, after the original operation finishes, an explicitly approved exact-attempt retry is required. Automatic-owned rows cannot be retried. This reported-score policy change uses synthetic responses only. The owner reported five uncertain pilot outcomes; the cause and charges remain unknown. A later deployment and then ONE finished exact-attempt diagnostic retry require separate approvals, not a restarted five-job batch.
Scores use three ordered evidence levels, 0 through 2. The validated finite in-range reported score is authoritative: fitIndex remains the average of the active role/skill/seniority reported scores, not a relevance probability. Complete matching probability distributions are still required, with finite [0,1] entries and an owner-chosen inclusive total band 0.99..1.01 (fixed 10 * Number.EPSILON arithmetic-only allowance for up to ten terms); there is no cross-field weighted-mean equality rejection. Even substantial bounded score/distribution disagreement can pass: an owner-approved application policy, not a rounding or vendor guarantee. Scores/probabilities are never substituted, rounded, clamped or renormalized; model/rubric/cache keys and match thresholds are unchanged. Historical mean/conflated/generic failures remain readable and are neither rewritten nor retried by reads, config or ordinary new keys. The total band is application policy, not a TypeSafe serialization/rounding/calibration guarantee. Existing failed probability rows and summaries are not cleared, reclassified or retried by this policy or deployment; the owner's 15 reported failures remain undiagnosed and unchanged until separately approved explicit retry of current attempts with finished owners. Live inspection also needs separate approval. See current probability policy and public evidence and reported-score policy. Confidence measures distribution concentration, not correctness. An empty preference dimension is omitted. Missing descriptions, low fit and low concentration stay uncertain; no model result rejects a candidate. show exposes factual evidence, filters and typed rubric distributions, not promised generated prose. Match thresholds are provisional and only tested with synthetic fixtures.
Before provider I/O, D1 reserves the cache key and attempt. Exceptions, invalid responses and timeouts remain potentially billed, without provider or Workflow retries. --retry-attempt UUID requires a new operation key, one job, the exact current unsuccessful attempt and a finished original operation. Unfinished operations cannot be reclaimed from age. The scoped new-ranked-invocation exception above authorizes a fresh attempt despite unknown activity/cost, without finishing or rewriting the old owner. A pending reservation may predate dispatch or have lost its settlement acknowledgment, so no exactly-once inference claim is made. The CLI exits 1 for incomplete assessment, including reuse of uncertain caches.
Desired Ranker timer (not activated here): only explicit cloud mode at exact production with assessmentMode: 'manual' and automaticAssessment: 'approved' declares 0 3,9,15,21 * * * on private Ranker. After a separately approved deployment update with those runtime settings and a working Ranker provider key, enabling requires an explicit owner-authenticated POST /v1/automatic-assessments/policy. Deployment and inventory do not change the independent, default-off D1 policy. The 03:00, 09:00, 15:00 and 21:00 UTC slots are six hours apart. At 15:00 UTC it is 16:00 CET or 17:00 CEST, before a future 18:00 Europe/Berlin digest, with no Telegram dependency or completion guarantee. One tick scans up to four stored rows and can reserve/send at most one new assessment across all profiles. That is up to four tied to a scheduled UTC date, not four per profile, a database quota or a dollar cap. Delivery may be late or missed; no catch-up scheduling or automatic resend. Direct explicit triggers and manual ranking are separate. The model-free 15-minute API collection cron is unchanged, and collectors/Workflows stay unscheduled. See the manual verification prerequisite and timer behavior.
Legacy runs allow 20 jobs/calls; both selected Free/Paid profiles allow 15 jobs per explicit assessment with SQL and binding-capacity preflight before reservations or provider I/O. The application allows up to 40 KiB (40,960 bytes) for each full serialized UTF-8 Jev request, 128 KiB aggregate input, a 16 KiB response and a 10-second provider timeout per call. Inputs over caps reject the whole operation before writes or inference. Background assessment follows acquisition finalization and uses the frozen run config, current job content and membership. It selects at most 20 missing cache keys, skipping succeeded and unresolved keys; later refreshes catch up. Collection coverage/factual freshness never depend on provider success. Production background assessment is skipped for both live and disabled transports; only synthetic test providers can catch up automatically. Successful responses project only known fields, ignoring metadata without relaxing answer/legend/probability identities or whole-response bounds. Cached usage counters are validated nonnegative safe integers or null; omitted/null counters mean unavailable, never zero/free. Absent/null whole usage is omitted; historical numeric/usage-absent judgments need no rewrite. New failed outcomes and cached show expose only closed possibly-billed stage codes in existing error columns; old summaries/call counts replay unchanged. Historical attempts are never reclassified, and uncertain attempts may have charges without usage. See assessment and storage, historical CF4 validation and manual integration evidence/rollback.
Repository layout
The repository root is the Node project. src/ contains the CLI and Workers, test/ contains isolated tests and retained JSON fixtures, migrations/ contains numbered D1 migrations, scripts/ contains build/test runners, and deployment/ contains shared resources, provider policy and offline inventory; root alchemy.run.ts is the official CLI stack. package.json, bun.lock, Nix and .envrc live at the root. Clojure source, tests, resources, dependency locks and Babashka tasks have been removed.
Enter nix develop, or use the existing direnv setup, then run Bun commands from the root. .envrc loads optional ignored .env.deployment at the root; nonsecret local deployment settings live in ignored deployment.local.json. The old app/ directory, dependencies, build output and caches are removed. Credentials were moved without opening them; no cloud access was performed.
Shared SQL preparation/row/batch/envelope checks live in src/db/statements.ts; src/db/budget.ts owns the existing whole-operation SQL budget. Repository and CollectionStorage remain the domain facades and retain compatibility exports. src/api.ts keeps request preflight, authentication, ordered dispatch and redacted failures; src/api/ groups profile, cached/statistics, ranking/assessment, refresh/recovery and source-policy handlers. CLI/API URL validation shares src/http/endpoint.ts, independently of the stricter production-release origin proof.
Nix package
nix build
nix flake check
./result/bin/jobs profile check example.config.json
nix run . -- plan example.config.json
The default package installs the standalone TypeScript CLI with pinned Node 24.18.0. Its dependencies come from the frozen Bun lock and a fixed-output dependency tree with install scripts disabled; compilation and installed CLI checks run offline. Only cli.mjs and its Node wrapper are installed. No Workers are uploaded and no database is created. Worker/D1 regression tests still require the separate Linux namespace runners above.
The Bun migration preserved all dependency versions/integrities. Its original Apple Silicon macOS checks passed. This CLI handoff also passed frozen installation on x86-64 Linux, four tooling checks, typecheck/build, 11 preparation checks, two official-CLI/import checks, 113 unit tests, eight integration tests plus six restart/upgrade phases, and all five demos. nix build and nix flake check passed from a sanitized public source snapshot; the Linux fixed-output dependency build matched the existing bunDeps.outputHash. No macOS or ARM dependency hash was independently regenerated here. Linux testing found and fixed workerd resolution: patch the platform binary exported by workerd, not Bun's separate executable copy, and detach its hardlink before mutation.
The flake supports Apple Silicon macOS, x86-64 Linux and ARM64 Linux. Other platforms require their own builders. After Bun dependency changes, regenerate and verify the bunDeps output hash in flake.nix; do not update toolchain pins as a side effect. For unstaged public changes, use the owned runner, which imports only its pristine source input and includes nix build --no-link/nix flake check. Never pass mutable work or a private checkout with credentials/state to a path snapshot.
Next steps
CF6 offline release preparation and the official Alchemy CLI stack are implemented. CF5 optional query expansion remains skipped. The required baseline includes the cloud-production Himalayas binding. Automatic refresh awaits reviewed publication and a later owner deployment to activate its desired API cron; bounded live source validation remains separate. Manual model enablement defaults off. Token provisioning, deployment, disclosure/spending approval and schedule activation remain separate owner steps. After deployment, only one separately approved exact-current-attempt verification is contemplated, not a restarted pilot batch; see the latest owner report and policy.