Skip to content

Code edits executor - #2

Merged
blockmandev merged 22 commits into
mainfrom
code-edits-executor
Oct 10, 2026
Merged

blockmandev merged 22 commits into
mainfrom
code-edits-executor

Conversation

@blockmandev

Copy link
Copy Markdown
Member

No description provided.

…e first benchmark

Worker adapters (incode first, never required), .insi/config.toml, three
ways to adopt it (the binary, insi init, per-ecosystem packages), the
Phase 1 crates, and the benchmark source as measured: Watchman's history
has 36 fix commits with a separate test file; incord-code has 4 and
inline tests.
A table of what now exists in the Insi repo (mine, validate, eval, learn,
report, the normalizer, briefing, the Watchman benchmark), the decision to
keep benchmark lessons in a file of their own, and a status column on the
Phase 1 rows of "Left to build".
cargo fmt --check, clippy --all-targets, test --lib and test --bins, the
same gate run by hand before every merge so far. /pr merge refuses a pull
request whose checks failed or are still running; until now this repository
had no checks for it to read. The Linux job installs the build packages the
Linux desktop backends link against, the set the Linux live tests were built
with. Actions pinned to major versions: actions/checkout@v4,
dtolnay/rust-toolchain@stable, Swatinem/rust-cache@v2.
Pushing is publishing: a key in a pull request has to be revoked, not just
deleted. Before the push, /pr scans the lines the branch adds and its commit
messages for credential shapes (prefixed keys: sk-, gh?_, github_pat_,
xox?-; cloud key ids; Google API keys; JWTs; private-key blocks; bearer
tokens) and for files that are credentials by name (.env but not its
templates, id_rsa and friends, .pem/.p12/.pfx). A finding names the file and
line and what it looked like, never the value. Removed lines are not looked
at: deleting a secret is the fix. The generic `token: <value>` shape that
stderr_tail redacts is left out on purpose: in code it matches
`token: String`.

Tests: 4 for the scanner, and a /pr test that a branch adding a token is
refused with nothing pushed and no PR created. 12 secret_scan and
pull_request tests pass.
A lane's work was merged into the shared tree before any check ran, so a
lane that broke the build landed and every later task inherited it. Each
lane now runs its task's verify command in its own checkout, in the
folder matching the workspace (git rev-parse --show-prefix), and a lane
that fails stays on its branch as Merged::CheckFailed with the branch
recorded on the task for the retry. INCODE_LANE_CHECK=0 turns the gate
off; the check after the merge runs either way.

Also: docs/LANES_AS_PRS.md (design for opening lanes as pull requests)
and the PRD's Phase 1 status rows.
With INCODE_LANES_AS=pr, a lane whose own check passed is pushed and
opened as a draft pull request onto the branch the run is on, instead
of being merged here. Its task waits Blocked with the URL recorded
(Ledger::await_review) - the ledger keeps its seven states, and Blocked
already means a decision is outstanding with a person - so its
dependants stay Pending and a drained run says it is waiting.

At the start of every run, reviews::settle asks the forge where each
such pull request stands (gh pr view --json state,baseRefName):
merged -> fast-forward this checkout from origin and run the task's
check, completing it only on a pass; closed -> a failed attempt, back
to the queue with its branch; open -> left waiting.

The base is checked once per run (branch, origin, gh reachable, branch
on origin) and before each batch (nothing unpushed, or every pull
request would carry those commits); either failing falls back to
merging here, said once. pull_request::open_onto opens onto a given
base with /pr's refusals; Forge::review tells merged from closed.

Also: a type alias in code_edits_tests.rs for a clippy type_complexity
error that was already failing clippy -D warnings on this branch.
secret_scan::pii_in, checked on every line the branch adds: a payment
card number written like one (4x4 groups, or 15-16 digits with an
issuer prefix) passing Luhn; a US SSN in an issued range; an email on a
real domain - not example.*, .test, .invalid, .localhost, noreply or a
git@ remote. Commit messages are not checked for it: a Signed-off-by
trailer carries an email on purpose. Findings name the file, line and
kind, never the value. Same shapes as Insi's scan (61ac225).
Insi's improvement loop scores a candidate harness by running incode with
INSI_HARNESS set to the candidate's folder. src/harness.rs reads from it:

