Skip to content
All docs

Docs · Product guides

Audit and operational doors

Source: docs/operations.md

On this page

After native sign-in and setup, open Audit (/app/audit), Explore (/app/explore), Operations (/app/operations), Telemetry delivery (/app/ingest), Pipeline health (/app/health) or Settings → Archive. Each server handler checks the current native session or a scoped credential directly. Responses are private, uncacheable and excluded from indexing. Owners and admins read audit; only owners export it. Audit has no public append, edit or delete endpoint.

Durable facts and private audit

Every covered mutation first records an attempted action. Its database writes run with an installation-local context inside one D1 transaction. Triggers record immutable facts containing the operation, actor, target reference and actual revision in that same transaction. A failed fact insert rolls back the target write. Native role, membership, invitation, session, credential, identity-setting, domain, provider and approval changes use this boundary. Bootstrap records its own durable fact. Notice delivery records a separate opaque attempt/result. HTTP results follow the database facts; a missing response never changes a committed fact into a failed action.

Facts project idempotently into a SHA-256 predecessor chain. A process can stop after a target commit and before projection; the next audit read projects the original fact once. A failed response or projection returns the operation reference with an instruction to inspect before retrying. Occurrence and recording times stay separate. A committed row describes persisted state; succeeded, denied and failed describe the HTTP result. Credential custody suspension and native session revocation facts are captured by the same transaction triggers.

Audit stores only server-selected action labels, opaque references, revisions, times and results. It never copies a request body, URL, header, email address, display name, token, credential hash, query literal or exception. Native settings with nonopaque keys have a private alias directory; their key strings do not enter the chain. The UI does not hydrate historical references from the native identity directory.

Actor privacy (/app/settings/privacy, POST /api/porthole/v1/actors/erase) requires the native owner, fresh identity proof and explicit confirmation. Remove the member first through Members. Erasure anonymizes their native directory record and external identity linkage, destroys unusable authentication values and records the opaque erasure journal in the same transaction. The erased account cannot reactivate. Historical audit bytes and actor references remain unchanged. Telemetry-subject erasure and retention policy remain PORT-035's separate responsibility.

Queries, revisions and approval

POST /api/porthole/v1/query accepts the supported signal/service/environment/team and nanosecond range filters. Explore submits the same operation. The underlying reader persists a protected query descriptor and an immutable completion watermark; audit carries only its opaque reference. GET /api/porthole/v1/query/REFERENCE repeats that descriptor under the caller's current authority. A later batch cannot enter the frozen result, and changed permissions still narrow or refuse replay. Direct telemetry reads and credential queries use the same scoped reader and emit an audit reference. Query descriptors belong to the protected product store, not the less detailed audit packet.

Operations saves real versioned count-monitor definitions and inactive repair plans. Monitor activation requires explicit confirmation for the current revision. An authorized owner, admin, scoped maintainer or responder can record approval of an exact unexpired repair revision. Editing creates a different revision and removes its approved state. There is no production executor yet; an approval record is not an executed repair. Quarantined restored definitions cannot activate, change or approve until a supported local reauthorization path exists.

Export and independent integrity checking

GET /api/v1/audit?after=0&through=100&limit=25 reads sequence (0,100]. Omit through to select the current checkpoint. Follow next while retaining that checkpoint. Invalid, duplicate and unknown parameters refuse without copying their values. A concurrent action cannot change a pinned prefix.

GET /api/v1/audit/export streams the complete pinned packet in pages of 100 records without a row ceiling. Keep its checkpoint in independent custody and verify the saved packet:

Shell
node scripts/porthole/verify-audit.mjs audit.json INDEPENDENTLY_RETAINED_64_HEX_CHECKPOINT

The independent reader rejects content changes, gaps, duplicates, reordering, truncation and checkpoint substitution. SQLite guards reject chain modification and deletion. A privileged database custodian can remove guards, so the chain alone is not a signature against that custodian. The packet supports an owner-authorized Evidence handoff; exporting it does not send it to another provider. PORT-052 supplies the connected scoped Evidence request/export and provider-receipt workflow and inherits this private, independently verifiable packet.

