i2x

Registrar project policies

A Registrar policy binds a project to its inventory scope, naming rules, exceptions and diagnostic retention limit. Recording a policy does not scan a project, move files or authorize deletion.

Read the current policy

GET /api/projects/{projectId}/registrar-policy requires an authenticated project member. A missing policy returns 404. The response includes the policy and its recording time.

Adopt a policy revision

POST /api/projects/{projectId}/registrar-policy requires policy and optionally accepts documents; other top-level fields are rejected. Supply the complete digest-bound policy produced by the Registrar policy library. The project and approver must match the authenticated request.

Adoption requires an owner or maintainer who is a human user, with a browser session verified by step-up authentication within the last five minutes. Cookie requests also require the same-origin and CSRF protections used throughout the API. Agent sessions cannot approve policy revisions.

The first revision is 1 with a null predecessor digest. Each later revision increments by one and names the exact previous policy digest. Existing revisions cannot be overwritten. A conflicting predecessor returns 409; repeated POST requests are not idempotent. After an uncertain response, read the current policy and compare its digest before retrying.

What the policy establishes

The policy includes project and system identities, revision, predecessor digest, scope digest, naming-rules digest, exception-register digest, approver identity, approval-evidence digest and a diagnostic retention limit of 1–259200 seconds. Its fixed safeguards preserve unknown items for review, require same-task cleanup of generated output, and grant no filesystem or cleanup authority.

Digests bind declarations; they do not prove that referenced rules were independently reviewed, that every file was inventoried, or that cleanup occurred. Detailed inventory paths and file contents are not part of this endpoint.

Retain and retrieve rule documents

Adoption may also include a documents object with exactly namingRules and exceptionRegister. Both complete versioned documents must match the policy digests. They are recorded atomically with the policy. Use GET /api/projects/{projectId}/registrar-policy/documents to retrieve them. This separate, authenticated endpoint includes private naming paths and exception details. A policy recorded without documents returns 404 here; the ordinary policy response does not include those paths.

Collect locally, review, then share

Use your adopted local policy bundle with i2x registrar-monitor <project-root> --bundle <policy-bundle.json> --out <empty-private-directory> --samples 10 --interval-seconds 30. This foreground command saves up to 100 observations, with 1?3,600 seconds between scans. It installs no service and sends nothing to i2x. Private paths stay in the saved files; terminal output contains summaries. Ctrl+C requests cancellation. Keep the output directory outside the project.

Verify saved observations with i2x registrar-monitor-verify <observation-directory> --bundle <policy-bundle.json> --expected-head <monitor-record-digest>. This checks the recorded chain and replays compliance. It does not rescan current files or authenticate a checkpoint supplied by you.

Prepare the latest observation for review with i2x registrar-monitor-export <observation-directory> --bundle <policy-bundle.json> --expected-head <monitor-record-digest> --submission-head <console-head-or-null> --out <new-submission.json>. The monitor record digest and console history head are different values. Export creates a private file and makes no network request. In the project console, select that file, review it and explicitly approve sending its paths and metadata. Never upload credentials or source-file contents. Export preserves the original observation time; it does not make old evidence current.

Monitoring detects inventory metadata and classification changes, not source-content edits. Saved output is bounded to 4 MiB per observation and 32 MiB per run. Review its retention after use; these commands do not automatically delete snapshots.

Inventory history

The project console uses ?view=page for at most 25 path-free summaries, starting with the newest page. Use Older/Newer observations to navigate. Pages retain ascending observation order. Returned page metadata contains the sequence range, page index and opaque olderCursor/newerCursor; send a returned cursor with ?view=page&cursor=.... Cursors bind this project and history head and grant no authority. If another observation is recorded, navigation returns 409; refresh the latest page. A failed navigation retains the displayed page with unknown currentness and holds submission until refresh. Page mode refuses private-path disclosure. Backend full-chain verification remains unchanged; no reduction in server verification work is established.

GET /api/projects/{projectId}/registrar-inventory returns ordered, path-free summaries. Add ?disclosure=paths&view=latest for the newest private inventory record. This is the project console private-details request;older record bodies are not returned. The latest record still includes its own policy and drift context. Use ?disclosure=paths&view=history only when you explicitly need all private retained records. historyScope identifies the projection and totalRetainedRecords reports the verified chain length. The same history head is preserved. The server continues full retained-chain verification;this reduces response disclosure rather than verification cost. Unknown or duplicate query parameters refuse. POST accepts exactly membership, expectedHeadDigest and observedAtEpochSeconds. Supply the complete verified membership assessment, not only its entries. The head is null for the first observation. Later submissions must name the current head; a conflict returns 409.

Submission requires the same human owner/maintainer step-up and CSRF checks as policy adoption. Observations cannot predate their adopted policy or use a future timestamp. The request limit is 4 MiB. Incomplete enumeration never confirms removal; a changed scope starts a new comparison boundary. These are retained declarations, not independent filesystem evidence. No file is deleted or changed. After an uncertain submission, read history before retrying.

Review unknown files

In the project console, open private inventory details and select an unclassified file or directory. Enter its classification, responsible owner, purpose and evidence digest. Download the classification draft and its source inventory. These private downloads do not change the saved observation.

Validate the draft with i2x registrar-classify --inventory registrar-classification-inventory.json --decisions registrar-classification-draft.json --out reviewed-decisions.json. Then run a fresh registrar-check using --classifications reviewed-decisions.json. Review and submit the new observation separately. Unknown items you did not review remain unknown. Symbolic links, unreadable paths and excluded boundaries require separate review; classification never grants permission to delete files.

Errors

401 means authentication is required; 403 means authority, step-up or CSRF checks failed; 404 means the project is unavailable to the caller or has no policy; 400 means invalid input or unsupported query parameters; 409 means the policy history conflicts. Other methods return 405.

OpenAPI contract · System Register read API