Skip to content

Sync dev into dev-internal - #292

Open
github-actions[bot] wants to merge 57 commits into
dev-internalfrom
dev
Open

github-actions[bot] wants to merge 57 commits into
dev-internalfrom
dev

Conversation

@github-actions

@github-actions github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

Automated sync of dev into dev-internal could not merge on its own. Resolve the conflict, then merge with a merge commit so both branches keep the same history.

eric-factory and others added 28 commits November 26, 2026 12:18
github/run-review.sh runs action.yml's automatic code review outside
GitHub Actions, in two parts around a caller's review session: `before`
opens the Droid Review check, marks the PR as being reviewed, and writes
the PR context and candidates prompt; `after` runs the validator pass
without GitHub credentials, posts the review, and closes the check.
github-pr-event.ts builds the pull_request event the entrypoints read,
from the GitHub API.

Closes AUT-3072

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Refs AUT-3072

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
A `git clone --depth 1` fetches only the default branch, so gh pr checkout fetched the PR branch but could not track it. Also state the token permissions the review needs: pull requests and checks write, contents read.

Refs AUT-3072

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
… nothing to review

The validator ran as a child of the part that held the write token, so it
could read the token from its parent's environment. It now runs in its own
part, `validate`, which takes the read-only token and gives the validator
an allowlisted environment like action.yml's validator step. `after` takes
the write token, posts the review and closes the check, or closes it with
the error `validate` left.

`before` exits 78 when the PR moved past PR_HEAD_SHA or the review settings
skip the event, so the caller can skip the session.

Refs AUT-3072

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
github-post-review runs `git diff` for incremental reviews. In after, that
ran in the checkout the session could change, where planted git config can
run commands while the write token is in the environment. after now runs
with GIT_DIR=/dev/null, so git opens no repository and posting reads the
diff through GitHub's API, as it already does when git fails.

Also test that droid-action's authenticated fetches leave no token in
~/.git-credentials on a computer with credential.helper=store.

Refs AUT-3072

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
When SESSION_USER names the user the session and validate run as, before
and after run as root and keep the session out of them:

- before checks that droid-action and RUNNER_TEMP can be changed by root
  alone, recreates the prompts directory instead of writing into one a
  previous session left, copies the droids into the session user's HOME as
  that user, and hands the clone and prompts over with chown once its git
  work is done.
- before and after keep their state, the review lifecycle, their own copy
  of the diff and the post results in $RUNNER_TEMP/github-review, which
  only they write.
- after runs from its private directory with no git, reads what the
  session and validate wrote as the session user, with a cleared
  environment, and closes the check when the prepared head differs from
  PR_HEAD_SHA instead of leaving it open.
- validate refuses to run as another user than SESSION_USER.
- Entrypoints keep their temporary files in the part's private directory,
  so prepare's frozen publisher bundles no longer pile up in /tmp.

Removed, as nothing needs them: the droid CLI install fallback in validate
(droid must be on its PATH), bun install in validate and after, the unused
DETAILED_PERMISSION_MESSAGES variable, and validate's reset of an earlier
error file. after no longer requires validate's error file to be a regular
file: reading it as the session user covers that when the users differ, and
a session running as the same user could write the same text directly.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
run-review.sh ran prepare with AUTOMATIC_REVIEW=true. Action inputs win over
.factory/review.yaml, so an automation's automaticReview: false and a
review.yaml auto_review.enabled: false were both ignored, and a
security-only review could not happen.

prepare now takes the caller's AUTOMATIC_REVIEW when it is set, then the
base branch's review.yaml, then true. The script sets
DEFAULT_AUTOMATIC_REVIEW=true, which loadReviewUxConfigFromBase applies
below the file, as the GitLab loader already does for its default. Actions
never sets it, so automatic review stays opt-in there. No other review
setting is forced: AUTOMATIC_SECURITY_REVIEW and the rest pass through from
the caller.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
- after closes the check of a before that was stopped, for example at the
  caller's time limit, before it closed the check or handed it over.
  before now keeps its outputs in $RUNNER_TEMP/github-review/before, which
  its exit deletes; after closes the check they name and deletes them.
- Both prompts get an absolute prior-findings path, and the validator gets
  RUNNER_TEMP, as in action.yml.