Settings → Archive and node scripts/porthole/archive.mjs export ORIGIN DIRECTORY preserve current product data, source/history labels, raw telemetry, audit streams and the actor-erasure journal. Keep a fresh native-session cookie in PORTHOLE_ARCHIVE_COOKIE, never in command arguments. Restore requires an empty product under its own destination owner; credentials, sessions and approval authority do not transfer. Imported definitions and historical health/delivery work are quarantined, ingestion is paused, and source audit streams retain their original hashes. The destination erasure journal is merged, never replaced by an older journal.

The shared rer export/rer import adapter also excludes credential and session material and applies an executable inactive-restore policy. Its native full-installation round trip is a separate qualification from the HTTP product archive.

Coverage inherited by later doors

Current public doors cover membership, credentials, identity administration, queries, exports, monitor definitions, exact repair approval, actor privacy and independent notice attempts. PORT-001/012/018/019/021/026/029/034/035/036/052/055/061 inherit this boundary before adding their remaining ingestion-policy, dashboard, SLO, pipeline, tool, execution, erasure, connector and signal-export doors. A future family is not implemented by a label in the audit map.

See recovery.md for independent observations, collector freshness, durable draining, firing-monitor outage behavior, notice consent and the remaining analytical/Base recovery limits.

Customer-bucket history

An installation may bind its customer R2 bucket as ARCHIVE_BUCKET. The owner uploads an immutable open-format historical object through POST /api/porthole/v1/storage/history, supplying X-Porthole-Source, X-Porthole-History and its content type. The response records an opaque identity, SHA-256, byte count and source/history labels. No request chooses a different bucket or supplies provider credentials. GET/HEAD on /api/porthole/v1/storage/history/REFERENCE/content verify the actual object digest before releasing bytes under the current owner session. Uploads and reauthorization require fresh native owner proof.

The streaming product archive preserves those exact durable references, with no bucket access grant. Restore quarantines them. To reattach the destination bucket, the owner explicitly confirms the original digest and supplies the identical original bytes, or verifies an already present object; only then can the destination serve it. Collection and delivery remain paused independently. PORT-013/035/061 inherit this custody and audit boundary for their larger archive, erasure and export workflows.

Accountable follow-up

Open Follow-up from Operations. Pipeline evaluation records durable work for current failed intake and recorded loss, stale authenticated collectors, uncertain or refused original mail notices, failing or unassessable count monitors, and exact repairs awaiting approval or execution. Every task starts with the active native owner, a blocker, next action and a due time of 24 hours; there is no automatic outbound escalation. An unavailable control plane remains an external owner recovery procedure because it cannot record its own outage.

Settings → Follow-up lets a native owner with identity proof from the preceding five minutes review the exact task revision, assignee, due time, next action, review note or dissent, suppression deadline and reminder consent. Reminders start off. Enabling them produces one durable in-app reminder per task generation when due and unsuppressed. Restart and repeated evaluation cannot duplicate it. Assignees read only their assigned work while their current service, environment and team scopes still cover it. Handover refuses a successor without the existing role and scope; explicit unassignment remains visible for owner review. Member removal refuses unresolved assigned work until that review has moved or explicitly unassigned it. Role and scope revocation proceeds immediately, suspends affected assignments into visible owner review, and preserves the original work scope. Task ownership transfers neither a credential nor repair approval, and it never disables collection or a monitor.

Telemetry tasks retain an immutable monitor ID and definition revision as their recovery guard. Collector tasks require an owner-reviewed monitor covering the same scope. Only a fresh measured Healthy evaluation of that active unchanged revision, with complete current telemetry coverage, resolves the work. Fresh heartbeats while the monitor still fires leave it blocked. Unknown data, a quiet alert, a closed ticket, an accepted provider receipt or a weakened replacement monitor cannot resolve it. A measured recurrence reopens the same task with its assignee and history preserved and a new reminder generation. Missing guards and unavailable execution remain named blockers. This minimal native monitor guard supplies PORT-059 recovery evidence; it makes no PORT-021 or PORT-084 SLO claim.

GET /api/porthole/v1/follow-up returns currently authorized tasks and their history. POST /api/porthole/v1/follow-up/review takes the task id, revision, ownerId (empty explicitly unassigns), dueAt in UTC milliseconds, nextAction, note, reminders (on or off), suppressedUntil in UTC milliseconds and confirm: review. An unbound telemetry task can additionally select guardId; the server freezes that monitor's revision and refuses a guard with narrower scope. Native origin, current owner authority and fresh proof are rechecked at the write. Stale task revisions refuse without changing assignment or history.

