@a-company/paradigm 7.2.0 → 7.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{accept-orchestration-XW44LF5Y.js → accept-orchestration-NFNY5A4Q.js} +1 -1
- package/dist/{aggregate-H7SB2UYT.js → aggregate-647KIGV6.js} +1 -1
- package/dist/ambient-5TA5CD7Z.js +2 -0
- package/dist/{ambient-TFLZFV5Y.js → ambient-N24SR3BC.js} +1 -1
- package/dist/ambient-W3SPKLKC.js +2 -0
- package/dist/{arch-loader-YVOS3QRY.js → arch-loader-6TDQOSUE.js} +1 -1
- package/dist/arch-loader-NAGXLWUQ.js +2 -0
- package/dist/{beacon-WVN264OT.js → beacon-4XQSMTNN.js} +1 -1
- package/dist/calibrate-SH6PRZFD.js +2 -0
- package/dist/calibration-aggregate-5IVXSBDP.js +2 -0
- package/dist/calibration-aggregate-DUEE3LL2.js +4 -0
- package/dist/captain-2MEKZKJS.js +2 -0
- package/dist/captain-V5XPN4UP.js +2 -0
- package/dist/chunk-43H6PB2A.js +142 -0
- package/dist/chunk-54C2PETP.js +12 -0
- package/dist/{chunk-RGSFU2YW.js → chunk-5LIE2QMS.js} +1 -1
- package/dist/{chunk-ACJWUOMA.js → chunk-74NGU6YN.js} +1 -1
- package/dist/chunk-ABHILQLA.js +42 -0
- package/dist/{chunk-2KK4JQ55.js → chunk-AMZ3ESAK.js} +2 -2
- package/dist/chunk-BTMT4K73.js +93 -0
- package/dist/chunk-BXKFSYIN.js +2 -0
- package/dist/{chunk-RZRFYGND.js → chunk-CHFY3JSF.js} +15 -15
- package/dist/chunk-D2T5AV5N.js +504 -0
- package/dist/{chunk-ASBK55FU.js → chunk-DLMDHS2X.js} +1 -1
- package/dist/{chunk-6VZSOQ7Y.js → chunk-DQ4MMMTP.js} +1 -1
- package/dist/chunk-F3OBFUOE.js +2 -0
- package/dist/chunk-GADXREYG.js +18 -0
- package/dist/{chunk-A5EEY6NO.js → chunk-HGT7RNOL.js} +1 -1
- package/dist/chunk-HLPYCWE5.js +6 -0
- package/dist/chunk-IGB2CIMK.js +93 -0
- package/dist/{chunk-27EK3OQZ.js → chunk-JJ3AUHQU.js} +1 -1
- package/dist/chunk-JOHPASZG.js +4 -0
- package/dist/chunk-JOWT6J4C.js +25 -0
- package/dist/chunk-L4MKNG56.js +42 -0
- package/dist/chunk-PRZZL57E.js +7 -0
- package/dist/chunk-QBIME67A.js +2 -0
- package/dist/{chunk-USYV5QYU.js → chunk-QTMJVEEW.js} +1 -1
- package/dist/chunk-RPGSQQTS.js +2 -0
- package/dist/chunk-RQHZUPLO.js +4 -0
- package/dist/chunk-SGLIPRIC.js +3 -0
- package/dist/chunk-SOVBBLFK.js +6 -0
- package/dist/chunk-SPU3R5GW.js +25 -0
- package/dist/{chunk-NRP2KJ6I.js → chunk-T577TTVG.js} +3 -3
- package/dist/{chunk-W3VWORQZ.js → chunk-VHVUJGZ2.js} +2 -2
- package/dist/chunk-WUSTIEYA.js +4 -0
- package/dist/{commands-4ENQMHFO.js → commands-RSHKXKXN.js} +1 -1
- package/dist/{compliance-3M6COUCO.js → compliance-EFNXWHDL.js} +1 -1
- package/dist/{constellation-TIKNCZWR.js → constellation-26225R5K.js} +1 -1
- package/dist/{diff-Z2YSIRC4.js → diff-G52RYZNF.js} +1 -1
- package/dist/dist-6TDAY6TQ-HMSTBL57.js +39 -0
- package/dist/dist-N4NYCS3D.js +2 -0
- package/dist/dist-O7KGTIYK.js +4 -0
- package/dist/{docs-OWJ7EPD7.js → docs-2O7HUSBX.js} +1 -1
- package/dist/doctor-KGQXLGOQ.js +2 -0
- package/dist/github-GI3HX3N5.js +4 -0
- package/dist/graph-slice-2WECDOEN.js +2 -0
- package/dist/index.js +6 -6
- package/dist/{init-QPMLEQWQ.js → init-JGYCABZZ.js} +1 -1
- package/dist/{integrity-FRGF5BFS.js → integrity-YUCXTQX3.js} +1 -1
- package/dist/mcp.js +2 -2
- package/dist/nomination-engine-3EYXJOZZ.js +2 -0
- package/dist/nomination-engine-BUPERVPR.js +2 -0
- package/dist/notebook-loader-QM4KUT4R.js +2 -0
- package/dist/{orchestrate-C5NM5MFN.js → orchestrate-RIKQB2DV.js} +1 -1
- package/dist/orchestration-GFNPCEUU.js +2 -0
- package/dist/orchestration-I62QXOWV.js +2 -0
- package/dist/platform-server-AAEDDBS3.js +25 -0
- package/dist/{probe-G3TKOJYW.js → probe-GD3VDWGT.js} +1 -1
- package/dist/reindex-FNL4QRUZ.js +2 -0
- package/dist/reindex-N4NTDLJY.js +2 -0
- package/dist/{review-WHRNLW2W.js → review-YG4LWV22.js} +1 -1
- package/dist/{ripple-B6U7263T.js → ripple-S6VBP5C6.js} +1 -1
- package/dist/{sentinel-EFPEX246.js → sentinel-RIEQWALQ.js} +1 -1
- package/dist/{sentinel-bridge-UR2MKARY.js → sentinel-bridge-D4LFDFCH.js} +1 -1
- package/dist/sentinel.js +1 -1
- package/dist/serve-NPRYOGQX.js +9 -0
- package/dist/{server-4D77LCST.js → server-K7G3IHR3.js} +1 -1
- package/dist/session-tracker-HYN6ZYPH.js +2 -0
- package/dist/{session-work-log-T2IE4Y4T.js → session-work-log-KZX4PGUL.js} +1 -1
- package/dist/{setup-L5OP24US.js → setup-GPOTHS3N.js} +1 -1
- package/dist/{shift-UDKXCIW7.js → shift-ZIJTQ5SW.js} +2 -2
- package/dist/{snapshot-MT5L6XE4.js → snapshot-2ARNF3U2.js} +1 -1
- package/dist/{spawn-I6XG57S2.js → spawn-PHA2SVQ3.js} +1 -1
- package/dist/{status-4QGKLOP6.js → status-NTWWESOR.js} +1 -1
- package/dist/{summary-6QNVQZJV.js → summary-4QXYLXAB.js} +1 -1
- package/dist/sync-layer-Z266WBWF.js +2 -0
- package/dist/task-6F527BNU.js +3 -0
- package/dist/task-loader-75NBBLRQ.js +2 -0
- package/dist/task-loader-INPLZRG5.js +2 -0
- package/dist/task-settlement-3ROAHAND.js +3 -0
- package/dist/task-settlement-F7CIKUG3.js +3 -0
- package/dist/team-PFJTOCPM.js +2 -0
- package/dist/tools-MAH6K5UL.js +142 -0
- package/dist/tools-Z354SXGS.js +2 -0
- package/dist/{workspace-4D4TQ637.js → workspace-HADUT5XT.js} +1 -1
- package/package.json +3 -6
- package/platform-ui/dist/assets/{AmbientSection-CwatqcBD.js → AmbientSection-xoxr3DQg.js} +1 -1
- package/platform-ui/dist/assets/{DocsSection-BZ2SFJBZ.js → DocsSection-Us2qksna.js} +1 -1
- package/platform-ui/dist/assets/{GitSection-MNNYU1tO.js → GitSection-DIHZyadf.js} +1 -1
- package/platform-ui/dist/assets/{GraphSection-COYjb4Pt.js → GraphSection-9TO0L1IO.js} +1 -1
- package/platform-ui/dist/assets/{LoreSection-B0hUbfsJ.js → LoreSection-DVDit8Aw.js} +1 -1
- package/platform-ui/dist/assets/{SentinelSection-BCxW1DCp.js → SentinelSection-a5_VNYcx.js} +1 -1
- package/platform-ui/dist/assets/{SymphonySection-BsucZRqy.js → SymphonySection-cRHEoJ9t.js} +1 -1
- package/platform-ui/dist/assets/TasksSection-44_gDO3L.css +1 -0
- package/platform-ui/dist/assets/TasksSection-h8x3qRIj.js +1 -0
- package/platform-ui/dist/assets/{TeamSection-C0QNTudW.js → TeamSection-mFoDyNic.js} +1 -1
- package/platform-ui/dist/assets/{UniversitySection-DN1-g9pw.js → UniversitySection-D99YRjmC.js} +1 -1
- package/platform-ui/dist/assets/{index-DwUT8pju.js → index-D_wB2S_2.js} +11 -11
- package/platform-ui/dist/index.html +1 -1
- package/dist/ambient-OW5M5LVN.js +0 -2
- package/dist/ambient-VCTUHHIG.js +0 -2
- package/dist/arch-loader-G3AAM4E2.js +0 -2
- package/dist/calibrate-PHVP7RPH.js +0 -4
- package/dist/captain-CAXGHC2V.js +0 -2
- package/dist/captain-CWCLFOXV.js +0 -2
- package/dist/chunk-33ERV2MW.js +0 -18
- package/dist/chunk-3I3TITBA.js +0 -25
- package/dist/chunk-3YM5ABNX.js +0 -2
- package/dist/chunk-6HYRS3PH.js +0 -142
- package/dist/chunk-727PXENG.js +0 -2
- package/dist/chunk-D6BSCELB.js +0 -2
- package/dist/chunk-FG3M6VVO.js +0 -30
- package/dist/chunk-HSY75GRR.js +0 -6
- package/dist/chunk-K7KT6FL3.js +0 -25
- package/dist/chunk-KAUGQMXU.js +0 -4
- package/dist/chunk-QPQBXRXX.js +0 -93
- package/dist/chunk-RVXQNS6K.js +0 -30
- package/dist/chunk-TMDPDIWA.js +0 -3
- package/dist/chunk-UNSI6DVD.js +0 -93
- package/dist/chunk-XBK244QR.js +0 -6
- package/dist/chunk-XMAV5AG6.js +0 -2
- package/dist/chunk-XSKIXXFW.js +0 -504
- package/dist/chunk-Y76OIMDO.js +0 -7
- package/dist/chunk-ZSWXLFN7.js +0 -12
- package/dist/dist-GQ42YS5N-4HIJZVBB.js +0 -39
- package/dist/dist-PW5YPGFF.js +0 -2
- package/dist/dist-RXYJK7AZ.js +0 -2
- package/dist/doctor-CBZYYQQH.js +0 -2
- package/dist/github-4X4MYINS.js +0 -4
- package/dist/lore-server-FC2GMDLT.js +0 -14
- package/dist/nomination-engine-EFXDEPZN.js +0 -2
- package/dist/nomination-engine-YRHZZZUN.js +0 -2
- package/dist/notebook-loader-TZVIMNDJ.js +0 -2
- package/dist/orchestration-EVWQWTOV.js +0 -2
- package/dist/orchestration-UP3KFUJT.js +0 -2
- package/dist/platform-server-FXF3XFHM.js +0 -25
- package/dist/reindex-QZYOD5K4.js +0 -2
- package/dist/reindex-W67B2LQP.js +0 -2
- package/dist/serve-L52ZUTU6.js +0 -10
- package/dist/serve-ZT2Z54NK.js +0 -8
- package/dist/session-tracker-BZ7FU4AT.js +0 -2
- package/dist/task-KFND4HLF.js +0 -3
- package/dist/task-loader-HBZ3KRH2.js +0 -2
- package/dist/task-loader-IO4UVFUD.js +0 -2
- package/dist/task-settlement-NF7PFSNE.js +0 -3
- package/dist/task-settlement-TATNPY6L.js +0 -3
- package/dist/team-6WNNLBAO.js +0 -2
- package/dist/tools-GDWT74O6.js +0 -2
- package/dist/tools-SDWAFQMQ.js +0 -142
- package/graph-ui/dist/assets/index-BlgXTl53.css +0 -1
- package/graph-ui/dist/assets/index-Bq5nXK8p.js +0 -63
- package/graph-ui/dist/index.html +0 -13
- package/lore-ui/dist/assets/index-C3EixkjW.css +0 -1
- package/lore-ui/dist/assets/index-DKhNxgtW.js +0 -56
- package/lore-ui/dist/index.html +0 -13
- package/platform-ui/dist/assets/CanvasSection-dFAthehN.js +0 -9
- package/platform-ui/dist/assets/CanvasSection-flMXU19z.css +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {m,o as o$1,B}from'./chunk-
|
|
2
|
+
import {m,o as o$1,B}from'./chunk-JOHPASZG.js';import {f}from'./chunk-K6TLYNRQ.js';import {e}from'./chunk-ZJQY5PPP.js';import {a as a$1}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as l from'fs';import*as a from'path';import o from'chalk';import G from'ora';async function D(){let t=process.cwd();console.log(o.blue(`
|
|
3
3
|
\u{1F4CA} Paradigm Status
|
|
4
4
|
`)),console.log(o.gray("\u2500".repeat(40)));let i=a$1.command("status").start("Getting project status"),r=G("Scanning project...").start(),p=l.existsSync(a.join(t,".premise")),m$1=l.existsSync(a.join(t,".purpose")),f$1=l.existsSync(a.join(t,"portal.yaml"));r.stop(),console.log(o.white(`
|
|
5
5
|
Configuration Files`)),console.log(o.gray("\u2500".repeat(40))),console.log(` .premise: ${p?o.green("\u2713 Found"):o.yellow("\u25CB Not found")}`),console.log(` .purpose: ${m$1?o.green("\u2713 Found"):o.yellow("\u25CB Not found")}`),console.log(` portal.yaml: ${f$1?o.green("\u2713 Found"):o.yellow("\u25CB Not found")}`),r.start("Counting files...");let u=await f(t),y=await e(t);if(r.stop(),console.log(o.white(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {m}from'./chunk-
|
|
2
|
+
import {m}from'./chunk-JOHPASZG.js';import'./chunk-K6TLYNRQ.js';import'./chunk-ZJQY5PPP.js';import {c as c$1,a}from'./chunk-YNDPSWOE.js';import'./chunk-VIG5LSGZ.js';import'./chunk-5TAVYPOV.js';import*as n from'fs';import*as c from'path';import o from'chalk';import S from'ora';async function F(){let p=process.cwd(),x=c.basename(p),l=S();console.log(o.blue(`
|
|
3
3
|
\u{1F4CA} Paradigm Summary
|
|
4
4
|
`));let r=c.join(p,".paradigm");(!n.existsSync(r)||!n.statSync(r).isDirectory())&&(console.log(o.red("\u274C No .paradigm/ directory found.")),console.log(o.gray(" Run `paradigm init` first.\n")),process.exit(1)),l.start("Aggregating symbols...");let m$1;try{m$1=await m(p),l.succeed(`Found ${m$1.symbols.length} symbols`);}catch(e){l.fail(o.red("Failed to aggregate symbols")),console.error(o.gray(e.message)),process.exit(1);}let u={components:{count:0,examples:[]},flows:{count:0,examples:[]},gates:{count:0,examples:[]},signals:{count:0,examples:[]},aspects:{count:0,examples:[]}};for(let e of m$1.symbols){let t=e.type,i=t==="component"?"components":t==="flow"?"flows":t==="gate"?"gates":t==="signal"?"signals":t==="aspect"?"aspects":null;i&&u[i]&&(u[i].count++,u[i].examples.length<3&&u[i].examples.push(e.symbol));}let a$1=[];n.existsSync(c.join(r,"config.yaml"))?a$1.push({check:"Config",status:"ok"}):a$1.push({check:"Config",status:"missing"});let k=["logger.md","probe.md","symbols.md"].every(e=>n.existsSync(c.join(r,"specs",e)));a$1.push({check:"Specs",status:k?"ok":"warn"});let j=n.existsSync(c.join(r,"docs"));a$1.push({check:"Docs",status:j?"ok":"warn"});let g=c$1(p);if(g.detected){let e=a(g.detected);e&&n.existsSync(c.join(p,e.outputPath))?a$1.push({check:`IDE (${g.detected})`,status:"ok"}):a$1.push({check:`IDE (${g.detected})`,status:"warn"});}let w=n.existsSync(c.join(r,"scan-index.json"))||n.existsSync(c.join(p,".paradigm-scan-index.json"));a$1.push({check:"Scan index",status:w?"ok":"missing"});let s=[];s.push(`# Project: ${x}`),s.push(""),s.push(`**Generated:** ${new Date().toISOString()}`),s.push("**Paradigm Version:** 0.2.0"),s.push(""),s.push("## Symbol Counts"),s.push(""),s.push("| Type | Count | Examples |"),s.push("|------|-------|----------|");for(let[e,t]of Object.entries(u))if(t.count>0){let i=t.examples.join(", ");s.push(`| ${e} | ${t.count} | ${i} |`);}s.push(""),s.push("## Source Files"),s.push(""),s.push(`- Purpose files: ${m$1.purposeFiles.length}`),s.push(`- Gate files: ${m$1.portalFiles.length}`),s.push(""),s.push("## Health Status"),s.push("");for(let e of a$1){let t=e.status==="ok"?"\u2713":e.status==="warn"?"\u26A0":"\u25CB";s.push(`- ${t} ${e.check}`);}s.push(""),s.push("---"),s.push("*Generated by `paradigm summary`*");let h=c.join(r,"project.md");l.start("Writing project.md...");try{n.writeFileSync(h,s.join(`
|
|
5
5
|
`),"utf8"),l.succeed(o.green("project.md generated"));}catch(e){l.fail(o.red("Failed to write project.md")),console.error(o.gray(e.message)),process.exit(1);}console.log(o.gray(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {a}from'./chunk-RPGSQQTS.js';import {b as b$1}from'./chunk-NFN5UUJB.js';import {f,d,c,j,k,i}from'./chunk-QBIME67A.js';import {b,a as a$1}from'./chunk-EK4ZRIFJ.js';import'./chunk-5TAVYPOV.js';b();var v="(blocked on GitHub)";function S(a,e){let t={taskId:a.id,kind:"agree",drift:[]},n=e.labels.map(r=>r.toLowerCase()),i;e.status==="closed"?i=e.closedReason==="not-planned"?"shelved":"done":(a.status==="done"||a.status==="shelved")&&(i="open"),i&&i!==a.status&&(c(a.status,i)?(t.kind="apply",t.targetStatus=i):(t.kind="conflict",t.drift.push(`GitHub implies "${i}" but the task is "${a.status}" \u2014 illegal transition, local wins. `+(i==="done"?"Reopen the task first, or close the issue once the work is really done.":"Resolve manually."))));let s=n.includes("blocked");return s&&!a.blocked_on?(t.blocked={set:v},t.kind==="agree"&&(t.kind="apply")):!s&&a.blocked_on===v&&(t.blocked={clear:true},t.kind==="agree"&&(t.kind="apply")),e.assignees.length>0&&!a.claimant?t.drift.push(`GitHub assignee ${e.assignees.join(", ")} \u2014 not reflected locally (assignee\u2192claimant is advisory; claim it locally to own it).`):e.assignees.length===0&&a.claimant?.kind==="human"&&t.drift.push(`Local claimant ${a.claimant.ref} has no GitHub assignee.`),t}var u="in progress",h="blocked";async function P(a){if(a==="github")try{await import('./github-GI3HX3N5.js');}catch{}return b$1(a)}async function o(a,e,t){try{await t();}catch(n){a$1.component("#task-sync").warn(`sync action failed: ${a}`,{taskId:e,error:n instanceof Error?n.message:String(n)});}}async function G(a$2,e,t,n={}){try{let i=await f(a$2,e),s=i?.external_ref;if(!i||!s?.provider)return;let r=await P(s.provider);if(!r||!r.capabilities().push||!await r.isAvailable())return;switch(t){case "claim":{a(i.claimant).assignee?await o("assignee",e,()=>r.edit?.(s,{addAssignee:"@me"})):i.claimant&&await o("agent-label",e,()=>r.edit?.(s,{addLabels:[`paradigm:${i.claimant.kind}/${i.claimant.ref}`]}));break}case "start":await o("label:in-progress",e,()=>r.edit?.(s,{addLabels:[u]}));break;case "done":await o("label:rm-in-progress",e,()=>r.edit?.(s,{removeLabels:[u]})),await o("close:completed",e,()=>r.close?.(s));break;case "shelved":await o("close:not-planned",e,()=>r.close?.(s,"not-planned"));break;case "reopen":await o("reopen",e,()=>r.reopen?.(s)),await o("label:rm-in-progress",e,()=>r.edit?.(s,{removeLabels:[u]}));break;case "block":await o("label:blocked",e,()=>r.edit?.(s,{addLabels:[h]})),n.reason&&await o("comment:blocked",e,()=>r.comment?.(s,`Blocked: ${n.reason}`));break;case "unblock":await o("label:rm-blocked",e,()=>r.edit?.(s,{removeLabels:[h]}));break}}catch(i){a$1.component("#task-sync").warn("projectTransition failed (non-fatal)",{taskId:e,error:i instanceof Error?i.message:String(i)});}}async function L(a,e,t){let n=false;if(t.targetStatus&&t.targetStatus!==e.status&&(t.targetStatus==="done"?n=await j(a,e.id):t.targetStatus==="shelved"?n=await k(a,e.id):n=await i(a,e.id,{status:t.targetStatus})),t.blocked){let i$1=await i(a,e.id,{blocked_on:t.blocked.clear?void 0:t.blocked.set});n=n||i$1;}return n}async function R(a,e){let t=await f(a,e),n=t?.external_ref;if(!t||!n?.provider)return {taskId:e,status:"unlinked",drift:[]};let i=await P(n.provider);if(!i?.capabilities().pull||!i.pull)return {taskId:e,status:"no-pull",drift:[]};if(!await i.isAvailable())return {taskId:e,status:"offline",drift:[]};let s;try{s=await i.pull(n);}catch(l){return a$1.component("#task-sync").warn("pull failed",{taskId:e,error:l instanceof Error?l.message:String(l)}),{taskId:e,status:"remote-error",drift:[]}}let r=S(t,s);if(r.kind==="conflict")return {taskId:e,status:"conflict",drift:r.drift};if(r.kind==="agree")return {taskId:e,status:"agree",drift:r.drift};let p=await L(a,t,r);return {taskId:e,status:p?"synced":"agree",targetStatus:r.targetStatus,drift:r.drift}}async function O(a){let t=(await d(a,{status:"all",limit:9999})).filter(i=>i.external_ref?.provider==="github"),n=[];for(let i of t)try{n.push(await R(a,i.id));}catch(s){n.push({taskId:i.id,status:"remote-error",drift:[String(s)]});}return n}export{G as projectTransition,O as syncAllLinked,R as syncTask};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {d,h,i,c as c$1,j as j$1,k}from'./chunk-QBIME67A.js';import'./chunk-EK4ZRIFJ.js';import {d as d$1,h as h$1,b,e,c,a,f,g}from'./chunk-WR6D3SC6.js';import'./chunk-5TAVYPOV.js';import {execSync}from'child_process';import*as P from'fs';import*as N from'os';import*as O from'path';import*as M from'js-yaml';function y(r){return r.project?O.resolve(r.project):process.cwd()}function j(){try{let r=execSync("git config user.email",{encoding:"utf-8",timeout:3e3}).trim();if(r)return r}catch{}try{let r=N.userInfo().username;if(r)return r}catch{}return "unknown"}function R(){return {kind:"human",ref:j()}}function m(r){let e=r.match(/-(\d+)$/);return e?e[1]:r}function G(r){return r.status==="done"||r.status==="shelved"}function U(r,e){if(!r.claimant)return "";let{kind:n,ref:t}=r.claimant;return n==="human"&&t===e?"you":t}function z(r,e){if(r.blocked_on)return true;for(let n of r.dependsOn||[]){let t=e.get(n);if(t&&!G(t))return true}return false}function H(r){return r.status==="in-progress"?"\u25B8":r.priority==="low"?"\u25CB":"\u25CF"}function E(r){let e=(r.tags||[]).join(", ");return `[${e?`${r.priority} \xB7 ${e}`:r.priority}]`}async function W(r,e){let n=await d(e,{status:"all",limit:9999});if(r==="@last"){let i=j(),c=n.filter(d=>d.claimant?.kind==="human"&&d.claimant.ref===i).sort((d,a)=>(a.created||"").localeCompare(d.created||""));return c.length===0?{errorMessage:"No tasks created by you yet \u2014 `@last` has nothing to resolve."}:{task:c[0]}}if(/^T-\d{4}-\d{2}-\d{2}-\d+$/.test(r)){let i=n.find(c=>c.id===r);return i?{task:i}:{errorMessage:`No task with id ${r}.`}}let t=n.filter(i=>i.status==="open"||i.status==="in-progress");if(/^\d+$/.test(r)){let i=parseInt(r,10),c=t.filter(d=>{let a=d.id.match(/-(\d+)$/);return a&&parseInt(a[1],10)===i});if(c.length===1)return {task:c[0]};if(c.length>1)return {errorMessage:`Suffix "${r}" is ambiguous across dates \u2014 use a full id:`,candidates:c.map(d=>` ${d.id} ${d.blurb}`)}}let o=r.toLowerCase(),s=t.filter(i=>i.blurb.toLowerCase().includes(o));return s.length===1?{task:s[0]}:s.length>1?{errorMessage:`"${r}" matches ${s.length} active tasks \u2014 be more specific:`,candidates:s.map(i=>` ${m(i.id)} ${i.blurb}`)}:{errorMessage:`No active task matches "${r}".`}}async function v(r,e){let n=await W(r,e);if(!n.task){d$1(n.errorMessage||`Could not resolve "${r}".`);for(let t of n.candidates||[])a(t);process.exit(1);}return n.task}async function nt(r,e$1){let n=y(e$1);if(e$1.fromThread){await K(n,e$1);return}let t=r.join(" ").trim();t||(d$1("Nothing to add \u2014 provide a blurb: `paradigm task add fix the parser`"),process.exit(1));let o=F(e$1.priority),s=e$1.tag||[],i$1=await h(n,{blurb:t,priority:o,tags:s,claimant:R()});if(e$1.start&&await i(n,i$1,{status:"in-progress"}),e$1.json){h$1({id:i$1});return}b(`${i$1} added`),e(`${t} ${E({priority:o,tags:s})}`),e$1.start&&e("\u2192 in-progress");}function F(r){return r==="high"||r==="low"?r:"medium"}async function K(r,e$1){let n=await import('fs'),{parseThread:t}=await import('./thread-2A7QKU72.js'),o=O.join(r,".paradigm","thread.md");if(!n.existsSync(o)){c("No thread.md found \u2014 nothing to import.");return}let i=t(n.readFileSync(o,"utf8")).looseEnds||[];if(i.length===0){a("No loose ends in thread.md.");return}let c$1=[];for(let d of i){let a=await h(r,{blurb:d,priority:"medium",tags:["from-thread"],claimant:R()});c$1.push({id:a,blurb:d});}if(e$1.json){h$1({created:c$1.map(d=>d.id)});return}f(`Imported ${c$1.length} loose end${c$1.length===1?"":"s"} as tasks`);for(let d of c$1)b(`${d.id} ${d.blurb}`);e("Thread.md was NOT cleared. Run `paradigm thread clear` once you have verified these.");}var V={active:"active",open:"open",done:"done",shelved:"shelved",all:"all"};async function st(r,e$1){let n=y(e$1);if(e$1.board){await q(n,e$1);return}let t=V[r||"active"];t||(d$1(`Unknown status "${r}" \u2014 use active | open | done | shelved | all.`),process.exit(1));let o=e$1.limit?parseInt(e$1.limit,10):20,s=j(),i=await d(n,{status:t,priority:e$1.priority,tag:e$1.tag,limit:9999});e$1.mine&&(i=i.filter(a=>a.claimant?.kind==="human"&&a.claimant.ref===s));let c=new Map,d$2=await d(n,{status:"all",limit:9999});for(let a of d$2)c.set(a.id,a);if(i=i.slice(0,o),e$1.json){h$1(i);return}if(i.length===0){e("No tasks.");return}if(t==="active"){let a$1=i.filter(l=>l.status==="in-progress"),f$1=i.filter(l=>l.status==="open");if(a$1.length>0){f("IN PROGRESS");for(let l of a$1)a(A(l,s,c));}if(f$1.length>0){f("OPEN");for(let l of f$1)a(A(l,s,c));}return}f(t.toUpperCase());for(let a$1 of i)a(A(a$1,s,c));}function A(r,e,n){let t=H(r),o=m(r.id).padStart(3," "),s=U(r,e),i=s?` (${s})`:"",c=z(r,n)?" \u26D4 blocked":"";return ` ${t} ${o} ${r.blurb}${i} ${E(r)}${c}`}async function q(r,e){let{assembleCaptainBoard:n}=await import('./captain-V5XPN4UP.js'),t=await n(r,{proposeClaimants:true});if(e.json){h$1(t);return}let o=j();f(`BOARD \u2014 ${t.summary.runs} run(s), ${t.summary.open} open, ${t.summary.inFlight} in flight, ${t.summary.unclaimed} unclaimed`);for(let s of t.runs){f(`\u25B6 ${s.blurb} [${s.runStatus}]`);for(let i of s.nodes){let c=i.stage!==void 0?`s${i.stage} `:"",d=i.claimant?` (${i.claimant.kind==="human"&&i.claimant.ref===o?"you":i.claimant.ref})`:"",a$1=i.fragileSymbols.length>0?` \u26A0 ${i.fragileSymbols.join(", ")}`:"";a(` ${c}${m(i.taskId)} ${i.blurb} [${i.status}]${d}${a$1}`);}}if(t.unclaimed.length>0){f("UNCLAIMED");for(let s of t.unclaimed){let i=s.proposedClaimant?` \u2192 ${s.proposedClaimant.ref}?`:"";a(` ${m(s.taskId)} ${s.blurb} [${s.priority}]${i}`);}}}async function _(r,e,n,t){try{let{projectTransition:o}=await import('./sync-layer-Z266WBWF.js');await o(r,e,n,{reason:t});}catch{}}async function it(r,e$1){let n=y(e$1),t=await v(r,n);if(c$1(t.status,"in-progress")||(d$1(`Cannot start ${m(t.id)} \u2014 it is ${t.status}.`),process.exit(1)),await i(n,t.id,{status:"in-progress"}),await _(n,t.id,"start"),e$1.json){h$1({id:t.id,status:"in-progress"});return}b(`${m(t.id)} \u2192 in-progress`),e(t.blurb);}async function ot(r,e$1){let n=y(e$1),t=await v(r,n);c$1(t.status,"done")||(d$1(`Cannot complete ${m(t.id)} \u2014 it is ${t.status}.`),process.exit(1)),await j$1(n,t.id),await _(n,t.id,"done");let o=[];if(e$1.ripple!==false&&(o=await J(t,n)),e$1.json){h$1({id:t.id,status:"done",...o.length?{ripple:o}:{}});return}b(`${m(t.id)} \u2713 done`),e(t.blurb),o.length>0&&e(`\u21AF touches: ${o.join(", ")}`),t.related_lore&&t.related_lore.length>0&&e(`lore: ${t.related_lore.join(", ")}`);}async function J(r,e){let n=(r.tags||[]).filter(t=>/^[#$^!~]/.test(t));if(n.length===0)return [];try{let{aggregateFromDirectory:t,buildSymbolIndex:o,getSymbol:s}=await import('./dist-N4NYCS3D.js'),i=await t(e),c=o(i),d=new Set;for(let a of n){let f=s(c,a);if(f)for(let l of f.referencedBy||[])d.add(l);}return Array.from(d).sort()}catch{return []}}async function at(r,e$1){let n=y(e$1),t=await v(r,n);if(c$1(t.status,"shelved")||(d$1(`Cannot shelve ${m(t.id)} \u2014 it is ${t.status}.`),process.exit(1)),await k(n,t.id),await _(n,t.id,"shelved"),e$1.json){h$1({id:t.id,status:"shelved"});return}b(`${m(t.id)} shelved`),e(t.blurb);}async function ct(r,e$1){let n=y(e$1),{syncTask:t,syncAllLinked:o}=await import('./sync-layer-Z266WBWF.js'),s=r?[await t(n,(await v(r,n)).id)]:await o(n);if(e$1.json){h$1({verdicts:s});return}if(s.length===0){e("No GitHub-linked tasks to sync.");return}let i=s.filter(a=>a.status==="synced"),c$1=s.filter(a=>a.status==="conflict");for(let a of i)b(`${m(a.taskId)} synced${a.targetStatus?` \u2192 ${a.targetStatus}`:""}`);for(let a of c$1){c(`${m(a.taskId)} conflict (local wins)`);for(let f of a.drift)e(` ${f}`);}let d=s.filter(a=>["offline","remote-error","unlinked","no-pull"].includes(a.status));d.some(a=>a.status==="offline")&&e("GitHub unavailable for some tasks \u2014 `gh auth login` to enable."),a(""),e(`${i.length} synced \xB7 ${c$1.length} conflict \xB7 ${s.filter(a=>a.status==="agree").length} unchanged \xB7 ${d.length} skipped`);}async function dt(r,e){let n=y(e),t=await v(r,n);if(e.json){h$1(t);return}if(f(t.id),g("blurb",t.blurb),g("status",t.status),g("priority",t.priority),t.tags&&t.tags.length>0&&g("tags",t.tags.join(", ")),t.claimant&&g("claimant",`${t.claimant.kind}:${t.claimant.ref}`),g("created",t.created),t.started_at&&g("started",t.started_at),t.completed&&g("completed",t.completed),t.shelved&&g("shelved",t.shelved),t.parentTaskId&&g("parent",t.parentTaskId),t.dependsOn&&t.dependsOn.length>0&&g("depends",t.dependsOn.join(", ")),t.blocked_on&&g("blocked_on",t.blocked_on),t.related_lore&&t.related_lore.length>0&&g("lore",t.related_lore.join(", ")),t.external_ref){let o=t.external_ref;g("external",`${o.provider}:${o.ref}${o.url?` (${o.url})`:""}`);}}async function lt(r,e$1){let n=y(e$1),t=await v(r,n),o={},s=[];if(e$1.blurb!==void 0&&(o.blurb=e$1.blurb,s.push(`blurb \u2192 "${e$1.blurb}"`)),e$1.priority!==void 0&&(o.priority=F(e$1.priority),s.push(`priority \u2192 ${o.priority}`)),e$1.tag!==void 0&&(o.tags=e$1.tag,s.push(`tags \u2192 [${o.tags.join(", ")}]`)),e$1.addTag!==void 0&&e$1.addTag.length>0){let c=o.tags??t.tags??[],d=Array.from(new Set([...c,...e$1.addTag]));o.tags=d,s.push(`+tags [${e$1.addTag.join(", ")}]`);}if(e$1.reopen&&(c$1(t.status,"open")||(d$1(`Cannot reopen ${m(t.id)} \u2014 it is ${t.status}.`),process.exit(1)),o.status="open",s.push("status \u2192 open")),s.length===0){c("Nothing to edit \u2014 pass -b/-p/-t/--add-tag/--reopen.");return}if(await i(n,t.id,o)||(d$1(`Edit rejected for ${m(t.id)} (illegal transition or task not found).`),process.exit(1)),e$1.reopen&&await _(n,t.id,"reopen"),e$1.json){h$1({id:t.id,changed:s});return}b(`${m(t.id)} edited`);for(let c of s)e(` ${c}`);}function Q(r){let e=r.toLowerCase();return e.includes("github.com")||/^[^/\s]+\/[^/#\s]+#\d+$/.test(r)?"github":(e.startsWith("http://")||e.startsWith("https://"),"url")}async function ut(r,e$1,n){let t=y(n),o=await v(r,t),s=n.provider||Q(e$1),i$1=/^https?:\/\//i.test(e$1),c={provider:s,ref:e$1,...i$1?{url:e$1}:{}};if(await i(t,o.id,{external_ref:c})||(d$1(`Link rejected for ${m(o.id)} (task not found).`),process.exit(1)),n.json){h$1({id:o.id,external_ref:c});return}b(`${m(o.id)} linked`),e(`${s}: ${e$1}`);}function X(r){try{let e=O.join(r,".paradigm","config.yaml");if(!P.existsSync(e))return {};let t=M.load(P.readFileSync(e,"utf8"))?.sync;return t?{provider:t.provider,repo:t.github?.repo}:{}}catch{return {}}}async function ft(r,e$1){let n=y(e$1),t=await v(r,n),o=X(n),s=e$1.provider||o.provider;if(!s){c("No sync provider configured \u2014 task left local-only."),e("Add a `sync:` block to .paradigm/config.yaml (e.g. provider: github, github: { repo: owner/repo }) or pass --provider.");return}let{getProvider:i$1}=await import('./registry-NEW4OJ44.js');s==="github"&&await import('./github-GI3HX3N5.js');let c$1=i$1(s);if(!c$1){c(`No provider registered for "${s}" \u2014 task left local-only.`),e("Known provider at this phase: github.");return}let d=c$1,a=e$1.repo||o.repo;if(s==="github"&&a){let{GithubProvider:l}=await import('./github-GI3HX3N5.js');d=new l({repo:a});}let f=false;try{f=await d.isAvailable();}catch{f=false;}if(!f){c(`${s} is not available \u2014 task left local-only.`),s==="github"&&e("Authenticate with `gh auth login`, then retry.");return}try{let l=await d.push(t),C={provider:s,ref:l.ref,...l.url?{url:l.url}:{},syncedAt:new Date().toISOString()};if(await i(n,t.id,{external_ref:C}),e$1.json){h$1({id:t.id,external_ref:C});return}b(`${m(t.id)} pushed \u2192 ${l.ref}`),l.url&&e(l.url);}catch(l){d$1(`Push to ${s} failed \u2014 task left untouched locally.`),e(l instanceof Error?l.message:String(l)),process.exitCode=1;}}function Y(r){let e=new Set;for(let n of (r||"").split(",")){let t=n.trim();t&&e.add(t);}return e}async function mt(r){try{let e=y(r),n=Y(r.symbols);if(n.size===0)return;let o=(await d(e,{status:"all",limit:9999})).filter(f=>f.external_ref?.provider?(f.tags||[]).some(l=>n.has(l)):!1);if(o.length===0)return;let{getProvider:s}=await import('./registry-NEW4OJ44.js');new Set(o.map(f=>f.external_ref.provider)).has("github")&&await import('./github-GI3HX3N5.js');let c=(r.hash||"").slice(0,7)||"(unknown)",d$1=Array.from(n).join(", "),a=`Commit ${c}: touched ${d$1}`;for(let f of o){let l=f.external_ref;try{let C=s(l.provider);if(!C||!C.capabilities().comment)continue;await C.comment(l,a);}catch{}}}catch{}}
|
|
3
|
+
export{j as currentHumanRef,W as resolveRef,nt as taskAddCommand,ot as taskDoneCommand,lt as taskEditCommand,ut as taskLinkCommand,st as taskLsCommand,ft as taskPushCommand,at as taskShelveCommand,dt as taskShowCommand,it as taskStartCommand,ct as taskSyncCommand,mt as taskSyncCommitCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export{c as assertTransition,j as completeTask,h as createTask,b as generateTaskId,f as loadTask,d as loadTasks,a as normalizeTask,l as rebuildTaskIndex,k as shelveTask,e as tasksForClaimant,i as updateTask,g as validateTaskDag}from'./chunk-QBIME67A.js';import'./chunk-EK4ZRIFJ.js';import'./chunk-5TAVYPOV.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export{c as assertTransition,j as completeTask,h as createTask,b as generateTaskId,f as loadTask,d as loadTasks,a as normalizeTask,l as rebuildTaskIndex,k as shelveTask,e as tasksForClaimant,i as updateTask,g as validateTaskDag}from'./chunk-BXKFSYIN.js';import'./chunk-EK4ZRIFJ.js';import'./chunk-5TAVYPOV.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {a as a$1}from'./chunk-VOPJ47QY.js';import {d,f as f$1}from'./chunk-QBIME67A.js';import {b as b$1,a}from'./chunk-EK4ZRIFJ.js';import'./chunk-5TAVYPOV.js';import*as f from'fs';import*as h from'path';b$1();var E=".paradigm/events/settlement-liveness.jsonl",b=30,P=new Set(["done","shelved","crashed"]);function _(t){return P.has(t)}function A(t){return _(t.status)||!!t.crashed_at}function T(t,n){try{let s=h.join(t,E);f.mkdirSync(h.dirname(s),{recursive:!0}),f.appendFileSync(s,JSON.stringify(n)+`
|
|
3
|
+
`,"utf8");}catch(s){a.component("#task-settlement").warn("Failed to append liveness record",{parentTaskId:n.parentTaskId,error:s instanceof Error?s.message:String(s)});}}function N(t){return Object.values(t).every(n=>n==="skipped"||n==="ok")}function R(){let t=process.env.PARADIGM_REAPER_STALE_MINUTES;return (t&&!Number.isNaN(Number(t))?Number(t):b)*60*1e3}async function O(t){let n=Date.now(),s=R(),a$1=[],d$1;try{d$1=await d(t,{status:"in-progress",limit:9999});}catch{return a$1}let{updateTask:o}=await import('./task-loader-75NBBLRQ.js');for(let i of d$1){if(i.status!=="in-progress"||i.crashed_at)continue;let u=i.started_at?new Date(i.started_at).getTime():NaN;if(Number.isNaN(u)||n-u<s)continue;let r=new Date().toISOString();await o(t,i.id,{status:"shelved",crashed_at:r,crash_reason:"reaper:stale-in-progress",shelved:r})&&(a$1.push(i.id),a.component("#task-settlement").warn("Reaped stale in-progress task",{taskId:i.id,startedAt:i.started_at,reason:"reaper:stale-in-progress"}));}return a$1}async function M(t,n,s){if(!n)return;try{await O(t);}catch(r){a.component("#task-settlement").warn("Reaper pass failed (non-fatal)",{error:r instanceof Error?r.message:String(r)});}let a$1=await f$1(t,n);if(!a$1){a.component("#task-settlement").warn("Orphan task: parent failed to load",{parentTaskId:n,orphanChildId:s,reason:"orphan:missing-parent"});let r=s?await f$1(t,s):null;if(r&&r.settledAt)return;await v(t,n,"orphan",r??void 0,true);return}if(a$1.settledAt)return;let d$1=(await d(t,{status:"all",limit:9999})).filter(r=>r.parentTaskId===a$1.id);if(d$1.length===0||!d$1.every(A))return;let o=d$1.some(r=>r.crashed_at),i=d$1.some(r=>r.status==="shelved"&&!r.crashed_at),u=o?"crashed":i?"shelved":"done";await v(t,a$1.id,u,a$1);}async function v(t,n,s,a$2,d=false){let o={recordWorkLog:"skipped",runPostflightLearning:"skipped",autoPromoteJournalEntries:"skipped"},i=0,u=0,r=a$2?.claimant?.ref;if(!r||r==="orchestrator")try{let{loadTasks:e}=await import('./task-loader-75NBBLRQ.js'),l=(await e(t,{status:"all",limit:9999})).filter(p=>p.parentTaskId===n&&p.claimant?.kind==="archetype"),c=new Map;for(let p of l)c.set(p.claimant.ref,(c.get(p.claimant.ref)??0)+1);let g=[...c.entries()].sort((p,y)=>y[1]-p[1])[0];g&&(r=g[0]);}catch{}r=r??"orchestrator";try{try{let{recordWorkLog:e}=await import('./work-log-loader-DL5GZ2BQ.js');e(t,{agent:r,task_ref:n,summary:`Settlement of task DAG ${n} (${s})`,outcome:s==="done"?"pass":"partial",symbols_touched:[]}),o.recordWorkLog="ok";}catch(e){o.recordWorkLog="threw",a.component("#task-settlement").warn("Settlement stage threw: recordWorkLog",{parentTaskId:n,error:e instanceof Error?e.message:String(e)});}try{let{runPostflightLearning:e}=await import('./ambient-5TA5CD7Z.js'),l=await e(t,{claimant:r});i=l.journalsWritten??0,u=l.promoted??0,o.runPostflightLearning="ok";}catch(e){o.runPostflightLearning="threw",a.component("#task-settlement").warn("Settlement stage threw: runPostflightLearning",{parentTaskId:n,error:e instanceof Error?e.message:String(e)});}try{let{autoPromoteJournalEntries:e}=await import('./nomination-engine-3EYXJOZZ.js'),l=e(t,r);u+=l.promoted??0,o.autoPromoteJournalEntries="ok";}catch(e){o.autoPromoteJournalEntries="threw",a.component("#task-settlement").warn("Settlement stage threw: autoPromoteJournalEntries",{parentTaskId:n,error:e instanceof Error?e.message:String(e)});}try{let{rebuildLearnedTable:e}=await import('./calibration-aggregate-5IVXSBDP.js'),l=e(t);l&&a.component("#calibration").info("Calibration refreshed on settle",{parentTaskId:n,samplesRead:l.samplesRead,learnedCells:l.groups.filter(c=>c.learned).length});}catch(e){a.component("#calibration").warn("Aggregate-on-settle failed (non-fatal)",{parentTaskId:n,error:e instanceof Error?e.message:String(e)});}}finally{let e=N(o),l={ts:new Date().toISOString(),parentTaskId:n,settledAs:s,stages:o,journalsWritten:i,promoted:u,chainLive:e};if(T(t,l),e){let c=Object.values(o).filter(g=>g==="ok").length;a$1(t,{verdicts:c,source:"settlement"});}if(a$2)try{let{updateTask:c}=await import('./task-loader-75NBBLRQ.js'),g={settledAt:new Date().toISOString()};s==="crashed"&&(g.crash_reason=a$2.crash_reason??"reaper:stale-in-progress"),d&&(g.orphaned=!0),await c(t,a$2.id,g);}catch(c){a.component("#task-settlement").warn("Failed to stamp settledAt",{parentTaskId:n,error:c instanceof Error?c.message:String(c)});}}}export{_ as isTerminal,O as reapStaleInProgress,M as settleParentIfComplete};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {a as a$1}from'./chunk-VOPJ47QY.js';import {d,f as f$1}from'./chunk-BXKFSYIN.js';import {b as b$1,a}from'./chunk-EK4ZRIFJ.js';import'./chunk-5TAVYPOV.js';import*as f from'fs';import*as h from'path';b$1();var E=".paradigm/events/settlement-liveness.jsonl",b=30,P=new Set(["done","shelved","crashed"]);function _(t){return P.has(t)}function A(t){return _(t.status)||!!t.crashed_at}function T(t,n){try{let s=h.join(t,E);f.mkdirSync(h.dirname(s),{recursive:!0}),f.appendFileSync(s,JSON.stringify(n)+`
|
|
3
|
+
`,"utf8");}catch(s){a.component("#task-settlement").warn("Failed to append liveness record",{parentTaskId:n.parentTaskId,error:s instanceof Error?s.message:String(s)});}}function N(t){return Object.values(t).every(n=>n==="skipped"||n==="ok")}function R(){let t=process.env.PARADIGM_REAPER_STALE_MINUTES;return (t&&!Number.isNaN(Number(t))?Number(t):b)*60*1e3}async function O(t){let n=Date.now(),s=R(),a$1=[],d$1;try{d$1=await d(t,{status:"in-progress",limit:9999});}catch{return a$1}let{updateTask:o}=await import('./task-loader-INPLZRG5.js');for(let i of d$1){if(i.status!=="in-progress"||i.crashed_at)continue;let u=i.started_at?new Date(i.started_at).getTime():NaN;if(Number.isNaN(u)||n-u<s)continue;let r=new Date().toISOString();await o(t,i.id,{status:"shelved",crashed_at:r,crash_reason:"reaper:stale-in-progress",shelved:r})&&(a$1.push(i.id),a.component("#task-settlement").warn("Reaped stale in-progress task",{taskId:i.id,startedAt:i.started_at,reason:"reaper:stale-in-progress"}));}return a$1}async function M(t,n,s){if(!n)return;try{await O(t);}catch(r){a.component("#task-settlement").warn("Reaper pass failed (non-fatal)",{error:r instanceof Error?r.message:String(r)});}let a$1=await f$1(t,n);if(!a$1){a.component("#task-settlement").warn("Orphan task: parent failed to load",{parentTaskId:n,orphanChildId:s,reason:"orphan:missing-parent"});let r=s?await f$1(t,s):null;if(r&&r.settledAt)return;await v(t,n,"orphan",r??void 0,true);return}if(a$1.settledAt)return;let d$1=(await d(t,{status:"all",limit:9999})).filter(r=>r.parentTaskId===a$1.id);if(d$1.length===0||!d$1.every(A))return;let o=d$1.some(r=>r.crashed_at),i=d$1.some(r=>r.status==="shelved"&&!r.crashed_at),u=o?"crashed":i?"shelved":"done";await v(t,a$1.id,u,a$1);}async function v(t,n,s,a$2,d=false){let o={recordWorkLog:"skipped",runPostflightLearning:"skipped",autoPromoteJournalEntries:"skipped"},i=0,u=0,r=a$2?.claimant?.ref;if(!r||r==="orchestrator")try{let{loadTasks:e}=await import('./task-loader-INPLZRG5.js'),l=(await e(t,{status:"all",limit:9999})).filter(p=>p.parentTaskId===n&&p.claimant?.kind==="archetype"),c=new Map;for(let p of l)c.set(p.claimant.ref,(c.get(p.claimant.ref)??0)+1);let g=[...c.entries()].sort((p,y)=>y[1]-p[1])[0];g&&(r=g[0]);}catch{}r=r??"orchestrator";try{try{let{recordWorkLog:e}=await import('./work-log-loader-DL5GZ2BQ.js');e(t,{agent:r,task_ref:n,summary:`Settlement of task DAG ${n} (${s})`,outcome:s==="done"?"pass":"partial",symbols_touched:[]}),o.recordWorkLog="ok";}catch(e){o.recordWorkLog="threw",a.component("#task-settlement").warn("Settlement stage threw: recordWorkLog",{parentTaskId:n,error:e instanceof Error?e.message:String(e)});}try{let{runPostflightLearning:e}=await import('./ambient-W3SPKLKC.js'),l=await e(t,{claimant:r});i=l.journalsWritten??0,u=l.promoted??0,o.runPostflightLearning="ok";}catch(e){o.runPostflightLearning="threw",a.component("#task-settlement").warn("Settlement stage threw: runPostflightLearning",{parentTaskId:n,error:e instanceof Error?e.message:String(e)});}try{let{autoPromoteJournalEntries:e}=await import('./nomination-engine-BUPERVPR.js'),l=e(t,r);u+=l.promoted??0,o.autoPromoteJournalEntries="ok";}catch(e){o.autoPromoteJournalEntries="threw",a.component("#task-settlement").warn("Settlement stage threw: autoPromoteJournalEntries",{parentTaskId:n,error:e instanceof Error?e.message:String(e)});}try{let{rebuildLearnedTable:e}=await import('./calibration-aggregate-DUEE3LL2.js'),l=e(t);l&&a.component("#calibration").info("Calibration refreshed on settle",{parentTaskId:n,samplesRead:l.samplesRead,learnedCells:l.groups.filter(c=>c.learned).length});}catch(e){a.component("#calibration").warn("Aggregate-on-settle failed (non-fatal)",{parentTaskId:n,error:e instanceof Error?e.message:String(e)});}}finally{let e=N(o),l={ts:new Date().toISOString(),parentTaskId:n,settledAs:s,stages:o,journalsWritten:i,promoted:u,chainLive:e};if(T(t,l),e){let c=Object.values(o).filter(g=>g==="ok").length;a$1(t,{verdicts:c,source:"settlement"});}if(a$2)try{let{updateTask:c}=await import('./task-loader-INPLZRG5.js'),g={settledAt:new Date().toISOString()};s==="crashed"&&(g.crash_reason=a$2.crash_reason??"reaper:stale-in-progress"),d&&(g.orphaned=!0),await c(t,a$2.id,g);}catch(c){a.component("#task-settlement").warn("Failed to stamp settledAt",{parentTaskId:n,error:c instanceof Error?c.message:String(c)});}}}export{_ as isTerminal,O as reapStaleInProgress,M as settleParentIfComplete};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export{e as teamAcceptCommand,f as teamCheckCommand,d as teamHandoffCommand,g as teamHistoryCommand,b as teamInitCommand,a as teamModelsCommand,h as teamResetCommand,c as teamStatusCommand}from'./chunk-QTMJVEEW.js';import'./chunk-T577TTVG.js';import'./chunk-TYWB5IQJ.js';import'./chunk-DLMDHS2X.js';import'./chunk-FYDRENK7.js';import'./chunk-ECLUYHAR.js';import'./chunk-YXLGVOZO.js';import'./chunk-Y4XFVDZC.js';import'./chunk-QBIME67A.js';import'./chunk-EK4ZRIFJ.js';import'./chunk-EKZDFEJW.js';import'./chunk-LPBCQM5Y.js';import'./chunk-JOHPASZG.js';import'./chunk-K6TLYNRQ.js';import'./chunk-ZJQY5PPP.js';import'./chunk-5TAVYPOV.js';
|