operations¶
what breaks and what to check. commands run against the database and the board's
own endpoints, so they hold wherever you deploy it; <sql> is a psql session on
the shared database.
the poller ticks every POLL_SECONDS (default 60) under a postgres advisory
lock. architecture has the rest;
security and moderation covers moderation, quotas and history
redaction.
endpoints¶
| path | meaning |
|---|---|
/healthz |
process alive, always 200. point liveness probes here |
/statusz |
external monitoring: 503 for a stale poller or failing mail delivery, implementation scan, PR intake or feedback task. anonymous replies carry only ok; a board admin session or a MONITORING_TOKEN bearer also gets per-subsystem failure times and counts, mail queue size and age, scan backlog, github quota and backoff, failing bots and projects failing preflight. no recipient addresses |
/api/specs |
the corpus as json for external tools (reading specs elsewhere). public, current-permission checked |
/api/namespaces |
per-project preflight (repo, push, roles should be pass; protection may stay unknown) plus poller.stale |
/bots |
admin login. a failing review bot shows its failure count and last error, in memory, reset by a restart |
/checkpoints |
admin login. per-project checkpoint state and what still blocks a cut |
poller stale¶
/statusz returns 503, or the board shows the stale banner.
- read the board's log for
poll:errors. the tick is serial, so one slow dependency stalls everything. - check the database is reachable:
<sql> -c 'select 1'. every board query carries a 15s statement timeout, so a dead database shows as repeated timeouts rather than a hang. - github problems appear as
gh:,scan:orapp token:lines. installation tokens refresh themselves; a lone 401 at the expiry boundary heals next tick. - restart only if the process itself is wedged. it drains the running tick first.
For PR intake failures, inspect subsystems.prIntake.failures and its HTTP
status when present. Check App credentials and installation permissions for
401/403 responses; wait for GitHub recovery or rate-limit reset for 5xx/429.
intake.* codes identify a credential, identity or token-scope mismatch.
pr_intake_budget means the scan ran out of time and will retry. If comment or
page limits persist, inspect the affected repository and handle those PRs
manually. Other board work continues while intake is degraded.
correct a spec PR¶
Correct the note or project policy and obtain approval for the new candidate. If the initial PR has not merged, the board closes its recorded submission and opens a replacement. An unexpected edit to an open publication branch stops replacement; close that PR without merging it before retrying the corrected candidate.
After publication, changes use revision PRs and keep the original spec number and path. Preserve the state row and submission records; clearing their identities prevents reliable recovery. If an unchanged PR was closed by mistake, restore its branch and reopen that same PR in GitHub.
review bot failing¶
failures back off exponentially, up to 60 ticks between attempts, so a quiet log
does not mean recovered. check /bots.
| symptom | cause | action |
|---|---|---|
401 |
endpoint rejected the api key | verify the key against the endpoint by hand, paste the working one into /bots |
5xx |
model origin down or overloaded | the backoff covers bursts; act only if it persists |
did not complete |
output was interrupted or exhausted its token limit | reduce reasoning effort; select None if the endpoint supports disabling thinking |
does not match the requested schema |
the endpoint returned an invalid result | check its JSON-format support and the selected response format |
| healthy but never reviews | nothing is eligible | see below |
a review fires only for a spec in ready-for-review or in-review, idle for
REVIEW_IDLE_MINUTES, whose review fingerprint differs from spec_board_reviews.
the fingerprint includes prose, effective prompt, model, endpoint, request settings and inherited
context; changing any of those can schedule another review within the existing
per-tick budget. bot comments wait until editor tabs close. force one:
if the symptoms contradict the stored config, suspect the code path rather than the data.
Once a model responds, the board saves its findings and editor operation before
delivering them. Temporary save failures retry that response with per-spec
backoff, without calling the model again. Shared findings finish before inline
comments are written so the comments do not invalidate their source hashes.
Failed saves stop after eight attempts. An open editor delays comment delivery
until it closes; pending text expires after 24 hours. Comment-only and frontmatter
edits preserve the saved review, which is reapplied only while the reviewed text
(ignoring whitespace) and permission remain unchanged. For a truncated review,
this comparison covers the excerpt sent to the model.
Denied, unavailable or changed evidence is not retried. /statusz reports pending
and failed deliveries separately from model health. After correcting a delivery
failure, delete that spec's review row using the command above to request a fresh
review.
rate limiting¶
the board allows 120 requests per 10 seconds per caller, and answers 429 with
Retry-After: 10. /healthz and static assets are exempt, and /statusz has
its own limit of 30 per 10 seconds. all dynamic traffic shares a ceiling of
600 requests per 10 seconds and 32 concurrent handlers. per 10 seconds, diff
routes allow 4 requests per caller and 6 uncached calculations in total;
revision routes allow 8 and 20. a full cache evicts its oldest entry instead
of clearing.
who counts as one caller depends on TRUSTED_PROXIES
(configuration). the default 0 uses the socket peer.
raise it only behind an edge that strips incoming forwarding headers and
blocks direct access to the board. a wrong count breaks the limiter either
way: too high and a caller picks its own bucket by sending the header; too low
and every request behind the proxy shares one bucket, so ordinary traffic trips
the limit.
checkpoint will not cut¶
the button is disabled while the project has blockers, and each one names the
spec or file and how to clear it (checkpoints has the
table). a post sent anyway is refused with N unresolved. what else stops a
cut:
the board snapshot is stale, wait for the next poll. every check compares the repo tree against the poller's view, and a replica that has not polled has none. one poll clears it;/statuszsays whether the poller is healthy.- Open discussions on the checkpoint's specs. Follow the Discussion links and resolve the threads. If a linked source is unavailable, a board admin can use Administrator recovery in the editor to resolve that block.
- a github error from the tag write. tags are not branch-protected, but a tag
ruleset can still refuse
refs/tags/specs/*, and the app installation needscontents: write./api/namespacesshows whether preflight passes.
the map refresh button reports the map is already current when nothing has
drifted, and no spec map at the repo apex for a project with specs-dir: ..
Projects with auto-merge enabled use this action to update their repository
map; spec publication PRs leave the shared README alone.
approval not counted¶
a name in approved-by with no approval on the board shows as pending on the
card and in the roster. the board only counts approvals its own route
recorded (review); the editor writes the name
after that. usual causes: the name was typed by hand, the approval predates
the board recording them, or the click failed. the approve button says why
it failed: the two services do not share a secret (EDITOR_SECRET on the
board, CMD_SPEC_BOARD_SECRET on the editor), the approver's numeric GitHub ID
is not in roles.yml, the board has not polled the note yet, or the spec is
not under review. a 409 also means the text changed after the editor saved
it; review the latest text and retry. the board logs each recorded click as
approval: approve github:<id> on <note> (<count>/<required>). the fix is
always the approver clicking approve again.
stale-approval mail missing¶
the mail goes to the approver's delivery address (/settings, else the
account's), through the same mute and opt-out as every other line, and only
after the note has sat idle for REVIEW_IDLE_MINUTES. it is sent once per new
text: notified_hash on the approval row in spec_board_snapshots records
which. a link in it to a snapshot that has since been replaced (the approver
retracted and re-approved) lands on the default comparison with a notice.
email¶
- digests become due after
EMAIL_DEBOUNCE_MINUTESof quiet or eight times that age. each poll attempts at most eight recipients and 200 rows per recipient, with a five-second admission budget; an active SMTP attempt may finish after it. older recipients rotate fairly across polls. the board snapshot is published before delivery starts. rows reaching 20 failed sends are dropped and/statuszrecordsDeliveryExhaustedand a dropped count. - opt-outs are one-way hashes in
spec_board_optout. re-enabling from the settings page clears them for all of a user's verified addresses. - attempted recipients wait one debounce window before their next batch. new activity does not reset that retry clock. restricted or deleted notes are removed from the outgoing digest after a current visibility check.
missing snapshot text¶
snapshot <id> has no stored text means an older snapshot reference has no
body. new references are protected by a foreign key, and snapshot writes hold
their bodies through commit. the constraint initially leaves existing rows
unvalidated so an old orphan does not prevent startup. inspect them with:
SELECT s.id, s.note_id, s.kind, s.label, s.hash
FROM spec_board_snapshots s
LEFT JOIN spec_board_snapshot_bodies b ON b.hash = s.hash
WHERE b.hash IS NULL;
recover missing text from database backups before validating the constraint:
implements scan lag¶
the scan compares immutable default-branch SHAs, so an old side-branch commit newly reached by a merge is included. each repository processes at most two pages per poll and persists its pending target and next page with the detected implementation events. it never advances past an unprocessed page.
/statusz reports pending repositories, oldest pending time and failures under
subsystems.implementationScan. a first scan, missing old commit or rewritten
branch performs resumable full reconciliation. cursor JSON lives in
spec_board_meta at implementation_scan:v1:<repo>; deleting that key requests
a full reconciliation.
editor and board recovery¶
deploy the editor before the board, with the same CMD_SPEC_BOARD_SECRET and
EDITOR_SECRET. then, before the new board starts, run its migration job as
the migration role: node server.js --migrate. the board refuses a schema
version other than its own. HEDGEDOC_INTERNAL_URL can point board mutations
at an internal editor address; it defaults to HEDGEDOC_BASE_URL. the v1 route
signs the exact request body. restart the editor with replacement rollout,
never parallel replicas.
permission_intent preserves an unfinished lock operation and its original
permission; leave it intact while recovering the editor. 409 means an open or
busy note; 412 discards an unapplied stale intent and replans next poll. editor
receipts are committed with mutations, so a lost response can be retried safely.
receipts and permission ownership records are deleted with their note. preserve
the editor's generated canonical short IDs; do not reuse one for a different note.
publication recovery reads the file at the original or revision PR's immutable
merge commit. an unavailable or
ambiguous file leaves publishing pending. never set published_hash from the
current note to clear that condition.
publication_generation increases when a poller claims publication work. delayed
completions only update state, snapshots and queued events while they still own
that generation. leave this counter intact during recovery.
publication identity guard¶
the board refuses to start while the unique partial index
spec_board_state_ns_pr is missing, invalid or defined differently; its
startup: log line asks to repair that index. the migration job creates the
index, and when that fails it logs publication identity guard: but still
exits successfully, so check its log. duplicate (namespace, pr_number) rows
block the index: resolve those claims from the actual PR history, rerun the
migration job, then start the board. a timeout during the check counts as a
failure.
on shutdown, new work stops and read/model requests are cancelled. acknowledged remote writes can finish their local state transactions before the pool closes. a separate 25-second deadline exits even if a connection never drains; the next process reconciles uncertain editor mutations and GitHub publications.
rotating credentials¶
| credential | how | cost |
|---|---|---|
SESSION_SECRET |
replace, restart the board | logs everyone out, dead-links every unsubscribe URL already sent. no dual-key path, so rotate only on suspected compromise |
GITHUB_TOKEN, app private key |
replace, restart the board | none |
bot api_key |
/bots, paste the new key |
none, leave blank to keep the current one |
backup and restore¶
back up the shared database with pg_dump -Fc. custom format means restore is
pg_restore, not psql:
# stop both services first so nothing writes mid-restore
pg_restore -U <user> -d <db> --clean --if-exists <dump>
the editor's uploads live on a filesystem volume. whatever covers the database does not cover them.
Keep a database and uploads backup with the previous image before deploying. Restoring an image does not restore the database.
implementation feedback¶
/statusz includes aggregate feedback counts for proposals waiting to be
placed, due jobs, discovery failures and paused projects. Task failures appear
under subsystems.feedback and return 503 until a tick succeeds. A proposal waits
while its note is open or was edited within REVIEW_IDLE_MINUTES, and stays
parked while its source is unavailable or private.
if proposals do not appear, check the project's feedback-bot selection,
the bot's enabled state and project assignment, and the automatic-proposals
toggle in settings. the service credential needs issues and pull requests
read access in each implementation repo, and contents read access in the
canonical spec repo. implementation-repo access is checked before initial
discovery and each daily reconciliation. the PR must have merged
and its description must name a tracked spec with implements.
discovery saves partial sweeps and retries failed requests without treating a page cap as success. incomplete or oversized evidence does not call the model. PRs that merged outside the 30-day discovery window are not picked up.
a placed proposal is a suggestion in the note; accepting or rejecting it there is the decision, and the board keeps no separate record of it. proposal payloads expire 90 days after placement. feedback tables are covered by the ordinary database backup.
deploying a change¶
Build the editor and board from the same release. Before upgrading, back up the database and uploads, and retain the encryption key separately. Stop the services while applying database migrations with the migration role, then start the new images with their runtime credentials. See release for the image build and migration commands.
Keep deployment-specific image references, backup schedules and rollback commands in the repository that manages your installation. Restoring an older image alone does not undo a database migration.