The private audit chain retains opaque task changes. Task notes, dissent, assignment reviews, recovery transitions and reminders remain in the protected work history. Both Settings archives and native installation archives preserve that history as quarantined evidence; restore revives no assignment, reminder, credential, approval or delivery consent. Re-export retains the original stream.

PORT-008, PORT-019, PORT-020, PORT-021, PORT-028, PORT-029, PORT-047, PORT-051, PORT-053, PORT-055, PORT-077 and PORT-091 inherit these accountable work and unchanged-recovery boundaries before adding services, reports, investigations, connectors, routes or executors. Their independent DONE gates remain unchanged. Outbound follow-up requires an already declared owner-confirmed adapter and separate explicit audited consent; the current follow-up screen offers only in-app reminders.

Host heartbeat monitors

Open Monitor Settings at /app/settings/monitors to create an inactive host heartbeat definition. Use the machine identities reported by authenticated collectors. An owner, admin or maintainer with the full definition scope can save a new revision and explicitly activate that exact revision. The same validated body is accepted by the existing object and configuration APIs. Current members read only monitors whose complete scope they hold; evaluation history and old definitions also retain their original scope restrictions.

collectors/heartbeat/process.mjs runs on the monitored machine. Supply its installation HTTPS origin, scoped ingest secret, heartbeat descriptor and optional intervalSeconds as one private JSON object on stdin. The descriptor contains collectorId, team, service, environment and signal; the process supplies hostId from the operating system hostname. It sends no external probe. Keep the interval below the configured missed deadline. A collector identity is bound to its first explicit host within that credential and scope; moving a collector to another host requires a new collector identity. Legacy heartbeats without an explicit host continue to support pipeline observation, but cannot establish host presence. Credentials must remain active, unexpired and within their custodian's current signal and resource grants.

The host definition uses type: host-heartbeat, an explicit hosts array, a signal, missedAfterSeconds, pendingSeconds and recoverySeconds. A heartbeat is overdue at exactly its trusted receipt time plus the missed interval. Pending starts at that deadline, then becomes Firing at the configured pending boundary. Recovery requires accepted presence over the recovery interval; any gap reaching the missed interval restarts recovery. Evaluation is driven by the existing health tick or an authorized explicit evaluation, so the recorded transition time is the evaluation time, with the condition boundary retained separately.

Monitors at /app/monitors show per-host last recorded evaluations and their revision history. The native API at /api/porthole/v1/monitors returns the same private evidence. POST to /api/porthole/v1/monitors/evaluate supplies an active monitor ID and its exact revision. Evidence retains the accepted observation references, timestamps, original rule and pending or recovery boundaries. New evaluations also retain each scoped source identity, receipt bounds, credential and membership revisions, native account generation, expiry and whether that source was authorized at evaluation time. Later rescoping or revocation cannot rewrite that historical decision. These snapshots contain no credential secret or broader source grants; they never supply live authority after restore. Never-registered hosts and revoked or unavailable sources remain Unknown; unavailable heartbeat storage cannot be interpreted as a missed heartbeat. Bounded observation coverage is explicit. A fresh heartbeat establishes neither telemetry completeness nor overall host health. Existing count-monitor coverage checks remain required. No notification delivery, external probe or SLO change is authorized by this family.

Product archives preserve definition revisions, per-host evaluation history and inert source and pending-state context. Restored monitors stay quarantined; collector credentials and live heartbeat state never resume from an archive. Other monitor families, complete source-definition migration, source-equivalent replay, ownership, templates, downtime and delivery qualification remain open in PORT-067.

Native installation exports use the same inactive host boundary: source registrations, heartbeat observations and pending monitor state are preserved as quarantined archive history. Native restore retains definition versions and recorded evaluations without restoring collector credentials or live host authority.

Removal handover history

A reviewed removal records opaque member references, the inventory digest, object revisions and explicit successor decisions in private transactional history. Each unassigned object opens named PORT-059 work; existing recovery guards, collection configuration and monitor definitions remain unchanged. Follow-up assignment changes retain their original evidence and add a handover event. An approved repair whose approver is removed becomes inactive and needs a new current approver; no approval or execution permission transfers.

Product archives carry these handover receipts as inactive history. Restore does not replay removal, revive ownership grants, private shares, public addresses, approvals, custodial credentials or pending work. Re-export retains the receipt decisions and their inactive state.