Record the fresh-context audit of the Nous Portal provider as the
first entry in docs/devlog/ (rounds 1-5, the fixes in 00d50e1..04fa08f,
decisions, gotchas, open items) with its INDEX.md, and add the Session
Logs pointer window to the root AGENTS.md.
DOX pass: docs/AGENTS.md now owns docs/devlog/ (one log per unit of
work, INDEX.md is the source of truth, logs are append-only) and its
verification line covers the filename convention; tests/AGENTS.md
documents the drive() harness changes from rounds 4 and 5 (a deferred
refresh to simulate overlapping handlers, a Nous model for setModel
assertions, provider-level fetchModels via the registered provider).
- apply(): only swap the current model when a Nous model was filtered
out; a session on another provider is left alone, and the notice names
the model actually in use instead of the first catalog hit.
- Device-code poll floors the interval at 1s and treats a non-numeric
interval as absent, matching pi-ai's own poller; interval: 0 from the
server no longer becomes a tight loop.
- Drop the provider's own context.publish: createProvider already
persists and publishes the fetchModels return value with checkedAt;
the extra publish was a second, timestamp-less write each refresh.
- tokenRequest tolerates a literal null error body (data.error would
have thrown TypeError, masking the HTTP status).
- tsconfig: remove allowImportingTsExtensions and baseUrl, both inert.
- .editorconfig covers .mjs.
- Tests: 14 (was 8). tokenRequest is exported and its HTML/null error
paths are pinned; the no-credential test now sets NOUS_API_KEY so it
fails if an env fallback returns; the slash commands are driven
through a recording pi (switch/notice semantics, and persist-before-
mutate on a failed flag write). Stub returns a private mkdtemp dir.
- CHANGELOG: /nous-catalog entry states the switch semantics.
- slow_down now sleeps (and waits longer) instead of re-polling at
once; the interval cap that could lower a server interval is gone.
The deadline already bounds the loop.
- Non-JSON error bodies from gateways and the Vercel checkpoint no
longer surface as SyntaxError; the HTTP status is preserved.
- Drop the dead process.env.NOUS_API_KEY fallback in fetchModels:
envApiKeyAuth already resolves it into the credential upstream.
- apply() persists the catalog flag before mutating memory, so a
read-only agent dir cannot leave the two out of step.
- sleep() replaced with node:timers/promises; three unused exports
removed; stale tags.user comment corrected; hermes filter explained.
- Tests: 8 (was 4). Pin tierOf, the tier header, and withoutTierHeader
on both stream entry points; t.mock.method replaces hand-rolled fetch
swaps; stub gains getAgentDir.
- Docs: README covers install lockfile flag, hermes row, browser-UA
posture, and typecheck path pinning; AGENTS.md allowlist includes
pi-coding-agent; tests/AGENTS.md contracts updated.
Appends the canonical DOX framework to the root AGENTS.md and creates
child docs for the two durable boundaries: docs/ (ADR numbering,
format and status rules) and tests/ (jiti aliasing to host-package
stubs, what the tests pin, the NOUS_API_KEY fallback gotcha).
tests/stubs/ gets no child doc on purpose: it is a single file whose
only contract is owned by tests/AGENTS.md.