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
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ ALTEROID_DATABASE_URL=postgres://alteroid:<openssl rand -hex 16 の値>@db:5432/
# alteroid credential set TZ --scope app --no-secret
# docker compose exec app alteroid credential list
#
# 播種される8つ(既定値): `TZ`(Asia/Tokyo)/ `ALTEROID_DAILY_REPORT_AT`
# 播種される9つ(既定値): `TZ`(Asia/Tokyo)/ `ALTEROID_DAILY_REPORT_AT`
# (22:00)/ `ALTEROID_INITIATIVE_EVERY`(55)/ `ALTEROID_ACCESS_TOKEN_TTL_DAYS`
# (30)/ `ALTEROID_WITHHELD_REPORT_FLUSH_MS`(1800000)/
# `ALTEROID_INBOX_SETTLE_MS`(2500)/
# `ALTEROID_INBOX_SETTLE_MS`(2500)/ `ALTEROID_REPORT_SETTLE_MS`(30000)/
# `ALTEROID_MEMORY_TIDY_AT`(03:00)/ `ALTEROID_REPORT_LOOKBACK_DAYS`(3)。
#
# ⚠️ **次の5つだけはこの仕組みに乗らない——正本は器の生の環境変数だけである。**
Expand Down Expand Up @@ -146,7 +146,7 @@ ALTEROID_DATABASE_URL=postgres://alteroid:<openssl rand -hex 16 の値>@db:5432/
# 退避済み生ログ(archive)の古い写しを自動で畳む(tombstone する)周期・分
# (issue #698)。既定は `apps/daemon/src/archive-folder.ts` の
# `DEFAULT_ARCHIVE_FOLD_EVERY_MINUTES`。`off` / `none` / `false` / `0` で止まる。
# ⚠️ **この変数は「播種される7つ」(上の説明)には含まれない** —— DB 正本の
# ⚠️ **この変数は「播種される9つ」(上の説明)には含まれない** —— DB 正本の
# 環境変数の袋に播種せず、走行中に `alteroid credential set` で直すことも
# できない。直すには器を焼き直す必要がある。
#ALTEROID_ARCHIVE_FOLD_EVERY=60
Expand Down
7 changes: 7 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ x-shared-env: &shared-env
# (人間の発言・許可確認・質問などは待たない)。0 で無効。**未設定なら既定を使う**——
# 空・空白・範囲外(0〜10000 の外)は既定へ倒れる(`resolveInboxSettleMs` の doc)。
ALTEROID_INBOX_SETTLE_MS: ${ALTEROID_INBOX_SETTLE_MS:-}
# `packages/core/src/clone.ts` の `REPORT_SETTLE_MS`(既定30秒。固定窓)を差し替える。暇なときに
# 最初に届いたマネージャーの報告だけ、先頭の報告が着いてからこの間だけ待って続く報告と1ターンに束ねる
# (人間の発言・許可確認・質問は待たない。待ちの途中に報告以外の合図〔人間・質問・許可確認・失敗の知らせ・
# 外部の合図・tick・蒸留〕が届けば窓を打ち切る)。外部の合図そのものの待ちは上の
# `ALTEROID_INBOX_SETTLE_MS` のまま。0 で無効。**未設定なら既定を使う**——
# 空・空白・範囲外(0〜120000 の外)は既定へ倒れる(`resolveReportSettleMs` の doc)。
ALTEROID_REPORT_SETTLE_MS: ${ALTEROID_REPORT_SETTLE_MS:-}
# 退避済み生ログの古い写しを自動で畳む周期(分)。issue #698。**未設定なら
# 既定を使う**(`apps/daemon/src/archive-folder.ts` の
# `DEFAULT_ARCHIVE_FOLD_EVERY_MINUTES`)——空・空白は分数として読めずに
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/app-env-var-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const APP_ENV_VAR_DEFAULTS: readonly { name: string; value: string }[] =
{ name: 'ALTEROID_ACCESS_TOKEN_TTL_DAYS', value: '30' },
{ name: 'ALTEROID_WITHHELD_REPORT_FLUSH_MS', value: '1800000' },
{ name: 'ALTEROID_INBOX_SETTLE_MS', value: '2500' },
{ name: 'ALTEROID_REPORT_SETTLE_MS', value: '30000' },
{ name: 'ALTEROID_MEMORY_TIDY_AT', value: '03:00' },
{ name: 'ALTEROID_REPORT_LOOKBACK_DAYS', value: '3' },
];
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/clone-digest-session-delta.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ function boot(script: SdkScript = {}): Boot {
...(script.unavailableDriver === true ? { driver: unavailableDriver } : { queryFn: fn }),
env: {},
inboxSettleMs: 0,
reportSettleMs: 0,
redeliveryGate: ALWAYS_REDELIVER,
runners: createRunnerRegistry([
createLocalRunner({ workspacePath: '/work', queryFn: fn, env: {} }),
Expand Down Expand Up @@ -1047,6 +1048,7 @@ function bootWithHooks(): Boot & { fire: () => Promise<void> } {
queryFn: fn,
env: {},
inboxSettleMs: 0,
reportSettleMs: 0,
redeliveryGate: ALWAYS_REDELIVER,
runners: createRunnerRegistry([
createLocalRunner({ workspacePath: '/work', queryFn: fn, env: {} }),
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/clone-external-instruction-fold.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ function boot(script: SdkScript = {}): Boot {
queryFn: fn,
env: {},
inboxSettleMs: 0,
reportSettleMs: 0,
redeliveryGate: ALWAYS_REDELIVER,
runners: createRunnerRegistry([
createLocalRunner({ workspacePath: '/work', queryFn: fn, env: {} }),
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/clone-human-answer-fold.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ function boot(script: SdkScript = {}): Boot {
}) as unknown as typeof sdkQuery;

const clone = createClone({
reportSettleMs: 2500,
stores: createMemoryStores(),
queryFn: fn,
env: {},
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/clone-inbox-settle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import { captureStderr, humanMessage } from './testing.js';
// 偽の時計で進める(実時間の待ちを足さない: scripts/wallclock-waits-ratchet.test.ts)
// `waitFor` は実時間の setTimeout を使うので、ここでは使わず `advance` で時計を進めて確かめる
const SETTLE_MS = 2500;
const ON = { inboxSettleMs: SETTLE_MS };
const OFF = { inboxSettleMs: 0 };
// 報告の窓も 2.5 秒に固定する: 既定は 30 秒(`clone-report-settle.test.ts`)で、ここは 2.5 秒の窓そのものの振る舞いを測る(期待は変えていない)
const ON = { inboxSettleMs: SETTLE_MS, reportSettleMs: SETTLE_MS };
const OFF = { inboxSettleMs: 0, reportSettleMs: 0 };

const report = (id: string, text: string): InboxEvent => ({
type: 'manager_message',
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/clone-ledger-noise.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function boot(managers: ManagerPool) {
queryFn: fn,
env: {},
inboxSettleMs: 0,
reportSettleMs: 0,
managers,
redeliveryGate: ALWAYS_REDELIVER,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ describe('クローン — マネージャーの確認がいまも待たれて
const manager = fakeManagerSdk();
const { fn, calls } = fakeSdk(reply);
const clone = createClone({
reportSettleMs: 2500,
redeliveryGate: ALWAYS_REDELIVER,
stores: createMemoryStores(),
queryFn: fn,
Expand Down Expand Up @@ -274,6 +275,7 @@ describe('クローン — マネージャーの確認がいまも待たれて
};

const clone = createClone({
reportSettleMs: 2500,
redeliveryGate: ALWAYS_REDELIVER,
stores: createMemoryStores(),
queryFn: fn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function setupReportTurn(stores: Stores, inTurn: (context: ToolContext) => Promi
queryFn: fn,
env: {},
inboxSettleMs: 0,
reportSettleMs: 0,
mcpServerFactory: (context) => {
captured = context;
return createCloneMcpServer(context);
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/clone-manager-report-shown.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ function boot(script: Script = {}): Boot {
queryFn: fn,
env: {},
inboxSettleMs: 0,
reportSettleMs: 0,
redeliveryGate: ALWAYS_REDELIVER,
mcpServerFactory: (context) => {
captured = context;
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/clone-memory-update-fold.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ function boot(script: SdkScript = {}): Boot {

const stores = createMemoryStores();
const clone = createClone({
reportSettleMs: 2500,
stores,
queryFn: fn,
env: {},
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/clone-pump-redelivery-hitb-order.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ describe('Clone#pump — #noteRedeliveryPredicateHitB の位置(characterizati
return 'わかった';
});
const clone = createClone({
reportSettleMs: 2500,
redeliveryGate: ALWAYS_REDELIVER,
stores,
queryFn: fn,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/clone-quota-autoclose-5164.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function boot(managers: ManagerPool, stores: Stores = createMemoryStores()) {
queryFn: fn,
env: {},
inboxSettleMs: 0,
reportSettleMs: 0,
managers,
redeliveryGate: ALWAYS_REDELIVER,
});
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/clone-quota-recovered-fold.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ function boot(managers: ManagerPool) {
const { fn, calls } = fakeSdk();
const stores = createMemoryStores();
const clone: CloneHost = createClone({
reportSettleMs: 2500,
stores,
queryFn: fn,
env: {},
Expand Down Expand Up @@ -310,6 +311,7 @@ describe('戻った担当の5時間枠の知らせを、ターンを起こさず
});
const stores = createMemoryStores();
const clone = createClone({
reportSettleMs: 2500,
stores,
queryFn: fn,
env: {},
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/clone-quota-recovery-notice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function stubPool(list: () => Promise<ManagerSummary[]>): ManagerPool {
function boot(managers: ManagerPool, sdkOptions: Parameters<typeof fakeSdk>[1] = {}) {
const { fn, calls } = fakeSdk(undefined, sdkOptions);
const clone: CloneHost = createClone({
reportSettleMs: 2500,
stores: createMemoryStores(),
queryFn: fn,
env: {},
Expand Down Expand Up @@ -198,6 +199,7 @@ describe('枠で止まった知らせを配る直前に、担当の回復を添
turnIndex < 2 ? { subtype: 'error_during_execution', text: spendLimitMessage } : undefined,
});
const clone = createClone({
reportSettleMs: 2500,
stores: createMemoryStores(),
queryFn: fn,
env: {},
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/clone-recovered-notice-fold.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function boot(managers: ManagerPool) {
const { fn, calls } = fakeSdk();
const stores = createMemoryStores();
const clone: CloneHost = createClone({
reportSettleMs: 2500,
stores,
queryFn: fn,
env: {},
Expand Down
Loading
Loading