mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-10-19 12:43:39 +00:00
* fix(managed-agent): admit background Shell and Monitor capture publication families The capture-publication reserve refused every payload but foreground Shell: the contract hard-refused is_background and any toolName but run_shell_command (#13533 A1), the store's checkpoint gate re-spelled the same shell-only assumption one layer below, and the hosted turn's checkpoint fork recorded the canonical-input digest only for shell. The three gates now share one family list (PUBLISHABLE_TOOL_NAMES) covering foreground/background Shell and Monitor, numeric bounds accept integral-valued numerics in parity with the TypeScript mirror, and the turn fork covers monitoring. Families admit only via the shared fixture vectors replayed byte-identically in both languages (22 vectors incl. boundary and exponent-spelling cases); mutation witness: removing the background arm reddens both suites. End-to-end, admitted background and Monitor reserves answer grant OPEN through the full Spring/broker/daemon chain (probe-gated witness lanes). * test(managed-agent): background-publication witness ITs with shared probe wiring Adds the end-to-end witnesses built while reconstructing #13533's findings: HostedBackgroundPublicationIT pins admitted background/Monitor reserves answering grant OPEN through the real Spring controller/stores/broker/daemon chain (strict detached-arm pins; environment-declined not_started named as the unlanded B1 dependency), and HostedRecoveryBlockedWedgeIT keeps the A2 wedge probes as regression coverage fed by a driver-relayed reserve 400. Both boot a shared PublicationProbeWiring extracted under com.alibaba.qwen.managedprobes (outside the app's component scan), with the refusal-diagnostic ProbeAdvice registered only in the publication context. All lanes are gated behind -Dqwen.wedge.probe=true, leaving the CI hosted-harness-mysql lane unaffected without it. * docs(design): managed tool publication background arm (EN/zh-CN) Design record for the #13533 A1 slice: why the single contract gains a background/Monitor arm rather than background captures routing through a second reserve (the digest-exact binding is family-independent, so option B duplicates the grant lifecycle for no invariant), the admitted payload families with integral-valued numeric bounds, the three closed shell-only layers the witness pinned (contract, store checkpoint gate, turn fork), the scope boundaries (no domain enablement; B1/B2/A2 named separately; the environment-declined 409 cause recorded as an A3-family follow-up), and the acceptance criteria with their mutation witnesses. * docs(design): drop the superseded background-arm drafts Upstream #13789 landed its own shape of the A1 fix (per-family arms with directory and its own verification), so the drafts written around this branch's earlier approach (shared constant, strict markers, no directory) would record decisions that contradict what main now runs. The remaining delta's rationale moves to the PR thread. * test(integration): enumerate the wedge driver in the relay-caller witness The sdk-java lane pins the exact set of drivers calling the shared relay helper; adding a new legitimate caller (the recovery-blocked wedge driver) in the same slice must update the enumeration or every later run of 'Check Hosted proxy header relay' fails 5-vs-6. The witness also keeps its purpose: a driver hand-rolling its own relay stays absent from the list and is caught — the new entry only records that this one uses the shared helper, which is exactly the posture the pin exists to keep. * test(managed-agent): rename probe witnesses off the Hosted*IT roster fingerprint The hosted fault-gates lane requires every Hosted*IT source class to run at least one test; the two probe-gated witnesses added with the A1 slice always record zero executions without -Dqwen.wedge.probe=true (1 run, 1 skipped, which counts as zero against the roster), so the rerun of the lane fails at 'Check that every Hosted integration test class ran' with '::error: ... ran no test in this job'. Make the probe intent structural by renaming them to one-shot ...Gate classes (the O4Gates' shape): the failsafe include glob '**/Hosted*IT.java' no longer schedules them, and both roster family predicates (hosted ^Hosted.*IT$ and non-hosted & non-IT) miss them. Probe lanes keep invoking by simple name; behavior unchanged. Verified: test-compile + checkstyle green, no residual old-name references outside archive snapshots. * feat(cli): add a test-only H3 admission switch for hosted probe witnesses QWEN_MANAGED_SESSION_TEST_DOMAINS admits the listed child_run/monitor_run domains at the two turn-admission checks only, so the probe witnesses can run against an unmodified bundle while the store-side commit gate keeps refusing what the frozen registry disables; production never sets it. Also reverts the publication inputDigest fork to upstream's form: since the merge, the store-side checkpoint gate admits the monitor family through PUBLISHABLE_TOOL_NAMES, which made the extra monitoring disjunct a provable no-op. * test(managed-agent): harden the hosted probe witnesses and collect them in a profile - Move ProbeAdvice out of the scanned package into com.alibaba.qwen.managedprobes so only a witness that lists it as an explicit application source registers it; the wedge witness omits it and keeps observing the production envelope as-is. - Add the hosted-harness-gates failsafe profile collecting **/Hosted*Gate.java with the probe flag on, keeping the Hosted*IT roster, its CI lane and both roster checks untouched. - Give both gates the driver-process lifecycle finally, budgets that cover the worst arm (driver waitFor 1500s / wedge watch 900s under @Timeout 1800s and a 2400s fork ceiling), an accurate deadline-expiry assertion message, quoted wrapper paths that reject quotes and newlines, per-gate evidence subtrees, and a session sweep that binds every probe session id with capped-sample naming. - Point the witness javadoc at #13533 and PR #13815 instead of the removed design doc, and name this PR's actual delta for the monitor arm (PUBLISHABLE_TOOL_NAMES extraction and the boundedIntField numeric widening) rather than a chain lifted elsewhere. - Driver: the header now says the reserve refusal is relay-injected and never reaches the server; the daemon gets the admission switch; each family replays its captured OPEN reserve with the same publicationId and only its digests forged, fired before the blocked settlement, and the 400 refusal reason must name the digest. * test(core): pin fractional numeric spellings in the publication payload corpus Adds shell-timeout-fractional, monitor-idle-timeout-fractional and monitor-max-events-fractional (each carrying a 1.5 field, all invalid) so the integral-only clause of boundedIntField is pinned in both languages by the shared, digest-stamped fixture vectors. * test(cli): register the test-only admission switch in the process.env guard Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> * test(managed-agent): align the witnesses with the H3-enabled registry Upstream #13889 (#13856) enabled everything the witnesses' simulated switch was papering over (shell kind and monitor_run domain are now enabled for submission), so the switch remnants are removed: the driver's daemon env entry, the process.env guard allowance, and both gates' javadoc mentions. The gates now assert straight on the plain registry against the unmodified bundle — exactly the reachability proof the review demanded for the record-commit path. The Arm-3 oracle is repointed at the layer that actually answers: a forged-digest replay of the captured OPEN reserve is refused by ToolPublicationStore.lockOriginal() with "Broker execution identity conflicts" before any payload validation, so the assertion checks status 400 plus the identity-conflict text instead of a digest mention that can never occur. * test(managed-agent): pin the arm-3 oracle to the placement/replay refusal layer Since the upstream merge, ToolPublicationStore.applyLocked() runs lockPublicationPlacement before lockOriginal, so a forged-digest replay of the captured OPEN reserve is refused at the placement check — "Reservation replay conflicts", comparing the replayed binding digest against the persisted row — before any identity or payload validation. The wire oracle is repointed to that layer (status 400 plus the reservation-replay-conflict message); the driver comment, the gate javadoc and the reviewer plan wording follow the layer that actually answers. * test(managed-agent): make the probe-turn verdict terminal instead of wall-clock driveProbeTurn's completed path latched from an initial 'completed' with no terminal-state check: after the two threshold exits, the fall-through waited for !hasActivePrompt but never verified the turn ended as a completion — a store request that hung got the daemon to fail the turn, and the driver journaled HOSTED_WEDGE_ABSENT green beside the wedged probe's evidence. The threshold path now returns 'wedged' only when the turn is still active past its budget; otherwise it breaks the polling loop and the transcript gate decides. The completed path now requires exactly one turn_complete for its promptId on both the threshold exit and the post-deadline fall-through, mirroring the recovery path's own assertion. A roster-witness pin in hosted-relay-headers.test.ts keeps that gate pinned inside the driver's completed path; removing it must turn the relay test red. * test(managed-agent): widen the wedge wait, wipe evidence per run and correct gate attribution - The post-clear driver wait rises from 300 s to 600 s: the driver's own post-clear budget runs to roughly 510 s (two sequential 240 s windows plus a 30 s transcript fetch), so a legitimate A2 recovery inside it would see the intended AssertionError('A2 REGRESSION: ...') route through an opaque driver timeout, with Files.copy(driver-final.log) skipped by the finally that also destroys the driver. - Both admission gates wipe their own evidence subtree right after Files.createDirectories: runs share the fixed target/wedge-evidence directory, so an earlier wedged run's artifacts otherwise survive into a later green run's bundle, and node-reports/ accumulates its SIGUSR2 dumps across runs forever. - HostedBackgroundPublicationGate's javadoc no longer credits this PR with the H3 family admission: #13789 landed that at the merge base, and requireCheckpoint already allowed the monitor family there; this witness's own delta is PUBLISHABLE_TOOL_NAMES, boundedIntField and the shared payloadVectors corpus. The monitor arm's closing claim re-points at the store-side checkpoint gate reading the same constant. * ci(sdk-java): collect the hosted admission gates with a hosted-gates roster family The hosted-harness-gates profile from this PR's round-2 merges matched no automated lane: surefire defaults skip *Gate.java, no workflow referenced the profile, and check-failsafe-reports had no roster mode for it — every lane stayed green without ever executing the witnesses. Wire it the way -Po4-mysql-gates is wired: - A new 'Verify Hosted admission gates' step in the Hosted process fault gates job, after that lane's report upload so its clean cannot discard the hosted lane's already-uploaded failsafe reports and fg7-cases evidence, with a 50 minute ceiling above the profile's 2400 s shared fork budget plus the wrapped compile/surefire/checkstyle work, and a matching 'Check that every Hosted admission gate class ran' roster step through a new hosted-gates family (/^Hosted.*Gate$/). - check-failsafe-reports.js registers the family beside the o4 modes with its usage string updated; Hosted*Gate classes stay out of both existing 'hosted' / 'non-hosted' families. - scripts/tests/check-failsafe-reports.test.js gains the new family's happy/outside-family/ran-no-test pins, and the upper bound in scripts/tests/hosted-process-ci.test.js moves from (145, 158, 160) to (195, 208, 210) for the added step. * test(integration): bind the completed-path sentinel to driveProbeTurn's transcript gate doudouOUC's verified mutation on dbId 4255682183 showed the R3-18 sentinel stayed green after removing the completed-path transcript gate: the slice started at the first 'const transcript = await daemon.json(', so with the gate deleted indexOf slid forward into wedgeEvidence, whose predicates are byte-identical. Bound the inspected source to driveProbeTurn, ending before wedgeEvidence, so removing the gate now turns the sentinel red. Verified both directions at this head: 4/4 pass unmutated; deleting the gate fails the first toContain on '/transcript?cursor=0&limit=256'; wedgeEvidence's fallback predicate supply is unreachable after slicing. * test(sdk-java): refuse evidence wipe roots outside the module target yiliang114's P3 (dbId 4256822620) on the wedge gate's recursive wipe: the resolved evidence root comes straight from -Dqwen.wedge.evidence and was recursively cleared with no containment check, so a local run pointed at a shared directory would delete unrelated content there. Both Hosted*Gate classes now assert the normalized evidence path stays under the module target/ before any recursive wipe, in the same assertion style the file already uses for its wrapper paths. Verified both directions on this head: with the property pointed outside target/, HostedRecoveryWedgeGate and HostedBackgroundPublicationGate fail in under a second at the new assertion and seeded sentinel files outside survive; with the default target/wedge-evidence path both gates proceed past the guard and fail only later at the intended MySQL stage (Druid/Flyway communications link failure against a dead port), leaving target/wedge-evidence/{wedge,publication} created. --------- Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> Co-authored-by: 易良 <1204183885@qq.com> |
||
|---|---|---|
| .. | ||
| chat-transcript-contract.ts | ||
| daemon-process.ts | ||
| gated-skill-fixture.ts | ||
| hosted-broker-reply-loss-driver.ts | ||
| hosted-cancellation-driver.ts | ||
| hosted-channel-fault-driver.ts | ||
| hosted-file-read-gate.mjs | ||
| hosted-harness-process.ts | ||
| hosted-latency-baseline.ts | ||
| hosted-latency-driver.ts | ||
| hosted-operator-recovery-driver.ts | ||
| hosted-process-crash-driver.ts | ||
| hosted-provider-control-driver.ts | ||
| hosted-recovery-blocked-wedge-driver.ts | ||
| hosted-relay-headers.test.ts | ||
| hosted-relay-headers.ts | ||
| hosted-session-store.ts | ||
| hosted-shell-output-driver.ts | ||
| hosted-shell-result-reader.ts | ||
| hosted-sse-gap-driver.ts | ||
| hosted-store-failure-driver.ts | ||
| hosted-workspace-tool-turn-driver.ts | ||