Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/added-16476-published-checkpoints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Feed the Code activity reader whole pushed PR diff regions, including removals, through the existing authorized sentinel observer, with whole-region secret filtering, bounded memory-only history, policy reset, visible freshness, buffered-snapshot labels and explicit replay; stop restoring or writing the legacy Matrix code-history file.
2 changes: 1 addition & 1 deletion changelog.d/fixed-matrix-ingest-freshness.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Matrix kiosk no longer goes stale for the length of a governor tick: an incremental sentinel pass now reads only new PR heads in the allowlisted repos every two minutes, independently of the full 15-minute sweep, and `/api/matrix/lines` reports `last_ingest_at` / `next_ingest_in_s` so the footer can tell "nothing pushed" from "nothing ingested". The matrix backlog (last 500 lines) and the set of already-evaluated PR heads now persist under `/data/matrix-lines.json` and `/data/sentinel-heads.json` and are restored at boot with the sequence counter continuing, so a hub-triggered restart no longer blanks the kiosk or re-diffs every open PR; the first ingest also runs at boot instead of waiting for the reconcile timer ([#16276](https://github.com/hivecommons/hive/issues/16276)).
- Matrix kiosk no longer goes stale for the length of a governor tick: an incremental sentinel pass now reads only new PR heads in the allowlisted repos every two minutes, independently of the full 15-minute sweep, and `/api/matrix/lines` reports `last_ingest_at` / `next_ingest_in_s` so the footer can tell "nothing pushed" from "nothing ingested". The set of already-evaluated PR heads now persists under `/data/sentinel-heads.json` and is restored at boot, so a hub-triggered restart no longer re-diffs every open PR; the first ingest also runs at boot instead of waiting for the reconcile timer ([#16276](https://github.com/hivecommons/hive/issues/16276)).
4 changes: 0 additions & 4 deletions src/cmd/hive/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2464,10 +2464,6 @@ func (b *boot) bootDashboard() { b.bootDashboardWith(defaultBootDashboardDeps())
// persistence enables injected; see bootDashboardDeps.
func (b *boot) bootDashboardWith(deps bootDashboardDeps) {
b.dashSrv = deps.newServer(b.cfg.Dashboard.Port, b.cfg.Dashboard.AuthToken, b.logger)
// The Matrix backlog survives a restart so the kiosk never blanks
// (#16276); the paired sentinel head map is set in
// applyGitHubClientConfigHooks.
b.dashSrv.SetMatrixPersistPath(matrixLinesStatePath)
b.dashSrv.SetIntegrationExecutionEvaluators(b.integrationPreparationEligibility, b.integrationEligibility)
worksource.SetRunStageAccessor(b.dashSrv.RunStageAccessor())
b.dashSrv.SetWritebackGate(b.writebackGate())
Expand Down
12 changes: 3 additions & 9 deletions src/cmd/hive/matrix_ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,9 @@ import (
// run every couple of minutes on its own goroutine.
const matrixIngestInterval = 2 * time.Minute

// matrixLinesStatePath and sentinelHeadsStatePath are where the Matrix
// backlog and the sentinel's evaluated-head map persist on the PVC, each its
// own file like the other /data histories so a parse failure in one never
// takes the other down. Together they let a restarted hive refill the kiosk
// at once and diff only heads that moved while it was down.
const (
matrixLinesStatePath = "/data/matrix-lines.json"
sentinelHeadsStatePath = "/data/sentinel-heads.json"
)
// sentinelHeadsStatePath keeps the evaluated-head map across restarts. Code
// buffers remain memory-only; restarting never restores captured code.
const sentinelHeadsStatePath = "/data/sentinel-heads.json"

// matrixIngestState serializes incremental passes so concurrent callers must
// not read the same new head twice.
Expand Down
6 changes: 3 additions & 3 deletions src/docs/api-reference/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ Part of the [Dashboard REST API reference](../api-reference.md); see that page f
| `GET` | `/api/openrouter/models` | Dashboard auth/session | Open Router Models | `pkg/dashboard/openrouter.go:47` |
| `GET` | `/api/openrouter/credit` | Dashboard auth/session | Open Router Credit | `pkg/dashboard/openrouter.go:48` |
| `GET` | `/openrouter/callback` | Public | Open Router Callback | `pkg/dashboard/openrouter.go:49` |
| `POST` | `/api/github-app/recheck` | Dashboard auth/session | GitHub App Recheck | `pkg/dashboard/server.go:1663` |
| `POST` | `/api/github-app/install-clicked` | Dashboard auth/session | GitHub App Install Clicked | `pkg/dashboard/server.go:1664` |
| `GET` | `/gh-setup` | Public | GitHub App Setup Callback | `pkg/dashboard/server.go:1665` |
| `POST` | `/api/github-app/recheck` | Dashboard auth/session | GitHub App Recheck | `pkg/dashboard/server.go:1662` |
| `POST` | `/api/github-app/install-clicked` | Dashboard auth/session | GitHub App Install Clicked | `pkg/dashboard/server.go:1663` |
| `GET` | `/gh-setup` | Public | GitHub App Setup Callback | `pkg/dashboard/server.go:1664` |
21 changes: 20 additions & 1 deletion src/docs/api-reference/dashboard-misc.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ The monitor renders CI and Review concurrently on one shared PR row; see
| `POST` | `/api/hives/{id}/heartbeat` | Dashboard auth/session | Hives Heartbeat | `pkg/dashboard/api_contribute.go:377` |
| `DELETE` | `/api/hives/{id}` | Owner only | Hives Delete | `pkg/dashboard/api_contribute.go:378` |
| `POST` | `/api/hives/onboard` | Dashboard auth/session | Hives Onboard | `pkg/dashboard/api_contribute.go:379` |
| `GET` | `/sso` | Public | SSO | `pkg/dashboard/server.go:1670` |
| `GET` | `/sso` | Public | SSO | `pkg/dashboard/server.go:1669` |
### Activity observation provenance

The CI snapshot retains real check/node IDs, head, App ID and transition times.
Expand Down Expand Up @@ -119,3 +119,22 @@ PR writes. Push and same-head retry observations do not inherit an old fixer,
owner or worker observation timestamp. Review completion uses the dispatch
ledger's own agent/review-head/decision receipt and aggregate participation;
another agent's same-perspective bundle verdict cannot settle that assignment.

### Published-checkpoint regions

`GET /api/matrix/lines?format=regions&since=<seq>&max=<lines>` selects whole
changed regions from the existing authorized sentinel observer. Authentication
and dashboard read permission are required, including in kiosk mode; responses
use `Cache-Control: no-store`. Disabled capture returns 404. An active cold
source returns 200 with an empty `regions` array and null `last_ingest_at`.

The response contains continuation `seq`, source high-water mark `latest`, policy
`epoch`, source label `Pushed PR`, stage `pushed-checkpoint`, `last_ingest_at`,
`next_ingest_in_s`, and `regions`. Each region has its own sequence, repo, actual
PR number and `pr_url`, head, path, stage, observed `at`, and ordered `lines`
(`op` is `+` or `-`, `line` is untrimmed text). Follow response `seq`, not
`latest`, until caught up. `max` is a line budget (1–500, default 200); the first
eligible region is always returned whole, even if larger than the budget.
Code buffers are bounded and memory-only, so this is not an audit history.
Clear retained browser code on epoch changes and failed/disabled/unauthorized
pulls. An empty response says nothing about work outside the admitted source.
Loading
Loading