Commit Graph
479 Commits
Author SHA1 Message Date
aiongg 1e1d1c1a0e Merge the contributor's Queue items follow-ups (#8)
The weighted fast track and add-to-queue change itself keeps main's form. On top of it:

- Queue items: a button on the Merge queue tab opens a dialog that takes PRs and issues, one per line, with a weight, and answers each line; refused lines stay in the box.
- An issue line fast-tracks the issue. When exactly one open PR closes it, that PR is queued too; when several do, the answer lists them and none is queued.
- Every fast-track mark Queue items makes keeps a heavier weight already there.
- Each merge queue row says how the PR came in, by whom (staff only) and when, in an Added column.
2026-11-16 15:02:01 +00:00
aiongg 4acb89e221 Projects home, project pages and a project picker for list pages (#7) 2026-11-16 14:35:37 +00:00
aiongg 1df8671345 The project picker narrows list pages only; pages reached by their own link show every repo
- The server applies x-autocraft-scope only on routes marked scoped (decisions inbox and needs, items, merge queue and next
  steps, activity, Now and the project home), and never on writes. Item, decision, batch, job, agent, finding, search,
  settings, /api/repos, /api/me and /api/progress show every repo the user may see.
- A list page's project is its URL's repo (or /projects/<repo>), else the pick; requests carry it and cache keys include it.
  A list page with a pick and no repo in its URL puts the pick there; a link with ?repo=X leaves the pick alone.
- /api/decisions/open-counts gives the user's inbox count per repo; the picker and the tiles show it.
- / opens the picked project only on first load; the logo and the Projects link show the tiles; a tile picks its project.
- The phone picker sits in the navigation drawer.
2026-11-16 14:35:09 +00:00
David MannandClaude Opus 5.5 6ae399fcb1 Queue items takes issues too, in a larger dialog
An issue line fast-tracks the issue with the weight, so Fix works it first, and queues each open PR that closes it (GitHub's closing references), saying which were queued or that none closes it yet. The dialog is wider (up to 760px) with room for twelve lines and says what queuing a PR and an issue does; Dialog gains size="lg" for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:49:45 +01:00
David MannandClaude Opus 5.5 bace5394d0 Queue items adds several PRs at once, and each queue row says who added it and how
The add box at the top of the Merge queue becomes a Queue items button. It opens a dialog that takes PRs one per line (a GitHub URL, repo#n or owner/repo#n) and a weight, adds each in turn and answers per line; refused lines stay in the box to fix.

Merge queue rows carry how the PR came in, from data the database already keeps: Queued (an operator's Queue items, from its pre-approval row), Pre-approved (a pre-approval with a fix-up), Merge answer (decisions.answered_by, or a Merge answer carried to a new head), or Take review. The login shows to staff only. The table's Added column shows it with the time, in place of Updated, and the weight moves into the row's last cell beside its menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:42:23 +01:00
David MannandClaude Opus 5.5 8ce68bac6b Operators add PRs to the merge queue, and fast track gets a weight
Fast-tracked items have a weight from 1 to 10 (default 5): heavier items
go first in every stage that orders by the work rank, and equal weights
keep the order added. The weight is a new fast_track column; the scores
(fastScoreSql, workScores) put it above the order added, so every planner
and the merge order follow it without other changes. The CLI takes
`fasttrack add <item> --weight N` and `fasttrack weight <item> N`, and
POST /api/fast-track/weight sets it (audited as fasttrack-weight).

"Add to merge queue" (POST /api/queue/add {item, weight}, operators)
starts a pre-approved merge at the PR's current head with no fix-up, a
row in `review` as a carried Merge answer uses, so the PR merges only
after a sure take review there, a clean pre-merge review and green CI; a
take-fix review, a defect or a red head asks the Merge? question. It also
fast-tracks the PR with the weight.

The Merge queue tab's add box now adds to the merge queue with a weight,
the fast-track marker shows the weight, and operators change it on the
board's cards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:40:34 +01:00
David MannandClaude Opus 5.5 3e9ed9a66c Operators add PRs to the merge queue, and fast track gets a weight
Fast-tracked items have a weight from 1 to 10 (default 5): heavier items
go first in every stage that orders by the work rank, and equal weights
keep the order added. The weight is a new fast_track column; the scores
(fastScoreSql, workScores) put it above the order added, so every planner
and the merge order follow it without other changes. The CLI takes
`fasttrack add <item> --weight N` and `fasttrack weight <item> N`, and
POST /api/fast-track/weight sets it (audited as fasttrack-weight).

"Add to merge queue" (POST /api/queue/add {item, weight}, operators)
starts a pre-approved merge at the PR's current head with no fix-up, a
row in `review` as a carried Merge answer uses, so the PR merges only
after a sure take review there, a clean pre-merge review and green CI; a
take-fix review, a defect or a red head asks the Merge? question. It also
fast-tracks the PR with the weight.

The Merge queue tab's add box now adds to the merge queue with a weight,
the fast-track marker shows the weight, and operators change it on the
board's cards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:46:51 +01:00
aiongg 303a000d97 Diff re-reads run at most 800 an hour 2026-11-15 02:34:36 +00:00
aiongg 5abb404482 Diff re-reads run at most 600 an hour 2026-11-15 02:31:38 +00:00
aiongg 80f9ba8f4c Each deploy installs the post-receive hook its commit carries 2026-11-15 02:26:30 +00:00
aiongg 9c9cc68ea3 Diff re-reads are paced: at most 200 an hour across the instance, none while the token's core rate is below the sync's reserve
- the pre-merge step takes a slot of the rolling hour before each re-read and reads the core rate once per pass; below the reserve the re-reads pause until the reset
- the plan waits for the pace (an external wait in the registry) and wakes when a slot frees
- the workflows listing serves every PR of a repo and default branch for ten minutes
- the sync's reserve is one constant both use
2026-11-15 00:08:09 +00:00
aiongg 18f82b15a2 Merge branch 'sec3-merge-rule-3' 2026-11-15 00:04:43 +00:00
aiongg fe3a1ec184 A diff waiting for what the merge rule reads beside it holds on the conservative reasons and is read again, spaced and counted, with no model call
- while the extras are pending the facts carry the reasons found without them plus a waiting reason; the Merge? question waits
- every open PR with a pending diff gets a re-read by the pre-merge step, at once and then an hour after each incomplete read; the step records the live base as the review does
- only these re-reads count towards the three tries, and other cached-diff readers never fetch again for the extras
- workflow defaults come only from defaults: run: working-directory; a step's expression working directory matches named files as path suffixes
- the facts memo keys on file times and sizes instead of reading the extras each pass
2026-11-15 00:04:24 +00:00
aiongg a5be498300 Code replies are parsed as written and refused when they hold a fixed-shape credential; the scrub keeps URLs, paths, quotes and backticks and hides named values only when they look generated 2026-11-15 00:02:05 +00:00
aiongg aa2789549e Merge branch 'sec3-runner-2' 2026-11-14 23:52:53 +00:00
aiongg 0244a99077 Merge branch 'sec3-worker-output-2' 2026-11-14 23:52:45 +00:00
aiongg ee966e7afa Code-carrying model replies reach their parsers with only the known credential shapes hidden; stored copies and every posted GitHub text get the whole scrub 2026-11-14 23:52:35 +00:00
aiongg 51ca1d51e4 A security fix waits before its model call until a confidential build environment has reported, with a health warning
A confidential environment is ready from its worker's first call after the flag, or the environment, was turned on (confidential_since, confidential_online_at); label, slot and key changes do not move the 4-hour build limit of private tasks. Until one is ready the fix job ends before the model call, the finding notes the wait and advanceSecurityFixes continues it once one is ready, and the confidential-env health check warns while security fixes or security build tasks wait; build-queue leaves those tasks to it.
2026-11-14 23:52:30 +00:00
aiongg ff3c7a1cef Merge branch 'sec3-merge-rule-2' 2026-11-14 23:51:44 +00:00
aiongg f066e7834c The merge rule's manifest reader refuses object-machinery keys, lockfile checksums are read whole when hunks don't name the package, and workflow run steps match files exactly
- TOML tables have no prototype; __proto__, constructor and prototype keys make a manifest unreadable, so it is held
- poetry checksums come from files entries only and [metadata] is skipped; a checksum change the hunks cannot attribute is decided from the lockfile's head text
- run-step tokens match exact files, joined with the step's or the default working directory; only local actions match by directory; xtask sources count when a step runs xtask
- package.json scripts changes need a person; build dependencies hold on an added, removed or renamed entry or a non-registry source, not on a registry bump; a byte-order mark is stripped
- workflows are read at the default branch's head, cached per blob, and only when a changed path could be run by name
- a cached diff that lacks what the rule reads beside it, or whose read failed, waits: the pre-merge step reads it again without a model call, at most three times, then the rule judges with what it has
2026-11-14 23:51:23 +00:00
aiongg 283cd3aa50 Nightly networked steps run through the hardened fetch script, and the tar extractor keeps a dangling link whose path stays in the tree without passing a link
- fetchScript() builds the fetch prologue (image toolchain, repository cargo config removed, env -i) for any fixed command list; rustPlan and the nightly fetch deps, fetch advisories and build-std fetch steps use it.
- A dangling symlink is kept when its target, walked component by component from the link's directory, never leaves the tree and passes no existing symlink; otherwise it is removed.
2026-11-14 23:50:04 +00:00
aiongg 9e6bace7be Merge branch 'sec3-identity-2' 2026-11-14 23:48:15 +00:00
aiongg f3562bb396 Merge branch 'sec3-review-base-2' 2026-11-14 23:47:45 +00:00
aiongg 70d7ac2d4c Alerts read a stale maintainer permission again, a superseded account-id error is dropped, and Contributors shows the tier the merge rule uses
- The alert pass reads a maintainer's repo permission from GitHub (the normal read path) when the
  cached one is over a day old, at most once a day per login and repo. A failed read keeps the
  older row; only an answer without write access ends the alerts. Turning alerts on takes a
  write permission of any age.
- The author-ids health check ignores an error older than the last successful pass, and the
  connection drops such an error.
- Contributors (page and CLI) shows the counts, override and tier of the account the login is
  bound to; an allow that does not count for it shows as not in effect.
2026-11-14 23:47:38 +00:00
aiongg 1c05c47966 A maintainer's new words get their own discussion budget; reviews mirror the base they read; bases are backfilled once
The PR author never ranks as a maintainer. Only a maintainer's comment or review
newer than the PR's previous review, or an unresolved, not outdated thread a
maintainer started, must fit; they have a budget of their own, and only such an
entry that still does not fit makes a take unsure.

A duplicate member or kept PR no comparison read a head of is released, or ends
the decision, without comparing again. The base branch a review's diff read
returns is written to the mirror at once. Reviews and pre-merge reviews stored
before bases were recorded take the PR's base once at the upgrade.
2026-11-14 23:47:28 +00:00
aiongg caefdbaa44 Carry points of a duplicate PR comparison get the reference checks of posted text; a flagged one is left out of the close comment 2026-11-14 23:45:26 +00:00
aiongg 062d03c72d Review fixes and pre-merge findings get the owner-statement and reference-quote checks: their texts reach GitHub when fixes are listed in a comment 2026-11-14 23:44:00 +00:00
aiongg 944dd7984e Merge branch 'sec3-merge-rule'
# Conflicts:
#	src/core/facts.ts
#	src/fixissue/parse.ts
#	src/fixup/patch.ts
#	src/prompts/index.ts
#	src/review/opus.ts
2026-11-14 23:33:45 +00:00
aiongg 768dea57af Discord reporter sign-in keeps its earlier flow while filing in Discord stays off 2026-11-14 23:32:47 +00:00
aiongg cb7b665b85 Merge branch 'sec3-model-text'
# Conflicts:
#	docs/pipeline.md
#	src/outside.ts
2026-11-14 23:32:43 +00:00
aiongg b15faf88cc Files the base commit's workflows run need a person before the rule merges them, and the Fix-issue triage is not offered build scripts
- the diff fetch reads the run steps and local actions of .github/workflows at the PR's base, cached per base commit, and stores them beside the diff
- a changed file named in a run step, or inside a local action's directory, is CI configuration; with the workflows unread, script-like paths are
- sourcePaths and parseTriage take the build scripts the base commit's manifests name
2026-11-14 23:32:23 +00:00
aiongg c2df2c568f Behaviour tests and docs for posted model text, owner statements in reviews, the answer form's issue drafts and card presses 2026-11-14 23:31:32 +00:00
aiongg a1a52e0453 Merge branch 'sec3-patch-guards' 2026-11-14 23:31:13 +00:00
aiongg 0729847458 Model patches and replies are judged on what really lands
- The CI-fix guard applies the patch with git and judges git's own diff and the files before and after it, so a hunk header that names other lines cannot hide a change to test code. Attributes that switch off a lint or a test, and cfg! calls, are read from the patched file's Rust tokens, however they are split over lines or commented.
- Conflict resolutions: a Rust answer is read as tokens; a line on neither side may add no item word, attribute, unsafe code or item macro, and the answer may hold no more of them than its two sides in their own files, so uncommenting a side's code counts as new. Manifest answers keep each line in the table and under the keys it had in its side, and each side's lines in order. A file whose head or base has marker-shaped lines is refused.
- One trust-path rule (build scripts of either parent, CI and tool configuration, agent-instruction files) is shared by every model-patch lane, conflict resolution included.
- Every lane reply parser reads through the strict single-value reader; a fenced reply with a second answer (a value with the same keys) outside the fence is void.
- When the first reply is used after its fix turn is skipped, fails or cannot be merged, it gets every lint check, the model checks the first lint put off included. A fenced first reply can take the fix turn's fields.
2026-11-14 23:30:36 +00:00
aiongg 1eb4ca4a6b A Discord reporter's GitHub sign-in is used only after the Discord user enters the code the sign-in page showed 2026-11-14 23:29:50 +00:00
aiongg 37083dec24 The merge rule reads whole manifests, lockfiles, file kinds and both names of a file, and the reviews are shown test files
- Cargo.toml: the head text of an edited manifest is fetched with the diff and kept beside it; the manifest is parsed whole before and after, and a change to the build script, links, proc-macro, build dependencies, patch or replace, a git or registry source, or a path leaving the repository needs a person
- lockfiles: a source outside the default registry, a new checksum for a locked version, a lockfile change without a manifest change, or a renamed, copied or deleted lockfile needs a person; registry version updates do not
- the trust paths the fix lanes refuse (.github, toolchain, task runner, .gitmodules, CODEOWNERS, agent files) and submodules, symlinks, mode changes and non-image binaries need a person
- diff sections carry both names of a renamed file and decode quoted names; a name that cannot be read needs a person
- docs links are resolved as a browser does: lines starting with ++, schemes without slashes, split attribute values, dot segments
- reviews are shown test files while the diff fits; tests cut for size need a person
- the rule's size is the line count of the cached diff at the reviewed head
- a pre-merge review row without an unsure value reads as unsure
- build scripts are read with a TOML parser in every lane, and the security-fix lane resolves them from the scanned commit
2026-11-14 23:29:01 +00:00
aiongg dd7604637d Merge branch 'sec3-review-base' 2026-11-14 23:27:23 +00:00
aiongg 62cc0705fc A post-merge follow-up issue counts as an item of the merged PR's author for the outside-author limits; prompts mark related items' titles as their authors' text 2026-11-14 23:27:22 +00:00
aiongg 5a3b165c1d Merge branch 'sec3-runner'
# Conflicts:
#	docs/operations.md
2026-11-14 23:27:17 +00:00
aiongg 6b02801f4c Merge branch 'sec3-identity' 2026-11-14 23:27:08 +00:00
aiongg 4522aa67cf Merge branch 'sec3-visibility' 2026-11-14 23:27:07 +00:00
aiongg 462cab307f Merge branch 'sec3-worker-output'
# Conflicts:
#	src/build/tasks.ts
2026-11-14 23:27:07 +00:00
aiongg 3e6565ee2d Act on a duplicate group only at heads a stored comparison read, and rank maintainer replies in others' threads first
A comparison stored without the PR heads binds nothing: Act marks its sets for
one more comparison and waits. A closer or kept PR whose bound head is not the
latest comparison's head is treated as moved. Unresolved threads a maintainer or
dashboard user replied to rank with maintainer entries in the review prompt's
discussion budget.
2026-11-14 23:27:05 +00:00
aiongg 6bca12f063 A security finding's build tasks go only to environments an operator marked confidential, which take no PR code
build_envs.confidential is set on the Build environments page or with envs add/set --confidential, never by the worker. claim() hands fix-check and scan-test tasks only to confidential environments and gives those no PR build, integration batch or PR/issue task; a signing worker skips integration batches too. While no enabled environment is confidential the tasks stay queued with the reason "Waiting for a confidential build environment.", the security fix's check tool answers at once, and the 4-hour round and scan-test limit starts only once a confidential environment can take the tasks.
2026-11-14 23:26:35 +00:00
aiongg 0c35554561 Job and sync texts name no repo hidden from the reader, and a quiet pull request's next step is veiled for viewers in its tab
- Job summaries, progress and errors (list, detail, last job per step, Now feed) and sync errors leave out text that names a hidden repo; an error left out reads "failed". Viewers read "failed" for a sync error as for a job error.
- A job's log tail leaves out the lines that name a hidden repo.
- The work list and the Queue page's work rows give viewers no next step for a quiet pull request; the Queue tab is taken from the stored text first, so the row stays in its tab.
2026-11-14 23:24:59 +00:00
aiongg de0547d883 Whitelist tiers, overrides and the pipeline's own tier belong to accounts and heads; removing an operator ends what acts as them
- History counts per GitHub account: a PR row with an id counts for that id, an id-less row for the
  account the login is bound to, and for nobody while the login is unbound. The sync no longer binds a
  login that has id-less merged or closed PRs; the backfill binds it from the history's own author.
  A failed binding pass shows as the author-ids health warning.
- An allow override stores the account it was given to (looked up when set) and counts only for it;
  a deny holds for any account under the login, in any letter case. The outside-author limits read
  the same per-account standing.
- The pipeline's own Fix, main CI fix and security fix PRs keep their own tier only while the head is
  a commit the pipeline pushed to its own branch (own_commits), or reached from one only through its
  own later pushes; otherwise a person is asked.
- Removing or demoting an operator revokes their org setup links, and a link works only while its
  creator is an operator. Removal drops Discord links and codes in any letter case.
- Decision alerts to maintainers need a repo permission read within a day.
- A cached author permission is not used for another account under the login, nor once its refresh
  has failed too often or for too long.
- Pushes to new branches and new PRs need the grant of a step that opens the pipeline's own PRs;
  security fix writes carry their own grant kind.
2026-11-14 23:24:55 +00:00
aiongg 60b2eb7fae Review-derived records bind the base branch the diff was read against
A review whose diff was read against another base than the PR has now is stale,
and its re-review waits and counts like one after a push. A re-review against a
new base withdraws the head's Merge decision and deletes its pre-merge review;
pre-merge rows and the sensitive-content memo are kept per base. Delta and
carried reviews only stand on an earlier review of the same base and record
that base. A batch takes a PR only when its review read the default branch,
checked again for each member before landing.

A plain Merge answer carried across a clean base merge ends when the review
there asks for fixes. Duplicate decisions bind each PR member to the head its
comparison read, and Act checks the kept PR's head too. A maintainer's
discussion entries are kept first in the review prompt's budget; one that does
not fit makes a take unsure.
2026-11-14 23:24:37 +00:00
aiongg f5bdb64c5e Runner hardening: per-repository installation tokens, a github.com-only credential helper, an allow-listed jev environment, pinned git attribute source and explicit repositories, absolute deny rules, a wider output scrub, and a deploy of the pushed commit
- Installation tokens for a write are minted for the write's repository (a transfer's also for its target); reads across repos and pushes to a contributor's fork keep the installation-wide token. Reading the app's keys checks the secrets file's mode like every other reader.
- The app's git credential helper is set for https://github.com only, after every configured helper is dropped.
- jev children get only the search path, home, locale, temp, cache, TLS and proxy variables and Jev's own.
- Git on the cached clones names the repository with GIT_DIR, runs with safe.bareRepository=explicit and reads attributes from the empty tree.
- The sandbox denies /proc and the credential directory in the absolute (//path) form as well.
- The scrub hides hex keys that are not digests, URL user:password, three-part dotted tokens and credentials inside hex or base64.
- The dashboard unit sees the settings file, releases, the bare repo and .local read-only.
- post-receive resolves the pushed commit once and the hook deploys that commit; the image build runs pnpm installs without install scripts.
2026-11-14 23:23:21 +00:00
aiongg 31b7fbba75 Dashboard readers get only what they may see of the planner's stored text, and expensive GETs are limited by the matched route
- One reader helper (src/dash/api/reader.ts) cuts queue rows, plan reasons, waits and status lines per reader: viewers get no review reason, verification text, plan note or refusal text and the reasons without their quoted part; a quiet pull request gives viewers none of it; nobody reads an item of a repo hidden from them ("another item, which blocks its review").
- The merge queue endpoints and their member lookups filter with the requester's allow-list, so batches and queued PRs of untracked repos are left out for everyone but operators.
- Decision facts name no PR of a hidden repo; the item API leaves out owner statements of hidden repos and gives viewers no excerpt or reason.
- The Needs feed blanks feedback about a quiet pull request for viewers; stopped fix reasons are staff only.
- Agent runs recorded without items are shown to operators only; duplicate comparisons are bound to the items they compare.
- The expensive-GET budget is spent by the matched route, so every spelling of a path counts.
- Limiter maps are capped: expired keys go at most once per window, then the oldest.
- /healthz/checks gives anonymous callers check names and states; signed-in operators and maintainers also get times and counts.
2026-11-14 23:21:57 +00:00
aiongg 45f6982329 Worker steps with network get no gate env, the gate env is an allow-list, gates come only from a base commit, and unreadable task dirs never stop the worker
- The fetch step runs cargo under env -i with git fetching off, and runArgs passes no gate env and no craft-fonts or craft-i18n mount to a step with network.
- Gate env lines are kept only for the repo's own switches and a short list of output, retry and profile settings; dev-debug must be a value cargo accepts. The task log names the gate ref and the gate.yml sha256.
- The worker reads the CI gate and craft-i18n.rev only at the task's base commit; a task without one runs in the stock image. The CI fix's check tool passes the PR's base commit, main fixes, nightly checks and warm builds name their default-branch commit, and the lint and check-tool queues no longer fall back to the head.
- Work dirs are removed after giving directories back owner rwx; a dir that still cannot be removed is renamed out of the task names and logged, at task end and at worker start, and warm dir cleanup does the same.
- Signing workers take no merge batch and no task with a patch.
- Worker updates over SSH accept only known host keys.
- The tar extractor refuses non-octal header numbers and removes dangling symlinks.
- warmStore.url follows the coordinator's plain-http rule, and the worker client and warm store refuse redirects.
2026-11-14 23:21:06 +00:00