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
8 changes: 6 additions & 2 deletions .github/fork-seams.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"//": "Upstream files with fork lines, and every line the fork may add to each (indentation and blank lines ignored). Checked by .github/scripts/fork-seam-check.cjs against the base branch's copy of this file; see docs/fork/updates.md. A new line is first announced in its entry (\"announced\": {\"since\": day, \"added\": [lines]}), then added by a later pull request that moves it to \"added\" (docs/fork/updates.md, Adding a seam line).",
"files": {
"packages/contracts/src/settings.ts": {
"why": "Fork settings live in forkSettings.ts; settings.ts takes them with one spread per struct. automaticUpdates stays inline: upstream's pending setting has the same name and place.",
"why": "Fork settings live in forkSettings.ts; settings.ts takes them with one spread per struct (the client settings patch's spread is announced for the calm sidebar's toggle, which saves the first client fork setting). automaticUpdates stays inline: upstream's pending setting has the same name and place.",
"added": [
"import * as ForkSettings from \"./forkSettings.ts\";",
"export * from \"./forkSettings.ts\";",
Expand All @@ -19,7 +19,11 @@
"*/",
"automaticUpdates: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),",
"automaticUpdates: Schema.optionalKey(Schema.Boolean),"
]
],
"announced": {
"since": "2026-11-22",
"added": ["...ForkSettings.ForkClientSettingsPatchFields,"]
}
},
"packages/shared/src/serverSettings.ts": {
"why": "A settings patch's fork fields are applied by forkSettingsPatch.ts, by the rules in forkSettings.ts.",
Expand Down
1 change: 1 addition & 0 deletions FORK_CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ setting is missing here or a setting named here does not exist.
| Run records: one line per agent run that ends (model, effort, role, kind, estimate, times, end status, provider-reported tokens) in `<stateDir>/run-records/runs.jsonl`, append-only, and a weekly summary command. | Later choices of model, effort and task size need what earlier runs cost and took. | none | always (writes only its own files) | [#588](https://github.com/scuttletoby/t3code/pull/588) |
| Model policy: the setting for which models (and efforts) agents may pick, per provider driver: off, advise or enforce, and the allowed rows. The server checks an agent's pick (`delegate_task`, `create_threads`, `t3_thread_launch`, `t3_thread_configure`, here, and both before and after it goes to linked machines): a model in no row, a call that names no model, or an effort off its row is refused in enforce, only noted in advise. A person's own pick is never refused; Settings marks one outside the rows. A bad hand edit, or a settings file that does not parse, refuses every agent pick (a warning if the value says advise). Settings offers the fork's start rows (Opus 5.5 and Fable 5.2) while none are saved. While it is on, a child whose call names its model keeps only the options it names. | Agents should use the models the person chose for each kind of work. | `server.modelPolicy` | off | [#268](https://github.com/scuttletoby/t3code/pull/268), [#731](https://github.com/scuttletoby/t3code/issues/731) |
| Placement, part 1: the settings only. `placement` (off, advise or enforce; this machine's labels, an optional facts command, label groups that must never meet on one machine, and a weight per linked machine) and `placementNeeds` (labels a project's work needs). Person-only; a bad `placement` reads as off and a bad `placementNeeds` fits no machine, each kept as written. Nothing reads them yet. | Delegated work should go to a machine that has what it needs, and never where it must not run. | `server.placement`, `server.placementNeeds`, `projectOverride.placementNeeds` | off | [#134](https://github.com/scuttletoby/t3code/issues/134) |
| Calm sidebar, part 1: the settings. `threadRoles` names the assistant thread and one orchestrator per project; the server refuses a role for a thread that is missing, deleted, a sub-agent, a side chat, delegated from a linked machine or in another project. `calmSidebarEnabled` is the per-device switch. Nothing shows them yet. | A short sidebar: the threads that matter on top, the rest folded. | `server.threadRoles`, `client.calmSidebarEnabled` | off | [#928](https://github.com/scuttletoby/t3code/pull/928) |

## Repository, CI and releases

Expand Down
9 changes: 5 additions & 4 deletions apps/server/src/fork/forkLayers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import * as PullRequestWatchSlot from "./pullRequestWatchSlot.ts";
import * as RemoteTaskPrompts from "./remoteTaskPrompts.ts";
import * as RemoteTaskPromptWakes from "./remoteTaskPromptWakes.ts";
import * as RunRecorder from "./runRecords/RunRecorder.ts";
import * as ThreadRoleTargets from "./threadRoleTargetsLayer.ts";
import * as WorkerWakeSlots from "./workerWakeSlots.ts";

/**
Expand All @@ -47,10 +48,9 @@ export const holdWorkCloudLink = <E, R, ROut2, E2, R2>(
) => HoldWorkConnect.layer(cloudLinkLayer).pipe(Layer.provideMerge(reachabilityLayer));

/**
* In the runtime's core dependencies (server.ts's `layerRuntimeCoreDependenciesBase`, not its local
* `layerRuntimeServices`): usage pacer (and its history), slot gate, usage refresher, the handoff
* service (fork/handoff), which upstream's own `mergeAll` builds concurrently beside its idle
* compaction worker, the run records follower (fork/runRecords) and the delegated result reminder.
* In server.ts's `layerRuntimeCoreDependenciesBase`: usage pacer and history, slot gate, usage
* refresher, handoff service (built beside upstream's idle compaction worker), run records, result
* reminder, and the `threadRoles` save check's thread lookup, which every settings write reaches.
*/
export const layerRuntimeServices = Layer.mergeAll(
UsagePacer.layer.pipe(Layer.provideMerge(UsageReadingsHistory.layer)),
Expand All @@ -59,6 +59,7 @@ export const layerRuntimeServices = Layer.mergeAll(
HandoffService.layer,
RunRecorder.layer,
DelegatedResultReminder.layer,
ThreadRoleTargets.layer,
);

/**
Expand Down
34 changes: 17 additions & 17 deletions apps/server/src/fork/serverSettingsWriteCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ import {
import * as HostProcess from "@t3tools/shared/HostProcess";
import { Effect } from "effect";

import { threadRolesSaveProblem } from "./threadRoleTargets.ts";

/** Fails when saving `next` over `current` would bring in a fork setting or interval that cannot apply. */
export function check(
export const check = Effect.fn("ForkSettingsWrite.check")(function* (
current: ServerSettings,
next: ServerSettings,
settingsPath: string,
): Effect.Effect<void, ServerSettingsError> {
return Effect.flatMap(HostProcess.Platform, (platform) => {
const problem =
forkSettingsWriteProblem(current, next) ??
playtestProgramProblem(current, next, platform) ??
placementFactsCommandSaveProblem(current, next, platform);
return problem === undefined
? Effect.void
: Effect.fail(
new ServerSettingsError({
settingsPath,
operation: "normalize",
cause: new ForkSettingsWriteError({ problem }),
}),
);
) {
const platform = yield* HostProcess.Platform;
const problem =
forkSettingsWriteProblem(current, next) ??
playtestProgramProblem(current, next, platform) ??
placementFactsCommandSaveProblem(current, next, platform) ??
// Reads the threads a new role pointer names, so it runs last (fork/threadRoleTargets.ts).
(yield* threadRolesSaveProblem(current, next));
if (problem === undefined) return;
return yield* new ServerSettingsError({
settingsPath,
operation: "normalize",
cause: new ForkSettingsWriteError({ problem }),
});
}
});

/** `update`, then {@link check} on what it returns. */
export const withCheck =
Expand Down
Loading
Loading