Compliance
Portfolio Compliance scores every repository against a pack of rules. Fork a pack, turn rules on or off, change their mode and scope, add your own, confirm facts, file waivers, and apply pack updates.
Start campaign
Starts a campaign: one fix task per selected project failing any selected rule, filed in risk order (lowest level first, then lowest failing rule level, then nudge before advise), and 409 when no project is left to fix. Requires permission to edit compliance and to create and edit tasks on every project; returns the campaign id and its items with status 201.
Preview a campaign
Returns what a campaign would fix, saving nothing: every rule failing without a fix on its way on a project the caller may fix, with its project count, and for the selected rules the projects in risk order. Requires permission to edit compliance.
List exceptions
Lists the organization's waivers on projects the caller may view, plus waivers scoped by a rule, soonest expiry first. Filters by pack, project and status. Requires permission to view compliance.
File exception
Files and approves a waiver of one rule on a project, or on every project a scope selects; a lock or non-waivable rule takes none. Owner, expiry, compensating control and reason are required (422 names each one missing), and the expiry may be at most the rule's maximum away. Requires permission to edit compliance on the project, or for the whole organization for a scoped waiver; returns the waiver with status 201.
Revoke exception
Revokes a waiver early; its rule counts as it really is again. Requires permission to edit compliance on the waiver's project, or for the whole organization for a scoped waiver; returns the waiver.
Confirm fact
Confirms a fact a scan inferred about a repository; later scans no longer change it. Requires permission to edit compliance on the fact's project; returns the fact.
Correct fact
Corrects a fact: its value is marked wrong and the sent value confirmed, later scans change neither, and scores recompute. Requires permission to edit compliance on the fact's project; returns the confirmed fact.
Get guard activity
Lists the Architectural Guard's denied, error, waived and escalated decisions on projects the caller may view, newest first, with each one's project and rule name, plus, on the first page, the rules the guard enforces (for a rule filter); 404 without the guard. Filters by project, pack, rule and decision, and pages with `limit` (up to 100) and the `before` id that `next` returns. Requires permission to view compliance.
Get the compliance matrix
Returns every selected project the caller may view under one pack, each row on its own: its scan state and auditor task, level, each pillar's state with its top gap and why it matters, its failing-rule count in `gap_count`, debt, commit and scan time, plus the newest scan's progress and a portfolio summary. Requires permission to view compliance.
List packs
Lists every pack the organization can use, the managed ones first, then its own: each one's name, description, origin, version, parent, rule count, whether it is the active pack, and what the caller may do to it (`can_rename`, `can_activate`, `can_delete`, `can_edit_rules`). Requires permission to view compliance.
Delete pack
Deletes the organization's own pack with its rules, scores and open updates, and revokes its active waivers; deleting the active pack makes its parent managed pack, else the default pack, active. A managed pack returns 409 `managed_pack`, and a pack a scan is running against 409 `scan_running`. Requires an Org Owner or Admin (else 403 `org_admin_required`) and permission to edit compliance; returns the active pack id.
Get pack
Returns one pack as the pack list shows it. Another organization's or an unknown pack returns 404. Requires permission to view compliance.
Update pack
Renames a pack and changes its description, changing only the fields sent: the organization's own pack by an Org Owner or Admin (else 403 `org_admin_required`), a managed pack by the operator only (else 409 `fork_to_edit`). An empty name returns 422 `invalid_pack`. Requires permission to edit compliance; returns the pack.
Activate pack
Makes a pack the organization's active pack, the one scans, the matrix and the Architectural Guard use. Requires an Org Owner or Admin (else 403 `org_admin_required`) and permission to edit compliance; returns the pack.
Fork pack
Forks a managed pack into the organization's own pack at the version it scores with, records that parent and version, and makes the fork the active pack. Returns 409 for a pack that is not managed. Requires permission to edit compliance for the whole organization; returns the new pack with status 201.
Get pack rules
Returns one pack and every rule in it, change rules included, ordered by level then key: each rule's id (what Get rule takes), key, name, kind, mode and whether it is on, plus its pillar and level (null for a change rule) and its change check kind; a managed pack lists the release the organization applied. Another organization's or an unknown pack returns 404. Requires permission to view compliance.
Add rule
Adds a rule to the organization's own pack, in observe or advise mode, reading not yet scanned until the next scan. An invalid rule returns 422 naming the field, and a managed pack returns 409 `fork_to_edit`, except for the operator, whose add publishes the managed pack's next release. Requires permission to edit compliance for the whole organization; returns the rule with status 201.
List primitives
Lists the check primitives a rule may use, each with its parameter schema. Requires permission to view compliance.
List proposals
Lists the organization's pack updates, newest first, each with its rule changes and the predicted level of every scanned project before and after. Filters by status. Requires permission to view compliance.
Apply proposal
Applies a pack update and rescores: the organization moves to the new version, or its fork takes the upstream changes while keeping its own on/off, mode and scope choices. Returns 409 for an update already decided. Requires permission to edit compliance for the whole organization.
Dismiss proposal
Dismisses a pack update without changing anything else. Returns 409 for an update already decided. Requires permission to edit compliance for the whole organization.
Get a project's compliance
Returns one project under one pack: its level, the pillar by level grid, every rule's state with why it matters, drift age, trend and waiver, the gap list, and its facts with their status. With the Architectural Guard on, also its guard decisions over 7 and 30 days in `guard_counts`. Requires permission to view compliance.
Get a rule's evidence on a project
Returns the evidence behind one rule's state on one project: what was found, the commit, scan time, check type and confidence. Requires permission to view compliance.
Fix a project's failing rules
Files and starts one task fixing the given failing rules on a project: a coder task, or an epic above eight rules or across three or more pillars, its body listing each violation and its expected result. Rules already being fixed are skipped, and 409 means nothing is left. Requires permission to edit compliance and to create and edit tasks on the project; returns the task id and kind with status 201.
Rescan a project
Rescans one project under the given pack, else the active pack. Requires permission to edit compliance on the project; returns the new scan id with status 201.
Get rule
Returns one rule: its readable scope and applicability, its oracles and whether they passed on a scan, and the projects the caller may view it fails on. With the Architectural Guard on, also its guard decisions over 7 and 30 days in `guard_counts`. Requires permission to view compliance.
Update rule
Changes only the fields sent on a rule of the organization's own pack (on or off, mode, scope, content) and rescores from stored scans; a managed pack's rule returns 409 `fork_to_edit`, except for the operator, whose edit publishes the managed pack's next release and offers it to every organization on the pack or a fork of it. An invalid edit returns 422 naming the field, gate and lock return 422 `mode_not_available`, and nudge needs the rule's oracles to have passed on a scan, else 422 `oracle_failed`. Requires permission to edit compliance for the whole organization.
Start scan
Starts an analysis of the selected projects under one pack: projects the caller may scan get one auditor run each and the rest join unscanned; 403 when the caller may scan none. An organization-wide editor's start also records the selection and active pack. Requires permission to edit compliance on the project; returns the scan id with status 201.
Rescan a scan's projects
Rescans every project of an earlier scan the caller may scan, as a new scan. Returns 403 when the caller may scan none of them. Requires permission to edit compliance on the project; returns the new scan id with status 201.
Stop scan
Stops every auditor run a scan still waits on, on the projects the caller may scan; each such row then reads as a scan error. Returns 403 when the caller may scan none of the scan's projects. Requires permission to edit compliance on the project; returns the number of runs stopped.
Preview a scope
Returns how many, and which, of the projects the caller may view a scope would select, evaluated over each project's confirmed and latest-scanned facts. Nothing is saved. Requires permission to view compliance.
Get compliance settings
Returns whether the daily scan runs and when it runs next, plus the active pack and version, and with the Architectural Guard on its stuck limit. Requires permission to view compliance.
Update compliance settings
Changes only the fields sent: whether the daily scan runs, and with the Architectural Guard on its stuck limit (1 to 50 refusals of one rule before an agent asks a person; 404 without the guard). Requires permission to edit compliance for the whole organization; returns the settings.
Get analysis setup
Returns what starting an analysis needs, defaults filled: every project the caller may view, each with why it cannot be scanned and whether the caller may scan it, the packs, and whether the organization has scanned before. Requires permission to view compliance.