Skip to content

[local-onboarding-try-it-on-this-repo-first-sug] Onboarding: try it on this repo first (suggested tasks, free first run) - #846

Open
danii1 wants to merge 4 commits into
feature/local-onboarding-tracker-picker-defaults-and-rfrom
feature/local-onboarding-try-it-on-this-repo-first-sug
Open

danii1 wants to merge 4 commits into
feature/local-onboarding-tracker-picker-defaults-and-rfrom
feature/local-onboarding-try-it-on-this-repo-first-sug

Conversation

@danii1

@danii1 danii1 commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Why

Stacked on #843 (feature/local-onboarding-tracker-picker-defaults-and-r, task local-onboarding-tracker-picker-defaults-and-r): this PR targets that branch. Review and merge #843 first.

Task local-onboarding-try-it-on-this-repo-first-sug: Onboarding: try it on this repo first (suggested tasks, free first run)

A person without a tracker token had to sign in for the Worker Pilot before the worker ran anything, and the first run was a CONTRIBUTING.md note that showed nothing of the product's value. Now the first task can be a real one from their repo, run in the foreground with no sign-in, and the sign-in comes only after they have seen a result.

What changed

  • Picker: wizard.ts and default-tracker.ts add "Try it on this repo first (no tracker needed)". It becomes the Enter default only when no GitHub/GitLab token matches. It is Markdown underneath, with the folder ~/.devintern/try/<repo>/tasks. devintern init does not show it.
  • Suggestions: try-mode.ts and try-runtime.ts run the user's own agent once in the harness's native read-only mode, under the configured sandbox, with a 180s limit. It asks for 3 tasks (title, what and why, files, acceptance) and writes them as status: todo files.
    • The sample CONTRIBUTING task replaces them if the scan fails, times out, finds nothing, or the harness has no read-only mode.
    • It also replaces them if git status differs after the scan.
  • Wizard step: worker-init-try.ts is a new try step after tracker. It shows the titles, and Enter picks the first. It then runs devintern <task file> --create-pr as a child process with the terminal attached, so it is the ordinary interactive run with the ordinary licence decision.
    • Afterwards it asks "Let the worker do the other 2 in the background? [Y/n]". Yes continues into the existing workspace, sign-in and service steps. No prints devintern worker init and ends with exit code 0.
  • Non-interactive: worker init --non-interactive --tracker try writes the suggested tasks and returns them in an additive trial field plus a run-first-task next step. It never runs them. I chose --tracker try over a flag on markdown because it matches the picker entry and needs no new flag. planTracker moved into worker-init-noninteractive-tracker.ts.
  • Other changes:
    • defaultEnsureTracker now takes an options object as its last argument; three existing test call sites were updated.
    • worker/cli.ts wires the real runners.
    • The fake agent in e2e gained a suggest mode and a clarity reply.
    • docs/code/quick-start.md and docs/code/markdown-tasks.md are updated.

Changes after review

Auto-review fix 1:

  • Envelope handling: parseSuggestions in packages/code/src/lib/init/try-mode.ts now unwraps a JSON envelope. If the parsed object has no tasks array but a string result field, it parses that string for suggestions, at most 2 levels deep. Other envelope shapes still fall back to the CONTRIBUTING sample.
  • Complexity ratchet: adding this pushed the function's complexity to 21, over the lint ratchet's limit of 20. I moved the per-entry normalization into a normalizeEntries helper to bring it back under.
  • Test: packages/code/tests/try-mode.test.ts has a new case where the {tasks} JSON sits inside an envelope's result string. It expects 3 suggestions.
  • Do the harnesses emit envelopes? runReadOnlyScan in try-runtime.ts doesn't set structuredOutput or streamEvents. Those are opt-in flags in packages/agent-harness/src/types.ts:85-100, which produce the JSON output. So stdout should be plain text, which the existing parsing already handles. I didn't run any real harness to check this.
    Findings addressed:
  • [medium] parseSuggestions takes the first { to the last } of the raw scan stdout. If the real harness invocation (buildHeadlessAgentInvocation in agent/spawn.ts, called from try-runtime.ts) emits a JSON or stream-JSON envelope with the answer as an escaped string, the outer object has no tasks array. Parsing then yields nothing, and try mode silently falls back to the CONTRIBUTING sample on every real run. The e2e fake agent prints the raw {tasks} JSON, so the tests never exercise a wrapped envelope. I did not verify the real output format of each harness. in packages/code/src/lib/init/try-mode.ts:108-135