- bun is installed from its GitHub release after checking a pinned
  SHA-256, instead of running bun.sh's installer as root with the write
  token in its environment.
- prepare gets the write token through its environment instead of env(1)'s
  arguments, which any user can read in /proc.
- before's failures after the check opens name the failed step on the
  check instead of the CI default message.
- Tests cover a review.yaml without automatic-review keys and git config
  planted above after's private directory. The fake server and git test
  helpers move to test/helpers, and the Bitbucket and Azure DevOps helper
  files re-export them.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
… succeeded

- review-artifacts.ts and pr-checkout.ts run git and gh with argument
  lists instead of shell strings, so shell syntax in a base branch name
  runs nothing.
- after posts only with VALIDATE_RESULT=succeeded. Unset or any other
  value closes the check as failed without posting.
- before takes no @droid commands from the PR description
  (AUTOMATIC_REVIEW_ONLY), and requires GITHUB_ACTOR, the login that sent
  the event, instead of falling back to the PR author.
- RUNNER_TEMP is required and must be absolute: every part of one run
  shares it, and no other run may.
- after reads at most 16 MiB of each file the session or validate wrote,
  for at most 30 seconds, and drops a larger file.
- validate deletes an earlier attempt's error and results before it runs,
  and reports a missing FACTORY_API_KEY on the check.
- The validator runs without a tracking comment when review_summary is
  off, as preparation then makes none for a new PR. This also fixes the
  Actions validator step.
- loadReviewUxConfigFromBase takes only the automatic_review default.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
… no git

after runs no git, and GitHub's compare API is three-dot, so once a PR was
rebased posting could not get the previous reviewed head's diff. It then
dropped the fixed decisions preparation had made eligible, and fixed
findings stayed open. prepare now keeps that diff in REVIEW_PRIOR_DIFF_PATH,
which run-review.sh points into before's own directory, and posting uses it
for exactly that base and head. Actions sets no REVIEW_PRIOR_DIFF_PATH, so
nothing changes there.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
- prepare creates no check for a run it already knows it will skip, such as
  an automatic trigger that review_auto_triggers leaves out. Completed as
  neutral, that check became the head's latest Droid Review and hid an
  earlier failing review from branch protection. Actions did the same when
  a workflow's types listed labeled.
- A run that skips after creating its check (no new changes since the last
  review, or superseded) completes it as failure while the findings it
  skipped to still block, instead of always as neutral.
- run-review.sh's before re-reads the PR for up to a minute while GitHub's
  API still reports a head that has not reached PR_HEAD_SHA, and skips at
  once only when the head moved past it. A synchronize delivery read during
  that lag used to leave its head unreviewed.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…none

A skipped automatic run again creates the neutral check on a head that has
no Droid Review check, as before 197d3ee, so repos that require the check
are not blocked while reviews are paused or at the auto-run limit. It still
creates none where the head already has a Droid Review check, completed or
in progress, or when the head's checks cannot be listed. A check made before
its run skipped completes as failure only over another Droid Review check on
the head while the findings it skipped to block, and as neutral otherwise.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
github/run-review.sh now takes GITHUB_EVENT_NAME and GITHUB_EVENT_PATH as
GitHub Actions sets them, and prepare.ts decides what to do with the
event, as in action.yml. before keeps a copy of the payload and its name
in $RUNNER_TEMP/github-review, which validate and after read. The made-up
pull_request event (github-pr-event.ts), PR_NUMBER, PR_HEAD_SHA,
PR_ACTION, the 60-second wait for a pushed head and the head checks are
gone; the PR number comes from prepare.

Commands run as in action.yml. help, pause, resume and resolve finish in
before, which exits 78. @droid fix and questions in a Droid finding's
thread get a session and no validator pass; after publishes the result
with github-post-command.ts, from a copy read as the session user. With
SESSION_USER set, before hands the command's droid-command-* directory
over with the clone and prompts.

FACTORY_AUTOMATION, which the script sets, makes @droid fill and
@droid security --full reply that they are not supported on Factory-run
automations yet, before anything else is written: their model runs write
to GitHub, and the session never holds a write token. It replaces
AUTOMATIC_REVIEW_ONLY. DEFAULT_AUTOMATIC_REVIEW is removed: automatic
review follows the caller's AUTOMATIC_REVIEW and the base branch's
.factory/review.yaml, as in action.yml.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
The publisher commits fixes through GitHub's git data API, so after's
token needs contents write for @droid fix, as droid-action mints for fix
runs in Actions. Comment only.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…w test

