@jungjaehoon/mama-os 0.30.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/gateway-tool-executor.d.ts +2 -1
- package/dist/agent/gateway-tool-executor.d.ts.map +1 -1
- package/dist/agent/gateway-tool-executor.js +86 -7
- package/dist/agent/gateway-tool-executor.js.map +1 -1
- package/dist/agent/gateway-tools.md +1 -1
- package/dist/agent/tool-registry.js +1 -1
- package/dist/agent/tool-registry.js.map +1 -1
- package/dist/api/operator-tasks-handler.d.ts.map +1 -1
- package/dist/api/operator-tasks-handler.js +2 -1
- package/dist/api/operator-tasks-handler.js.map +1 -1
- package/dist/cli/commands/start.d.ts +0 -13
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +88 -27
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/runtime/api-routes-init.d.ts.map +1 -1
- package/dist/cli/runtime/api-routes-init.js +19 -3
- package/dist/cli/runtime/api-routes-init.js.map +1 -1
- package/dist/cli/runtime/gateway-wiring.d.ts.map +1 -1
- package/dist/cli/runtime/gateway-wiring.js +17 -0
- package/dist/cli/runtime/gateway-wiring.js.map +1 -1
- package/dist/db/migrations/operator-task-temporal.d.ts.map +1 -1
- package/dist/db/migrations/operator-task-temporal.js +5 -0
- package/dist/db/migrations/operator-task-temporal.js.map +1 -1
- package/dist/evidence/effects.d.ts +18 -2
- package/dist/evidence/effects.d.ts.map +1 -1
- package/dist/evidence/effects.js +76 -7
- package/dist/evidence/effects.js.map +1 -1
- package/dist/operator/changes-projection.d.ts +2 -0
- package/dist/operator/changes-projection.d.ts.map +1 -1
- package/dist/operator/changes-projection.js +1 -0
- package/dist/operator/changes-projection.js.map +1 -1
- package/dist/operator/conductor.d.ts +1 -0
- package/dist/operator/conductor.d.ts.map +1 -1
- package/dist/operator/conductor.js +6 -0
- package/dist/operator/conductor.js.map +1 -1
- package/dist/operator/leg-cadence.d.ts +72 -0
- package/dist/operator/leg-cadence.d.ts.map +1 -0
- package/dist/operator/leg-cadence.js +122 -0
- package/dist/operator/leg-cadence.js.map +1 -0
- package/dist/operator/operator-trigger-loop.d.ts.map +1 -1
- package/dist/operator/operator-trigger-loop.js +2 -0
- package/dist/operator/operator-trigger-loop.js.map +1 -1
- package/dist/operator/task-ledger.d.ts +7 -0
- package/dist/operator/task-ledger.d.ts.map +1 -1
- package/dist/operator/task-ledger.js +16 -8
- package/dist/operator/task-ledger.js.map +1 -1
- package/dist/operator/temporal-effect.d.ts +3 -0
- package/dist/operator/temporal-effect.d.ts.map +1 -1
- package/dist/operator/temporal-effect.js.map +1 -1
- package/dist/operator/workorder-consumer.d.ts +2 -0
- package/dist/operator/workorder-consumer.d.ts.map +1 -1
- package/dist/operator/workorder-consumer.js +6 -3
- package/dist/operator/workorder-consumer.js.map +1 -1
- package/dist/operator/workorder-publishers.d.ts +7 -0
- package/dist/operator/workorder-publishers.d.ts.map +1 -1
- package/dist/operator/workorder-publishers.js +15 -0
- package/dist/operator/workorder-publishers.js.map +1 -1
- package/dist/scheduler/heartbeat.d.ts +8 -0
- package/dist/scheduler/heartbeat.d.ts.map +1 -1
- package/dist/scheduler/heartbeat.js +12 -0
- package/dist/scheduler/heartbeat.js.map +1 -1
- package/package.json +2 -2
- package/scripts/crack-failure-digests.ts +55 -0
|
@@ -121,7 +121,7 @@ export declare class GatewayToolExecutor {
|
|
|
121
121
|
reason?: string;
|
|
122
122
|
}): void;
|
|
123
123
|
/** Forwarder hook for owner-issued workorders (Stage-2 S2-T4; enqueue+ack only). */
|
|
124
|
-
setWorkOrderRequestHandler(fn: (kind: 'board' | 'wiki' | 'memory-curation') => {
|
|
124
|
+
setWorkOrderRequestHandler(fn: (kind: 'board' | 'wiki' | 'memory-curation', causeEventIds?: readonly string[]) => {
|
|
125
125
|
accepted: boolean;
|
|
126
126
|
reason?: string;
|
|
127
127
|
}): void;
|
|
@@ -187,6 +187,7 @@ export declare class GatewayToolExecutor {
|
|
|
187
187
|
private beginTraceIfNeeded;
|
|
188
188
|
private requireTraceApi;
|
|
189
189
|
private appendToolTraceIfNeeded;
|
|
190
|
+
private extractFailureCode;
|
|
190
191
|
private summarizeToolTraceOutput;
|
|
191
192
|
private completeDirectModelRunIfNeeded;
|
|
192
193
|
private failDirectModelRunIfNeeded;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-tool-executor.d.ts","sourceRoot":"","sources":["../../src/agent/gateway-tool-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA2BH,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EAcjB,0BAA0B,EAG1B,eAAe,EACf,YAAY,EAIZ,2BAA2B,EAE3B,kBAAkB,EAClB,cAAc,EAGf,MAAM,YAAY,CAAC;AAkBpB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAInD,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAwB,MAAM,4BAA4B,CAAC;AAqG1F,KAAK,uBAAuB,GAAG,2BAA2B,CAAC;AAC3D,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA4RF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,I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AAO,CAAC,eAAe;YA2BT,uBAAuB;IA6BrC,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,wBAAwB;YAWlB,8BAA8B;YAgB9B,0BAA0B;IAYxC,OAAO,CAAC,uBAAuB;IAuC/B,OAAO,CAAC,wBAAwB;IAwBhC,OAAO,CAAC,mCAAmC;IAe3C,OAAO,CAAC,uBAAuB;IA6D/B,OAAO,CAAC,+BAA+B;YAiCzB,8BAA8B;IAqF5C,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,yBAAyB;IAkBjC,OAAO,CAAC,kBAAkB;IAoD1B,OAAO,CAAC,kBAAkB;YA+BZ,iCAAiC;IAy8B/C;;;OAGG;YACW,WAAW;IAoDzB;;;OAGG;YACW,YAAY;IA2C1B;;OAEG;YACW,WAAW;IAiKzB;;;OAGG;YACW,kBAAkB;IAkChC;;OAEG;YACW,gBAAgB;IA8B9B;;OAEG;YACW,mBAAmB;IAqGjC;;;OAGG;YACW,gBAAgB;IAkC9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAoDzB;;;;;OAKG;YACW,kBAAkB;IA2EhC;;;;;;OAMG;IACH,OAAO,CAAC,UAAU,CAAsD;IACxE,OAAO,CAAC,uBAAuB;IAsE/B;;OAEG;YACW,eAAe;YAqDf,cAAc;IAqG5B;;;;;;;;;;;OAWG;YACW,oBAAoB;YA2FpB,gBAAgB;IAoC9B,MAAM,CAAC,aAAa,IAAI,eAAe,EAAE;IAIzC;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,IAAI,eAAe;YAInD,oBAAoB;CAqHnC"}
|
|
@@ -1064,8 +1064,27 @@ class GatewayToolExecutor {
|
|
|
1064
1064
|
execution_status: error || result?.success === false ? 'failed' : 'completed',
|
|
1065
1065
|
duration_ms: durationMs,
|
|
1066
1066
|
envelope_hash: ctx.envelope?.envelope_hash ?? null,
|
|
1067
|
+
// The thrower's closed cause survives sanitization (the sanitizer
|
|
1068
|
+
// preserves `code`); the trace was the one place that dropped it,
|
|
1069
|
+
// leaving only sha256 digests. Carried, never invented: no code = NULL.
|
|
1070
|
+
failure_code: this.extractFailureCode(result, error),
|
|
1067
1071
|
});
|
|
1068
1072
|
}
|
|
1073
|
+
extractFailureCode(result, error) {
|
|
1074
|
+
const candidate = error instanceof types_js_1.AgentError && typeof error.code === 'string'
|
|
1075
|
+
? error.code
|
|
1076
|
+
: result?.code;
|
|
1077
|
+
if (typeof candidate !== 'string') {
|
|
1078
|
+
return null;
|
|
1079
|
+
}
|
|
1080
|
+
// Carried, never invented - and never diluted: TOOL_ERROR is transport,
|
|
1081
|
+
// not a cause (review: it would over-report as if it named something),
|
|
1082
|
+
// and only code-shaped values (bounded, identifier charset) may land.
|
|
1083
|
+
if (candidate === 'TOOL_ERROR' || !/^[A-Za-z0-9_.:-]{1,64}$/.test(candidate)) {
|
|
1084
|
+
return null;
|
|
1085
|
+
}
|
|
1086
|
+
return candidate;
|
|
1087
|
+
}
|
|
1069
1088
|
summarizeToolTraceOutput(result, error) {
|
|
1070
1089
|
if (error) {
|
|
1071
1090
|
return (error instanceof Error ? error.message : String(error)).slice(0, 200);
|
|
@@ -1687,7 +1706,10 @@ class GatewayToolExecutor {
|
|
|
1687
1706
|
error: 'The workorder request handler is not wired on this deployment (boot-order fault).',
|
|
1688
1707
|
};
|
|
1689
1708
|
}
|
|
1690
|
-
|
|
1709
|
+
// The batch rides from HOST execution state, never from tool input -
|
|
1710
|
+
// an agent-supplied cause is forgeable (S2 review #14). Conductor
|
|
1711
|
+
// runs carry their inbox batch here; chat runs carry nothing.
|
|
1712
|
+
const enqueued = this.workOrderRequestHandler(requestedKind, this.getExecutionState().causeEventIds);
|
|
1691
1713
|
if (!enqueued.accepted) {
|
|
1692
1714
|
return {
|
|
1693
1715
|
success: false,
|
|
@@ -1998,6 +2020,7 @@ class GatewayToolExecutor {
|
|
|
1998
2020
|
this.taskLedger.create(input, {
|
|
1999
2021
|
runId: this.getExecutionState().modelRunId ?? null,
|
|
2000
2022
|
causeEventIds: this.getExecutionState().causeEventIds,
|
|
2023
|
+
causeKind: this.getExecutionState().source === 'operator' ? 'clock' : 'owner_message',
|
|
2001
2024
|
})),
|
|
2002
2025
|
};
|
|
2003
2026
|
}
|
|
@@ -2017,6 +2040,7 @@ class GatewayToolExecutor {
|
|
|
2017
2040
|
// was given, and the system knew that before the run began - so there is
|
|
2018
2041
|
// nothing to ask the agent for.
|
|
2019
2042
|
causeEventIds: this.getExecutionState().causeEventIds,
|
|
2043
|
+
causeKind: this.getExecutionState().source === 'operator' ? 'clock' : 'owner_message',
|
|
2020
2044
|
});
|
|
2021
2045
|
return { success: true, task: serializeTaskToolRecord(updated) };
|
|
2022
2046
|
}
|
|
@@ -2030,7 +2054,7 @@ class GatewayToolExecutor {
|
|
|
2030
2054
|
}
|
|
2031
2055
|
const contextPacketId = input.context_packet_id;
|
|
2032
2056
|
if (typeof contextPacketId !== 'string' || contextPacketId.trim().length === 0) {
|
|
2033
|
-
throw new types_js_1.AgentError('task_temporal_reconcile requires a
|
|
2057
|
+
throw new types_js_1.AgentError('task_temporal_reconcile requires a context_packet_id', 'TOOL_ERROR', undefined, false);
|
|
2034
2058
|
}
|
|
2035
2059
|
const executionState = this.getExecutionState();
|
|
2036
2060
|
if (!executionState.envelope || !executionState.modelRunId) {
|
|
@@ -2045,14 +2069,25 @@ class GatewayToolExecutor {
|
|
|
2045
2069
|
throw new types_js_1.AgentError('task_temporal_reconcile context packet is unavailable', 'TOOL_ERROR', undefined, false);
|
|
2046
2070
|
}
|
|
2047
2071
|
const attempt = this.taskLedger.inspectTemporalAttempt(context.attemptId);
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2072
|
+
// (a) freshness: a RECEIPT, not a gate (S2 disposition - measured
|
|
2073
|
+
// ZERO live rejections; staleness is evidence quality, not
|
|
2074
|
+
// authorization). Recorded on the receipt, loud when stale.
|
|
2075
|
+
const packetCreatedAt = Number.isSafeInteger(packet.created_at)
|
|
2076
|
+
? packet.created_at
|
|
2077
|
+
: null;
|
|
2078
|
+
if (packetCreatedAt === null || packetCreatedAt < attempt.workOrder.updatedAt) {
|
|
2079
|
+
// console.error, not securityLogger.warn: the default log level
|
|
2080
|
+
// hides warns, and a silent staleness signal is no signal.
|
|
2081
|
+
console.error('[temporal] context packet predates the active attempt', {
|
|
2082
|
+
attemptId: context.attemptId,
|
|
2083
|
+
packetCreatedAt,
|
|
2084
|
+
attemptUpdatedAt: attempt.workOrder.updatedAt,
|
|
2085
|
+
});
|
|
2051
2086
|
}
|
|
2052
2087
|
const effectInput = input;
|
|
2053
2088
|
if (effectInput.outcome !== 'deferred' &&
|
|
2054
2089
|
(!Array.isArray(packet.source_refs) || packet.source_refs.length === 0)) {
|
|
2055
|
-
throw new types_js_1.AgentError('task_temporal_reconcile requires source-backed
|
|
2090
|
+
throw new types_js_1.AgentError('task_temporal_reconcile requires source-backed evidence', 'TOOL_ERROR', undefined, false);
|
|
2056
2091
|
}
|
|
2057
2092
|
if (!packet.task.startsWith(`${temporalContextPacketBinding(context)}\n`) ||
|
|
2058
2093
|
(effectInput.outcome === 'deferred'
|
|
@@ -2065,6 +2100,7 @@ class GatewayToolExecutor {
|
|
|
2065
2100
|
const evidence = {
|
|
2066
2101
|
contextPacketId,
|
|
2067
2102
|
contextPacketSha256: (0, crypto_1.createHash)('sha256').update(packet.packet_json).digest('hex'),
|
|
2103
|
+
packetCreatedAt,
|
|
2068
2104
|
};
|
|
2069
2105
|
const { context_packet_id: _contextPacketId, ...trustedEffectInput } = effectInput;
|
|
2070
2106
|
return {
|
|
@@ -3007,9 +3043,52 @@ class GatewayToolExecutor {
|
|
|
3007
3043
|
}
|
|
3008
3044
|
try {
|
|
3009
3045
|
const temporalContext = ctx.temporalWorkContext;
|
|
3010
|
-
|
|
3046
|
+
let effectiveInput = temporalContext
|
|
3011
3047
|
? { ...input, task: bindTemporalContextPacketTask(temporalContext, input.task) }
|
|
3012
3048
|
: input;
|
|
3049
|
+
// (d)-by-construction (S2 measurement: 94% of reconcile rejections were
|
|
3050
|
+
// packets carrying only recalled memories). The HOST knows the bound
|
|
3051
|
+
// source - the task row holds it raw; the context carries only hashes -
|
|
3052
|
+
// so the host seeds the compile with it. Same doctrine as the binding
|
|
3053
|
+
// prefix and causeEventIds: the agent never restates what the host knows.
|
|
3054
|
+
if (temporalContext && this.taskLedger) {
|
|
3055
|
+
const boundTask = this.taskLedger.getById(temporalContext.taskId);
|
|
3056
|
+
const rawChannel = boundTask?.sourceChannel ?? null;
|
|
3057
|
+
// Trimmed: a whitespace-only event id is truthy but fails ref
|
|
3058
|
+
// normalization downstream - which would fail the WHOLE compile,
|
|
3059
|
+
// exactly what "strictly additive" forbids.
|
|
3060
|
+
const rawEventId = boundTask?.sourceEventId?.trim() || null;
|
|
3061
|
+
const sep = rawChannel ? rawChannel.indexOf(':') : -1;
|
|
3062
|
+
const seedConnector = rawChannel && sep > 0 ? rawChannel.slice(0, sep) : null;
|
|
3063
|
+
const seedChannelId = rawChannel && sep > 0 ? rawChannel.slice(sep + 1) : null;
|
|
3064
|
+
// STRICTLY ADDITIVE (review: an out-of-boundary host seed turned a
|
|
3065
|
+
// weak-but-succeeding compile into a permanent failure the agent
|
|
3066
|
+
// cannot remove). Inject only a well-formed channel whose connector
|
|
3067
|
+
// the run's envelope actually grants - otherwise compile proceeds
|
|
3068
|
+
// exactly as before.
|
|
3069
|
+
const envelopeGrantsSeed = seedConnector !== null &&
|
|
3070
|
+
seedChannelId !== null &&
|
|
3071
|
+
seedChannelId.length > 0 &&
|
|
3072
|
+
(ctx.envelope?.scope.raw_connectors ?? []).includes(seedConnector);
|
|
3073
|
+
if (rawChannel && rawEventId && envelopeGrantsSeed) {
|
|
3074
|
+
const boundSeed = {
|
|
3075
|
+
kind: 'raw',
|
|
3076
|
+
raw_id: rawEventId,
|
|
3077
|
+
connector: seedConnector,
|
|
3078
|
+
channel_id: seedChannelId,
|
|
3079
|
+
};
|
|
3080
|
+
const existingSeeds = Array.isArray(effectiveInput.seed_refs)
|
|
3081
|
+
? effectiveInput.seed_refs
|
|
3082
|
+
: [];
|
|
3083
|
+
const alreadySeeded = existingSeeds.some((ref) => typeof ref === 'object' &&
|
|
3084
|
+
ref !== null &&
|
|
3085
|
+
ref.kind === 'raw' &&
|
|
3086
|
+
ref.raw_id === rawEventId);
|
|
3087
|
+
if (!alreadySeeded) {
|
|
3088
|
+
effectiveInput = { ...effectiveInput, seed_refs: [...existingSeeds, boundSeed] };
|
|
3089
|
+
}
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3013
3092
|
const result = await this.contextCompileService.compileAndPersistContext({
|
|
3014
3093
|
caller: 'gateway',
|
|
3015
3094
|
envelope: ctx.envelope,
|