Scope

  • Included: the picker option, the scan, the foreground run, the worker offer, the flags path, tests, and docs.
  • Excluded:
    • Spec item 6 (switching to a real tracker by re-running worker init) is not implemented. defaultEnsureTracker skips the picker once the workspace .env names a tracker. The workspace step also refuses a tracker change once a query is saved. Making it work needs a separate change, so the end-of-try text points to the docs instead.
    • The foreground run's result display is the child's own output, and I did not add a separate summary.
    • A try run whose push fails with no token gets the child's output and a hint with the command, not special handling.

Tradeoffs

  • Foreground run: it is a child process, not an in-process call. This reuses the interactive path and licence rules unchanged, and I pass process.execArgv to it. The cost is that the run has no live handle in the wizard, and its output is raw.
  • Scan safety: an agent whose harness has no read-only mode is skipped for the sample, so some users will not get suggestions. I judged that better than a writable scan.
  • Automated environments: the wizard checks isAutomatedEnvironment before spawning, so in CI or a systemd service it prints the command and runs nothing. Only the isAutomatedEnvironment classification is covered by unit tests; the refusal-before-spawn behaviour is covered by e2e.
  • Task file location: the foreground run takes the task as a file path. That needs no tracker credentials, and the markdown client still moves the file's status off todo, as the e2e shows.
  • Existing e2e: worker-init-wizard.test.ts and the golden path used Enter to mean Markdown. The first now types markdown; the golden path already did.

Blast Radius

  • Callers changed: the interactive worker init picker (a new first entry, new Enter default when untokened), defaultEnsureTracker's signature, and the flags-mode --tracker parsing (try is new).
  • Unchanged paths: with tryMode absent (every unit test that injects ensureTracker), the picker and defaults are as before. Other trackers, devintern init, existing JSON fields and exit codes are unchanged. The JSON trial field and the run-first-task step are additive.
  • Remaining risks: worker init now exits 0 when the user declines the worker after a try run. A shell MARKDOWN_TASKS_DIR or an already-saved one wins over the try folder, so tasks may land there instead.
  • Telemetry: a declined try run reports completion via trackWorkerInitCompleted with the tracker as "markdown".

Verification

Checks a later pass could not run or bypassed (no later pass reports them):

  • Auto-review fix 1: Typecheck, lint (including knip and the ratchet) and format all passed. These ran as part of the lefthook pre-commit hook. I didn't use --no-verify.

  • Auto-review fix 1: The only thing not run was a real harness invocation, so the actual stdout format of each agent is unverified.

  • bun run typecheck: pass.

  • bun run lint from the repo root (oxlint, knip, lint-ratchet): pass, after splitting the plan file, an options object for defaultEnsureTracker, and an extracted helper to stay under the ratchet limits.

  • bun run test in packages/code: 6544 pass, 7 skip, 0 fail. This includes the new tests/try-mode.test.ts (scan fallback, folder location, interactive-run classification) and the default-tracker cases.

  • After bun run build, in packages/e2e: worker-init-try.test.ts, worker-init-wizard.test.ts and worker-init-noninteractive.test.ts run together as 29 pass, 0 fail. The new try tests cover:

    • suggestions, a foreground run, then declining the worker;
    • accepting and reaching the sign-in prompt;
    • the automated-environment refusal;
    • the empty-scan fallback;
    • --tracker try with the JSON result.
  • I did not run the rest of the local e2e suite or the opt-in suites, and I did not test against a real agent or a real GitHub token. The foreground run in e2e used the fake agent and a local bare remote (no PR was created).

  • I did not commit anything.

Verification after review

Later entries supersede earlier results for the same check.

Auto-review fix 1:

  • bun run test tests/try-mode.test.ts in packages/code: 15 pass, 0 fail, including the new wrapped-envelope case.
  • Typecheck, lint (including knip and the ratchet) and format all passed. These ran as part of the lefthook pre-commit hook. I didn't use --no-verify.
  • The only thing not run was a real harness invocation, so the actual stdout format of each agent is unverified.

