@ouro.bot/cli 0.1.0-alpha.1086 → 0.1.0-alpha.1087
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/changelog.json +6 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/dist/heart/orientation-frame.js +9 -4
- package/dist/repertoire/guardrails.js +29 -3
- package/dist/repertoire/tools.js +3 -1
- package/dist/senses/pipeline.js +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.1087",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Owner's explicit asks are not refused: advisory correction hold for family; literal shell variables resolved"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.1086",
|
|
6
12
|
"changes": [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0"?>
|
|
2
2
|
<Container version="2">
|
|
3
3
|
<Name>ouro-butler</Name>
|
|
4
|
-
<Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.
|
|
4
|
+
<Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1087</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -162,6 +162,7 @@ function deriveSignals(currentUserSpeech, priorAssistantReferents, latestStructu
|
|
|
162
162
|
*/
|
|
163
163
|
const TERSE_CORRECTION_MAX_WORDS = 12;
|
|
164
164
|
const CORRECTION_HOLD_CLEARED_BY = "Resolve the referent (orientation_get lists the candidates) or restate the request as a standalone, correction-free instruction. The policy is recomputed from each user turn, so it never carries past this turn.";
|
|
165
|
+
const CORRECTION_HOLD_ADVISORY = "Advisory only: tools are not blocked. Read the referent first (orientation_get lists the candidates); if the request is clear, do it now without asking for confirmation. Ask only when two readings would lead to different actions.";
|
|
165
166
|
function countWords(text) {
|
|
166
167
|
return text.trim().split(/\s+/).filter(Boolean).length;
|
|
167
168
|
}
|
|
@@ -171,7 +172,7 @@ function correctionMarkerArmsHold(combinedSpeech, priorAssistantReferents, lates
|
|
|
171
172
|
// Long speech still holds when there is something concrete to disambiguate.
|
|
172
173
|
return priorAssistantReferents.length > 0 || Boolean(latestStructuredOutput);
|
|
173
174
|
}
|
|
174
|
-
function deriveActionPolicy(signals, combinedSpeech, priorAssistantReferents, latestStructuredOutput) {
|
|
175
|
+
function deriveActionPolicy(signals, combinedSpeech, priorAssistantReferents, latestStructuredOutput, familySpeaker) {
|
|
175
176
|
const holdSignals = signals.filter((signal) => signal !== "correction_marker"
|
|
176
177
|
|| correctionMarkerArmsHold(combinedSpeech, priorAssistantReferents, latestStructuredOutput));
|
|
177
178
|
if (holdSignals.length === 0)
|
|
@@ -186,7 +187,8 @@ function deriveActionPolicy(signals, combinedSpeech, priorAssistantReferents, la
|
|
|
186
187
|
: "Current user speech appears to correct or revise prior understanding; inspect orientation before mutating durable state.",
|
|
187
188
|
blockedMutationKinds: ["durable_state_write", "external_side_effect"],
|
|
188
189
|
...(triggeredBy ? { triggeredBy } : {}),
|
|
189
|
-
clearedBy: CORRECTION_HOLD_CLEARED_BY,
|
|
190
|
+
clearedBy: familySpeaker ? CORRECTION_HOLD_ADVISORY : CORRECTION_HOLD_CLEARED_BY,
|
|
191
|
+
...(familySpeaker ? { advisory: true } : {}),
|
|
190
192
|
};
|
|
191
193
|
}
|
|
192
194
|
// A reply names the message it answers. The sense stamps that message's text on the
|
|
@@ -233,7 +235,7 @@ function buildOrientationFrame(input) {
|
|
|
233
235
|
const latestStructuredOutput = candidateStructuredOutput && shouldAttachStructuredOutput(combinedSpeech, signals)
|
|
234
236
|
? candidateStructuredOutput
|
|
235
237
|
: undefined;
|
|
236
|
-
const actionPolicy = deriveActionPolicy(signals, combinedSpeech, priorAssistantReferents, candidateStructuredOutput);
|
|
238
|
+
const actionPolicy = deriveActionPolicy(signals, combinedSpeech, priorAssistantReferents, candidateStructuredOutput, input.familySpeaker === true);
|
|
237
239
|
const frame = {
|
|
238
240
|
schemaVersion: 1,
|
|
239
241
|
channel: input.channel,
|
|
@@ -270,6 +272,7 @@ function buildOrientationFrame(input) {
|
|
|
270
272
|
speechKind,
|
|
271
273
|
signals,
|
|
272
274
|
blockedMutationKinds: actionPolicy.blockedMutationKinds,
|
|
275
|
+
advisory: actionPolicy.advisory === true,
|
|
273
276
|
triggeredBy: actionPolicy.triggeredBy ?? null,
|
|
274
277
|
referentCount: priorAssistantReferents.length,
|
|
275
278
|
structuredOutput: candidateStructuredOutput?.id ?? null,
|
|
@@ -288,7 +291,9 @@ function renderOrientationFrame(frame) {
|
|
|
288
291
|
];
|
|
289
292
|
if (frame.actionPolicy.mode === "correction_hold") {
|
|
290
293
|
lines.push(`policy reason: ${frame.actionPolicy.reason}`);
|
|
291
|
-
lines.push(
|
|
294
|
+
lines.push(frame.actionPolicy.advisory
|
|
295
|
+
? `policy is advisory: nothing is blocked; check before ${frame.actionPolicy.blockedMutationKinds.join(", ")}`
|
|
296
|
+
: `policy blocks: ${frame.actionPolicy.blockedMutationKinds.join(", ")}`);
|
|
292
297
|
if (frame.actionPolicy.triggeredBy) {
|
|
293
298
|
lines.push(`policy trigger: correction marker "${frame.actionPolicy.triggeredBy}" in current user speech`);
|
|
294
299
|
}
|
|
@@ -271,10 +271,35 @@ const SEGMENT_OPERATORS = new Set(["&&", "||", ";", "|"]);
|
|
|
271
271
|
// shell could resolve it into one. A word like that counts as mentioning the folder when its directory part can match the folder's
|
|
272
272
|
// path, so the read-only rule below applies to the command.
|
|
273
273
|
const EXPANSION = "\u0001";
|
|
274
|
+
// Marks a word built from a same-command literal, so the word is still checked though it shows no glob or expansion.
|
|
275
|
+
const SUBSTITUTED = "\u0002";
|
|
274
276
|
const STABLE_VARIABLES = ["HOME", "TMPDIR", "USER"];
|
|
277
|
+
// Builtins that can set a variable other than by NAME=value; with any of them present no assignment is trusted.
|
|
278
|
+
const OTHER_VARIABLE_SETTERS = /(?:^|[\s;&|(])(?:read|for|select|declare|typeset|local|readonly|eval|getopts|mapfile|readarray|printf|source|\.|let|export\s+-|unset)(?=$|[\s;&|)])/;
|
|
279
|
+
/**
|
|
280
|
+
* Variables this command sets exactly once to a plain literal (`R=gim-home/CIT; gh pr view 1 -R $R`), with where the
|
|
281
|
+
* assignment ends. Uses after that point are that literal, so they need not count as "could be anything". Quoted values,
|
|
282
|
+
* expansions in the value, a second assignment to the same name or any other way of setting a variable leave it unknown.
|
|
283
|
+
*/
|
|
284
|
+
function literalAssignments(command) {
|
|
285
|
+
const found = new Map();
|
|
286
|
+
if (OTHER_VARIABLE_SETTERS.test(command))
|
|
287
|
+
return found;
|
|
288
|
+
for (const match of command.matchAll(/(?:^|[\s;&|(])(?:export\s+)?([A-Za-z_]\w*)=([^\s;&|()<>`$'"\\{}*?[\]~]+)(?=$|[\s;&|)])/g)) {
|
|
289
|
+
const name = match[1];
|
|
290
|
+
// Counts every NAME= in the command, including the one just matched.
|
|
291
|
+
if (command.match(new RegExp(`(?:^|[^\\w$])${name}=`, "g")).length === 1)
|
|
292
|
+
found.set(name, { value: match[2], end: match.index + match[0].length });
|
|
293
|
+
}
|
|
294
|
+
return found;
|
|
295
|
+
}
|
|
275
296
|
function neutraliseExpansions(command) {
|
|
276
|
-
|
|
297
|
+
const literals = literalAssignments(command);
|
|
298
|
+
return command.replace(/\$\([^)]*\)|`[^`]*`|\$\{([A-Za-z_]\w*)\}|\$([A-Za-z_]\w*)|\$\{[^}]*\}/g, (_match, braced, plain, offset) => {
|
|
277
299
|
const name = braced ?? plain;
|
|
300
|
+
const literal = name === undefined ? undefined : literals.get(name);
|
|
301
|
+
if (literal && offset >= literal.end)
|
|
302
|
+
return `${SUBSTITUTED}${literal.value}`;
|
|
278
303
|
if (name !== undefined && STABLE_VARIABLES.includes(name) && !new RegExp(`\\b${name}=`).test(command) && process.env[name])
|
|
279
304
|
return process.env[name];
|
|
280
305
|
return EXPANSION;
|
|
@@ -288,8 +313,9 @@ function wordPattern(word) {
|
|
|
288
313
|
return new RegExp(`^${source}$`);
|
|
289
314
|
}
|
|
290
315
|
function globOrExpansionCouldReach(command, folder, agentRoot) {
|
|
291
|
-
const tokens = neutraliseExpansions(command).split(/[\s<>|;&()'"]+/).filter((token) => /[*?[{\u0001]/.test(token));
|
|
292
|
-
return tokens.some((
|
|
316
|
+
const tokens = neutraliseExpansions(command).split(/[\s<>|;&()'"]+/).filter((token) => /[*?[{\u0001\u0002]/.test(token));
|
|
317
|
+
return tokens.some((marked) => {
|
|
318
|
+
const token = marked.replaceAll(SUBSTITUTED, "");
|
|
293
319
|
const word = token.startsWith("~") ? expandHome(token) : token;
|
|
294
320
|
const absolute = word.startsWith("/") || word.startsWith(EXPANSION) ? word : `${agentRoot}/${word}`;
|
|
295
321
|
const dir = absolute.slice(0, Math.max(absolute.lastIndexOf("/"), 0));
|
package/dist/repertoire/tools.js
CHANGED
|
@@ -429,7 +429,9 @@ async function preflightToolCall(name, args, ctx) {
|
|
|
429
429
|
return { kind: "ready" };
|
|
430
430
|
const risk = riskProfileForTool(def, name, args);
|
|
431
431
|
const orientationPolicy = ctx?.orientationFrame?.actionPolicy;
|
|
432
|
-
|
|
432
|
+
// A family speaker's hold is advice; a relationship-scoped turn (Sanctuary) always enforces it.
|
|
433
|
+
if (orientationPolicy?.mode === "correction_hold" && (!orientationPolicy.advisory || ctx?.relationshipAuthorization)
|
|
434
|
+
&& orientationPolicyBlocks(risk, orientationPolicy.blockedMutationKinds)) {
|
|
433
435
|
(0, runtime_1.emitNervesEvent)({
|
|
434
436
|
level: "warn", event: "tool.orientation_hold_block", component: "tools",
|
|
435
437
|
message: "orientation hold blocked high-risk tool execution",
|
package/dist/senses/pipeline.js
CHANGED
|
@@ -913,6 +913,7 @@ async function handleInboundTurnExclusive(input) {
|
|
|
913
913
|
messages: sessionMessages,
|
|
914
914
|
currentUserMessages,
|
|
915
915
|
structuredOutputs: session.structuredOutputs ?? [],
|
|
916
|
+
familySpeaker: resolvedContext.friend.trustLevel === "family",
|
|
916
917
|
})
|
|
917
918
|
: undefined);
|
|
918
919
|
// Step 4b: Continuity pipeline — derive tempo, build start-of-turn packet, snapshot obligations
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouro.bot/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.1087",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@ouro.bot/cli",
|
|
9
|
-
"version": "0.1.0-alpha.
|
|
9
|
+
"version": "0.1.0-alpha.1087",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.78.0",
|
|
12
12
|
"@ouro.bot/friends": "0.1.0-alpha.18",
|