- instructions.md: standing instructions in the headless run's system
  context, after the project's CLAUDE.md/AGENTS.md, bounded the same way.
- roles.json ({"roles", "tiers"}): over admin.json per key, applied where
  routing is read (resolve_roles, role_source, the headless plan pick) and
  never folded into the loaded config, so a /roles save cannot write a
  harness into the operator's admin.json. INCODE_ROLE_* still wins; the
  source shows as "harness".
- agents/*.md: sub-agents between the project's and the operator's.

A harness file present but unreadable refuses the headless run: it would
be scored as that harness while running on the defaults. With the variable
unset nothing changes.

Verified on the debug binary: `incode --admin` shows `role plan
harness-probe-model <- harness`; a roles.json with a misspelt key refuses
`-t` with the file and the field named. cargo test --all: 1911 lib + 46
bin passed; clippy -D warnings and fmt --check clean.
budget_for_spawn kept the first 2,000 and last ~9,900 bytes of an over-
budget prompt and silently dropped the middle, on the theory that the
instruction is always short and last. Measured on Insi's lesson writer, whose
instruction comes first in a 20 KB prompt: the model got the preamble's head
and a diff's tail, and answered by asking what it was meant to do — four
lessons of fifteen lost.

Now the whole prompt is written to .incode/context/task-<hash>.md in the
agent's workspace (the folder the memory hooks spill to and prune) and the
agent is told to read it in full first; nothing is dropped. A prompt that
cannot be written stops the turn with the reason instead of running cut.
Applies to the agy, codex and claude backends. Tests: the instruction-first
and instruction-last shapes both arrive byte for byte; an unwritable
workspace refuses. Both fail with the old cut put back.
agy sends a long reply as dozens of step_update fragments of one step
(ACTIVE, then a DONE that is itself only a fragment); each was emitted as a
whole Text, and task_run's `show` joins every Text with a newline. Measured
on Insi's lesson writer: `"issue\n": "… anim\nation …"`, so a JSON answer
never parsed. Fragments are now shown live as TextDelta and each step's text
is one Text when the next step begins or the stream ends.

The test feeds lines shaped like the captured long reply (split inside words
and inside a JSON key) and asserts one parseable Text per step. It passes
with the fix (15/15 agy tests); its run against the old behaviour was stopped
by the machine's low-memory guard before it finished, so that check is still
to be done.
@blockmandev
blockmandev merged commit fc67311 into main Oct 10, 2026
2 of 4 checks passed
@blockmandev
blockmandev deleted the code-edits-executor branch October 10, 2026 18:04
blockmandev added a commit that referenced this pull request Nov 13, 2026
…#10) (#86)

zip 8.6.0 (shipped: documents and the tool archives ext_tools unpacks) had
advisories fixed in 9.0.5: a parser differential between its two headers
(critical), extract() writing outside the target through a symlink, unbounded
symlink targets and Shrink/Reduce/Implode sizes (high), an AES HMAC check
skipped at early EOF (medium). calamine 0.38.0 is the first on zip 9 (0.36.1
needed zip ^8.6), so the spreadsheet reader leaves zip 8 too: one zip in the
tree. rustls 0.23.45 -> 0.23.46 is a test-only dev-dependency (4 low/medium
alerts). All MIT or MIT/Apache/ISC; MSRV 1.88 (toolchain 1.97).

zip 9 returns an entry's name as a Result. ext_tools refuses an entry whose
name it cannot read; the document reader skips one (it looks for known
parts only).

New test: a zip whose local header names `../e.txt` while the central
directory names `fine.txt` (the critical advisory's shape) writes nothing
outside the folder; control: the consistent archive unpacks. It guards a
regression; it was not run against zip 8.6.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants