@ironbee-ai/cli 0.26.0 → 0.27.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/CHANGELOG.md +2 -0
- package/dist/clients/claude/agents/ironbee-verifier.md +31 -0
- package/dist/clients/claude/platforms/skill.android.md +2 -0
- package/dist/clients/claude/platforms/skill.backend.md +2 -0
- package/dist/clients/claude/platforms/skill.browser.md +2 -0
- package/dist/clients/claude/platforms/skill.node.md +2 -0
- package/dist/clients/codex/agents/ironbee-verifier.md +75 -26
- package/dist/clients/codex/commands/ironbee-verify/SKILL.md +38 -61
- package/dist/clients/codex/index.js +2 -2
- package/dist/clients/codex/platforms/skill.android.md +2 -0
- package/dist/clients/codex/platforms/skill.backend.md +2 -0
- package/dist/clients/codex/platforms/skill.browser.md +2 -0
- package/dist/clients/codex/platforms/skill.node.md +2 -0
- package/dist/clients/codex/rules/ironbee-verification.md +10 -27
- package/dist/clients/codex/skills/ironbee-verification.md +40 -68
- package/dist/clients/codex/util.js +32 -22
- package/dist/clients/cursor/platforms/skill.android.md +2 -0
- package/dist/clients/cursor/platforms/skill.backend.md +2 -0
- package/dist/clients/cursor/platforms/skill.browser.md +2 -0
- package/dist/clients/cursor/platforms/skill.node.md +2 -0
- package/dist/clients/cursor/skills/ironbee-verification.md +21 -0
- package/dist/hooks/core/session-state.js +1 -1
- package/dist/hooks/core/submit-verdict.js +2 -2
- package/dist/hooks/core/verification-lifecycle.js +1 -1
- package/dist/hooks/core/verify-gate.js +11 -11
- package/dist/lib/install-version.js +1 -1
- package/dist/lib/platform-section.js +3 -3
- package/package.json +1 -1
|
@@ -2,82 +2,54 @@
|
|
|
2
2
|
name: ironbee-verification
|
|
3
3
|
description: >
|
|
4
4
|
MANDATORY verification after code changes. Activates when implementing features, fixing
|
|
5
|
-
bugs, modifying UI components, API endpoints, styles, refactoring, or any task that
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
near the bottom of this file. After every code edit you MUST verify the affected
|
|
9
|
-
cycle(s) through real tools and submit a single verdict (pass or fail) before
|
|
10
|
-
reporting task completion. If verification fails, submit the fail verdict first,
|
|
11
|
-
then fix.
|
|
5
|
+
bugs, modifying UI components, API endpoints, styles, refactoring, or any task that changes
|
|
6
|
+
application behavior. After editing code you MUST verify the changes before reporting task
|
|
7
|
+
completion — and you verify by DELEGATING to the ironbee-verifier custom agent, never inline.
|
|
12
8
|
---
|
|
13
9
|
|
|
14
10
|
# IronBee Verification
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
No task is complete until changes are verified — through **real tools**, not by reading code or inferring behavior. After verification, you MUST submit a verdict (pass or fail) before doing anything else. If verification fails, submit the fail verdict first, then fix.
|
|
18
|
-
|
|
19
|
-
## Cycles
|
|
20
|
-
|
|
21
|
-
IronBee runs verification in **cycles**. A single Stop hook can drive multiple cycles in parallel — every active cycle must pass for your task to complete.
|
|
22
|
-
|
|
23
|
-
You don't choose which cycle runs — the file pattern decides. A single edited file can match multiple cycles' patterns and activate them all. Cycles always run in parallel within a single Stop run. Each cycle has its own tools, flow steps, and verdict fields.
|
|
24
|
-
|
|
25
|
-
**See the platform sections near the bottom of this file** for which cycles are active for this project, the tools they expose, and the per-cycle verdict fields you must include.
|
|
26
|
-
|
|
27
|
-
## Application lifecycle (your responsibility)
|
|
28
|
-
|
|
29
|
-
For every active cycle you manage the running application:
|
|
30
|
-
- **Build** if needed (`npm run build`, `docker compose build`, …)
|
|
31
|
-
- **Start** before navigating/connecting (`npm run dev`, `docker compose up -d`, …)
|
|
32
|
-
- **Stop** when verification is complete
|
|
33
|
-
|
|
34
|
-
If already running, skip start. If the build fails, fix it before proceeding.
|
|
12
|
+
> **Delegate — do NOT verify inline.** You verify by spawning the **`ironbee-verifier` custom agent** via `spawn_agent` with `agent_type="ironbee-verifier"` **and `fork_turns="none"`** (the default `fork_turns="all"` silently drops the agent_type → a generic toolless agent; not a generic "act as" agent either) and relaying its verdict. The verifier owns the devtools tools; you (the main agent) don't have them.
|
|
35
13
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
14
|
+
## Rule
|
|
15
|
+
No task is complete until your changes are verified through **real tools** — and you verify by
|
|
16
|
+
**delegating to the `ironbee-verifier` custom agent**, never inline. You do not have the
|
|
17
|
+
verification tools (browser / runtime / backend devtools); the verifier does. After delegating,
|
|
18
|
+
relay its verdict; on fail, fix the reported issues and re-delegate until it passes.
|
|
19
|
+
|
|
20
|
+
## How to verify — delegate
|
|
21
|
+
1. Finish your code edits.
|
|
22
|
+
2. Spawn the `ironbee-verifier` custom agent: call `spawn_agent` with `agent_type="ironbee-verifier"`
|
|
23
|
+
AND `fork_turns="none"` (REQUIRED — the default `fork_turns="all"` silently drops the agent_type,
|
|
24
|
+
giving a generic agent without the verification tools; not a generic "act as" agent either) with a
|
|
25
|
+
prompt like *"Verify the recent changes"* (optionally describe what changed, or pass a
|
|
26
|
+
scenario). It drives the verification tools, exercises every active cycle, and submits the
|
|
27
|
+
single verdict in this **shared session** — then returns a short summary.
|
|
28
|
+
**Wait for it in the same turn — do NOT background the verifier.** Let it run to completion
|
|
29
|
+
and read its verdict before you respond. If the verifier is backgrounded, your turn can end
|
|
30
|
+
(and the Stop gate fire) before its verdict is recorded, leaving your changes unverified.
|
|
31
|
+
3. **Relay the verdict.** If it FAILED: fix the issues it reported. Optionally record what you
|
|
32
|
+
fixed so the next pass verdict can describe it:
|
|
51
33
|
```
|
|
52
|
-
echo '
|
|
34
|
+
echo '{"fixes":["what you repaired"]}' | ironbee hook record-fix
|
|
53
35
|
```
|
|
54
|
-
|
|
55
|
-
- Pass → `{ "session_id": "...", "status": "pass", "checks": [...] }`
|
|
56
|
-
- Fail → add `"issues": [...]` describing what failed.
|
|
57
|
-
- Pass after a previous fail → add `"fixes": [...]` describing what was repaired.
|
|
58
|
-
- **The Stop hook enforces that you called the required tools for every active cycle and that the verdict carries non-empty `checks`.**
|
|
59
|
-
8. If failed → fix → rebuild → go back to step 2 → repeat until pass.
|
|
60
|
-
|
|
61
|
-
<!--IRONBEE:PLATFORM:browser-->
|
|
62
|
-
<!--/IRONBEE:PLATFORM:browser-->
|
|
63
|
-
|
|
64
|
-
<!--IRONBEE:PLATFORM:node-->
|
|
65
|
-
<!--/IRONBEE:PLATFORM:node-->
|
|
66
|
-
|
|
67
|
-
<!--IRONBEE:PLATFORM:backend-->
|
|
68
|
-
<!--/IRONBEE:PLATFORM:backend-->
|
|
36
|
+
Then re-delegate. Repeat until it passes.
|
|
69
37
|
|
|
70
|
-
|
|
71
|
-
|
|
38
|
+
The Stop gate enforces this: it blocks completion until a verdict exists for your changes. Since
|
|
39
|
+
you can't verify inline, delegation is the only path forward.
|
|
72
40
|
|
|
73
|
-
##
|
|
74
|
-
-
|
|
75
|
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
41
|
+
## BANNED
|
|
42
|
+
- Trying to run the verification tools yourself (`bdt_*` / `ndt_*` / `bedt_*`) or
|
|
43
|
+
`ironbee hook verification-start` / `submit-verdict` — those are the verifier's job. Delegate.
|
|
44
|
+
- Using the generic `spawn_agent` tool / a plain fork to "be" the verifier — that spawns a
|
|
45
|
+
DEFAULT agent without the devtools. Spawn the `ironbee-verifier` custom agent via `spawn_agent` with `agent_type="ironbee-verifier"` and `fork_turns="none"`.
|
|
46
|
+
- Reporting a task complete without delegating verification of your changes.
|
|
47
|
+
- Claiming verification passed based on code reading, assumptions, or prior knowledge.
|
|
48
|
+
- Backgrounding the verifier custom agent (or ending your turn before it returns its verdict) —
|
|
49
|
+
wait for it to finish in the same turn.
|
|
79
50
|
|
|
80
51
|
## Subagent teams
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
52
|
+
- Implementation subagents write code; they do NOT verify.
|
|
53
|
+
- Verification is ALWAYS delegated to the dedicated `ironbee-verifier` custom agent — it owns the
|
|
54
|
+
per-cycle browser/node/backend flows and the verification tools. Each session's verification
|
|
55
|
+
is isolated via session-specific verdict files.
|
|
@@ -1,38 +1,48 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var k=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var o=(n,t)=>k(n,"name",{value:t,configurable:!0});var M=(n,t)=>{for(var e in t)k(n,e,{get:t[e],enumerable:!0})},P=(n,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of L(t))!W.call(n,r)&&r!==e&&k(n,r,{get:()=>t[r],enumerable:!(s=E(t,r))||s.enumerable});return n};var J=n=>P(k({},"__esModule",{value:!0}),n);var pn={};M(pn,{AGENTS_MD_END_MARKER:()=>x,AGENTS_MD_START_MARKER:()=>v,canonicalizeCodexServerName:()=>C,canonicalizeCodexToolName:()=>$,classifyCodexTool:()=>V,codexAgentTomlPath:()=>en,codexConfigTomlPath:()=>T,codexHooksJsonPath:()=>ln,decodeJwtPayload:()=>A,ensureFeaturesHooksTrue:()=>Z,ensureMultiAgentV2SpawnMetadataExposed:()=>q,extractBashBinary:()=>j,extractCodexMcpServer:()=>I,extractCodexToolInput:()=>D,extractTomlTopLevelModel:()=>rn,findTomlSection:()=>h,normalizeCodexToolName:()=>S,parseCodexHookStdin:()=>B,readCodexConfigToml:()=>an,removeAgentsTable:()=>tn,removeMcpServer:()=>N,removeMultiAgentV2SpawnMetadata:()=>Q,resolveCodexUsage:()=>U,stripAgentsMdBlock:()=>un,tomlBodyFromRecord:()=>sn,upsertAgentsMdBlock:()=>on,upsertAgentsTable:()=>nn,upsertMcpServer:()=>Y,userCodexAgentTomlPath:()=>fn,userCodexConfigTomlPath:()=>cn,userCodexHooksJsonPath:()=>gn,writeCodexConfigToml:()=>dn});module.exports=J(pn);var m=require("fs"),b=require("os"),p=require("path"),y=require("../../lib/logger");function B(n){try{return JSON.parse(n)}catch(t){return y.logger.debug(`failed to parse Codex hook stdin: ${t}`),{}}}o(B,"parseCodexHookStdin");const _="mcp__",z={browser_devtools:"browser-devtools",node_devtools:"node-devtools",backend_devtools:"backend-devtools",android_devtools:"android-devtools"},H=["bdt_","ndt_","bedt_","adt_"];function C(n){return z[n]??n}o(C,"canonicalizeCodexServerName");function $(n){if(!H.some(e=>n.startsWith(e)))return n;const t=n.split("_");return t.length<=3?n:`${t[0]}_${t[1]}_${t.slice(2).join("-")}`}o($,"canonicalizeCodexToolName");const F=[["bdt_","browser-devtools"],["ndt_","node-devtools"],["bedt_","backend-devtools"],["adt_","android-devtools"]];function I(n){if(!n)return null;if(n.startsWith(_)){const t=n.slice(_.length),e=t.indexOf("__");return e<0?null:C(t.slice(0,e))}for(const[t,e]of F)if(n.startsWith(t))return e;return null}o(I,"extractCodexMcpServer");function S(n){return n==="exec_command"?"Bash":n==="apply_patch"?"Edit":n==="update_plan"?"TodoWrite":n==="read_file"?"Read":n==="web_search"?"WebSearch":n==="web_fetch"?"WebFetch":n}o(S,"normalizeCodexToolName");function V(n){if(!n)return{tool_type:null,tool_name:"",mcp_server:null};if(n.startsWith(_)){const s=n.slice(_.length),r=s.indexOf("__");if(r>=0){const i=s.slice(0,r),u=C(i),a=s.slice(r+2);return{tool_type:"mcp",tool_name:$(a),mcp_server:u}}}const t=I(n);if(t!==null&&!n.startsWith(_))return{tool_type:"mcp",tool_name:$(n),mcp_server:t};const e=S(n);return n==="spawn_agent"||n==="wait_agent"||n==="close_agent"?{tool_type:"sub_agent",tool_name:e,mcp_server:null}:{tool_type:null,tool_name:e,mcp_server:null}}o(V,"classifyCodexTool");function D(n,t){if(!n||t===void 0)return;if(n==="apply_patch"){if(typeof t=="string")return{input_size:t.length};if(typeof t=="object"&&t!==null){const r=t,i=r.command??r.input;if(typeof i=="string")return{input_size:i.length}}return{input_size:void 0}}if(typeof t!="object"||t===null)return;const e=t;if(S(n)==="Bash"){const r=e.cmd??e.command,i=typeof r=="string"?j(r):void 0;return{workdir:e.workdir,binary:i}}if(n==="update_plan"){const r=e.explanation,i=e.plan;return{explanation:typeof r=="string"?r:void 0,plan_step_count:Array.isArray(i)?i.length:void 0}}if(n==="spawn_agent"){const r=e.agent_type,i=e.message,u=e.fork_context;return{agent_type:typeof r=="string"?r:void 0,message_size:typeof i=="string"?i.length:void 0,fork_context:typeof u=="boolean"?u:void 0}}if(n==="wait_agent"){const r=e.targets,i=e.timeout_ms;return{target_count:Array.isArray(r)?r.length:void 0,timeout_ms:typeof i=="number"?i:void 0}}if(n==="close_agent"){const r=e.target;return{target:typeof r=="string"?r:void 0}}if(n==="view_image"){const r=e.path,i=e.detail;return{path:typeof r=="string"?r:void 0,detail:typeof i=="string"?i:void 0}}if(n==="write_stdin"){const r=e.session_id,i=e.chars,u=e.yield_time_ms,a=e.max_output_tokens;return{session_id:typeof r=="number"?r:void 0,chars_size:typeof i=="string"?i.length:void 0,yield_time_ms:typeof u=="number"?u:void 0,max_output_tokens:typeof a=="number"?a:void 0}}if(n.startsWith(_)||I(n)!==null){if("_metadata"in e){const{_metadata:r,...i}=e;return i}return e}}o(D,"extractCodexToolInput");function j(n){const t=n.trim();if(!t)return;const e=t.split(/\s+/);for(const s of e)if(!/^[A-Za-z_][A-Za-z0-9_]*=/.test(s)&&s.length>0)return s.split(/[\\/]/).pop()??s}o(j,"extractBashBinary");function A(n){const t=n.split(".");if(t.length!==3)return null;try{const e=Buffer.from(t[1],"base64url").toString("utf-8"),s=JSON.parse(e);return typeof s!="object"||s===null?null:s}catch{return null}}o(A,"decodeJwtPayload");function K(n){if(typeof n=="string"){const t=A(n);return t?{email:t.email,planType:t["https://api.openai.com/auth"]?.chatgpt_plan_type}:{}}if(typeof n=="object"&&n!==null){const t=n;return{email:t.email,planType:t.chatgpt_plan_type}}return{}}o(K,"extractIdTokenFields");function U(n){const t=n??(0,p.join)((0,b.homedir)(),".codex","auth.json");if(!(0,m.existsSync)(t))return{};try{const e=JSON.parse((0,m.readFileSync)(t,"utf-8")),s=e.auth_mode==="chatgpt"||e.auth_mode==="swic"?"subscription":e.auth_mode==="api"?"api":void 0,{email:r,planType:i}=K(e.tokens?.id_token);return{usageType:s,usagePlan:i?.toLowerCase(),userEmail:r}}catch(e){return y.logger.debug(`failed to parse ${t}: ${e}`),{}}}o(U,"resolveCodexUsage");function X(n,t){return n.trim()===`[${t}]`}o(X,"tableHeaderLineExact");function G(n){const t=n.trim();return/^\[\[?[^\]]+\]\]?$/.test(t)}o(G,"isAnyTableHeader");function R(n){const e=n.trim().match(/^\[([^[\]]+)\]$/);return e===null?null:e[1]}o(R,"tableHeaderName");function h(n,t){let e=-1;for(let r=0;r<n.length;r+=1)if(X(n[r],t)){e=r;break}if(e<0)return null;let s=n.length;for(let r=e+1;r<n.length;r+=1)if(G(n[r])){s=r;break}return{startIdx:e,endIdx:s}}o(h,"findTomlSection");function O(n){const t=[...n];for(;t.length>0&&t[t.length-1].trim()==="";)t.pop();return t}o(O,"trimTrailingBlanks");function w(n,t){return n.length===0?t.join(`
|
|
2
2
|
`)+`
|
|
3
3
|
`:n.replace(/\n+$/,"")+`
|
|
4
4
|
|
|
5
5
|
`+t.join(`
|
|
6
6
|
`)+`
|
|
7
|
-
`}o(
|
|
8
|
-
`),e=
|
|
9
|
-
`);return
|
|
10
|
-
`)?
|
|
11
|
-
`}o(Z,"ensureFeaturesHooksTrue");function q(n
|
|
12
|
-
`),
|
|
13
|
-
`);return
|
|
14
|
-
`)?
|
|
15
|
-
`}o(q,"
|
|
16
|
-
`),
|
|
7
|
+
`}o(w,"appendBlockWithSeparator");function Z(n){const t=n.split(`
|
|
8
|
+
`),e=h(t,"features");if(e===null)return w(n,["[features]","hooks = true"]);const s=t.slice(e.startIdx+1,e.endIdx),r=/^\s*hooks\s*=/;let i=!1;for(let d=0;d<s.length;d+=1)if(r.test(s[d])){s[d]="hooks = true",i=!0;break}i||s.unshift("hooks = true");const u=O(s),c=[...t.slice(0,e.startIdx),t[e.startIdx],...u,...e.endIdx<t.length?[""]:[],...t.slice(e.endIdx)].join(`
|
|
9
|
+
`);return c.endsWith(`
|
|
10
|
+
`)?c:c+`
|
|
11
|
+
`}o(Z,"ensureFeaturesHooksTrue");function q(n){const t=n.split(`
|
|
12
|
+
`),e=h(t,"features.multi_agent_v2");if(e===null)return w(n,["[features.multi_agent_v2]","hide_spawn_agent_metadata = false"]);const s=t.slice(e.startIdx+1,e.endIdx),r=/^\s*hide_spawn_agent_metadata\s*=/;let i=!1;for(let d=0;d<s.length;d+=1)if(r.test(s[d])){s[d]="hide_spawn_agent_metadata = false",i=!0;break}i||s.unshift("hide_spawn_agent_metadata = false");const u=O(s),c=[...t.slice(0,e.startIdx),t[e.startIdx],...u,...e.endIdx<t.length?[""]:[],...t.slice(e.endIdx)].join(`
|
|
13
|
+
`);return c.endsWith(`
|
|
14
|
+
`)?c:c+`
|
|
15
|
+
`}o(q,"ensureMultiAgentV2SpawnMetadataExposed");function Q(n){const t=n.split(`
|
|
16
|
+
`),e=h(t,"features.multi_agent_v2");if(e===null)return n;const s=t.slice(e.startIdx+1,e.endIdx).filter(a=>a.trim().length>0);if(!(s.length===1&&/^\s*hide_spawn_agent_metadata\s*=\s*false\s*$/.test(s[0])))return n;const u=[...t.slice(0,e.startIdx),...t.slice(e.endIdx)].join(`
|
|
17
|
+
`).replace(/\n{3,}/g,`
|
|
18
|
+
|
|
19
|
+
`);return u.endsWith(`
|
|
20
|
+
`)?u:u+`
|
|
21
|
+
`}o(Q,"removeMultiAgentV2SpawnMetadata");function Y(n,t,e){const s=`mcp_servers.${t}`,r=n.split(`
|
|
22
|
+
`),i=h(r,s),a=[`[${s}]`,...e];if(i===null)return w(n,a);const c=r.slice(0,i.startIdx),d=r.slice(i.endIdx),l=[...c,...a,...d.length>0?[""]:[],...d].join(`
|
|
23
|
+
`);return l.endsWith(`
|
|
24
|
+
`)?l:l+`
|
|
25
|
+
`}o(Y,"upsertMcpServer");function N(n,t){const e=`mcp_servers.${t}`,s=`${e}.`,r=n.split(`
|
|
26
|
+
`),i=[];let u=!1,a=!1;for(const l of r){const g=R(l);if(g!==null&&(u=g===e||g.startsWith(s),u)){a=!0;continue}u||i.push(l)}if(!a)return n;const c=[];let d=!1;for(const l of i){const g=l.trim().length===0;g&&d||(c.push(l),d=g)}const f=c.join(`
|
|
17
27
|
`);return f.endsWith(`
|
|
18
28
|
`)||f.length===0?f:f+`
|
|
19
|
-
`}o(
|
|
20
|
-
`),i=
|
|
21
|
-
`);return
|
|
22
|
-
`)?
|
|
23
|
-
`}o(
|
|
24
|
-
`),i=[];let
|
|
29
|
+
`}o(N,"removeMcpServer");function nn(n,t,e){const s=`agents.${t}`,r=n.split(`
|
|
30
|
+
`),i=h(r,s),a=[`[${s}]`,...e];if(i===null)return w(n,a);const c=r.slice(0,i.startIdx),d=r.slice(i.endIdx),l=[...c,...a,...d.length>0?[""]:[],...d].join(`
|
|
31
|
+
`);return l.endsWith(`
|
|
32
|
+
`)?l:l+`
|
|
33
|
+
`}o(nn,"upsertAgentsTable");function tn(n,t){const e=`agents.${t}`,s=`${e}.`,r=n.split(`
|
|
34
|
+
`),i=[];let u=!1,a=!1;for(const l of r){const g=R(l);if(g!==null&&(u=g===e||g.startsWith(s),u)){a=!0;continue}u||i.push(l)}if(!a)return n;const c=[];let d=!1;for(const l of i){const g=l.trim().length===0;g&&d||(c.push(l),d=g)}const f=c.join(`
|
|
25
35
|
`);return f.endsWith(`
|
|
26
36
|
`)||f.length===0?f:f+`
|
|
27
|
-
`}o(
|
|
28
|
-
`)){const e=t.trim();if(e.startsWith("["))break;const s=e.match(/^model\s*=\s*"([^"]*)"/);if(s&&s[1].length>0)return s[1]}return null}o(
|
|
37
|
+
`}o(tn,"removeAgentsTable");function en(n,t){return(0,p.join)(n,".codex","agents",`${t}.toml`)}o(en,"codexAgentTomlPath");function rn(n){for(const t of n.split(`
|
|
38
|
+
`)){const e=t.trim();if(e.startsWith("["))break;const s=e.match(/^model\s*=\s*"([^"]*)"/);if(s&&s[1].length>0)return s[1]}return null}o(rn,"extractTomlTopLevelModel");function sn(n){const t=[];for(const[e,s]of Object.entries(n))if(s!=null){if(typeof s=="string")t.push(`${e} = ${JSON.stringify(s)}`);else if(typeof s=="number"||typeof s=="boolean")t.push(`${e} = ${s}`);else if(Array.isArray(s)){const r=s.map(i=>typeof i=="string"?JSON.stringify(i):typeof i=="number"||typeof i=="boolean"?String(i):JSON.stringify(i));t.push(`${e} = [${r.join(", ")}]`)}else if(typeof s=="object"){const r=s,i=[];for(const[u,a]of Object.entries(r))a!=null&&(typeof a=="string"?i.push(`${u} = ${JSON.stringify(a)}`):typeof a=="number"||typeof a=="boolean"?i.push(`${u} = ${a}`):i.push(`${u} = ${JSON.stringify(a)}`));t.push(`${e} = { ${i.join(", ")} }`)}}return t}o(sn,"tomlBodyFromRecord");const v="<!-- ironbee:start -->",x="<!-- ironbee:end -->";function on(n,t){const e=`${v}
|
|
29
39
|
${t.trimEnd()}
|
|
30
|
-
${
|
|
40
|
+
${x}`,s=n.indexOf(v),r=n.indexOf(x);if(s>=0&&r>s){const i=n.slice(0,s),u=n.slice(r+x.length);return i+e+u}return n.trim().length===0?e+`
|
|
31
41
|
`:n.trimEnd()+`
|
|
32
42
|
|
|
33
43
|
`+e+`
|
|
34
|
-
`}o(
|
|
44
|
+
`}o(on,"upsertAgentsMdBlock");function un(n){const t=n.indexOf(v),e=n.indexOf(x);if(t<0||e<t)return n.trim().length===0?null:n;const s=n.slice(0,t).trimEnd(),r=n.slice(e+x.length).trimStart(),i=s+(s.length>0&&r.length>0?`
|
|
35
45
|
|
|
36
46
|
`:"")+r;return i.trim().length===0?null:i.endsWith(`
|
|
37
47
|
`)?i:i+`
|
|
38
|
-
`}o(
|
|
48
|
+
`}o(un,"stripAgentsMdBlock");function an(n){const t=T(n);if(!(0,m.existsSync)(t))return"";try{return(0,m.readFileSync)(t,"utf-8")}catch(e){return y.logger.debug(`failed to read ${t}: ${e}`),""}}o(an,"readCodexConfigToml");function dn(n,t){const e=T(n);try{(0,m.writeFileSync)(e,t)}catch(s){y.logger.debug(`failed to write ${e}: ${s}`)}}o(dn,"writeCodexConfigToml");function T(n){return(0,p.join)(n,".codex","config.toml")}o(T,"codexConfigTomlPath");function ln(n){return(0,p.join)(n,".codex","hooks.json")}o(ln,"codexHooksJsonPath");function cn(){return(0,p.join)((0,b.homedir)(),".codex","config.toml")}o(cn,"userCodexConfigTomlPath");function gn(){return(0,p.join)((0,b.homedir)(),".codex","hooks.json")}o(gn,"userCodexHooksJsonPath");function fn(n){return(0,p.join)((0,b.homedir)(),".codex","agents",`${n}.toml`)}o(fn,"userCodexAgentTomlPath");0&&(module.exports={AGENTS_MD_END_MARKER,AGENTS_MD_START_MARKER,canonicalizeCodexServerName,canonicalizeCodexToolName,classifyCodexTool,codexAgentTomlPath,codexConfigTomlPath,codexHooksJsonPath,decodeJwtPayload,ensureFeaturesHooksTrue,ensureMultiAgentV2SpawnMetadataExposed,extractBashBinary,extractCodexMcpServer,extractCodexToolInput,extractTomlTopLevelModel,findTomlSection,normalizeCodexToolName,parseCodexHookStdin,readCodexConfigToml,removeAgentsTable,removeMcpServer,removeMultiAgentV2SpawnMetadata,resolveCodexUsage,stripAgentsMdBlock,tomlBodyFromRecord,upsertAgentsMdBlock,upsertAgentsTable,upsertMcpServer,userCodexAgentTomlPath,userCodexConfigTomlPath,userCodexHooksJsonPath,writeCodexConfigToml});
|
|
@@ -33,6 +33,8 @@ If you see only `ios/`, `web/`, or no mobile directories — the project does NO
|
|
|
33
33
|
- Read Logcat output for the tag(s) relevant to the changed code: `MCP:adt_o11y_log-read` or `MCP:adt_o11y_log-follow` (drain a follow with `MCP:adt_o11y_log-get-followed`, stop it with `MCP:adt_o11y_log-stop-follow`).
|
|
34
34
|
- Confirm expected log lines appear AND no unexpected crashes (FATAL / E/ entries for the app package).
|
|
35
35
|
|
|
36
|
+
**Batch (speed):** connect + launch-app run standalone first (prerequisites). On the device-evidence path, batch the UI interactions + the UI snapshot into one `MCP:adt_execute`; the snapshot captures the state after the batched interactions, so to assert an intermediate state take a snapshot at that point too. The device-evidence screenshot is usually pixel-judged (a visual change) — take THAT one standalone with `includeBase64: true` so you can see it; batch it only when it's purely gate evidence. Log-evidence reads batch together too.
|
|
37
|
+
|
|
36
38
|
### Verdict fields
|
|
37
39
|
The verdict is platform-agnostic — submit only semantic judgment:
|
|
38
40
|
|
|
@@ -13,6 +13,8 @@ The **backend protocol cycle** verifies backend changes by driving real protocol
|
|
|
13
13
|
|
|
14
14
|
You can satisfy the cycle via **protocol-call evidence** (you drive the request yourself), **log evidence** (something else drives the request, you read the resulting logs), **DB evidence** (you inspect database state directly), or any combination. Pick whichever fits the task; one is enough.
|
|
15
15
|
|
|
16
|
+
**Batch (speed):** group consecutive `bedt_*` steps into one `MCP:bedt_execute` — e.g. a POST then a GET that reuses the created id (bind the first call's result: `const r = callTool('bedt_request_http', {…POST…}); callTool('bedt_request_http', { /* GET using an id from r */ })`), register-source + read, or db-connect + query. Keep a step standalone only when you must inspect its result to DECIDE what to do next, not just to pass a value along.
|
|
17
|
+
|
|
16
18
|
### Path A — Protocol-call evidence
|
|
17
19
|
|
|
18
20
|
1. **Confirm a backend service is running** (the user's dev server, Docker compose, k8s port-forward, …). The agent itself does not start the service — ask the user if uncertain.
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
All four tools are MANDATORY (the stop hook checks each). Functional interaction is expected for every verification.
|
|
16
16
|
|
|
17
|
+
**Batch (speed):** navigate (step 1) is standalone — read the ARIA snapshot it returns to decide your interactions. Then run steps 2–5 in ONE `MCP:bdt_execute` batch — `callTool('bdt_interaction_…', …)` for each interaction, `callTool('bdt_content_take-screenshot', …)`, `callTool('bdt_a11y_take-aria-snapshot', …)`, `callTool('bdt_o11y_get-console-messages', …)` — instead of four separate turns. Screenshot/aria/console capture the state AFTER the batched interactions, so batch interactions that lead to ONE state you want to assert; to assert an intermediate state (e.g. a modal that opens then closes) take a screenshot/snapshot at that point too — interleave it in the batch or split into two. The interaction is what makes the evidence meaningful: a batch of just the four evidence tools with no real interaction passes the tool-presence check but verifies nothing. If you must judge the screenshot's pixels, take that one standalone with `includeBase64: true`.
|
|
18
|
+
|
|
17
19
|
### Verdict fields
|
|
18
20
|
The verdict is platform-agnostic — you submit only semantic judgment:
|
|
19
21
|
|
|
@@ -31,6 +31,8 @@ If you see `pom.xml`, `build.gradle`, `requirements.txt`, `pyproject.toml`, `go.
|
|
|
31
31
|
- Read errors: `MCP:ndt_debug_get-logs` with the error-level filter.
|
|
32
32
|
4. **Disconnect** (optional): `MCP:ndt_debug_disconnect`.
|
|
33
33
|
|
|
34
|
+
**Batch (speed):** connect (step 2) is standalone discovery. Batch consecutive `ndt_*` calls in one `MCP:ndt_execute` — set several probes together, then later read snapshots/logs together. The exercise step is ALWAYS separate: whatever triggers the code path (a browser/backend call on another server, a CLI command, the user) can't share an `ndt_*` batch — so node runs as set probes (batch) → exercise (separate) → read snapshots (batch).
|
|
35
|
+
|
|
34
36
|
### Verdict fields
|
|
35
37
|
The verdict is platform-agnostic — you submit only semantic judgment:
|
|
36
38
|
|
|
@@ -55,10 +55,31 @@ If already running, skip start. If the build fails, fix it before proceeding.
|
|
|
55
55
|
- Pass → `{ "session_id": "...", "status": "pass", "checks": [...] }`
|
|
56
56
|
- Fail → add `"issues": [...]` describing what failed.
|
|
57
57
|
- Pass after a previous fail → add `"fixes": [...]` describing what was repaired.
|
|
58
|
+
- **A FALSE failure is a FAIL — not "verified failure handling".** When you exercise a negative path, separate an EXPECTED negative test (you deliberately fed invalid input — bad card, missing auth, malformed payload — and it correctly failed → supports a `pass`) from a FALSE failure (a VALID, in-scope operation that SHOULD succeed but errors out → a DEFECT). Report a false failure as `status: "fail"` (or at minimum non-empty `issues`), never as a passing "failure path verified". Passing a run whose own evidence shows a legitimate operation breaking is a false pass.
|
|
58
59
|
- **Nothing to verify? Use N/A — never fake evidence.** When the change has no runtime surface (type-only edit, behavior-neutral refactor, config/docs that still tripped a cycle): global `{ "session_id": "...", "status": "not_applicable", "reason": ["why there's no runtime surface"] }` (no `checks`), or per-platform on a pass/fail verdict `"not_applicable_cycles": ["browser"], "reason": ["server-only change"]` to exempt some cycles while verifying others. `reason` is REQUIRED (recorded + observable); strict mode rejects N/A. Base "nothing to verify" on the FULL change set (the change is often already COMMITTED) — check `git diff HEAD~1 HEAD --stat`, not just a clean `git status`, before declaring N/A.
|
|
59
60
|
- **The stop hook enforces that you called the required tools for every active (non-exempt) cycle and that a pass/fail verdict carries non-empty `checks`.**
|
|
60
61
|
8. If failed → fix → rebuild → go back to step 2 → repeat until pass.
|
|
61
62
|
|
|
63
|
+
## Speed — batch your tool calls (fewer LLM round-trips)
|
|
64
|
+
|
|
65
|
+
Each tool call is a separate LLM round-trip, and that round-trip — not the tool's execution
|
|
66
|
+
— is the dominant cost of a verification. Drive the tools in as few turns as you can:
|
|
67
|
+
|
|
68
|
+
- **Batch a scope's work into ONE `MCP:*_execute` call.** Each cycle exposes a batch tool
|
|
69
|
+
(`MCP:bdt_execute` / `MCP:ndt_execute` / `MCP:bedt_execute` / `MCP:adt_execute`) that runs
|
|
70
|
+
many steps in one turn — nest each as a `callTool('<tool>', { … })`. A batch nests only
|
|
71
|
+
that cycle's own tools (you can't mix servers in one `*_execute`). It's a JS sandbox, so a later step
|
|
72
|
+
can reuse a value an earlier `callTool` returned
|
|
73
|
+
(`const r = callTool(…); callTool(…, { /* a field from r */ })`); and `*_execute` STOPS at
|
|
74
|
+
the first failing nested call, so the rest don't run. Nested calls are credited to the gate like
|
|
75
|
+
standalone calls — but authoring the batch is not the work: read each result and confirm
|
|
76
|
+
real evidence came back (a batch whose interaction failed has no screenshot/snapshot
|
|
77
|
+
behind it). See each platform section for that cycle's concrete batch shape, including any
|
|
78
|
+
cycle-specific screenshot or recording handling.
|
|
79
|
+
- **Discovery stays standalone — you can't batch what you haven't seen.** The step that
|
|
80
|
+
reveals what to do (navigate / connect / snapshot) runs first and on its own; you read its
|
|
81
|
+
result, THEN batch the actions it told you to take.
|
|
82
|
+
|
|
62
83
|
<!--IRONBEE:PLATFORM:browser-->
|
|
63
84
|
<!--/IRONBEE:PLATFORM:browser-->
|
|
64
85
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var v=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var a=(i,e)=>v(i,"name",{value:e,configurable:!0});var _=(i,e)=>{for(var n in e)v(i,n,{get:e[n],enumerable:!0})},V=(i,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of m(e))!h.call(i,r)&&r!==n&&v(i,r,{get:()=>e[r],enumerable:!(t=A(e,r))||t.enumerable});return i};var b=i=>V(v({},"__esModule",{value:!0}),i);var yt={};_(yt,{addPendingFixes:()=>rt,clearActiveActivity:()=>ft,clearActiveFix:()=>C,clearActiveVerification:()=>F,clearPendingFixes:()=>at,clearVerifyIntent:()=>ot,closeOpenCycles:()=>lt,generateTraceId:()=>T,getActiveActivityId:()=>H,getActiveFixId:()=>k,getActiveTraceId:()=>E,getActiveVerificationId:()=>w,getChainedStatusLine:()=>D,getContextInjectedVerificationId:()=>et,getLastVerdictStatus:()=>q,getPendingFixes:()=>nt,getPhase:()=>N,getRetries:()=>R,getUsagePlan:()=>Y,getUsageType:()=>X,getUserEmail:()=>K,getVerifyIntent:()=>ct,incrementRetries:()=>$,isActive:()=>W,isFailLikeVerdictStatus:()=>dt,isRecordingActive:()=>B,isRecordingRequired:()=>O,readState:()=>c,reconcileAbandonedActivity:()=>vt,reconcileForCompact:()=>pt,reconcileSessionState:()=>gt,resetRetries:()=>L,setActive:()=>G,setActiveActivity:()=>ut,setActiveFix:()=>U,setActiveVerification:()=>P,setChainedStatusLine:()=>tt,setContextInjectedVerificationId:()=>it,setLastVerdictStatus:()=>j,setPhase:()=>z,setRecordingActive:()=>M,setRecordingRequired:()=>J,setUsage:()=>Z,setUserEmail:()=>Q,setVerifyIntent:()=>st,writeState:()=>u});module.exports=b(yt);var x=require("crypto"),l=require("fs"),y=require("path"),f=require("../../lib/logger"),g=require("./activity-participants"),p=require("../../lib/atomic"),d=require("./actions");const I="state.json",S={retries:0,activeVerificationId:null,activeTraceId:null,lastVerdictStatus:null,activeFixId:null,activeActivityId:null,phase:null,recordingRequired:!1,recordingActive:!1,active:!1,userEmail:null,usageType:null,usagePlan:null,chainedStatusLine:null,contextInjectedVerificationId:null,pendingFixes:[],verifyIntent:null};function T(){return(0,x.randomBytes)(16).toString("hex")}a(T,"generateTraceId");function c(i){const e=(0,y.join)(i,I);if(!(0,l.existsSync)(e))return{...S};try{const n=(0,l.readFileSync)(e,"utf-8"),t=JSON.parse(n),r=["coding","verifying","fixing"],s=["api","subscription"];return{retries:typeof t.retries=="number"?t.retries:0,activeVerificationId:typeof t.activeVerificationId=="string"?t.activeVerificationId:null,activeTraceId:typeof t.activeTraceId=="string"?t.activeTraceId:null,lastVerdictStatus:typeof t.lastVerdictStatus=="string"?t.lastVerdictStatus:null,activeFixId:typeof t.activeFixId=="string"?t.activeFixId:null,activeActivityId:typeof t.activeActivityId=="string"?t.activeActivityId:null,phase:typeof t.phase=="string"&&r.includes(t.phase)?t.phase:null,recordingRequired:typeof t.recordingRequired=="boolean"?t.recordingRequired:!1,recordingActive:typeof t.recordingActive=="boolean"?t.recordingActive:!1,active:typeof t.active=="boolean"?t.active:!1,userEmail:typeof t.userEmail=="string"?t.userEmail:null,usageType:typeof t.usageType=="string"&&s.includes(t.usageType)?t.usageType:null,usagePlan:typeof t.usagePlan=="string"&&t.usagePlan.length>0?t.usagePlan:null,chainedStatusLine:typeof t.chainedStatusLine=="string"&&t.chainedStatusLine.length>0?t.chainedStatusLine:null,contextInjectedVerificationId:typeof t.contextInjectedVerificationId=="string"?t.contextInjectedVerificationId:null,pendingFixes:Array.isArray(t.pendingFixes)?t.pendingFixes.filter(o=>typeof o=="string"&&o.length>0):[],verifyIntent:typeof t.verifyIntent=="string"&&t.verifyIntent.length>0?t.verifyIntent:null}}catch(n){return f.logger.debug(`failed to read state from ${e}: ${n}`),{...S}}}a(c,"readState");function u(i,e){const n=(0,y.join)(i,I);try{(0,l.mkdirSync)(i,{recursive:!0});const t=`${n}.tmp.${process.pid}.${Date.now()}`,r=JSON.stringify(e,null,2);try{(0,l.writeFileSync)(t,r),(0,p.renameWithRetry)(t,n)}catch(s){try{(0,l.existsSync)(t)&&(0,l.unlinkSync)(t)}catch{}throw s}(0,p.sweepStaleTmpFiles)(n)}catch(t){f.logger.debug(`failed to write state to ${n}: ${t}`)}}a(u,"writeState");function w(i){return c(i).activeVerificationId??void 0}a(w,"getActiveVerificationId");function P(i,e,n){const t=c(i);t.activeVerificationId=e,t.activeTraceId=n,t.phase="verifying",u(i,t)}a(P,"setActiveVerification");function E(i){return c(i).activeTraceId??void 0}a(E,"getActiveTraceId");function F(i){const e=c(i);e.activeVerificationId=null,e.activeTraceId=null,e.phase="coding",u(i,e)}a(F,"clearActiveVerification");function R(i){return c(i).retries}a(R,"getRetries");function $(i){const e=c(i);return e.retries=e.retries+1,u(i,e),e.retries}a($,"incrementRetries");function L(i){const e=c(i);e.retries=0,u(i,e)}a(L,"resetRetries");function q(i){return c(i).lastVerdictStatus??void 0}a(q,"getLastVerdictStatus");function j(i,e){const n=c(i);n.lastVerdictStatus=e,u(i,n)}a(j,"setLastVerdictStatus");function U(i,e){const n=c(i);n.activeFixId=e,u(i,n)}a(U,"setActiveFix");function k(i){return c(i).activeFixId??void 0}a(k,"getActiveFixId");function C(i){const e=c(i);e.activeFixId=null,u(i,e)}a(C,"clearActiveFix");function z(i,e){const n=c(i);n.phase=e,u(i,n)}a(z,"setPhase");function N(i){return c(i).phase}a(N,"getPhase");function O(i){return c(i).recordingRequired}a(O,"isRecordingRequired");function J(i,e){const n=c(i);n.recordingRequired=e,u(i,n)}a(J,"setRecordingRequired");function B(i){return c(i).recordingActive}a(B,"isRecordingActive");function M(i,e){const n=c(i);n.recordingActive=e,u(i,n)}a(M,"setRecordingActive");function W(i){return c(i).active}a(W,"isActive");function G(i,e){const n=c(i);n.active=e,e||(n.activeActivityId=null),u(i,n)}a(G,"setActive");function H(i){return c(i).activeActivityId??void 0}a(H,"getActiveActivityId");function K(i){return c(i).userEmail??void 0}a(K,"getUserEmail");function Q(i,e){const n=typeof e=="string"&&e.length>0?e:null,t=c(i);t.userEmail!==n&&(t.userEmail=n,u(i,t))}a(Q,"setUserEmail");function X(i){return c(i).usageType??void 0}a(X,"getUsageType");function Y(i){return c(i).usagePlan??void 0}a(Y,"getUsagePlan");function Z(i,e){const n=e.usage_type==="api"||e.usage_type==="subscription"?e.usage_type:null,t=typeof e.usage_plan=="string"&&e.usage_plan.length>0?e.usage_plan:null,r=c(i);r.usageType===n&&r.usagePlan===t||(r.usageType=n,r.usagePlan=t,u(i,r))}a(Z,"setUsage");function D(i){return c(i).chainedStatusLine??void 0}a(D,"getChainedStatusLine");function tt(i,e){const n=typeof e=="string"&&e.length>0?e:null,t=c(i);t.chainedStatusLine!==n&&(t.chainedStatusLine=n,u(i,t))}a(tt,"setChainedStatusLine");function et(i){return c(i).contextInjectedVerificationId??void 0}a(et,"getContextInjectedVerificationId");function it(i,e){const n=typeof e=="string"&&e.length>0?e:null,t=c(i);t.contextInjectedVerificationId!==n&&(t.contextInjectedVerificationId=n,u(i,t))}a(it,"setContextInjectedVerificationId");function nt(i){return c(i).pendingFixes}a(nt,"getPendingFixes");function rt(i,e){const n=e.filter(o=>typeof o=="string"&&o.length>0);if(n.length===0)return;const t=c(i),r=new Set(t.pendingFixes),s=[...t.pendingFixes];for(const o of n)r.has(o)||(r.add(o),s.push(o));s.length!==t.pendingFixes.length&&(t.pendingFixes=s,u(i,t))}a(rt,"addPendingFixes");function at(i){const e=c(i);e.pendingFixes.length!==0&&(e.pendingFixes=[],u(i,e))}a(at,"clearPendingFixes");function ct(i){return c(i).verifyIntent}a(ct,"getVerifyIntent");function st(i,e){const n=c(i);n.verifyIntent!==e&&(n.verifyIntent=e,u(i,n))}a(st,"setVerifyIntent");function ot(i){const e=c(i);e.verifyIntent!==null&&(e.verifyIntent=null,u(i,e))}a(ot,"clearVerifyIntent");function dt(i){return i==="fail"||i==="fail_reported"}a(dt,"isFailLikeVerdictStatus");function ut(i,e){const n=c(i);n.activeActivityId=e,n.active=!0,u(i,n)}a(ut,"setActiveActivity");function ft(i){const e=c(i);e.activeActivityId=null,e.active=!1,u(i,e)}a(ft,"clearActiveActivity");async function lt(i,e,n){const t=c(i);let r=!1;if(t.activeVerificationId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:n};await(0,d.appendAction)(e,o),f.logger.debug(`close-open-cycles: ended verification ${t.activeVerificationId} (${n})`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,r=!0}if(t.activeFixId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:n};await(0,d.appendAction)(e,o),f.logger.debug(`close-open-cycles: ended fix ${t.activeFixId} (${n})`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),r=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,r=!0),t.phase!=="coding"&&(t.phase="coding",r=!0),t.verifyIntent!==null&&(t.verifyIntent=null,r=!0),r&&u(i,t)}a(lt,"closeOpenCycles");async function gt(i,e,n){const t=c(i);let r=!1;if(t.activeVerificationId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:"session_reconcile"};await n(e,o),f.logger.debug(`reconcile: ended abandoned verification ${t.activeVerificationId}`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,r=!0}if(t.activeFixId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:"session_reconcile"};await n(e,o),f.logger.debug(`reconcile: ended abandoned fix ${t.activeFixId}`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),r=!0}if(t.active){const s=Date.now(),o={...(0,d.baseFields)(e),type:"activity_end",timestamp:s,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"activity_start",s),reason:"session_reconcile"};await n(e,o),f.logger.debug(`reconcile: ended abandoned activity ${t.activeActivityId??""}`),t.active=!1,t.activeActivityId=null,(0,g.clearActivityParticipants)(i),r=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,r=!0),t.phase!=="coding"&&(t.phase="coding",r=!0),t.verifyIntent!==null&&(t.verifyIntent=null,r=!0),r&&u(i,t)}a(gt,"reconcileSessionState");async function vt(i,e,n){const t=c(i);if(!t.active&&!t.activeVerificationId&&!t.activeFixId&&t.verifyIntent===null||!(0,g.isParticipantPresent)(i,g.MAIN_PARTICIPANT_ID)&&(0,g.anyActiveParticipants)(i))return;let r=!1;const s=(0,d.findLastActionTimestamp)(e)??Date.now();if(t.activeVerificationId){const o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:"interrupt_inferred"};await n(e,o),f.logger.debug(`interrupt-reconcile: ended verification ${t.activeVerificationId}`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,r=!0}if(t.activeFixId){const o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:"interrupt_inferred"};await n(e,o),f.logger.debug(`interrupt-reconcile: ended fix ${t.activeFixId}`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),r=!0}if(t.active){const o={...(0,d.baseFields)(e),type:"activity_end",timestamp:s,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"activity_start",s),reason:"interrupt_inferred"};await n(e,o),f.logger.debug(`interrupt-reconcile: ended activity ${t.activeActivityId??""}`),t.active=!1,t.activeActivityId=null,(0,g.clearActivityParticipants)(i),r=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,r=!0),t.phase!=="coding"&&(t.phase="coding",r=!0),t.verifyIntent!==null&&(t.verifyIntent=null,r=!0),r&&u(i,t)}a(vt,"reconcileAbandonedActivity");async function pt(i,e,n){const t=c(i);let r=!1;if(t.activeVerificationId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:"compact"};await n(e,o),f.logger.debug(`compact-reconcile: ended verification ${t.activeVerificationId}`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,r=!0}if(t.activeFixId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:"compact"};await n(e,o),f.logger.debug(`compact-reconcile: ended fix ${t.activeFixId}`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),r=!0}if(t.active){const s=Date.now(),o={...(0,d.baseFields)(e),type:"activity_end",timestamp:s,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"activity_start",s),reason:"compact"};await n(e,o),f.logger.debug(`compact-reconcile: ended activity ${t.activeActivityId??""}`),t.active=!1,t.activeActivityId=null,(0,g.clearActivityParticipants)(i),r=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,r=!0),t.phase!=="coding"&&(t.phase="coding",r=!0),t.verifyIntent!==null&&(t.verifyIntent=null,r=!0),r&&u(i,t)}a(pt,"reconcileForCompact");0&&(module.exports={addPendingFixes,clearActiveActivity,clearActiveFix,clearActiveVerification,clearPendingFixes,clearVerifyIntent,closeOpenCycles,generateTraceId,getActiveActivityId,getActiveFixId,getActiveTraceId,getActiveVerificationId,getChainedStatusLine,getContextInjectedVerificationId,getLastVerdictStatus,getPendingFixes,getPhase,getRetries,getUsagePlan,getUsageType,getUserEmail,getVerifyIntent,incrementRetries,isActive,isFailLikeVerdictStatus,isRecordingActive,isRecordingRequired,readState,reconcileAbandonedActivity,reconcileForCompact,reconcileSessionState,resetRetries,setActive,setActiveActivity,setActiveFix,setActiveVerification,setChainedStatusLine,setContextInjectedVerificationId,setLastVerdictStatus,setPhase,setRecordingActive,setRecordingRequired,setUsage,setUserEmail,setVerifyIntent,writeState});
|
|
1
|
+
"use strict";var v=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var V=Object.prototype.hasOwnProperty;var a=(i,e)=>v(i,"name",{value:e,configurable:!0});var h=(i,e)=>{for(var n in e)v(i,n,{get:e[n],enumerable:!0})},_=(i,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of m(e))!V.call(i,r)&&r!==n&&v(i,r,{get:()=>e[r],enumerable:!(t=A(e,r))||t.enumerable});return i};var b=i=>_(v({},"__esModule",{value:!0}),i);var St={};h(St,{addPendingFixes:()=>ct,clearActiveActivity:()=>gt,clearActiveFix:()=>z,clearActiveVerification:()=>F,clearPendingFixes:()=>st,clearVerifyIntent:()=>ut,closeOpenCycles:()=>vt,generateTraceId:()=>T,getActiveActivityId:()=>Q,getActiveFixId:()=>C,getActiveTraceId:()=>E,getActiveVerificationId:()=>w,getChainedStatusLine:()=>et,getContextInjectedVerificationId:()=>nt,getLastVerdictHadIssues:()=>U,getLastVerdictStatus:()=>q,getPendingFixes:()=>at,getPhase:()=>O,getRetries:()=>R,getUsagePlan:()=>D,getUsageType:()=>Z,getUserEmail:()=>X,getVerifyIntent:()=>ot,incrementRetries:()=>L,isActive:()=>G,isFailLikeVerdictStatus:()=>lt,isRecordingActive:()=>M,isRecordingRequired:()=>J,readState:()=>c,reconcileAbandonedActivity:()=>yt,reconcileForCompact:()=>It,reconcileSessionState:()=>pt,resetRetries:()=>$,setActive:()=>K,setActiveActivity:()=>ft,setActiveFix:()=>k,setActiveVerification:()=>P,setChainedStatusLine:()=>it,setContextInjectedVerificationId:()=>rt,setLastVerdictHadIssues:()=>H,setLastVerdictStatus:()=>j,setPhase:()=>N,setRecordingActive:()=>W,setRecordingRequired:()=>B,setUsage:()=>tt,setUserEmail:()=>Y,setVerifyIntent:()=>dt,writeState:()=>u});module.exports=b(St);var x=require("crypto"),f=require("fs"),y=require("path"),l=require("../../lib/logger"),g=require("./activity-participants"),p=require("../../lib/atomic"),d=require("./actions");const I="state.json",S={retries:0,activeVerificationId:null,activeTraceId:null,lastVerdictStatus:null,lastVerdictHadIssues:!1,activeFixId:null,activeActivityId:null,phase:null,recordingRequired:!1,recordingActive:!1,active:!1,userEmail:null,usageType:null,usagePlan:null,chainedStatusLine:null,contextInjectedVerificationId:null,pendingFixes:[],verifyIntent:null};function T(){return(0,x.randomBytes)(16).toString("hex")}a(T,"generateTraceId");function c(i){const e=(0,y.join)(i,I);if(!(0,f.existsSync)(e))return{...S};try{const n=(0,f.readFileSync)(e,"utf-8"),t=JSON.parse(n),r=["coding","verifying","fixing"],s=["api","subscription"];return{retries:typeof t.retries=="number"?t.retries:0,activeVerificationId:typeof t.activeVerificationId=="string"?t.activeVerificationId:null,activeTraceId:typeof t.activeTraceId=="string"?t.activeTraceId:null,lastVerdictStatus:typeof t.lastVerdictStatus=="string"?t.lastVerdictStatus:null,lastVerdictHadIssues:typeof t.lastVerdictHadIssues=="boolean"?t.lastVerdictHadIssues:!1,activeFixId:typeof t.activeFixId=="string"?t.activeFixId:null,activeActivityId:typeof t.activeActivityId=="string"?t.activeActivityId:null,phase:typeof t.phase=="string"&&r.includes(t.phase)?t.phase:null,recordingRequired:typeof t.recordingRequired=="boolean"?t.recordingRequired:!1,recordingActive:typeof t.recordingActive=="boolean"?t.recordingActive:!1,active:typeof t.active=="boolean"?t.active:!1,userEmail:typeof t.userEmail=="string"?t.userEmail:null,usageType:typeof t.usageType=="string"&&s.includes(t.usageType)?t.usageType:null,usagePlan:typeof t.usagePlan=="string"&&t.usagePlan.length>0?t.usagePlan:null,chainedStatusLine:typeof t.chainedStatusLine=="string"&&t.chainedStatusLine.length>0?t.chainedStatusLine:null,contextInjectedVerificationId:typeof t.contextInjectedVerificationId=="string"?t.contextInjectedVerificationId:null,pendingFixes:Array.isArray(t.pendingFixes)?t.pendingFixes.filter(o=>typeof o=="string"&&o.length>0):[],verifyIntent:typeof t.verifyIntent=="string"&&t.verifyIntent.length>0?t.verifyIntent:null}}catch(n){return l.logger.debug(`failed to read state from ${e}: ${n}`),{...S}}}a(c,"readState");function u(i,e){const n=(0,y.join)(i,I);try{(0,f.mkdirSync)(i,{recursive:!0});const t=`${n}.tmp.${process.pid}.${Date.now()}`,r=JSON.stringify(e,null,2);try{(0,f.writeFileSync)(t,r),(0,p.renameWithRetry)(t,n)}catch(s){try{(0,f.existsSync)(t)&&(0,f.unlinkSync)(t)}catch{}throw s}(0,p.sweepStaleTmpFiles)(n)}catch(t){l.logger.debug(`failed to write state to ${n}: ${t}`)}}a(u,"writeState");function w(i){return c(i).activeVerificationId??void 0}a(w,"getActiveVerificationId");function P(i,e,n){const t=c(i);t.activeVerificationId=e,t.activeTraceId=n,t.phase="verifying",u(i,t)}a(P,"setActiveVerification");function E(i){return c(i).activeTraceId??void 0}a(E,"getActiveTraceId");function F(i){const e=c(i);e.activeVerificationId=null,e.activeTraceId=null,e.phase="coding",u(i,e)}a(F,"clearActiveVerification");function R(i){return c(i).retries}a(R,"getRetries");function L(i){const e=c(i);return e.retries=e.retries+1,u(i,e),e.retries}a(L,"incrementRetries");function $(i){const e=c(i);e.retries=0,u(i,e)}a($,"resetRetries");function q(i){return c(i).lastVerdictStatus??void 0}a(q,"getLastVerdictStatus");function j(i,e){const n=c(i);n.lastVerdictStatus=e,u(i,n)}a(j,"setLastVerdictStatus");function U(i){return c(i).lastVerdictHadIssues===!0}a(U,"getLastVerdictHadIssues");function H(i,e){const n=c(i);n.lastVerdictHadIssues=e,u(i,n)}a(H,"setLastVerdictHadIssues");function k(i,e){const n=c(i);n.activeFixId=e,u(i,n)}a(k,"setActiveFix");function C(i){return c(i).activeFixId??void 0}a(C,"getActiveFixId");function z(i){const e=c(i);e.activeFixId=null,u(i,e)}a(z,"clearActiveFix");function N(i,e){const n=c(i);n.phase=e,u(i,n)}a(N,"setPhase");function O(i){return c(i).phase}a(O,"getPhase");function J(i){return c(i).recordingRequired}a(J,"isRecordingRequired");function B(i,e){const n=c(i);n.recordingRequired=e,u(i,n)}a(B,"setRecordingRequired");function M(i){return c(i).recordingActive}a(M,"isRecordingActive");function W(i,e){const n=c(i);n.recordingActive=e,u(i,n)}a(W,"setRecordingActive");function G(i){return c(i).active}a(G,"isActive");function K(i,e){const n=c(i);n.active=e,e||(n.activeActivityId=null),u(i,n)}a(K,"setActive");function Q(i){return c(i).activeActivityId??void 0}a(Q,"getActiveActivityId");function X(i){return c(i).userEmail??void 0}a(X,"getUserEmail");function Y(i,e){const n=typeof e=="string"&&e.length>0?e:null,t=c(i);t.userEmail!==n&&(t.userEmail=n,u(i,t))}a(Y,"setUserEmail");function Z(i){return c(i).usageType??void 0}a(Z,"getUsageType");function D(i){return c(i).usagePlan??void 0}a(D,"getUsagePlan");function tt(i,e){const n=e.usage_type==="api"||e.usage_type==="subscription"?e.usage_type:null,t=typeof e.usage_plan=="string"&&e.usage_plan.length>0?e.usage_plan:null,r=c(i);r.usageType===n&&r.usagePlan===t||(r.usageType=n,r.usagePlan=t,u(i,r))}a(tt,"setUsage");function et(i){return c(i).chainedStatusLine??void 0}a(et,"getChainedStatusLine");function it(i,e){const n=typeof e=="string"&&e.length>0?e:null,t=c(i);t.chainedStatusLine!==n&&(t.chainedStatusLine=n,u(i,t))}a(it,"setChainedStatusLine");function nt(i){return c(i).contextInjectedVerificationId??void 0}a(nt,"getContextInjectedVerificationId");function rt(i,e){const n=typeof e=="string"&&e.length>0?e:null,t=c(i);t.contextInjectedVerificationId!==n&&(t.contextInjectedVerificationId=n,u(i,t))}a(rt,"setContextInjectedVerificationId");function at(i){return c(i).pendingFixes}a(at,"getPendingFixes");function ct(i,e){const n=e.filter(o=>typeof o=="string"&&o.length>0);if(n.length===0)return;const t=c(i),r=new Set(t.pendingFixes),s=[...t.pendingFixes];for(const o of n)r.has(o)||(r.add(o),s.push(o));s.length!==t.pendingFixes.length&&(t.pendingFixes=s,u(i,t))}a(ct,"addPendingFixes");function st(i){const e=c(i);e.pendingFixes.length!==0&&(e.pendingFixes=[],u(i,e))}a(st,"clearPendingFixes");function ot(i){return c(i).verifyIntent}a(ot,"getVerifyIntent");function dt(i,e){const n=c(i);n.verifyIntent!==e&&(n.verifyIntent=e,u(i,n))}a(dt,"setVerifyIntent");function ut(i){const e=c(i);e.verifyIntent!==null&&(e.verifyIntent=null,u(i,e))}a(ut,"clearVerifyIntent");function lt(i){return i==="fail"||i==="fail_reported"}a(lt,"isFailLikeVerdictStatus");function ft(i,e){const n=c(i);n.activeActivityId=e,n.active=!0,u(i,n)}a(ft,"setActiveActivity");function gt(i){const e=c(i);e.activeActivityId=null,e.active=!1,u(i,e)}a(gt,"clearActiveActivity");async function vt(i,e,n){const t=c(i);let r=!1;if(t.activeVerificationId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:n};await(0,d.appendAction)(e,o),l.logger.debug(`close-open-cycles: ended verification ${t.activeVerificationId} (${n})`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,r=!0}if(t.activeFixId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:n};await(0,d.appendAction)(e,o),l.logger.debug(`close-open-cycles: ended fix ${t.activeFixId} (${n})`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),r=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,r=!0),t.phase!=="coding"&&(t.phase="coding",r=!0),t.verifyIntent!==null&&(t.verifyIntent=null,r=!0),r&&u(i,t)}a(vt,"closeOpenCycles");async function pt(i,e,n){const t=c(i);let r=!1;if(t.activeVerificationId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:"session_reconcile"};await n(e,o),l.logger.debug(`reconcile: ended abandoned verification ${t.activeVerificationId}`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,r=!0}if(t.activeFixId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:"session_reconcile"};await n(e,o),l.logger.debug(`reconcile: ended abandoned fix ${t.activeFixId}`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),r=!0}if(t.active){const s=Date.now(),o={...(0,d.baseFields)(e),type:"activity_end",timestamp:s,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"activity_start",s),reason:"session_reconcile"};await n(e,o),l.logger.debug(`reconcile: ended abandoned activity ${t.activeActivityId??""}`),t.active=!1,t.activeActivityId=null,(0,g.clearActivityParticipants)(i),r=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,r=!0),t.phase!=="coding"&&(t.phase="coding",r=!0),t.verifyIntent!==null&&(t.verifyIntent=null,r=!0),r&&u(i,t)}a(pt,"reconcileSessionState");async function yt(i,e,n){const t=c(i);if(!t.active&&!t.activeVerificationId&&!t.activeFixId&&t.verifyIntent===null||!(0,g.isParticipantPresent)(i,g.MAIN_PARTICIPANT_ID)&&(0,g.anyActiveParticipants)(i))return;let r=!1;const s=(0,d.findLastActionTimestamp)(e)??Date.now();if(t.activeVerificationId){const o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:"interrupt_inferred"};await n(e,o),l.logger.debug(`interrupt-reconcile: ended verification ${t.activeVerificationId}`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,r=!0}if(t.activeFixId){const o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:"interrupt_inferred"};await n(e,o),l.logger.debug(`interrupt-reconcile: ended fix ${t.activeFixId}`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),r=!0}if(t.active){const o={...(0,d.baseFields)(e),type:"activity_end",timestamp:s,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"activity_start",s),reason:"interrupt_inferred"};await n(e,o),l.logger.debug(`interrupt-reconcile: ended activity ${t.activeActivityId??""}`),t.active=!1,t.activeActivityId=null,(0,g.clearActivityParticipants)(i),r=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,r=!0),t.phase!=="coding"&&(t.phase="coding",r=!0),t.verifyIntent!==null&&(t.verifyIntent=null,r=!0),r&&u(i,t)}a(yt,"reconcileAbandonedActivity");async function It(i,e,n){const t=c(i);let r=!1;if(t.activeVerificationId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"verification_end",timestamp:s,verification_id:t.activeVerificationId,activity_id:t.activeActivityId,trace_id:t.activeTraceId,duration:(0,d.findDurationSinceLastAction)(e,"verification_start",s),reason:"compact"};await n(e,o),l.logger.debug(`compact-reconcile: ended verification ${t.activeVerificationId}`),t.activeVerificationId=null,t.activeTraceId=null,t.contextInjectedVerificationId=null,r=!0}if(t.activeFixId){const s=Date.now(),o={...(0,d.baseFields)(e),type:"fix_end",timestamp:s,fix_id:t.activeFixId,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"fix_start",s),reason:"compact"};await n(e,o),l.logger.debug(`compact-reconcile: ended fix ${t.activeFixId}`),t.activeFixId=null,t.pendingFixes.length>0&&(t.pendingFixes=[]),r=!0}if(t.active){const s=Date.now(),o={...(0,d.baseFields)(e),type:"activity_end",timestamp:s,activity_id:t.activeActivityId,duration:(0,d.findDurationSinceLastAction)(e,"activity_start",s),reason:"compact"};await n(e,o),l.logger.debug(`compact-reconcile: ended activity ${t.activeActivityId??""}`),t.active=!1,t.activeActivityId=null,(0,g.clearActivityParticipants)(i),r=!0}(t.recordingRequired||t.recordingActive)&&(t.recordingRequired=!1,t.recordingActive=!1,r=!0),t.phase!=="coding"&&(t.phase="coding",r=!0),t.verifyIntent!==null&&(t.verifyIntent=null,r=!0),r&&u(i,t)}a(It,"reconcileForCompact");0&&(module.exports={addPendingFixes,clearActiveActivity,clearActiveFix,clearActiveVerification,clearPendingFixes,clearVerifyIntent,closeOpenCycles,generateTraceId,getActiveActivityId,getActiveFixId,getActiveTraceId,getActiveVerificationId,getChainedStatusLine,getContextInjectedVerificationId,getLastVerdictHadIssues,getLastVerdictStatus,getPendingFixes,getPhase,getRetries,getUsagePlan,getUsageType,getUserEmail,getVerifyIntent,incrementRetries,isActive,isFailLikeVerdictStatus,isRecordingActive,isRecordingRequired,readState,reconcileAbandonedActivity,reconcileForCompact,reconcileSessionState,resetRetries,setActive,setActiveActivity,setActiveFix,setActiveVerification,setChainedStatusLine,setContextInjectedVerificationId,setLastVerdictHadIssues,setLastVerdictStatus,setPhase,setRecordingActive,setRecordingRequired,setUsage,setUserEmail,setVerifyIntent,writeState});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";var m=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var
|
|
1
|
+
"use strict";var m=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var _=(c,r)=>m(c,"name",{value:r,configurable:!0});var $=(c,r)=>{for(var s in r)m(c,s,{get:r[s],enumerable:!0})},S=(c,r,s,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of T(r))!I.call(c,n)&&n!==s&&m(c,n,{get:()=>r[n],enumerable:!(o=F(r,n))||o.enumerable});return c};var k=c=>S(m({},"__esModule",{value:!0}),c);var N={};$(N,{runSubmitVerdict:()=>L});module.exports=k(N);var y=require("fs"),w=require("path"),d=require("../../lib/logger"),u=require("../../lib/config"),x=require("../../lib/recording-tools"),V=require("../../lib/telemetry"),a=require("./actions"),e=require("./session-state");function J(c,r){const s=(0,e.getPendingFixes)(c);if(s.length>0)return s;const o=(0,a.summarizeFixFileChanges)((0,a.getFileChangesSinceLastFailVerdict)(r));return o.length>0?o:["re-verified after a prior failure (no tracked code changes in this fix cycle)"]}_(J,"deriveFixes");async function L(c){const{sessionId:r,sessionDir:s,verdictFile:o,actionsFile:n,verdictJson:C,projectDir:E}=c;let t;try{t=JSON.parse(C)}catch(i){return d.logger.debug(`submit-verdict: invalid JSON: ${i}`),{success:!1,message:"REJECTED: verdict is not valid JSON."}}if(t.status!=="pass"&&t.status!=="fail"&&t.status!=="not_applicable")return{success:!1,message:`REJECTED: status must be "pass", "fail", or "not_applicable", got "${t.status}".`};const f=t.status==="not_applicable",g=Array.isArray(t.not_applicable_cycles)?t.not_applicable_cycles:[],b=g.length>0;if(f&&b)return{success:!1,message:'REJECTED: do not combine not_applicable_cycles with status "not_applicable" (global N/A already exempts every cycle). Use status "not_applicable" for the whole change, OR a pass/fail status with not_applicable_cycles for a subset.'};if(b){const i=g.filter(l=>!u.ALL_CYCLES.includes(l));if(i.length>0)return{success:!1,message:`REJECTED: unknown cycle name(s) in not_applicable_cycles: ${i.join(", ")}. Valid: ${u.ALL_CYCLES.join(" / ")}.`}}if(f||b){if((0,e.isFailLikeVerdictStatus)((0,e.getLastVerdictStatus)(s)))return{success:!1,message:"REJECTED: you reported a fail \u2014 N/A cannot reclassify it. Fix the issues and re-verify, or report the fail again."};if(!Array.isArray(t.reason)||t.reason.length===0)return{success:!1,message:`REJECTED: ${f?'status "not_applicable"':"not_applicable_cycles"} requires a non-empty "reason" array explaining why there is no runtime surface to verify.`};if(E!==void 0&&(0,u.getVerificationStrict)((0,u.loadConfig)(E)))return{success:!1,message:"REJECTED: strict mode \u2014 N/A is not accepted. Verify the change with the required tools, or report a fail."}}if(!f&&(!Array.isArray(t.checks)||t.checks.length===0))return{success:!1,message:"REJECTED: checks must be a non-empty array describing what you functionally tested."};if(t.status==="fail"&&(!Array.isArray(t.issues)||t.issues.length===0))return{success:!1,message:'REJECTED: when status is "fail", issues must be a non-empty array describing what failed.'};if(t.status==="pass"&&(0,e.isFailLikeVerdictStatus)((0,e.getLastVerdictStatus)(s))&&(!Array.isArray(t.fixes)||t.fixes.length===0)&&(t.fixes=J(s,n)),(0,e.isRecordingRequired)(s)&&(0,e.isRecordingActive)(s))return{success:!1,message:`REJECTED: recording is still active.
|
|
2
2
|
|
|
3
3
|
1. Stop recording first:
|
|
4
4
|
${(0,x.listRecordingCycleTools)().map(l=>` ${l.stopTool} (${l.cycle} cycle)`).join(`
|
|
5
5
|
`)}
|
|
6
6
|
2. Then re-run the same submit-verdict command.
|
|
7
7
|
|
|
8
|
-
Recording start/stop must bracket the verification flow \u2014 start before devtools tools, stop before submit-verdict.`};try{(0,y.mkdirSync)((0,w.dirname)(o),{recursive:!0}),(0,y.writeFileSync)(o,JSON.stringify(t,null,2))}catch(
|
|
8
|
+
Recording start/stop must bracket the verification flow \u2014 start before devtools tools, stop before submit-verdict.`};try{(0,y.mkdirSync)((0,w.dirname)(o),{recursive:!0}),(0,y.writeFileSync)(o,JSON.stringify(t,null,2))}catch(i){return d.logger.debug(`submit-verdict: failed to write ${o}: ${i}`),{success:!1,message:`REJECTED: failed to write verdict file: ${i}`}}(0,e.setLastVerdictStatus)(s,t.status),(0,e.setLastVerdictHadIssues)(s,t.status==="pass"&&Array.isArray(t.issues)&&t.issues.length>0),(0,e.clearPendingFixes)(s),(0,e.isRecordingRequired)(s)&&(0,e.setRecordingRequired)(s,!1);const v=(0,e.getActiveActivityId)(s),h=(0,e.getActiveFixId)(s);if(h){const i=Date.now(),l={...(0,a.baseFields)(n),type:"fix_end",timestamp:i,fix_id:h,activity_id:v,duration:(0,a.findDurationSinceLastAction)(n,"fix_start",i)};await(0,a.appendAction)(n,l),(0,e.clearActiveFix)(s),(0,e.setPhase)(s,"coding"),d.logger.debug(`fix-end (verdict): ${h}`)}const p=(0,e.getActiveVerificationId)(s),A=(0,e.getActiveTraceId)(s);if(p){const i=Date.now(),l={...(0,a.baseFields)(n),type:"verification_end",timestamp:i,verification_id:p,activity_id:v,trace_id:A,duration:(0,a.findDurationSinceLastAction)(n,"verification_start",i),status:t.status};await(0,a.appendAction)(n,l),(0,e.clearActiveVerification)(s),d.logger.debug(`verification-end (auto): ${p} trace=${A}`)}const R=t,D={...(0,a.baseFields)(n),type:"verdict_write",timestamp:Date.now(),verification_id:p,activity_id:v,trace_id:A,verdict:R};if(await(0,a.appendAction)(n,D),await(0,V.trackVerdictWrite)(r,t.status,E),d.logger.debug(`submit-verdict: session=${r} status=${t.status}`),t.status==="pass"){const i=t.fixes?.length?` Fixes: ${t.fixes.join(", ")}`:"";return{success:!0,message:`VERDICT ACCEPTED: pass.${g.length>0?` (N/A cycles: ${g.join(", ")})`:""}${i}`}}return t.status==="not_applicable"?{success:!0,message:`VERDICT ACCEPTED: not_applicable. ${(t.reason??[]).join(", ")}`}:{success:!0,message:`VERDICT ACCEPTED: fail. Issues: ${(t.issues??[]).join(", ")}. Fix and re-verify.`}}_(L,"runSubmitVerdict");0&&(module.exports={runSubmitVerdict});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var v=Object.defineProperty;var
|
|
1
|
+
"use strict";var v=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var V=Object.prototype.hasOwnProperty;var x=(n,t)=>v(n,"name",{value:t,configurable:!0});var A=(n,t)=>{for(var e in t)v(n,e,{get:t[e],enumerable:!0})},_=(n,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of y(t))!V.call(n,a)&&a!==e&&v(n,a,{get:()=>t[a],enumerable:!(s=l(t,a))||s.enumerable});return n};var F=n=>_(v({},"__esModule",{value:!0}),n);var D={};A(D,{endVerification:()=>b,openFixCycleIfFixing:()=>w,startVerification:()=>E});module.exports=F(D);var I=require("crypto"),f=require("../../lib/logger"),r=require("./actions"),i=require("./session-state");async function E(n){const{sessionDir:t,actionsFile:e}=n,s=(0,i.getActiveActivityId)(t),a=(0,i.getActiveFixId)(t);if(a){const g=Date.now(),u={...(0,r.baseFields)(e),type:"fix_end",timestamp:g,fix_id:a,activity_id:s,duration:(0,r.findDurationSinceLastAction)(e,"fix_start",g)};await(0,r.appendAction)(e,u),(0,i.clearActiveFix)(t),f.logger.debug(`fix-end: ${a} (starting new verification)`)}const c=(0,i.getActiveVerificationId)(t);if(c){const g=(0,i.getActiveTraceId)(t);f.logger.debug(`ending previous verification ${c} before starting new one`);const u=Date.now(),p={...(0,r.baseFields)(e),type:"verification_end",timestamp:u,verification_id:c,activity_id:s,trace_id:g,duration:(0,r.findDurationSinceLastAction)(e,"verification_start",u)};await(0,r.appendAction)(e,p),(0,i.clearActiveVerification)(t)}const o=(0,I.randomUUID)(),d=(0,i.generateTraceId)(),m={...(0,r.baseFields)(e),type:"verification_start",timestamp:Date.now(),verification_id:o,activity_id:s,trace_id:d};return await(0,r.appendAction)(e,m),(0,i.setActiveVerification)(t,o,d),n.recordingEnabled&&((0,i.setRecordingRequired)(t,!0),(0,i.setRecordingActive)(t,!1)),n.intent==="fix"?(0,i.setVerifyIntent)(t,"fix"):(0,i.clearVerifyIntent)(t),f.logger.debug(`verification-start: ${o} trace=${d} recording=${!!n.recordingEnabled} intent=${n.intent??"-"}`),{verificationId:o,traceId:d}}x(E,"startVerification");async function w(n){const{sessionDir:t,actionsFile:e}=n;if(!(0,i.isFailLikeVerdictStatus)((0,i.getLastVerdictStatus)(t))&&!(0,i.getLastVerdictHadIssues)(t))return;const s=(0,i.getActiveFixId)(t);if(s)return s;const a=(0,i.getActiveActivityId)(t),c=(0,I.randomUUID)(),o={...(0,r.baseFields)(e),type:"fix_start",timestamp:Date.now(),fix_id:c,activity_id:a};return await(0,r.appendAction)(e,o),(0,i.setActiveFix)(t,c),(0,i.setPhase)(t,"fixing"),f.logger.debug(`fix-start (edit after fail / pass-with-issues): ${c}`),c}x(w,"openFixCycleIfFixing");async function b(n){const{sessionDir:t,actionsFile:e}=n,s=(0,i.getActiveVerificationId)(t);if(!s)return{success:!1,message:"No active verification to end."};const a=(0,i.getActiveTraceId)(t),c=(0,i.getActiveActivityId)(t),o=Date.now(),d={...(0,r.baseFields)(e),type:"verification_end",timestamp:o,verification_id:s,activity_id:c,trace_id:a,duration:(0,r.findDurationSinceLastAction)(e,"verification_start",o)};return await(0,r.appendAction)(e,d),(0,i.clearActiveVerification)(t),f.logger.debug(`verification-end: ${s} trace=${a}`),{success:!0,verificationId:s,traceId:a,message:`Verification ${s} ended.`}}x(b,"endVerification");0&&(module.exports={endVerification,openFixCycleIfFixing,startVerification});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var T=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var u=(e,t)=>T(e,"name",{value:t,configurable:!0});var W=(e,t)=>{for(var i in t)T(e,i,{get:t[i],enumerable:!0})},X=(e,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of z(t))!K.call(e,s)&&s!==i&&T(e,s,{get:()=>t[s],enumerable:!(o=Q(t,s))||o.enumerable});return e};var Z=e=>X(T({},"__esModule",{value:!0}),e);var ge={};W(ge,{runVerifyGate:()=>fe});module.exports=Z(ge);var
|
|
1
|
+
"use strict";var T=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var u=(e,t)=>T(e,"name",{value:t,configurable:!0});var W=(e,t)=>{for(var i in t)T(e,i,{get:t[i],enumerable:!0})},X=(e,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of z(t))!K.call(e,s)&&s!==i&&T(e,s,{get:()=>t[s],enumerable:!(o=Q(t,s))||o.enumerable});return e};var Z=e=>X(T({},"__esModule",{value:!0}),e);var ge={};W(ge,{runVerifyGate:()=>fe});module.exports=Z(ge);var b=require("fs"),d=require("../../lib/logger"),V=require("../../lib/telemetry"),h=require("./actions"),r=require("./session-state"),B=require("./activity-participants"),p=require("../../lib/config"),M=require("./required-tools");const ee=3,te=1;function ie(e){const t=p.CYCLE_TO_SERVER[e];if(t===void 0)throw new Error(`No MCP server registered for cycle '${e}'.`);return t}u(ie,"mcpServerForCycle");function _(e){return JSON.stringify({session_id:e,status:"pass",checks:["form submits successfully","new item appears in list","no console errors"]})}u(_,"verdictExamplePass");function q(e){return JSON.stringify({session_id:e,status:"fail",checks:["form renders","submit button unresponsive"],issues:["button click handler not firing","TypeError in console"]})}u(q,"verdictExampleFail");function k(...e){for(const t of e)try{(0,b.existsSync)(t)&&(0,b.unlinkSync)(t)}catch(i){d.logger.debug(`failed to cleanup ${t}: ${i}`)}}u(k,"cleanup");function oe(e){if(!(0,b.existsSync)(e))return null;try{return JSON.parse((0,b.readFileSync)(e,"utf-8"))}catch{return null}}u(oe,"readVerdictQuietly");function re(e,t){const i=(0,h.getFileChangesSinceLastVerification)(e),o=new Set;for(const f of i)for(const a of(0,p.getActiveCycles)(f.file_path,t))o.add(a);const s=[];o.has("browser")&&s.push("browser");for(const f of p.OPTIONAL_CYCLES)o.has(f)&&s.push(f);return s}u(re,"computeActiveCycles");function ne(e,t,i){const o=ie(e),s=new Set(t.filter(a=>a.tool_type==="mcp"&&a.mcp_server===o).map(a=>a.tool_name)),f=(0,p.getRequiredToolsConfig)(i,e);return{cycle:e,result:(0,M.satisfyRequiredTools)(s,f),config:f,usedCount:s.size}}u(ne,"checkCycleTools");function se(e){return{cycle:"browser",valid:!0,passCriteriaMet:!0}}u(se,"checkBrowserEvidence");function ae(e){return{cycle:"node",valid:!0,passCriteriaMet:!0}}u(ae,"checkNodeEvidence");function ce(e){return{cycle:"backend",valid:!0,passCriteriaMet:!0}}u(ce,"checkBackendEvidence");function le(e){return{cycle:"android",valid:!0,passCriteriaMet:!0}}u(le,"checkAndroidEvidence");function de(e,t){if(!Array.isArray(t.checks)||t.checks.length===0)return{cycle:e,valid:!1,reason:"missing checks"};if(e==="browser")return se(t);if(e==="node")return ae(t);if(e==="backend")return ce(t);if(e==="android")return le(t);throw new Error(`No evidence checker registered for cycle '${e}'.`)}u(de,"checkCycleEvidence");function ue(e){const t=e.cycle.charAt(0).toUpperCase()+e.cycle.slice(1);if(e.result.missing.length===0)return`${t} cycle: ok.`;const i=e.result.missing.map(o=>` - ${o}`).join(`
|
|
2
2
|
`);return e.config.evidencePaths.length>0&&e.result.pathName!==void 0?`${t} cycle: incomplete (closest path "${e.result.pathName}", tried [${e.result.triedPaths.join(", ")}]):
|
|
3
3
|
${i}`:`${t} cycle: missing required tools:
|
|
4
|
-
${i}`}u(ue,"describeMissingTools");async function fe(e){const{sessionId:t,sessionDir:i,actionsFile:o,verdictFile:s,maxRetries:f}=e,a=f??ee,C=e.config??(0,p.loadConfig)(e.projectDir);if(d.logger.debug(`verify-gate: session=${t} verdictExists=${(0,
|
|
4
|
+
${i}`}u(ue,"describeMissingTools");async function fe(e){const{sessionId:t,sessionDir:i,actionsFile:o,verdictFile:s,maxRetries:f}=e,a=f??ee,C=e.config??(0,p.loadConfig)(e.projectDir);if(d.logger.debug(`verify-gate: session=${t} verdictExists=${(0,b.existsSync)(s)}`),(0,B.anyNonMainParticipants)(i)&&((0,r.getActiveVerificationId)(i)!==void 0||!(0,b.existsSync)(s)))return d.logger.debug("verifier sub-agent still running \u2014 allowing the main Stop, deferring activity close to the verifier (silent): verifier_running"),{action:"allow",reason:"verifier_running",message:"Verification is still running (delegated to the ironbee-verifier sub-agent). It continues in the background; you'll be re-invoked with its verdict when it finishes \u2014 do NOT claim completion yet, and do NOT spawn another verifier. A PASS completes the work; a FAIL means fix the reported issues and re-verify."};if(!(0,h.hasFileChangesSinceLastVerification)(o)){if((0,r.getLastVerdictStatus)(i)==="fail"){if((0,r.getVerifyIntent)(i)!=="fix")return d.logger.debug("fail verdict with no code changes in window \u2014 status report, allowing"),(0,r.setLastVerdictStatus)(i,"fail_reported"),await l(o,i,t,"allow","fail_verdict_reported",[],e.projectDir),{action:"allow"};const n=(0,r.incrementRetries)(i);return n>=a?(d.logger.debug(`fix intent declared but retries exhausted (${n}/${a}) \u2014 releasing`),(0,r.resetRetries)(i),await(0,r.closeOpenCycles)(i,o,"max_retries_exceeded"),await l(o,i,t,"allow","max_retries_exceeded",[],e.projectDir),{action:"allow",message:`VERIFICATION FAILED ${a} TIMES. Allowing completion.
|
|
5
5
|
|
|
6
6
|
The fail verdict was never resolved. Report the unresolved issues in your final response.`}):(d.logger.debug(`fix intent declared, fail verdict not addressed \u2014 blocking (unaddressed, attempt ${n}/${a})`),await l(o,i,t,"block","fail_verdict_unaddressed",[],e.projectDir),{action:"block",message:`VERIFICATION FAILED \u2014 unaddressed (attempt ${n}/${a}).
|
|
7
7
|
|
|
@@ -13,7 +13,7 @@ You submitted a fail verdict but did not address the reported issues. Either:
|
|
|
13
13
|
|
|
14
14
|
2. Or \u2014 if the issues genuinely cannot be fixed \u2014 re-verify (keep the --intent fix flag)
|
|
15
15
|
to confirm the failure: each blocked stop counts toward maxRetries; once exhausted,
|
|
16
|
-
the gate will allow completion with the issues reported.`})}return d.logger.debug("no code changes detected, allowing completion"),await l(o,i,t,"allow","no_edits",[],e.projectDir),{action:"allow"}}const c=re(o,C);if(c.length===0)return d.logger.debug("file changes match no cycle pattern, allowing completion"),await l(o,i,t,"allow","no_cycle_active",[],e.projectDir),{action:"allow"};const S=(0,p.getVerificationStrict)(C),U=(0,r.isFailLikeVerdictStatus)((0,r.getLastVerdictStatus)(i)),y=oe(s),x=!S&&!U&&y!==null&&Array.isArray(y.reason)&&y.reason.length>0;if(x&&y.status==="not_applicable")return d.logger.debug("global N/A verdict, allowing completion"),(0,r.resetRetries)(i),(0,r.setLastVerdictStatus)(i,"not_applicable"),await l(o,i,t,"allow","verdict_not_applicable",c,e.projectDir),{action:"allow"};let
|
|
16
|
+
the gate will allow completion with the issues reported.`})}return d.logger.debug("no code changes detected, allowing completion"),await l(o,i,t,"allow","no_edits",[],e.projectDir),{action:"allow"}}const c=re(o,C);if(c.length===0)return d.logger.debug("file changes match no cycle pattern, allowing completion"),await l(o,i,t,"allow","no_cycle_active",[],e.projectDir),{action:"allow"};const S=(0,p.getVerificationStrict)(C),U=(0,r.isFailLikeVerdictStatus)((0,r.getLastVerdictStatus)(i)),y=oe(s),x=!S&&!U&&y!==null&&Array.isArray(y.reason)&&y.reason.length>0;if(x&&y.status==="not_applicable")return d.logger.debug("global N/A verdict, allowing completion"),(0,r.resetRetries)(i),(0,r.setLastVerdictStatus)(i,"not_applicable"),await l(o,i,t,"allow","verdict_not_applicable",c,e.projectDir),{action:"allow"};let v=c;if(x&&Array.isArray(y.not_applicable_cycles)&&y.not_applicable_cycles.length>0){const n=new Set(y.not_applicable_cycles.filter(g=>c.includes(g)));if(v=c.filter(g=>!n.has(g)),v.length===0)return d.logger.debug("per-platform N/A exempted every active cycle \u2014 treating as global N/A"),(0,r.resetRetries)(i),(0,r.setLastVerdictStatus)(i,"not_applicable"),await l(o,i,t,"allow","verdict_not_applicable",c,e.projectDir),{action:"allow"};d.logger.debug(`per-platform N/A: exempt=[${[...n].join(",")}] enforced=[${v.join(",")}]`)}const J=(0,h.getToolCallsSinceLastFileChange)(o),N=v.map(n=>ne(n,J,C)),D=N.filter(n=>!n.result.satisfied);if(D.length>0){const n=N.every(m=>m.usedCount===0),g=(0,r.incrementRetries)(i),$=!(0,h.hasVerifierEverEngaged)(o),G=$&&g>te,Y=g>=a;if(G||Y){const m=$?"verifier_unavailable":"max_retries_exceeded";d.logger.debug(`tool-presence loop releasing (attempt ${g}/${a}, neverEngaged=${$}) \u2014 ${m}`),(0,r.resetRetries)(i),await(0,r.closeOpenCycles)(i,o,m),await l(o,i,t,"allow",m,c,e.projectDir);const A=c.join(", ");return $?{action:"allow",message:`VERIFICATION UNAVAILABLE \u2014 allowing completion.
|
|
17
17
|
|
|
18
18
|
The ${A} verification cycle could not run this session: no verification was ever started and no verification tool was recorded across the whole session. This points to an environment/setup problem rather than a skipped step. Check:
|
|
19
19
|
- the devtools MCP server is installed and loads (try \`npx -y @ironbee-ai/devtools\`);
|
|
@@ -26,7 +26,7 @@ The ${A} verification cycle was attempted but its required tools were not all co
|
|
|
26
26
|
|
|
27
27
|
You made code changes but did not verify them.
|
|
28
28
|
|
|
29
|
-
${
|
|
29
|
+
${v.includes("browser")?`Browser cycle (UI verification):
|
|
30
30
|
1. Build and start the application if not already running
|
|
31
31
|
2. Navigate to the affected page(s)
|
|
32
32
|
3. Functionally test your changes \u2014 click, type, submit, interact with the UI to confirm the code works
|
|
@@ -34,18 +34,18 @@ ${b.includes("browser")?`Browser cycle (UI verification):
|
|
|
34
34
|
5. Take an accessibility snapshot to verify page structure
|
|
35
35
|
6. Check console for errors
|
|
36
36
|
7. Stop the dev server when done
|
|
37
|
-
`:""}${
|
|
37
|
+
`:""}${v.includes("node")?`Node cycle (Node.js runtime debug):
|
|
38
38
|
1. Connect to the running Node process via ndt_debug_connect
|
|
39
39
|
2. Set probes (tracepoint / logpoint / exceptionpoint) at the changed code paths
|
|
40
40
|
3. Exercise the code path so probes fire
|
|
41
41
|
4. Read snapshots via ndt_debug_get-probe-snapshots, OR inspect runtime errors via ndt_debug_get-logs
|
|
42
|
-
`:""}${
|
|
42
|
+
`:""}${v.includes("backend")?`Backend cycle (runtime-agnostic service verification \u2014 pick ONE or more evidence paths):
|
|
43
43
|
1. Identify the backend layer affected by your change (HTTP / gRPC / GraphQL / WebSocket endpoint, log output, or database state)
|
|
44
44
|
2a. Protocol-call path: make a real call against the running service (bedt_request_http / bedt_request_grpc / bedt_request_graphql / bedt_request_websocket-open / bedt_request_replay), inspect status / body / traceId, chain follow-ups to verify side effects
|
|
45
45
|
2b. Log-evidence path (for when something else drives the request): bedt_log_register-source (file / docker / kubernetes), then bedt_log_read / bedt_log_read-multi / bedt_log_follow
|
|
46
46
|
2c. DB-evidence path (for schema / migration / seed / query-regression changes): bedt_db_connect (named, readonly by default), then bedt_db_query / bedt_db_describe-table / bedt_db_list-tables / bedt_db_snapshot / bedt_db_diff / bedt_db_get-changes
|
|
47
47
|
3. (Optional) Pin a correlation trace id for the run via bedt_o11y_new-trace-id / bedt_o11y_set-trace-context \u2014 IronBee already injects an active verification traceId, so the o11y pin only matters when you want a fresh root for log searches.
|
|
48
|
-
`:""}${
|
|
48
|
+
`:""}${v.includes("android")?`Android cycle (mobile device / emulator verification \u2014 pick ONE evidence path):
|
|
49
49
|
1. Connect to a running device or emulator: adt_device_connect
|
|
50
50
|
2a. Device-evidence path: drive the app UI (adt_device_launch-app / adt_interaction_tap / adt_interaction_input-text / adt_interaction_swipe), then capture BOTH a screenshot (adt_content_take-screenshot) AND a UI snapshot (adt_a11y_take-ui-snapshot) to confirm the visual + structural result
|
|
51
51
|
2b. Log-evidence path: read Logcat output for the changed code path (adt_o11y_log-read / adt_o11y_log-follow) and confirm expected log lines / absence of errors
|
|
@@ -62,15 +62,15 @@ ${H}
|
|
|
62
62
|
|
|
63
63
|
Run the missing tools, functionally test your changes, then submit your verdict:
|
|
64
64
|
Pass: echo '${_(t)}' | ironbee hook submit-verdict
|
|
65
|
-
Fail: echo '${q(t)}' | ironbee hook submit-verdict`}}if(!(0,
|
|
65
|
+
Fail: echo '${q(t)}' | ironbee hook submit-verdict`}}if(!(0,b.existsSync)(s))return await l(o,i,t,"block","no_verdict",c,e.projectDir),{action:"block",message:`VERDICT MISSING.
|
|
66
66
|
|
|
67
67
|
You ran the verification tools but did not submit a verdict.${(0,r.isRecordingActive)(i)?`
|
|
68
68
|
\u26A0 Recording is still active \u2014 call mcp__browser-devtools__bdt_content_stop-recording BEFORE submit-verdict (otherwise it will reject with "recording is still active").`:""}
|
|
69
69
|
|
|
70
70
|
Submit your verdict via:
|
|
71
|
-
echo '${_(t)}' | ironbee hook submit-verdict`};let w;try{w=JSON.parse((0,
|
|
72
|
-
echo '${_(t)}' | ironbee hook submit-verdict`}}if(w.status==="not_applicable")return k(s),await l(o,i,t,"block","not_applicable_rejected",
|
|
73
|
-
echo '${_(t)}' | ironbee hook submit-verdict`};const F=
|
|
71
|
+
echo '${_(t)}' | ironbee hook submit-verdict`};let w;try{w=JSON.parse((0,b.readFileSync)(s,"utf-8"))}catch(n){return d.logger.debug(`failed to parse verdict ${s}: ${n}`),k(s),await l(o,i,t,"block","invalid_verdict",c,e.projectDir),{action:"block",message:`INVALID VERDICT JSON. Re-submit valid JSON:
|
|
72
|
+
echo '${_(t)}' | ironbee hook submit-verdict`}}if(w.status==="not_applicable")return k(s),await l(o,i,t,"block","not_applicable_rejected",v,e.projectDir),{action:"block",message:`VERDICT REJECTED: ${S?"N/A is not accepted in strict mode \u2014 verify the change with the required tools.":"N/A is not honored here \u2014 verify the change with the required tools, or report a fail."}
|
|
73
|
+
echo '${_(t)}' | ironbee hook submit-verdict`};const F=v.map(n=>de(n,w)),j=F.filter(n=>!n.valid);if(j.length>0)return k(s),await l(o,i,t,"block","invalid_verdict",c,e.projectDir),{action:"block",message:`VERDICT REJECTED:
|
|
74
74
|
${j.map(g=>` - ${g.cycle} cycle: ${g.reason}`).join(`
|
|
75
75
|
`)}
|
|
76
76
|
|