🤖 Opened by DevIntern from local-onboarding-try-it-on-this-repo-first-sug

…arding: try it on this repo first (suggested tasks, free first run)
Unwrap a harness JSON envelope (string `result`) in parseSuggestions; test added.
@danii1 danii1 added the devintern-authored Pull request written by DevIntern working its own backlog label Dec 4, 2026
@danii1

danii1 commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Artifacts & verification

Run: 1701 · Commit: c3a07d1ac51bf73007ddb50fedaac2a18a685273

Verification report

Produced by __verify-1, execution 1 at 7101829225f4032a8b287f5211ecadc9a5ff487a.

Show artifact
{
  "summary": "The diff covers every requirement I checked. The picker offers 'Try it on this repo first' and makes it the Enter default when no token matches. Tasks go to `<workspace>/try/<repo>/tasks`, not the checkout. The read-only scan falls back to the CONTRIBUTING sample on failure, timeout, no output or no tasks, and it fails if the checkout changed during the scan. The first task runs through a child `devintern <file> --create-pr` process with the terminal attached. The worker question ('Let the worker do the other N…') leads to the existing sign-in and service steps on yes and prints `devintern worker init` on no. `--tracker try` writes the tasks, adds `trial` and a `run-first-task` next step to the JSON report, and never runs a task. I ran typecheck, which passed. I also ran the try-mode and default-tracker unit tests (21 pass, 0 fail). I did not run the offline e2e tests, because they need a built `dist`. The change is safe for existing callers because `planTracker` has one caller, `worker-init-steps.ts:256`, and the `defaultEnsureTracker` signature change is mirrored in the updated tests.",
  "items": [
    {
      "priority": "medium",
      "confidence": "medium",
      "category": "testing",
      "file": "packages/e2e/tests/local/worker-init-try.test.ts",
      "line": "1",
      "issue": "The new e2e tests (decline the worker, accept and reach sign-in, automated environment, empty-scan fallback, `--tracker try`) are PTY-based and need a built CLI. They were not run in this review, so the foreground-run and sign-in paths have no executed evidence.",
      "evidence": "Not run: `packages/code/dist` has no CLI build here. The tests are skipped when `cliPath` is missing, so a green skip would prove nothing.",
      "suggestion": "Build the CLI and run `bun run --filter @devintern/e2e` on the local tests before merging, as AGENTS.md requires for CLI output changes."
    },
    {
      "priority": "low",
      "confidence": "medium",
      "category": "bug",
      "file": "packages/code/src/lib/init/try-runtime.ts",
      "line": "98",
      "issue": "`runForegroundTask` re-invokes `process.argv[1]` with `process.execArgv`. This works for the bundled CLI and `bun start`. A compiled single-binary or unusual launcher would spawn the wrong thing, and the failure only shows as a non-zero exit code.",
      "evidence": "try-runtime.ts:98-102. Tasks given as an absolute `.md` path are accepted by the markdown tracker (`packages/task-trackers/src/markdown/path-utils.ts:83`), so the child's argument handling is fine.",
      "suggestion": "On spawn failure or an exit code that is not a task failure, print the manual command (`tryRunCommand`). Already partly done for non-zero codes."
    },
    {
      "priority": "low",
      "confidence": "low",
      "category": "bug",
      "file": "packages/code/src/lib/init/try-mode.ts",
      "line": "195",
      "issue": "`writeTryTasks` names the fallback sample file with the fixed stem `SAMPLE_MARKDOWN_STEM`, while the other tasks use `try-<n>-<slug>`. `existingTryTasks` recognises both patterns. A user-authored file that happens to match `try-<n>-*.md` in the try folder would be reported as an existing try task and block regeneration in `--tracker try`.",
      "evidence": "Reading worker-init-try.ts:136-146. Not exercised by a test.",
      "suggestion": "Low risk because the folder is workspace-owned. Optionally match on the `sample: devintern-try` frontmatter instead of the file name."
    },
    {
      "priority": "info",
      "confidence": "medium",
      "category": "documentation",
      "file": "docs/code/quick-start.md",
      "line": "80",
      "issue": "The docs say Enter runs the first task and that the branch stays in the checkout without a token. The code asks 'Run which one first? [Enter = 1]' and then prints the manual command on failure; it does not specifically detect a missing token. The docs and code agree in practice, but the no-token message depends on the child run's own output.",
      "evidence": "worker-init-try.ts:92-98 prints push guidance only for a non-zero exit code. That is a generic message, not token detection.",
      "suggestion": "Acceptable. Confirm in the e2e run that the output is helpful when `GITHUB_TOKEN` is absent."
    }
  ],
  "approved": true
}