The prior-findings view test, which came with dev's #271, faked the review
artifacts' git commands through execSync and made every execFileSync call
throw. This branch runs those commands through execFileSync, so after
merging dev the fake no longer applied and 14 of its 16 tests failed. The
fake now answers the same commands through execFileSync and still refuses
fetchImmutableReviewDiff's direct diff, as beforeEach does.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

# Conflicts:
#	src/github/operations/review-lifecycle.ts
On a Factory run the session holds no write token, so `@droid fill` and
`@droid security --full` now take the command path: before writes a prompt
that has the session write its result (the generated description, or the
validated scan results), and after publishes it with its own token. Fill
updates Droid's block of the PR description through the handler Actions
uses. A full scan opens a PR from droid/security-report-<date> that adds the
report rendered from the session's results, every finding marked for manual
remediation, since nothing the session changed is published. This replaces
the "not supported" reply.

Cut github/run-review.sh back to what its only caller needs. The header is
now the caller contract and names the REVIEW_MODEL and REASONING_EFFORT
lines of the state file. The validate-user guard, the relative RUNNER_TEMP
check, the leftover-directory removal, the validate error-file override and
the one-byte-over size check are gone, with their tests. The git test keeps
only the shell-syntax case, against a local remote, as
base-branch-fetch.test.ts.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
… its patches

`@droid security --full` on a Factory run now uses Actions' own scan
prompt, with only its last step changed: the session holds no write token,
so it commits its patches and the report and bundles those commits. after
pushes them to droid/security-report-<date>, opens the report PR and
renders its description with handleUpdatePRDescription in security-report
mode, as the scan's MCP tool does in Actions. Patched findings are now
reported as patched instead of every finding being marked manual.

before installs the security-engineer plugin for the session user when
prepare asks for it, as action.yml does. prepare writes review_model for the
scan from Actions' rule (SECURITY_MODEL, else REVIEW_MODEL, as the model
policy allows), now shared as securityScanModel, and the header says the
state file's model lines apply to this command. The result-only scan prompt
is gone, and fill's result moves beside the prompt in droid-prompts.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…ory-run.sh

GitLab and Azure webhook runs on Factory computers will run like
github/run-review.sh: before and after as root, the session and the
validator pass as SESSION_USER. The helpers they would use unchanged now
live in lib/factory-run.sh, which github/run-review.sh sources from inside
the droid-action directory: the SESSION_USER setup, check_owned,
as_session_user, read_session_file and its 16 MiB cap, the pinned bun
install (now given its download directory), BUN_RUN (bun without the
checkout's bunfig.toml and .env), copy_review_droids, and the skip exit
code 78.

The GitHub event, prepare's GITHUB_OUTPUT parsing, the Droid Review check
and GitHub's files and posting stay in github/run-review.sh. Behavior is
unchanged: the run-review test only copies the new file into its
droid-action copy.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
feat(github): add a plain GitHub script split around the session
…es post-quantum key exchange

Bun 1.2.11 offers only X25519, so FACTORY_API_KEY traffic to
app.factory.ai can be recorded now and decrypted later. Bun 1.4.5 offers
X25519MLKEM768, and app.factory.ai selects it.

- Pin Bun 1.4.5 in every composite action, CI, the GitLab and Bitbucket
  container images, docs, and lib/factory-run.sh (with the release's
  SHA-256 for linux-x64, linux-x64-baseline and linux-aarch64).
- Install composite-action dependencies with --frozen-lockfile, as CI and
  the shell runners already do.
- Bump @types/bun to 1.4.5 to match the runtime.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
install_bun returned whenever any bun was on PATH, so a self-hosted runner
that had installed Bun 1.2.11 into ~/.bun/bin kept running it after the pin
moved. A bun elsewhere on PATH is still used as is; the helper's own copy
is reused only when it reports BUN_VERSION, and is otherwise reinstalled
through the checksum-verified download.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Restore dev's install_bun, composite-action installs, @types/bun and
lockfiles, so the branch only moves the Bun pins from 1.2.11 to 1.4.5.
The stale managed bun on persistent runners and --frozen-lockfile in the
composite actions are follow-ups.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
The Bitbucket and Azure DevOps runners still installed Bun 1.2.11 when no
bun is on PATH. Bump their version strings, the Azure setup doc, and the
GitLab template test's note, so the whole repository runs Bun 1.4.5.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
The Bitbucket setup doc and the Bamboo example still told agents to
provide bun 1.2.x.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@markattar-factory

Copy link
Copy Markdown
Contributor

Daily sync attempt for VAL-473: no commit or push. dev-internal remains 21 commits behind dev at ce30149bac93e47ed4934bd73fea2dfc9f1e374f.

  • The server-side merge returned HTTP 409. In a throwaway clone, the only conflict was an additive test block in test/review/conversation.test.ts. I retained the internal risk/run-plan tests and all incoming dev tests. The resolved file passed 23 tests.
  • bun install, bun run typecheck, and bun run format:check passed. The required risk regression command returned 243 pass, 1 fail across 16 files.
  • Failure: test/core/risk/evidence.test.ts:588, createPrRiskEvidenceWorkspace incremental > hands the judge only what the author changed since the prior head, with what to look at. Expected importers ["src/caller.ts", "src/lib.test.ts"]; received [].
  • The same test failed again after aborting the merge on the unchanged dev-internal checkout. The risk implementation, its tests, both action YAML files, and the specified risk integration edits were unchanged by the merge. No copied action step changed on dev, so no risk-step port was attempted.
  • Environment: macOS, Apple Git 2.50.1, installed Bun 1.3.13 (the action pins Bun 1.2.11). I did not change production code or weaken the required test. The whole suite was not run, per instructions.

Mark: investigate the existing importer-evidence test failure, validate with the pinned Bun runtime on the intended runner, then complete this sync once the required checks pass. This pull request remains open; no branches were pushed and no history was rewritten. The temporary clone is being removed after this attempt.

* fix(review): explain disabled auto-trigger skips in plain English

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-andrew-yang <andrew.yang1@factory.ai>

* fix(review): address automatic skip wording edge cases

Label the inferred GitLab first review without implying an opening event.
Use only own event-label properties and cover both cases with regressions.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

---------

Co-authored-by: Factory: remote-delegations <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-andrew-yang <andrew.yang1@factory.ai>
markattar-factory and others added 23 commits December 3, 2026 14:55
fix(runtime): run droid-action on Bun 1.4.5 so Factory API traffic uses post-quantum key exchange
Add optional code-review.metadata.actionSha so a review session can be
traced to the droid-action revision that ran it.

GitLab and Azure DevOps read HEAD of the dedicated action checkout
(DROID_ACTION_DIR), never the repository under review, with git run in a
stripped environment. GitHub reports github.action_ref only when it is a
full 40-character commit pin; branch and tag refs are omitted because the
runner does not expose the resolved commit. Unknown revisions are omitted
and never fail a review. Both review passes carry the same value.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
before copied the security-reviewer droid into ~/.factory/droids, but a
droid run with FACTORY_ENV=development reads its droids from
~/.factory-dev/droids. On a Factory dev computer, the subagent the
review prompt requires was then missing, and the session ended without
a review. A caller whose droid keeps its user files elsewhere now passes
that directory as SESSION_FACTORY_DIR; without it, the droids still go
to ~/.factory/droids, so GitHub Actions is unchanged.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
A PR or issue description keeps its @droid mentions, so every edit or push
re-ran the tag flow and posted the command help table again. Share the
"is this body command new" check from isManualReviewRequest and skip the
help reply, without a review, when the mention was already there.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…ry fallback

The hosted runner now takes the review droids' directory only from
SESSION_FACTORY_DIR, so it hardcodes no Factory config path. before
refuses to start without the variable and names it, as it does for
GITHUB_ACTOR, and a failed droids copy names the directory it tried.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
as_session_user clears the environment, so the security-engineer plugin
install ran droid without FACTORY_ENV, and droid installed the plugin
into its production directory, where a dev computer's session droid
does not look. before now requires SESSION_FACTORY_ENV, the FACTORY_ENV
the session's droid runs with, and keeps it for the plugin install.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…directory

validate ran base-action in an allowlisted environment without
FACTORY_ENV, so on a dev computer the validator's droid used its
production directory, and setupDroidSettings wrote
~/.factory/droid/settings.json whichever directory the session droid
reads. validate now requires SESSION_FACTORY_DIR and SESSION_FACTORY_ENV,
as before does, and names a missing one for after to report. Its
validator gets FACTORY_ENV=$SESSION_FACTORY_ENV and SESSION_FACTORY_DIR.
setupDroidSettings takes the Factory config directory instead of a home
directory, and base-action passes it SESSION_FACTORY_DIR, so the
validator's settings land in the session droid's directory. The CI
callers pass no directory and keep ~/.factory.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
setupDroidSettings wrote under /droid when its directory was an empty
string, which base-action passes when a workflow sets SESSION_FACTORY_DIR
to an empty value, as an unset input or variable does. An empty directory
now means ~/.factory, like an unset one.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…ntion

Address review of the first pass:
- Key a description command on its kind and command word, not the raw
  parser span, so "@droid" -> "@droid frobnicate" and one unknown command
  -> another reply again, and a spacing-only "@droid help" edit does not.
- Look for the command among every mention of the previous description
  (parseDroidMentions), so a persistent prose mention that another command
  took precedence over is still recognized; for an unknown mention, any new
  unrecognized mention in the current description earns the help reply.
- Leave the opened/edited rule to isNewBodyCommand alone.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
A failed review closed its Droid Review check as neutral. In Actions
the failed job shows the failure next to it, but github/run-review.sh
has no job, so a hosted failure looked like a review with nothing to
say. run-review.sh now exports FACTORY_AUTOMATION=true for every part,
not only for prepare, and reviewCheckConclusion concludes a failed run
as failure when it is set. That covers finalize from the finish trap
(before or after failing once the check is open) and a review that
failed to post. A superseded or skipped run still concludes neutral,
and validate's validator keeps its allowlisted environment without the
variable. Actions never sets it, so CI keeps neutral.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
When before failed, its reason went only to stderr and to the check,
and prepare.ts opens no check when it fails early, as it does when an
unlisted bot opened the PR. A caller that posts its own failed check
then had no reason to show. fail() now also writes the message, as
printed, to $RUNNER_TEMP/github-review/before-error, which only root
writes and which outlives before. before makes that directory afresh,
so a run that succeeds or exits 78 has no such file. Failures before
fail() can run, such as a missing variable or installing bun, write
none.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
The Droid Review check's details_url and every "View job" link pointed
at the Actions run page for GITHUB_RUN_ID, which does not exist when
github/run-review.sh runs outside Actions. githubJobUrl() now returns
REVIEW_JOB_URL when it is set, and the review lifecycle, the posted
review's summary, the tracking comment's job link and
update-comment-link build their links with it. run-review.sh passes its
environment through to the entrypoints, so the caller sets the variable
in before and after. Without it the links are unchanged.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
When the org's model policy disallowed the configured review model,
prepare dropped the model and output model_fallback_note, but no
finished review showed it. In Actions only the publisher step had
MODEL_FALLBACK_NOTE, and it hands a review to finishReviewLifecycle,
which never rendered it; github/run-review.sh did not keep it at all.

finishReviewLifecycle now reads MODEL_FALLBACK_NOTE and the summary
shows it as a "> [!NOTE]" block, as the tracking comment does, in the
clean, findings, failed and skipped states. The post step of
action.yml, review/action.yml and security/action.yml gets the
variable, with the publisher step's fallback order, since it finishes a
review that posts. run-review.sh keeps MODEL_FALLBACK_NOTE from
prepare's output for after and its finalize. Command replies are
unchanged.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…gger

c52bf57 (#287) deliberately reworded the skip reason for a disabled
automatic trigger to the user-facing "automatic reviews of "labeled"
events are turned off for this repository". This lifecycle test still
expected the old "automatic trigger labeled is disabled". No code or
other test asserts the old wording; the other uses of it in this file
pass it in as an arbitrary skip reason.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
On github/run-review.sh only prepare's fallback note reached after.
When the validator pass fell back on its own (its prompt step, or its
droid retrying without --model), the note was lost, while action.yml's
post and publisher steps take prepare's note, then the validator
prompt's, then the validator's.

validate now writes the first of the validator prompt's and the
validator's notes to $RUNNER_TEMP/droid-prompts/github-review-model-fallback-note,
also when the validator fails, and clears it first. after uses it,
read as the session user, when prepare left no note, so posting and
finalize see the same order as in Actions. validate runs as the session
user and cannot write the root-owned state file, so the note goes where
validate's error already does.

Since that note can come from the session, the summary now escapes the
note's text and keeps only its `code` spans as <code>, so it cannot add
links or mentions to Droid's comment.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
An org-wide install needs Factory to set review defaults, such as
security_block_on_critical and security_block_on_high, that a repo's
.factory/review.yaml can still override. resolveReviewUxConfig now
reads REVIEW_DEFAULTS, JSON with review.yaml's keys, and layers it
between the built-in defaults and the base-branch file, below nonempty
action inputs. It goes through parseReviewConfigYaml, so every
review.yaml key, alias and rule applies, and a malformed value fails
the run as a malformed review.yaml does, with an error naming
REVIEW_DEFAULTS. ReviewConfigError takes the source it names.

The config is resolved once (prepare, generate-review-prompt), in steps
that inherit the job's environment, and run-review.sh's before passes
its environment to prepare; later steps read the resolved
REVIEW_CONFIG_JSON. Nothing sets the variable yet.

Refs AUT-3173

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
When the caller stopped a hosted review session (its turn cap or the
job's time limit), validate still ran the validator, which failed with
"The review session did not write valid candidates", and the summary
showed that instead of why the session stopped. In Actions the
validator step does not run after a failed session step, and finalize
gets the session step's error as DROID_ERROR_MESSAGE.

The caller now sets SESSION_ERROR_MESSAGE in validate and after when a
review's session failed. validate then skips the validator and exits 0,
and after fails with it as DROID_ERROR_MESSAGE before looking at
validate's result, so finalize closes the check and summary with it.
When validate failed without writing its own error, after reports the
caller's VALIDATE_ERROR_MESSAGE, after validate's error file and before
the generic message. Commands are unchanged: Actions passes their
publisher only DROID_SUCCESS, not the session's error.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
after told github-post-command that a command's session succeeded
whenever it left a result file, so a session the caller stopped (its
turn cap or the job's time limit) could still have a partial result
published. Actions passes DROID_SUCCESS from the session step's
conclusion. after now passes DROID_SUCCESS=false when
SESSION_ERROR_MESSAGE is set, and the publisher replies that Droid
could not finish without publishing the result.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…el text

The note can come from the hosted review's session, so the summary renders
it with prose(), its escaping for model text, instead of a formatter of its
own that kept `code` spans. Drops two test cases others already cover, and
rewraps run-review.sh's notes for callers.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
A finding thread counts as Droid's when its first comment's author is
Factory's production App or the login in DROID_BOT_LOGIN. GitHub's
GraphQL API names a bot without the "[bot]" its REST API adds, so a
thread whose bot DROID_BOT_LOGIN names, as a hosted review on another
Factory App does, never matched: @droid fix answered that there were no
open findings, and a question in a finding's thread got the command
list. A GraphQL Bot author now matches DROID_BOT_LOGIN with "[bot]"
added; a user of the same name still does not.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
A failed review's check listed only its steps when it had any, so a
review that stopped partway showed which step failed but not why. The
summary now adds the reason the failure comment gives after the steps.
The rendered previews and the Failed check snapshot show it.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
When droid exec rejects --model it prints "Invalid model:" and then
every model the organization can use. runDroid looked for that line in
the last 1,500 characters of stderr, so a long model list hid it: the
review retried the same model three times and failed with the tail of
the list as its error. runDroid now notes the line as each stderr line
arrives, for both the tier alias swap and the fallback to the
organization's default model.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
A hosted run's before opens the review check before its session exists,
so REVIEW_JOB_URL is the automation's page then, and the check kept that
link: after had the session's page, but updateReviewCheck never set
details_url. Each check update now sets it from REVIEW_JOB_URL, so the
check opens the session once after updates it.

Refs AUT-3073

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@markattar-factory

Copy link
Copy Markdown
Contributor

Daily sync attempt for VAL-473, 2026-12-04.

dev-internal is missing 28 commits from dev. The server-side merge returned HTTP 409. In a disposable clone, the only conflict was additive tests in test/review/conversation.test.ts; I kept the internal risk/run-plan tests and all incoming dev tests. All listed risk files and small risk integration edits stayed unchanged. The risk tail stayed after Revoke GitHub App token and at the end of action.yml.

Validation on the proposed merge:

  • bun install, bun run typecheck, and bun run format:check: passed.
  • Required targeted risk command: 243 pass, 1 fail across 16 files, 1164 assertions.
  • Conflict-file validation: 23 pass, 0 fail.
  • Failure: test/core/risk/evidence.test.ts:588, createPrRiskEvidenceWorkspace incremental > hands the judge only what the author changed since the prior head, with what to look at. Expected importers ["src/caller.ts", "src/lib.test.ts"]; received [].
  • I aborted the local merge and reproduced the same isolated failure on unchanged dev-internal. This failure is not introduced by the merge; its cause is not established. Local runtime: Bun 1.3.13 on macOS.

Incoming dev changes the shared Bun setup step from 1.2.11 to 1.4.5. The copied setup step in risk/action.yml still pins 1.2.11. Per the sync instructions, I did not port this change into the risk action.

No commit or push. Current internal head remains ce30149bac93e47ed4934bd73fea2dfc9f1e374f; the final comparison still reports 28 missing commits. The full suite was not run locally, and there is no new pushed head to inspect in CI.

Mark: investigate the existing importer-evidence failure in the intended runner/runtime, review the copied Bun setup divergence, and complete the sync once required checks pass. The throwaway clone is removed as part of this run; no existing checkout, other remote branch, or other pull request is changed.

factory-nizar and others added 5 commits December 4, 2026 11:04
#287 reworded automaticReviewSkipReason but left this test expecting the
old "automatic trigger labeled is disabled" text, so it fails on dev.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
feat(review): record the action revision in review session tags
feat(review): support directory-specific guidelines
fix(github): make hosted review report like the Actions workflow, and add REVIEW_DEFAULTS
fix(review): reply to a description's Droid mention only when it is new
@markattar-factory

Copy link
Copy Markdown
Contributor

Sync attempt at 2026-12-06T01:41:58Z (VAL-473): blocked; nothing committed or pushed.

  • dev-internal is missing 57 commits from dev. The server-side merge returned HTTP 409.
  • In a throwaway clone, resolved three conflicts:
    • src/core/review/validated/diff.ts: kept dev's new guideline path parser and the internal decodePatchPath export required by risk incremental evidence.
    • src/github/utils/command-parser.ts: used dev's description parser refactor and retained the prohibition on requesting a manual risk assessment from PR/issue prose.
    • test/review/conversation.test.ts: kept both internal tests and all incoming dev tests.
  • All listed risk files and small risk integration files were unchanged relative to the internal head. Risk wiring tests passed, including tail ordering after token revocation.
  • bun install, bun run typecheck, and bun run format:check passed.
  • Required targeted tests: 243 pass, 1 fail, 1164 assertions across 16 files. Failure: test/core/risk/evidence.test.ts:588, “hands the judge only what the author changed since the prior head, with what to look at”; expected importers ["src/caller.ts", "src/lib.test.ts"], received [].
  • Additional focused tests (test/review/conversation.test.ts, test/github/data/review-guidelines.test.ts, test/github/data/pr-risk.test.ts): 48 pass, 0 fail, 183 assertions.
  • Aborted the local merge and reproduced the same isolated assertion failure on unchanged dev-internal at ce30149bac93e47ed4934bd73fea2dfc9f1e374f. It is not introduced by the merge; its root cause remains undiagnosed. Local runtime is Bun 1.3.13 on macOS, while incoming dev specifies Bun 1.4.5.
  • Shared-step divergence, not ported as instructed: dev changes Install Bun from 1.2.11 to 1.4.5; the copied setup in risk/action.yml remains 1.2.11. The root risk tail was not changed.
  • Deleted the throwaway clone and dependencies; deletion verified. Did not run the whole test suite or create a new pushed head.

Mark: investigate the existing importer-evidence failure on the intended runner/runtime, review the copied Bun setup divergence, and complete this sync once the required checks pass.

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.

3 participants