Repository navigation
Ingest the observer's nemar.observation.v1 post - #2066
Merged
neuromechanist merged 13 commits intoNov 7, 2026
Merged
neuromechanist merged 13 commits into
neuromechanist merged 13 commits into
Conversation
…em against the migration
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR2066Version: 🤖 Updated on each push. |
neuromechanist
merged commit Nov 7, 2026
91945d9
into
feature/issue-2005-epic-compute-core
25 checks passed
8 of 9 tasks
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The compute Worker now takes the real observer's post. Owner decision of 2026-11-06: the Worker adopts the observer's
nemar.observation.v1document andAuthorization: Bearer <token>; the observer in nemar-process is not changed.shared/contract/compute-observation.schema.json: the document as a JSON Schema (draft 2020-12, every object the observer writes closed), derived from whatobserver/observe.pyemits. Shared byte for byte with nemar-process (observer/schema/observation-v1.schema.json), the way the launch specification is.shared/contract/compute-observation.ts: the zod mirror, andparseAllocTres, the one reader of Slurm's allocation items (cpu,mem,node,gres/gpu); it fails closed on a value it cannot read.backend/src/services/compute-observation.ts: the document to the stored rows, as a table in the file header. Settlement, tolerance and the mismatch flag are untouched.POST /compute/observer:Authorization: Beareronly;X-Compute-Observer-Tokenand the{snapshots, sacct}body are gone. Token rules are as before (one-hour per-run HMAC, one uniform 403, 1 MiB, 5,000 rows, never logged).test/fixtures/compute-observation/{quick,daily}.v1.jsonare what the observer itself wrote; nemar-process holds the same bytes.Mapping
partitions.<name>.jobs.PENDING.jobs/.RUNNING.jobs(0 when the state is absent)compute_queue_snapshots.pending/.runningaccounting.jobs[].job_id,partition,state,elapsed_secondscompute_sacct_rows.slurm_job_id,partition,state,elapsed_secondsalloc_tres:node,cpu,gres/gpu,mem(to MB, rounded up)alloc_nodes,alloc_cpus,alloc_gpus,alloc_mem_mbsubmit,start,endsubmit_time,start_time,end_timecharged_milli= NULL (the rate table prices the allocation)Refused (400
invalid_post, path and fixed word, run not spent, nothing stored): wrongschema, unknown field at any level, a mode other thanquickordaily, more than 5,000 rows, analloc_tresvalue that cannot be read (malformed_tres), elapsed time with nocpuitem (missing_cpu).Skipped and counted in
skipped: a partition whose queue was not read (jobsnull, never stored as zero); a row that is valid but that no table can hold (a pending array id such as123_[1-5], an unreadable partition, state or elapsed time, a value past a column bound).Mode:
quickanddailyare both live; there is no dry run.quickhas noaccounting.Tests
From
backend/, one file at a time; root for the contract files:bun test test/compute-observer.test.ts: 48 passbun test test/compute-e2e.test.ts: 3 passbun test test/compute-switches-flag.test.ts: 39 passbun test test/compute-route-inventory.test.ts: 5 passbun test test/oidc-token-allowlist.test.ts: 6 passbun test test/compute-observation-contract.unit.test.ts: 15 pass, 1 skip (the drift tests run withNEMAR_PROCESS_DIRset to the nemar-process branch; the same run withNEMAR_REQUIRE_PROCESS_DRIFT=1),test/contract-schemas.test.ts63 pass,test/compute-contract.unit.test.ts454 pass,test/compute-header.unit.test.ts56 passbun run typecheck,bun run lint: cleanMutations, each run and each failing as intended:
parseAllocTresmade to guess (lenient integer parse, bare memory read as MB): contract test 1 fail (a value it cannot read is a failure),compute-observer.test.tsfails first ata malformed alloc_tres is refused, settles nothing(later failures in that run are the harness collapsing after a 5 s timeout).compute-observer.test.ts2 fail (a document whose schema is not exactly nemar.observation.v1,a v1 document with a field the observer does not write).compute-observer.test.ts1 fail (the token is read from Authorization: Bearer only).Drift: nemar-process pins this PR's first commit (
6e4e8b6b) for the schema and fixtures; after this merges, its pin should move to the squash commit that holds the same files.Not run: full suites, CI.