Auto-review summary

Produced by auto-review, execution 1 at c3a07d1ac51bf73007ddb50fedaac2a18a685273.

Show artifact
{
  "iterations": 1,
  "success": true,
  "finalFeedback": {
    "summary": "Try mode is a Markdown tracker whose tasks folder lives in the workspace, so the change mostly reuses existing paths. It is safe because the scan and the foreground run are both injected (`TryDeps`), the run is refused in automated environments, and the flags path never runs a task. I checked this by reading the diff and did not run any tests. The round-1 parse issue is fixed, since `parseSuggestions` now tries fenced blocks and envelope unwrapping before falling back to the first `{` to last `}` span. The remaining issues are minor.",
    "items": [
      {
        "priority": "low",
        "confidence": "medium",
        "category": "bug",
        "file": "packages/code/src/lib/init/worker-init.ts",
        "line": "198-208",
        "issue": "When the user declines the worker (`run.finished`), `runWorkerInit` returns `{ ok: true, ready: true }`, but no worker, service or workspace registration exists. Callers that read `ready` (for example to print a ready message or pick an exit code) will treat an abandoned setup as complete. Telemetry also reports `trackWorkerInitCompleted` for a setup that stopped early.",
        "evidence": "worker-init.ts diff lines 198-208; the early return skips the workspace, query, license and service steps.",
        "suggestion": "Return `ready: false` (with `ok: true`), and track a distinct event such as a 'try declined' outcome instead of 'completed'."
      },
      {
        "priority": "low",
        "confidence": "medium",
        "category": "bug",
        "file": "packages/code/src/lib/init/worker-init-steps.ts",
        "line": "153-156",
        "issue": "`run.finished` is only checked after a step returns. If `tryStep` sets `finished` and the step loop is later re-entered (for example after a revisit), a stale `finished` or `trial` can carry over. This is the same shape as the round-1 `run.trial` finding, which was not addressed and is not made worse here.",
        "evidence": "worker-init-steps.ts diff lines 152-156 and 167-178; `trial.tasks` set means `tryStep` is skipped on revisit.",
        "suggestion": "Clear `run.trial` and `run.finished` in the tracker step when a non-try tracker is chosen."
      },
      {
        "priority": "low",
        "confidence": "low",
        "category": "code-quality",
        "file": "packages/code/src/lib/worker/cli.ts",
        "line": "316",
        "issue": "The usage line embeds a literal `\\n` and hand-indented continuation inside a single array element. This is inconsistent with the neighbouring entries, which use one string per line, and it can break any help renderer that prefixes or wraps each entry.",
        "evidence": "cli.ts diff line 316.",
        "suggestion": "Split it into two array entries."
      },
      {
        "priority": "low",
        "confidence": "medium",
        "category": "testing",
        "file": "packages/code/tests/try-mode.test.ts",
        "line": "1",
        "issue": "The unit tests cover only the pure helpers. `tryStep`, `writeFlagsTryTasks`, `removeFlagsTryTasks`, `addRunFirstTask`, `planTracker --tracker try` and `runReadOnlyScan` have no unit tests. The e2e tests cover the happy paths, but they are not in PR CI per AGENTS.md. Failure rollback of the `trialFiles` is untested. This was already reported in round 1.",
        "evidence": "No test file references the functions above in the diff.",
        "suggestion": "Add unit tests for `planTracker('try')`, the removal of `trialFiles` on failure, and `addRunFirstTask` ordering."
      },
      {
        "priority": "info",
        "confidence": "low",
        "category": "documentation",
        "file": "packages/code/src/lib/worker/cli.ts",
        "line": "386-389",
        "issue": "`worker init --non-interactive` now always passes `tryMode: { scan: runReadOnlyScan }`. With `--tracker try` this spawns the user's agent over the checkout, which uses agent quota or tokens inside a flag-driven init that is otherwise offline-capable. The docs say tasks are written and never run, but they do not say that the scan itself calls the agent.",
        "evidence": "cli.ts diff lines 383-390; the `saveStep` change calls `writeFlagsTryTasks` unconditionally when a draft has `trial`.",
        "suggestion": "Say in the quick-start docs that `--tracker try` runs one read-only agent scan, with the fallback to the docs-only sample if the scan fails."
      }
    ],
    "approved": true
  },
  "unresolved": [],
  "stopReason": "approved",
  "commitSha": "c3a07d1ac51bf73007ddb50fedaac2a18a685273",
  "history": [
    {
      "iteration": 1,
      "feedback": {
        "summary": "Try mode is added as a Markdown tracker with a workspace-local folder, a read-only agent scan, and a foreground interactive run. The move of `planTracker` is clean: its only caller is `worker-init-steps.ts:256`. It reaches the scan and the run only through injected `TryDeps`. I did not run the tests. The safety claim rests on code reading: the scan uses the harness's native read-only mode and compares `git status --porcelain` before and after, and the foreground run re-invokes the CLI, which makes its own licence decision. That claim is unproven beyond reading (no run). I found no blocking defect, only the robustness and test gaps below.",
        "items": [
          {
            "priority": "medium",
            "confidence": "low",
            "category": "bug",
            "file": "packages/code/src/lib/init/try-mode.ts",
            "line": "108-135",
            "issue": "`parseSuggestions` takes the first `{` to the last `}` of the raw scan stdout. If the real harness invocation (`buildHeadlessAgentInvocation` in `agent/spawn.ts`, called from `try-runtime.ts`) emits a JSON or stream-JSON envelope with the answer as an escaped string, the outer object has no `tasks` array. Parsing then yields nothing, and try mode silently falls back to the CONTRIBUTING sample on every real run. The e2e fake agent prints the raw `{tasks}` JSON, so the tests never exercise a wrapped envelope. I did not verify the real output format of each harness.",
            "evidence": "unproven: `try-runtime.ts` returns raw stdout; the only tests are `tests/try-mode.test.ts` and the fake agent, which print bare JSON",
            "suggestion": "Confirm what the claude, codex, opencode and cursor harnesses print in headless readonly mode. If it is an envelope, unwrap it (reuse an existing result extractor) before `parseSuggestions`, and add a test with a wrapped sample."
          },
          {
            "priority": "low",
            "confidence": "medium",
            "category": "bug",
            "file": "packages/code/src/lib/init/worker-init-steps.ts",
            "line": "152-157",
            "issue": "`run.trial` stays set when the user is sent back to the tracker step and picks a real tracker. `worker-init.ts` then still prints the 'Moving to a real tracker later' hint and skips the first-sample-ticket offer for a tracker that is not try mode. When try mode is re-picked, `onChosen` replaces `run.trial` and drops `tasks`, so the scan runs again and writes more task files.",
            "evidence": "packages/code/src/lib/init/worker-init-steps.ts:259-262 (`revisit === 'tracker'`) and `tryModeOffer.onChosen` set `run.trial` but nothing clears it; worker-init.ts checks `!run.trial`",
            "suggestion": "Clear `run.trial` and `run.finished` when the tracker step is revisited, and keep `trial.tasks` when the same folder is picked again."
          },
          {
            "priority": "low",
            "confidence": "medium",
            "category": "code-quality",
            "file": "packages/code/src/lib/init/try-mode.ts",
            "line": "182-200",
            "issue": "`writeTryTasks` never reads existing `try-*` files. Re-running the wizard (as the docs advise) in a folder with earlier suggestions appends a fresh set, including tasks already done or stale. Flags mode handles this with `existingTryTasks`, but the interactive path does not.",
            "evidence": "packages/code/src/lib/init/worker-init-try.ts:68-72 always calls `suggestTasks` and `writeTryTasks`; the flags path at worker-init-try.ts:128-133 skips when files exist",
            "suggestion": "Reuse `existingTryTasks` in `tryStep`, or ask whether to regenerate."
          },
          {
            "priority": "low",
            "confidence": "medium",
            "category": "testing",
            "file": "packages/code/tests/try-mode.test.ts",
            "line": "1-138",
            "issue": "Unit tests cover the pure helpers only. The security-relevant paths have no unit coverage: `runReadOnlyScan` (the unsupported-readonly harness refusal, the checkout-changed rejection, the timeout) and the `removeFlagsTryTasks` rollback. E2e covers the happy paths but is not in PR CI, per AGENTS.md.",
            "evidence": "No test imports `try-runtime.ts` or `removeFlagsTryTasks`",
            "suggestion": "Add a test of `runReadOnlyScan` with a stub harness and a git fixture that mutates the tree, and one of rollback after a failed flags run."
          },
          {
            "priority": "info",
            "confidence": "medium",
            "category": "code-quality",
            "file": "packages/code/src/lib/init/worker-init-noninteractive-tracker.ts",
            "line": "18-22",
            "issue": "`planTracker` gives `ctx` a default of `{ workspaceDir: '', processEnv: {} }`. A caller that omits it would produce a relative path like `try/<repo>/tasks`. The only caller (worker-init-steps.ts:256) passes it, so it cannot happen today.",
            "evidence": "packages/code/src/lib/init/worker-init-steps.ts:256-259",
            "suggestion": "Make `ctx` required."
          }
        ],
        "approved": false
      },
      "addressed": [
        {
          "priority": "medium",
          "confidence": "low",
          "category": "bug",
          "file": "packages/code/src/lib/init/try-mode.ts",
          "line": "108-135",
          "issue": "`parseSuggestions` takes the first `{` to the last `}` of the raw scan stdout. If the real harness invocation (`buildHeadlessAgentInvocation` in `agent/spawn.ts`, called from `try-runtime.ts`) emits a JSON or stream-JSON envelope with the answer as an escaped string, the outer object has no `tasks` array. Parsing then yields nothing, and try mode silently falls back to the CONTRIBUTING sample on every real run. The e2e fake agent prints the raw `{tasks}` JSON, so the tests never exercise a wrapped envelope. I did not verify the real output format of each harness.",
          "evidence": "unproven: `try-runtime.ts` returns raw stdout; the only tests are `tests/try-mode.test.ts` and the fake agent, which print bare JSON",
          "suggestion": "Confirm what the claude, codex, opencode and cursor harnesses print in headless readonly mode. If it is an envelope, unwrap it (reuse an existing result extractor) before `parseSuggestions`, and add a test with a wrapped sample."
        }
      ],
      "fixSummary": "## What changed\n- **Envelope handling:** `parseSuggestions` in `packages/code/src/lib/init/try-mode.ts` now unwraps a JSON envelope. If the parsed object has no `tasks` array but a string `result` field, it parses that string for suggestions, at most 2 levels deep. Other envelope shapes still fall back to the CONTRIBUTING sample.\n- **Complexity ratchet:** adding this pushed the function's complexity to 21, over the lint ratchet's limit of 20. I moved the per-entry normalization into a `normalizeEntries` helper to bring it back under.\n- **Test:** `packages/code/tests/try-mode.test.ts` has a new case where the `{tasks}` JSON sits inside an envelope's `result` string. It expects 3 suggestions.\n- **Do the harnesses emit envelopes?** `runReadOnlyScan` in `try-runtime.ts` doesn't set `structuredOutput` or `streamEvents`. Those are opt-in flags in `packages/agent-harness/src/types.ts:85-100`, which produce the JSON output. So stdout should be plain text, which the existing parsing already handles. I didn't run any real harness to check this.\n## Verification\n- `bun run test tests/try-mode.test.ts` in `packages/code`: 15 pass, 0 fail, including the new wrapped-envelope case.\n- Typecheck, lint (including knip and the ratchet) and format all passed. These ran as part of the lefthook pre-commit hook. I didn't use `--no-verify`.\n- The only thing not run was a real harness invocation, so the actual stdout format of each agent is unverified.",
      "commitSha": "7101829225f4032a8b287f5211ecadc9a5ff487a"
    },
    {
      "iteration": 2,
      "feedback": {
        "summary": "Try mode is a Markdown tracker whose tasks folder lives in the workspace, so the change mostly reuses existing paths. It is safe because the scan and the foreground run are both injected (`TryDeps`), the run is refused in automated environments, and the flags path never runs a task. I checked this by reading the diff and did not run any tests. The round-1 parse issue is fixed, since `parseSuggestions` now tries fenced blocks and envelope unwrapping before falling back to the first `{` to last `}` span. The remaining issues are minor.",
        "items": [
          {
            "priority": "low",
            "confidence": "medium",
            "category": "bug",
            "file": "packages/code/src/lib/init/worker-init.ts",
            "line": "198-208",
            "issue": "When the user declines the worker (`run.finished`), `runWorkerInit` returns `{ ok: true, ready: true }`, but no worker, service or workspace registration exists. Callers that read `ready` (for example to print a ready message or pick an exit code) will treat an abandoned setup as complete. Telemetry also reports `trackWorkerInitCompleted` for a setup that stopped early.",
            "evidence": "worker-init.ts diff lines 198-208; the early return skips the workspace, query, license and service steps.",
            "suggestion": "Return `ready: false` (with `ok: true`), and track a distinct event such as a 'try declined' outcome instead of 'completed'."
          },
          {
            "priority": "low",
            "confidence": "medium",
            "category": "bug",
            "file": "packages/code/src/lib/init/worker-init-steps.ts",
            "line": "153-156",
            "issue": "`run.finished` is only checked after a step returns. If `tryStep` sets `finished` and the step loop is later re-entered (for example after a revisit), a stale `finished` or `trial` can carry over. This is the same shape as the round-1 `run.trial` finding, which was not addressed and is not made worse here.",
            "evidence": "worker-init-steps.ts diff lines 152-156 and 167-178; `trial.tasks` set means `tryStep` is skipped on revisit.",
            "suggestion": "Clear `run.trial` and `run.finished` in the tracker step when a non-try tracker is chosen."
          },
          {
            "priority": "low",
            "confidence": "low",
            "category": "code-quality",
            "file": "packages/code/src/lib/worker/cli.ts",
            "line": "316",
            "issue": "The usage line embeds a literal `\\n` and hand-indented continuation inside a single array element. This is inconsistent with the neighbouring entries, which use one string per line, and it can break any help renderer that prefixes or wraps each entry.",
            "evidence": "cli.ts diff line 316.",
            "suggestion": "Split it into two array entries."
          },
          {
            "priority": "low",
            "confidence": "medium",
            "category": "testing",
            "file": "packages/code/tests/try-mode.test.ts",
            "line": "1",
            "issue": "The unit tests cover only the pure helpers. `tryStep`, `writeFlagsTryTasks`, `removeFlagsTryTasks`, `addRunFirstTask`, `planTracker --tracker try` and `runReadOnlyScan` have no unit tests. The e2e tests cover the happy paths, but they are not in PR CI per AGENTS.md. Failure rollback of the `trialFiles` is untested. This was already reported in round 1.",
            "evidence": "No test file references the functions above in the diff.",
            "suggestion": "Add unit tests for `planTracker('try')`, the removal of `trialFiles` on failure, and `addRunFirstTask` ordering."
          },
          {
            "priority": "info",
            "confidence": "low",
            "category": "documentation",
            "file": "packages/code/src/lib/worker/cli.ts",
            "line": "386-389",
            "issue": "`worker init --non-interactive` now always passes `tryMode: { scan: runReadOnlyScan }`. With `--tracker try` this spawns the user's agent over the checkout, which uses agent quota or tokens inside a flag-driven init that is otherwise offline-capable. The docs say tasks are written and never run, but they do not say that the scan itself calls the agent.",
            "evidence": "cli.ts diff lines 383-390; the `saveStep` change calls `writeFlagsTryTasks` unconditionally when a draft has `trial`.",
            "suggestion": "Say in the quick-start docs that `--tracker try` runs one read-only agent scan, with the fallback to the docs-only sample if the scan fails."
          }
        ],
        "approved": true
      },
      "addressed": [],
      "commitSha": "c3a07d1ac51bf73007ddb50fedaac2a18a685273"
    }
  ]
}

…-picker-defaults-and-r' into feature/local-onboarding-try-it-on-this-repo-first-sug

# Conflicts:
#	packages/code/src/lib/init/wizard.ts
#	packages/code/src/lib/init/worker-init-noninteractive.ts
@danii1

danii1 commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

🔀 This branch had merge conflicts with feature/local-onboarding-tracker-picker-defaults-and-r; devintern resolved them and pushed the merge. Please double-check the resolution.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devintern-authored Pull request written by DevIntern working its own backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant