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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ This project follows pre-1.0 SemVer: minor versions may still include breaking c

### Fixed

- [fixed] A local goal on a model that reasons no longer stops after one model
call when the first reply runs out of output. The baseline restart that
follows asks for a strategy, a JSON answer of about 100 tokens under a
192-token limit, and the model's reasoning used up that limit every time:
14 of 14 strategy calls across four runs of 20 exercises. Each of those
goals ended with the rest of its calls unused. The strategy call now sends
`think:false` when the profile's `think:false` calibration probes passed.
A strategy the model answered but that cannot be used, because it was cut
off, points outside the reviewed source or repeats an accepted one, no
longer ends the goal either: the restart edit runs from the original
source without it, and the receipt records the strategy as rejected.
- [fixed] The semantic index reads `.mjs`, `.cjs`, `.mts` and `.cts` files.
It could parse them but never collected them, so a project written as ES
modules had none of its own source in the index and a goal's first context
Expand Down
10 changes: 7 additions & 3 deletions docs/local-harness-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ is saved in a schema-2 digest-bound profile and reused for tool-call probes,
coding edits, and strategy requests. A profile in the runtime-default mode
whose probes returned thinking output is treated as a model that reasons:
its goals get the larger budget and the whole-file edits described in
[local-harness.md](local-harness.md). A profile saved by 0.27.1 or earlier
[local-harness.md](local-harness.md), and its restart strategy requests use
`think:false` when its `think:false` probes passed, because a strategy has a
192-token limit that reasoning uses up. A profile saved by 0.27.1 or earlier
keeps its mode, usually `think:false`, until `phonton models calibrate MODEL`
runs again. Older schema-1 profiles retain their
original runtime-default request behavior until recalibrated. Probe
Expand Down Expand Up @@ -304,8 +306,10 @@ controller can retry directly from the captured baseline without a strategy
call. A byte-identical repeated reply is resent once with seeded sampling,
and two successive repeats stop; mixed new-file and existing-file work keeps
its multi-call reserve.
The same mechanism can be tried at a different reviewed path or source span;
repeating it at the same target stops that branch.
The same mechanism can be tried at a different reviewed path or source span.
A strategy that repeats an accepted one at the same target, or that cannot be
used for another reason, is recorded as rejected, and the edit runs from the
captured baseline without it.
Module-style JS/TS files use complete parsed function spans where they fit, and
named failing-check evidence puts the relevant function first for the next edit.
Original Git staging has separate integrity evidence, with changes stopping the run.
Expand Down
12 changes: 10 additions & 2 deletions docs/local-harness.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@ took one model call per change. When the scope is one existing file of at most
100 lines and the model uses SearchReplace and reasons before it answers, the
first edit and every repair show that file whole and ask for the complete
corrected file in the whole-file JSON shape used for new files. A restart
keeps its span edit, anchored to the strategy's source span. For any model,
keeps its span edit, anchored to the strategy's source span when it has one.
For any model,
when a search/replace reply changes nothing and its file has at most 300
lines, the next edit from the same parent is a whole-file edit, once per
branch. Either way the whole-file edit runs only
Expand Down Expand Up @@ -699,7 +700,14 @@ existing parsers; it does not download an embedding model or call a remote servi
After an unchanged repair or repeated candidate, a baseline restart uses a separate
bounded model call to propose a strategy anchored to an exact reviewed source span.
The receipt keeps its raw reply, selected anchor, claimed difference, context and
token usage. A missing or repeated strategy stops that branch. The strategy
token usage. A reply that cannot be used (cut off at its output limit, outside
the reviewed paths and spans, a repeat of an accepted strategy at the same
target, or otherwise malformed) is recorded as rejected, and the edit then runs
from the original source without a strategy. A strategy call that fails, times
out or loses the resident model ends the search. On a model that reasons, the
strategy call sends `think:false` when the profile's `think:false` calibration
probes passed, because reasoning would use up its 192-token limit before the
answer. The strategy
and following edit each reserve one of the same `generations` model-attempt
budget, even if admission later stops a chat request; the
strategy is a proposal, and only the resulting candidate bytes and fixed checks
Expand Down
4 changes: 2 additions & 2 deletions phonton-local/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,7 @@ impl LocalRuntime {
saved.name = format!(
"{}: {}",
match thinking {
LocalThinkingMode::Off => "Think off",
LocalThinkingMode::Off => THINK_OFF_PROBE_PREFIX,
LocalThinkingMode::RuntimeDefault => "Runtime default",
},
saved.name
Expand Down Expand Up @@ -1467,7 +1467,7 @@ impl LocalRuntime {
)
.await?;
if default.creation_protocol.is_some() || off.edit_protocol.is_none() {
off.prefix_probes("Think off");
off.prefix_probes(THINK_OFF_PROBE_PREFIX);
off.probes.extend(default.probes);
default.probes = off.probes;
(LocalThinkingMode::RuntimeDefault, default)
Expand Down
21 changes: 21 additions & 0 deletions phonton-types/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ pub const DIFF_CREATION_PROBE_NAME: &str = "UnifiedDiff create";
/// output beside the answer. [`ModelProfile::reasons`] reads it back.
pub const THINKING_OUTPUT_NOTE: &str = " Runtime returned separate thinking output.";

/// Name prefix of the `think:false` probes that a profile saved in the
/// runtime-default mode keeps. [`ModelProfile::strategy_thinking`] reads it
/// back.
pub const THINK_OFF_PROBE_PREFIX: &str = "Think off";

/// Editing wire protocol demonstrated by a compatibility probe.
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
Expand Down Expand Up @@ -243,6 +248,22 @@ impl ModelProfile {
.any(|probe| probe.detail.contains(THINKING_OUTPUT_NOTE))
}

/// Thinking mode for a restart strategy: a JSON answer of about 100
/// tokens under a 192-token limit, which a model that reasons uses up
/// before it answers. Such a profile asks with `think:false` when one of
/// its `think:false` calibration probes passed; any other profile keeps
/// its own mode.
pub fn strategy_thinking(&self) -> LocalThinkingMode {
let off_answered = self.probes.iter().any(|probe| {
probe.name.starts_with(THINK_OFF_PROBE_PREFIX) && probe.status == CheckStatus::Passed
});
if self.reasons() && off_answered {
LocalThinkingMode::Off
} else {
self.thinking.unwrap_or_default()
}
}

/// Keep absent probes on older profiles distinct from measured success.
pub fn creation_status(&self) -> CheckStatus {
let name = match self.protocol {
Expand Down
Loading
Loading