Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion extensions/gentle-ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { emptyFallbacksFile, fallbacksFilePath, followProfileRename, readFallbac
import { getSupportedThinkingLevels } from "@earendil-works/pi-ai";
import { PROFILE_TIER_EVENT, supportsOpenAIFast } from "../lib/openai-fast-tier.ts";
import { isDeepStrictEqual } from "node:util";
import { AsyncLocalStorage } from "node:async_hooks";
import { appendSystemPromptOnce } from "../lib/append-system-prompt.ts";
import { filterChildSessionContextFiles, type ContextFileOptions } from "../lib/child-context-files.ts";
import { dataArgumentRanges, recognizeDestructiveCommands } from "../lib/destructive-command-guard.ts";
Expand Down Expand Up @@ -10018,6 +10019,16 @@ interface NegotiatedHostTransportStatus {
}
const reviewTransportRefusalByProvider = new WeakMap<object, ReviewTransportRefusal>();

// odd/tasks/review-one-call.md L19: the STATUS opt-in for a stopped review's
// non-blocking findings (gentle-ai#6088) is asked only by facade calls that
// gentle_review_run dispatches. The scope is set by the run around its own
// facade dispatch, in process; it is not a tool parameter, so no model input
// can set it, and a direct gentle_review call never asks for the findings.
const reviewRunScope = new AsyncLocalStorage<true>();
function nonBlockingFindingsForRun(): { nonBlockingFindings?: true } {
return reviewRunScope.getStore() === true ? { nonBlockingFindings: true } : {};
}

function clearReviewTransportProbeForTesting(nativeReviewCli: NativeReviewCli | null): void {
if (nativeReviewCli !== null) reviewTransportRefusalByProvider.delete(nativeReviewCli as unknown as object);
}
Expand Down Expand Up @@ -10844,6 +10855,8 @@ async function executeReviewControllerOperationImpl(
{
cwd: defaultCwd,
...inspectSelector,
// gentle-ai#6088: only on behalf of gentle_review_run (L19).
...nonBlockingFindingsForRun(),
...(signal === undefined ? {} : { signal }),
},
retainedUntrackedSelections,
Expand Down Expand Up @@ -11798,6 +11811,9 @@ async function executeReviewControllerOperationImpl(
...(parameters.lineageId === undefined ? {} : { lineageId: parameters.lineageId }),
...(effectiveBaseRef === undefined ? {} : { baseRef: effectiveBaseRef, committedOnly: true }),
...(effectiveUntrackedSelection.untrackedScope === undefined ? {} : effectiveUntrackedSelection),
// gentle-ai#6088: only on behalf of gentle_review_run (L19); the run
// bounds them and drops the raw set from its nested record.
...nonBlockingFindingsForRun(),
...(signal === undefined ? {} : { signal }),
}, retainedUntrackedSelections, defaultCwd);
if (negotiated.transport !== undefined) {
Expand Down Expand Up @@ -12584,7 +12600,7 @@ function createGentleAiExtensionForTesting(
// but emits no nested tool_call/tool_result/execution events. SDK
// accounting sees only the outer call; internal facade calls have
// no additional budget/timing events. Returned metrics describe them.
const result = await tools[name].execute(toolCallId, args as never, signal, onUpdate, ctx);
const result = await reviewRunScope.run(true, () => tools[name].execute(toolCallId, args as never, signal, onUpdate, ctx));
return result.details as Record<string, unknown>;
},
presentForecast: async (forecast) => {
Expand Down
6 changes: 5 additions & 1 deletion odd/tasks/nonblocking-delivery-slices.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ S3. Preserve run-only opt-in, direct/capture STATUS parity, bounded findings/cla
## Tasks
T1 | S1-S3 | worker scope | done | run-only opt-in, bounds/isolation and correction-gate tests; integrated 46/46 PASS | commit: 55f3b664f
T2 | S1-S3 | worker result | done | bounded coordinator result; RED 5 failures, GREEN 7/7 plus 27/27 existing tests; exact reference code | commit: 6e5825d28
T3 | S1-S3 | parent | in_progress | earlier integrated proof retained; in-flight refusal race RED reproduced, generated fix and134 native tests GREEN; independent concurrency verification pending | commit: 332224982 + e9e9d0aa3 + b1971cb64 (race correction)
T3 | S1-S3 | parent | in_progress | refusal and bounded-result corrections independently verified and delivered; remaining integration must explain nested statement_truncated, then receive fresh checks | commit: 332224982 + e9e9d0aa3 + b1971cb64 (race correction)
T4 | S1-S3 | parent | pending | publish <=400-line slices after provider prerequisite and required verification | commit: pending

## Log
Expand All @@ -35,3 +35,7 @@ L12. Independent verifier26: baseline5PASS/5FAIL on each TS/runtime; candidate10
L14. #3212 integrated current main atcd34b10bc; public result files byte-identical to prior candidate,18tests/typecheck291PASS and297allCI PASS. Fresh302merge gate stopped on unresolved review4555320381. Parent public probe reproduced1MiB statement with emptyfindings, stopped outcome, exactlyoneSTATUS call and unchanged input;16KiB cap covers only list. Parent implementation decision under standing authorization: share1024UTF8-byte claim cap for statement, keep whole codepoints and short text unchanged, emit nested statement_truncated:true only on truncation. This is host-derived metadata, never a provider-schema/authority change. Explorer2c confirms nested marker survives coordinator/tool serialization; subsequent integration guidance/tests and docs slice must explain it. No additional top-level scope key needed. Regression/fix/independent verification and delivery pending.

L15. Statement regression RED9PASS/3FAIL (1048576vs1024,1028vs1024,1027vs1023). Reused unchanged UTF8 helper/1024claim cap and added nested host-only statement_truncated:true on cuts; docs explain disclosure/provider-schema separation. Parent30654/54coordinator/native testsPASS, typecheck/diffPASS; inputs/calls/outcomes/claims preserved across stop/correction and empty/nonempty lists. Risk3 public result contract: independent proof and freshCI pending; later integration guidance must explain the marker.

L16. #3211 merged5e592cf7a and retained probes#3219 merged20d147cee. #3212 statementfixe4ca47371: independent60/60 with30 differential compatibility cases identical; parent54/typecheckPASS,317allCI and319freshhead/320lines/allchecks/threadsresolved. Mergedca9993e3421029539168fcbd44f7dabb7bb61659 normally, no admin/force. Threadwasalreadyresolved315, no duplicate replyposted. #3213 integrated currentmain in nbf-scope-current-main; initial patch-equality check againstbb1f7f56's firstparent failed; no equality/SDK validation was established by that command. Parent322 was mistakenly launched despite failed setup; preserve its actual result and diagnose the correct comparison base before publishing. No new behavior or benchmark claim; checks/delivery pending. Remaining integration/docs must disclose statement_truncated.

L17. Parent setup error: bb1's firstparent is only the fixture-typing commit, not original scope base; comparison against actual f091a0da3 proves all five scope files' added/removed patch lines identical to integrated main-relative delta, and coordinator unchanged from correctedmain. Two SDK lookup assumptions failed before link; actual importer pins1.5.2 despite >=1.2.0 manifest range. Parent32224/24PASS but typecheck path missing;323 validated lock/installed1.5.2, linked ignored local dependencies and typecheck/diffPASS. No source correction or dependency install. These setup failures remain recorded, not hidden by later PASS.
Loading
Loading