Repository navigation
Announce the first Chief and duplicates to plugins - #712
Conversation
|
Triage: this pull request now has its issue — #715 — opened from this body, with the repro, the expected behaviour and the acceptance lines taken from what the diff and its tests do. Two things the author still owes on this PR, because they are not mine to write:
The owner is not recorded yet: the commits show the git identity |
bootstrap and duplicateBot created Bots through the module-local createBot, which skips the bot.created wrapper in hooks.js. A plugin that adopts new Bots (the tree root) could therefore miss the first Main Bot (created on the first open, after its startup timers) or leave a copy outside the tree until a restart. Create both through rt.createBot.
bf55559 to
1cd5ccc
Compare
|
Verdict: PASS at 1cd5ccc Both bypasses now go through the announced path, and the two tests drive the real entry points rather than the helper: the onboarding case empties the home, calls the actual Ran: Not run: Non-blocking: the announcement fires inside |
…hinkFlowLab#719) Written-by: Dev Fixes ThinkFlowLab#718. Tip SHA: d70f618 ## Reproduce `node .github/scripts/enqueue-guard.mjs --pr <n>` read only `hold`, the newest conclusion and the diff: a pull request on a branch of this repository whose body named no issue and which carried no `agent-pr` label passed the guard. That is the gap ThinkFlowLab#711/ThinkFlowLab#712/ThinkFlowLab#713 exposed - they entered the review path with neither. ## What changed - `.github/scripts/enqueue-guard.mjs`: `guard()` takes `body`, `mechanicalRelease` and `fork`, and pushes two reasons onto the existing list so the one-line `message` renders them: `no issue reference in the pull request body: add "Fixes #<n>"` when no line matches `/^[\s>#-]*(?:fixes|closes)\s*#\d+/im`, and `missing label: agent-pr` when the label list - lower-cased the way `merge-gate`'s `names()` reads it - lacks it. `main()` passes `body: pull.body`, `mechanicalRelease: isMechanicalRelease(files.map((f) => f.filename))` and `fork: head.repo.full_name !== repo`, both sides lower-cased. - **Two exemptions, neither of them `result.exempt`**: a mechanical release PR (it carries neither by design), and a fork. `exempt` is also true for T0/T1, and routine work on our own branch still names its issue; `head.repo.full_name` is the branch-ownership test the Chief fixed after ThinkFlowLab#711/ThinkFlowLab#713 turned out to be the owner's own fork work. A deleted fork (`head.repo` null) is not this repository either, so it is exempt. - `.github/scripts/enqueue-guard.test.mjs`: the `fakeGh` pull response carries `body` (default `Fixes ThinkFlowLab#602`) and `head.repo.full_name` (default `ThinkFlowLab/FlyBot`) - without either every existing case changes meaning - the two `hold` fixtures carry `agent-pr` beside `hold`, and `run()` takes a `repo` override so a case can spell the repository differently. Seven cases: same-repo missing reference, same-repo missing label, both present, fork, mechanical release, lower-case `--repo` on our own branch, fork under either spelling. - `AGENTS.md` -> `### Merge gates`: one bullet after the `awaiting-approval is retired` one, naming both exemptions. ## INC answered `Verdict: INC at 7abac48` (`6337118114`) named two things, both fixed on this tip: 1. **The fork test was case-sensitive where the API is not.** `fork = pull.head?.repo?.full_name !== repo` let `--repo thinkflowlab/flybot` read our own branch as a fork, answer ALLOW and switch both rules off. Both sides are lower-cased now, and two new cases pin it: our own branch still refuses under the lower-case spelling, and a fork stays exempt under either. Reverting only the `toLowerCase()` makes `ThinkFlowLab#718: a lower-case --repo spelling does not turn our own branch into a fork` red (21/22). 2. **The header carried `#NNN`.** It names `ThinkFlowLab#718` now (and the fork exemption beside the mechanical release one). ## What I ran At the tip: ``` $ node --test .github/scripts/enqueue-guard.test.mjs # tests 22 # pass 22 # fail 0 $ node --check .github/scripts/enqueue-guard.mjs (no output) $ risk-gate judge over the three changed files risk-tier: T3; basis: .github/scripts/enqueue-guard.mjs=T3, .github/scripts/enqueue-guard.test.mjs=T3, AGENTS.md=T3 ``` The 15 pre-existing cases stay green: the fixture change is what keeps them meaningful rather than newly refused. ## Red without the source change Four cuts, each restored afterwards (all at this tip): - delete the two refusals from `guard()` -> **17/22**: the two refusal cases, the fork case (it also asserts the same pull request on our own branch is refused), and the lower-case case. - narrow the skip to `if (!mechanicalRelease)` -> **20/22**: both fork cases fail. - replace the skip with `if (true)` -> **19/22**: both fork cases and the mechanical release case fail. - drop only the `toLowerCase()` in the `fork` comparison -> **21/22**: `ThinkFlowLab#718: a lower-case --repo spelling does not turn our own branch into a fork`. ## Not run - `npm run verify` and the rest of `.github/scripts/*.test.mjs`: this box has no full checkout - only the three changed files plus what they import - so the whole suite is left to CI. No file other than the three changes. The doc test in the same file (`ThinkFlowLab#602: the instructions that enqueue point at the guard`) is green here against the tip's `AGENTS.md`, `SKILL.md` and `autonomous-dev.md`. - The guard against the live API (`gh`): this box has no `gh`. The cases drive the whole of `main()` through the injectable `fakeGh`, including `exempt`, `fork` and the `head.repo` shape the API sends. ## Risk T3 by the repository's own rules (`.github/**` and `AGENTS.md`), so it needs a PASS at the tip. The behaviour change is confined to the guard and only refuses more, and only for a branch this repository owns: a pull request with no `Fixes #<n>`/`Closes #<n>` line or without `agent-pr` can no longer enter the queue - that is the point - while forks and the daily release PR are untouched. Per the issue, an owner-authored pull request on a fork gets no refusal at all now; no `author_association: OWNER` waiver was added.
Announce the first Chief and duplicates to plugins
Fixes #722
core/src/host/hooks.jsannounces every new Bot withbot.createdby wrappingrt.createBot. Two callers bypassed the wrapper by using the module-localcreateBot, so no event fired:bootstrap()creates the first Main Bot (Chief) on the firststaterequest.@flybot/treeadopts Chief only through that event or its startup timers (0/1/5/15 s); if the server had been running before the first open, the timers were long gone and Chief stayed outside the tree — nocreate_team/create_child_bot/find_bots, no root — until a restart.duplicateBot()copies a Bot with no event, so the copy stayed "outside the tree" until a restart or another Bot creation.Both now create through
rt.createBot, the announced path. No other behaviour changes.core/test/flybot.test.jsadds two cases: onboarding on an empty home announcesChief, andduplicate-botannounces the copy (both fail without the change; the first drives the realstaterequest, the second the real endpoint).docs/subsystems/core-host.mdrecords the rule.Ran at the tip:
npm run verify(green,TZ=UTC),ds-bot-patches generate+check. Not run: smoke (this macOS box has nosetsid, sodev/bench.shcannot startdsh web), Desktop, real-model steward.Fixes #715