@blockrun/franklin 3.15.75 → 3.15.76
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/context.js +1 -0
- package/dist/stats/audit.js +18 -2
- package/package.json +1 -1
package/dist/agent/context.js
CHANGED
|
@@ -27,6 +27,7 @@ When a user asks for a current price, today's news, or any live-world state, **c
|
|
|
27
27
|
|
|
28
28
|
# System
|
|
29
29
|
- All text you output outside of tool use is displayed to the user. Use markdown for formatting.
|
|
30
|
+
- **Markdown tables**: use plain ASCII pipe \`|\` for every column separator, not the box-drawing \`│\` (U+2502). Mixing \`│\` data rows with \`|\` separator rows produces a broken table that no renderer parses correctly. Same rule for the separator: use \`---\`, not \`━━━\` or other Unicode dashes. If you can't draw a clean table in plain ASCII, emit a bullet list instead.
|
|
30
31
|
- Tools are your hands. You MUST use tools to take action — do not describe what you would do without doing it. Never end your turn with a promise of future action — execute it now. Every response should either (a) contain tool calls that make progress, or (b) deliver a final result to the user.
|
|
31
32
|
- You can call multiple tools in a single response. If you intend to call multiple tools and there are no dependencies between them, make ALL independent tool calls in parallel. This is critical for performance. However, if tool calls depend on previous results, run them sequentially — do NOT use placeholders or guess dependent values.
|
|
32
33
|
|
package/dist/stats/audit.js
CHANGED
|
@@ -105,6 +105,12 @@ export function readAudit() {
|
|
|
105
105
|
return [];
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Regex: SCREAMING-CASE bracketed label like `[SYSTEM NOTE]`,
|
|
110
|
+
* `[FRANKLIN HARNESS PREFETCH]`, `[GROUNDING CHECK FAILED]`. Used to detect
|
|
111
|
+
* harness-injected text that masks the real user prompt in audit forensics.
|
|
112
|
+
*/
|
|
113
|
+
const SYNTHETIC_LABEL = /\[[A-Z][A-Z _-]+\]/;
|
|
108
114
|
/** Pull the last user message from a Dialogue history, flatten, and strip newlines. */
|
|
109
115
|
export function extractLastUserPrompt(history) {
|
|
110
116
|
for (let i = history.length - 1; i >= 0; i--) {
|
|
@@ -122,9 +128,19 @@ export function extractLastUserPrompt(history) {
|
|
|
122
128
|
// "[FRANKLIN HARNESS PREFETCH] CRCL price..." and 18 showed
|
|
123
129
|
// "[GROUNDING CHECK FAILED] ..." instead of the user's actual question.
|
|
124
130
|
// Skip any message whose first non-whitespace block is a SCREAMING-CASE
|
|
125
|
-
// bracketed label
|
|
126
|
-
if (
|
|
131
|
+
// bracketed label.
|
|
132
|
+
if (new RegExp('^' + SYNTHETIC_LABEL.source).test(cleaned))
|
|
127
133
|
continue;
|
|
134
|
+
// 3.15.76: also strip TRAILING synthetic labels. Newer post-response
|
|
135
|
+
// evaluators append `[SYSTEM NOTE] The user is correcting you. Your
|
|
136
|
+
// previous response was wrong...` to the user's real text within the
|
|
137
|
+
// SAME message — so the message doesn't start with the bracket but the
|
|
138
|
+
// audit field still ends up half-real, half-synthetic. The bracket is
|
|
139
|
+
// preceded by whitespace + at least one real character, so trim from
|
|
140
|
+
// the first such occurrence.
|
|
141
|
+
const trailing = cleaned.match(new RegExp('^(.+?)\\s' + SYNTHETIC_LABEL.source));
|
|
142
|
+
if (trailing && trailing[1].trim())
|
|
143
|
+
return trailing[1].trim();
|
|
128
144
|
return cleaned;
|
|
129
145
|
}
|
|
130
146
|
return undefined;
|
package/package.json
CHANGED