Repository navigation
Commit 198714d
committed
[feat.db.sigma.D7+] app.job stops being a table nobody writes to, and the first thing it recorded was a rule I had only ever written in comments
The ledger has existed since migration 007 with the state machine, the
one-in-flight unique index, v_job_live and reap_orphaned_jobs — and 0 rows, no
writer. backend/jobs.py is the writer; field_server calls it around every
compute (that file's changes are in 86aff26, swept into a peer commit before I
could stage them — the WHY is here and at both call sites).
MEASURED, four requests, four correct terminal rows:
fields.mep done 0.21 s
fields.mep failed UNSUPPORTED "Gasteiger cannot parameterize F/P" (PF6-)
fields.qm.homo failed BUDGET "SCF exceeded its 0 s budget"
counters at /health: opened 4 · done 1 · failed 3 · write_failed 0
A ledger that only ever records successes is the one that is easiest to lie
with, so the failure paths were wired and exercised first.
THREE DESIGN POINTS, each of which is a rule this repo already paid for:
- A JOB ROW MAY NEVER COST A RESULT. Every failure degrades to "no row" and the
field still returns — but NOT silently: the counters are on /health, because a
ledger that is quietly not being written looks exactly like a system with no
work in it, which is the OFFLINE-vs-EMPTY confusion the ops console exists to
refuse.
- Rows are inserted as 'running', not 'queued'. In a synchronous service 'queued'
would last microseconds, and a state the system cannot be observed in is noise.
The state stays valid in the schema for the worker that will use it.
- A conflict on job_one_inflight is a MEASUREMENT, not an error: today two
identical concurrent requests both compute, so that counter is how often
duplicated work actually happens. Guessing that number was never going to
justify building the wait-for-result path.
AND THE LEDGER IMMEDIATELY CAUGHT SOMETHING. `max_seconds: 0` is documented in
four separate comments as "refuse before doing any work, tell me the cost". The
HTTP layer had `max(req_seconds, 1.0)`, so zero became one; and run_scf had no
pre-flight at all, so the refusal came from the in-loop watchdog after one SCF
cycle. The job rows show it: 1.03 s and 1.28 s, error BUDGET. A rule stated in
four comments and implemented in none of them is a rule about my intentions.
Both fixed: the floor preserves 0 (and clamps negatives to 0 — nonsense is not a
request for the default), and run_scf now screens with the model this repo
already measured over 47 molecules, 2.8x safety factor included rather than
quietly dropped. Zero-budget refusal went 1.30 s -> 0.05 s and now names the
estimate and the basis-function count, so the caller knows what to send instead.
THE NEW GUARD SHADOWED AN OLD WITNESS, which is the part worth keeping. The
in-loop watchdog's test used max_seconds=0.0 — the pre-flight now refuses that
before an SCF object exists, so the test went red on a message with no cycle
count, and the watchdog it exists to prove was no longer being exercised. A new
guard that shadows an older guard's test does not remove the need for the older
guard, it removes the EVIDENCE for it, and the suite still reads green
everywhere else. Fixed by budgeting 0.05 s against the model's own 0.033 s
estimate for benzene (clears the screen, an order of magnitude under a converged
SCF), and the pre-flight got a witness of its own.
Three more stale expectations repaired, all from another session's real changes,
none by weakening the invariant:
- the cube-origin units check hardcoded pad=4.0 while the box now GROWS until the
contour closes; it reads pad_used_angstrom now, so it tests units instead of
padding policy (hardcoding turned every tuning pass into a "unit inversion");
- iso_suggest was replaced by iso_fixed/iso_sized_for; the invariant (the drawn
isovalue lies inside the field's range) survives the rename;
- the stray-basis-literal scanner convicted MINIMAL_BASES, a NEW and legitimate
home for a DIFFERENT fact ("which bases are too small to quote a frontier
energy from"). Narrowed by NAME, not by line, so a literal in a function body
is still a stray — which is where the original incident lived. Its positive
control now plants inside a function, or it would test the exemption.
19/19 physics contracts green (was 17 passed / 2 failed).
Also landing the performance probe from earlier today, unrelated but finished:
scripts/perf_probe.mjs + docs/PERF.md. Cold load 920 ms measured, bundle
3.14 MB / 902 KB gzip, field-swap medians 189-722 ms across 6 kinds.
STOPPED HERE at Ivan's instruction (「暂停先」). Four agents were mid-flight and
were killed; their partial files are deliberately NOT in this commit:
src/.../facets/{property-cockpit,pharmacophore-designer}/index.ts,
src/app/services/ligand-store.ts, scripts/memory_probe.py, docs/probe_runs/.
Uncommitted and unverified is the honest state for work that was interrupted.1 parent 86aff26 commit 198714d
4 files changed
Lines changed: 1409 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
0 commit comments