archscribe 0.2.1 → 0.2.2
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/README.md +97 -38
- package/dashboard-server/client-dist/assets/index-BK3iMzXX.css +1 -0
- package/dashboard-server/client-dist/assets/index-Bs2O2H8s.js +23 -0
- package/dashboard-server/client-dist/index.html +2 -2
- package/dashboard-server/dist/core-bridge.js +8 -1
- package/dashboard-server/dist/files-route.js +6 -0
- package/dashboard-server/dist/index.js +27 -29
- package/dashboard-server/dist/outputs-route.js +208 -0
- package/dashboard-server/dist/run-route.js +22 -7
- package/dist/cli/archscribe.js +47 -11
- package/dist/cli/archscribe.js.map +1 -1
- package/dist/cli/commands.js +6 -0
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/context.d.ts +1 -0
- package/dist/cli/context.js +34 -0
- package/dist/cli/context.js.map +1 -0
- package/dist/cli/doctor.js +2 -1
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/history.js +58 -0
- package/dist/cli/history.js.map +1 -1
- package/dist/cli/login.js +4 -3
- package/dist/cli/login.js.map +1 -1
- package/dist/cli/logout.js +1 -1
- package/dist/cli/logout.js.map +1 -1
- package/dist/cli/review.d.ts +1 -0
- package/dist/cli/review.js +144 -0
- package/dist/cli/review.js.map +1 -0
- package/dist/cli/run.d.ts +4 -1
- package/dist/cli/run.js +17 -21
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/shell.d.ts +1 -1
- package/dist/cli/shell.js +19 -4
- package/dist/cli/shell.js.map +1 -1
- package/dist/cli/ui/animations.js +1 -1
- package/dist/cli/ui/document-frame.d.ts +17 -0
- package/dist/cli/ui/document-frame.js +65 -0
- package/dist/cli/ui/document-frame.js.map +1 -0
- package/dist/cli/ui/document-tui.d.ts +5 -0
- package/dist/cli/ui/document-tui.js +224 -0
- package/dist/cli/ui/document-tui.js.map +1 -0
- package/dist/cli/ui/keys.d.ts +1 -0
- package/dist/cli/ui/keys.js +30 -6
- package/dist/cli/ui/keys.js.map +1 -1
- package/dist/cli/ui/little-scribe.d.ts +3 -0
- package/dist/cli/ui/little-scribe.js +67 -0
- package/dist/cli/ui/little-scribe.js.map +1 -0
- package/dist/cli/ui/mascot.d.ts +4 -2
- package/dist/cli/ui/mascot.js +19 -46
- package/dist/cli/ui/mascot.js.map +1 -1
- package/dist/cli/ui/menu.d.ts +1 -1
- package/dist/cli/ui/menu.js +1 -1
- package/dist/cli/ui/menu.js.map +1 -1
- package/dist/cli/ui/stage.js +12 -7
- package/dist/cli/ui/stage.js.map +1 -1
- package/dist/cli/ui/term.js +3 -1
- package/dist/cli/ui/term.js.map +1 -1
- package/dist/core/actor-inference.d.ts +1 -0
- package/dist/core/actor-inference.js +2 -1
- package/dist/core/actor-inference.js.map +1 -1
- package/dist/core/approval-ledger.d.ts +57 -0
- package/dist/core/approval-ledger.js +95 -0
- package/dist/core/approval-ledger.js.map +1 -0
- package/dist/core/component-groups.d.ts +2 -0
- package/dist/core/component-groups.js +4 -0
- package/dist/core/component-groups.js.map +1 -1
- package/dist/core/docx-package.d.ts +9 -0
- package/dist/core/docx-package.js +99 -0
- package/dist/core/docx-package.js.map +1 -0
- package/dist/core/docx-styles.d.ts +12 -11
- package/dist/core/docx-styles.js +12 -11
- package/dist/core/docx-styles.js.map +1 -1
- package/dist/core/docx-update.d.ts +6 -0
- package/dist/core/docx-update.js +469 -0
- package/dist/core/docx-update.js.map +1 -0
- package/dist/core/docx.d.ts +8 -2
- package/dist/core/docx.js +263 -74
- package/dist/core/docx.js.map +1 -1
- package/dist/core/flow-steps.d.ts +1 -4
- package/dist/core/flow-steps.js +46 -108
- package/dist/core/flow-steps.js.map +1 -1
- package/dist/core/flow-trace.d.ts +9 -2
- package/dist/core/flow-trace.js +57 -58
- package/dist/core/flow-trace.js.map +1 -1
- package/dist/core/flow.js +9 -7
- package/dist/core/flow.js.map +1 -1
- package/dist/core/grouping-messages.generated.d.ts +21 -0
- package/dist/core/grouping-messages.generated.js +22 -0
- package/dist/core/grouping-messages.generated.js.map +1 -0
- package/dist/core/iuh-logo.d.ts +1 -0
- package/dist/core/iuh-logo.js +3 -0
- package/dist/core/iuh-logo.js.map +1 -0
- package/dist/core/ledger-reconcile.d.ts +40 -0
- package/dist/core/ledger-reconcile.js +296 -0
- package/dist/core/ledger-reconcile.js.map +1 -0
- package/dist/core/manifest.js +1 -1
- package/dist/core/manifest.js.map +1 -1
- package/dist/core/markdown.d.ts +14 -1
- package/dist/core/markdown.js +83 -14
- package/dist/core/markdown.js.map +1 -1
- package/dist/core/materialize-report.d.ts +10 -0
- package/dist/core/materialize-report.js +72 -0
- package/dist/core/materialize-report.js.map +1 -0
- package/dist/core/output-history.d.ts +29 -0
- package/dist/core/output-history.js +204 -0
- package/dist/core/output-history.js.map +1 -0
- package/dist/core/output-mutation.d.ts +1 -0
- package/dist/core/output-mutation.js +15 -0
- package/dist/core/output-mutation.js.map +1 -0
- package/dist/core/parser.js +1 -0
- package/dist/core/parser.js.map +1 -1
- package/dist/core/project-config.d.ts +4 -0
- package/dist/core/project-config.js +39 -0
- package/dist/core/project-config.js.map +1 -1
- package/dist/core/review-feedback.d.ts +7 -0
- package/dist/core/review-feedback.js +46 -0
- package/dist/core/review-feedback.js.map +1 -0
- package/dist/core/uc-context-builder.d.ts +1 -0
- package/dist/core/uc-context-builder.js +11 -0
- package/dist/core/uc-context-builder.js.map +1 -1
- package/dist/core/uc-grouping-candidates.d.ts +9 -0
- package/dist/core/uc-grouping-candidates.js +35 -0
- package/dist/core/uc-grouping-candidates.js.map +1 -0
- package/dist/core/uc-grouping-evidence.d.ts +5 -0
- package/dist/core/uc-grouping-evidence.js +95 -0
- package/dist/core/uc-grouping-evidence.js.map +1 -0
- package/dist/core/uc-proposal.d.ts +19 -2
- package/dist/core/uc-proposal.js +127 -0
- package/dist/core/uc-proposal.js.map +1 -1
- package/dist/diagrams/activity.js +16 -5
- package/dist/diagrams/activity.js.map +1 -1
- package/dist/diagrams/arch/classify.d.ts +35 -0
- package/dist/diagrams/arch/classify.js +132 -0
- package/dist/diagrams/arch/classify.js.map +1 -0
- package/dist/diagrams/arch/layout-clean.d.ts +10 -0
- package/dist/diagrams/arch/layout-clean.js +74 -0
- package/dist/diagrams/arch/layout-clean.js.map +1 -0
- package/dist/diagrams/arch/layout-component.d.ts +13 -0
- package/dist/diagrams/arch/layout-component.js +136 -0
- package/dist/diagrams/arch/layout-component.js.map +1 -0
- package/dist/diagrams/arch/layout-hexagonal.d.ts +11 -0
- package/dist/diagrams/arch/layout-hexagonal.js +142 -0
- package/dist/diagrams/arch/layout-hexagonal.js.map +1 -0
- package/dist/diagrams/arch/layout-layered.d.ts +17 -0
- package/dist/diagrams/arch/layout-layered.js +89 -0
- package/dist/diagrams/arch/layout-layered.js.map +1 -0
- package/dist/diagrams/arch/model.d.ts +66 -0
- package/dist/diagrams/arch/model.js +216 -0
- package/dist/diagrams/arch/model.js.map +1 -0
- package/dist/diagrams/arch/xml.d.ts +20 -0
- package/dist/diagrams/arch/xml.js +39 -0
- package/dist/diagrams/arch/xml.js.map +1 -0
- package/dist/diagrams/architecture.d.ts +26 -36
- package/dist/diagrams/architecture.js +48 -155
- package/dist/diagrams/architecture.js.map +1 -1
- package/dist/diagrams/layout/radial.d.ts +1 -1
- package/dist/diagrams/layout/radial.js +385 -0
- package/dist/diagrams/layout/radial.js.map +1 -1
- package/dist/diagrams/sequence-model.js +6 -8
- package/dist/diagrams/sequence-model.js.map +1 -1
- package/dist/diagrams/usecase.d.ts +2 -1
- package/dist/diagrams/usecase.js +44 -20
- package/dist/diagrams/usecase.js.map +1 -1
- package/dist/diagrams/usecase_layout.d.ts +7 -12
- package/dist/diagrams/usecase_layout.js +25 -84
- package/dist/diagrams/usecase_layout.js.map +1 -1
- package/dist/knowledge/evidence.d.ts +48 -0
- package/dist/knowledge/evidence.js +253 -0
- package/dist/knowledge/evidence.js.map +1 -0
- package/dist/knowledge/hub-grouping.d.ts +4 -0
- package/dist/knowledge/hub-grouping.js +43 -26
- package/dist/knowledge/hub-grouping.js.map +1 -1
- package/dist/knowledge/local-kb.js +22 -20
- package/dist/knowledge/local-kb.js.map +1 -1
- package/dist/knowledge/rag-augment.d.ts +31 -6
- package/dist/knowledge/rag-augment.js +78 -37
- package/dist/knowledge/rag-augment.js.map +1 -1
- package/dist/knowledge/rag-client.js +1 -1
- package/dist/knowledge/rag-client.js.map +1 -1
- package/dist/knowledge/retriever.d.ts +1 -0
- package/dist/knowledge/retriever.js +4 -2
- package/dist/knowledge/retriever.js.map +1 -1
- package/dist/knowledge/store-lock.d.ts +2 -0
- package/dist/knowledge/store-lock.js +35 -0
- package/dist/knowledge/store-lock.js.map +1 -0
- package/dist/knowledge/types.d.ts +2 -0
- package/dist/license/client.d.ts +2 -1
- package/dist/license/client.js +5 -2
- package/dist/license/client.js.map +1 -1
- package/dist/license/gate.js +2 -2
- package/dist/license/gate.js.map +1 -1
- package/dist/license/verify.js +19 -14
- package/dist/license/verify.js.map +1 -1
- package/dist/parser.jar +0 -0
- package/dist/server.js +120 -29
- package/dist/server.js.map +1 -1
- package/dist/theory/context.d.ts +52 -0
- package/dist/theory/context.js +144 -0
- package/dist/theory/context.js.map +1 -0
- package/dist/theory/fill.d.ts +16 -2
- package/dist/theory/fill.js +129 -97
- package/dist/theory/fill.js.map +1 -1
- package/dist/theory/references.d.ts +5 -3
- package/dist/theory/references.js +8 -10
- package/dist/theory/references.js.map +1 -1
- package/dist/theory/scaffold.js +40 -24
- package/dist/theory/scaffold.js.map +1 -1
- package/dist/tools/analyze_project.js +3 -0
- package/dist/tools/analyze_project.js.map +1 -1
- package/dist/tools/environment.js +1 -0
- package/dist/tools/environment.js.map +1 -1
- package/dist/tools/generate_report.d.ts +10 -6
- package/dist/tools/generate_report.js +193 -277
- package/dist/tools/generate_report.js.map +1 -1
- package/dist/tools/propose_uc_groupings.d.ts +1 -10
- package/dist/tools/propose_uc_groupings.js +23 -79
- package/dist/tools/propose_uc_groupings.js.map +1 -1
- package/dist/tools/review_tools.d.ts +26 -0
- package/dist/tools/review_tools.js +55 -0
- package/dist/tools/review_tools.js.map +1 -0
- package/dist/tools/scaffold.d.ts +3 -1
- package/dist/tools/scaffold.js +103 -61
- package/dist/tools/scaffold.js.map +1 -1
- package/dist/tools/scan_repo.js +1 -1
- package/dist/tools/scan_repo.js.map +1 -1
- package/dist/types/ir.d.ts +4 -0
- package/dist/types/license.d.ts +3 -0
- package/dist/types/report.d.ts +11 -2
- package/dist/types/theory.d.ts +4 -0
- package/dist/types/uc-grouping.d.ts +58 -0
- package/dist/utils/dashboard-launcher.js +1 -0
- package/dist/utils/dashboard-launcher.js.map +1 -1
- package/dist/utils/mcp-launch.d.ts +2 -0
- package/dist/utils/mcp-launch.js +12 -1
- package/dist/utils/mcp-launch.js.map +1 -1
- package/dist/utils/run-history.d.ts +1 -2
- package/dist/utils/run-history.js +2 -11
- package/dist/utils/run-history.js.map +1 -1
- package/package.json +34 -14
- package/LICENSE +0 -33
- package/dashboard-server/client-dist/assets/index-CswIFyKN.js +0 -9
- package/dashboard-server/client-dist/assets/index-DWB_-3yk.css +0 -1
- package/dashboard-server/dist/review-route.js +0 -150
- package/dist/core/review-ledger.d.ts +0 -36
- package/dist/core/review-ledger.js +0 -104
- package/dist/core/review-ledger.js.map +0 -1
- package/dist/core/review-rerun.d.ts +0 -16
- package/dist/core/review-rerun.js +0 -31
- package/dist/core/review-rerun.js.map +0 -1
- package/dist/tools/review-tasks.d.ts +0 -28
- package/dist/tools/review-tasks.js +0 -168
- package/dist/tools/review-tasks.js.map +0 -1
- package/dist/utils/approval.d.ts +0 -37
- package/dist/utils/approval.js +0 -173
- package/dist/utils/approval.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import "https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap";:root{--bg:#fafaf9;--panel:#fff;--panel2:#f1f1ee;--panel3:#e6e6e2;--ink:#0b0b0b;--dim:#4a4a47;--faint:#8c8c88;--rule:#0b0b0b;--hair:#dededa;--track:#ededea;--accent:#d6351f;--accent-soft:#d6351f1a;--pass:#1e7a4c;--pass-soft:#1e7a4c1a;--revise:#b5680b;--revise-soft:#b5680b1a;--skip:#6b6b68;--skip-soft:#6b6b681a;--onAccent:#fff;--onInk:#fafaf9;--sidebar-w:236px;--mono:"JetBrains Mono", monospace;--sans:"Archivo", system-ui, sans-serif}*,:before,:after{box-sizing:border-box;margin:0;padding:0}html,body,#root{height:100%}body{font-family:var(--sans);color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased;font-size:13.5px;line-height:1.5}.shell{background:var(--bg);min-height:100vh;color:var(--ink);display:flex}.sidebar{width:var(--sidebar-w);flex:0 0 var(--sidebar-w);background:var(--panel);border-right:1px solid var(--rule);z-index:100;flex-direction:column;height:100vh;display:flex;position:sticky;top:0}.main{flex:1;min-width:0;min-height:100vh}.logo{border-bottom:1px solid var(--rule);align-items:center;gap:10px;padding:16px 16px 14px;display:flex}.logo-img{flex-shrink:0;width:auto;height:28px;display:block}.logo-ver{font-family:var(--mono);color:var(--faint);border:1px solid var(--hair);margin-left:auto;padding:2px 4px;font-size:9.5px}.sidebar-section-label{font-family:var(--mono);letter-spacing:.14em;color:var(--faint);margin-bottom:7px;font-size:9.5px}.sidebar-proj-section{border-bottom:1px solid var(--hair);padding:14px 16px}.project-select-btn{text-align:left;background:var(--panel2);border:1px solid var(--rule);cursor:pointer;width:100%;font-family:var(--mono);color:var(--ink);align-items:center;gap:8px;padding:9px 10px;font-size:12.5px;font-weight:500;display:flex;position:relative}.project-select-btn:hover{background:var(--panel3)}.project-select-btn .ps-arrow{color:var(--faint);margin-left:auto;font-size:10px}.project-dropdown{background:var(--panel);border:1px solid var(--rule);z-index:200;border-top:none;max-height:200px;position:absolute;top:100%;left:-1px;right:-1px;overflow-y:auto}.project-dropdown-item{cursor:pointer;font-family:var(--mono);color:var(--ink);border-bottom:1px solid var(--hair);padding:9px 10px;font-size:12px}.project-dropdown-item:hover{background:var(--panel2)}.project-dropdown-item.active{background:var(--panel2);font-weight:700}.sidebar-nav-section{flex:1;padding:12px 16px 0}.nav-item{color:var(--dim);cursor:pointer;-webkit-user-select:none;user-select:none;border-left:2px solid #0000;align-items:center;gap:10px;margin-bottom:2px;padding:9px 10px;font-size:13.5px;display:flex}.nav-item:hover{color:var(--ink);background:var(--panel2)}.nav-item.active{color:var(--ink);border-left-color:var(--accent);background:var(--accent-soft);font-weight:600}.nav-num{font-family:var(--mono);color:var(--faint);min-width:16px;font-size:10px}.nav-item.active .nav-num{color:var(--accent)}.sidebar-footer{border-top:1px solid var(--hair);color:var(--faint);margin-top:auto;padding:14px 16px;font-size:12px}.sidebar-footer .proj{color:var(--ink);margin-bottom:2px;font-size:13px;font-weight:600}.hamburger{z-index:200;background:var(--ink);color:var(--onInk);cursor:pointer;border:none;justify-content:center;align-items:center;width:40px;height:40px;font-size:20px;display:none;position:fixed;top:14px;left:14px}.screen-header{border-bottom:1px solid var(--rule);background:var(--panel);align-items:center;gap:18px;padding:15px 28px;display:flex}.screen-label{font-family:var(--mono);letter-spacing:.16em;color:var(--faint);flex-shrink:0;font-size:9.5px}.screen-title{letter-spacing:-.35px;text-transform:uppercase;margin:0;font-size:19px;font-weight:700}.screen-actions{gap:8px;margin-left:auto;display:flex}.mono{font-family:var(--mono)}.sub{color:var(--dim);margin-bottom:20px;font-size:13px}.btn{background:var(--panel);color:var(--ink);border:1px solid var(--rule);text-transform:uppercase;letter-spacing:.05em;cursor:pointer;font-size:12.5px;font-weight:600;font-family:var(--sans);padding:9px 15px}.btn:hover{background:var(--panel2)}.btn-primary{background:var(--accent);border-color:var(--accent);color:var(--onAccent);font-weight:700}.btn-primary:hover{background:var(--ink);border-color:var(--ink);color:var(--onInk)}.btn-ink{background:var(--ink);border-color:var(--ink);color:var(--onInk);font-weight:700}.btn-ink:hover{background:var(--accent);border-color:var(--accent);color:var(--onAccent)}.section-row{border-bottom:1px solid var(--rule);background:var(--panel);display:grid}.section-cell{padding:20px 24px 24px}.section-cell+.section-cell{border-left:1px solid var(--rule)}.section-heading{text-transform:uppercase;letter-spacing:.08em;align-items:baseline;gap:10px;margin-bottom:14px;font-size:12px;font-weight:700;display:flex}.section-heading .sh-meta{font-family:var(--mono);color:var(--faint);font-size:10px;font-weight:400}.section-heading .sh-score{font-family:var(--mono);color:var(--revise);font-size:10px;font-weight:400}.kpi-grid{border-bottom:1px solid var(--rule);background:var(--panel);grid-template-columns:repeat(4,1fr);display:grid}.kpi-cell{border-right:1px solid var(--hair);padding:16px 20px 18px}.kpi-cell:last-child{border-right:none}.kpi-label{font-family:var(--mono);letter-spacing:.14em;color:var(--faint);align-items:center;gap:6px;margin-bottom:8px;font-size:9.5px;display:flex}.kpi-dot{flex-shrink:0;width:5px;height:5px}.kpi-value{font-family:var(--mono);letter-spacing:-1.5px;margin-bottom:10px;font-size:34px;font-weight:700;line-height:1}.kpi-unit{color:var(--faint);font-size:15px;font-weight:400}.kpi-bar{background:var(--track);height:8px}.kpi-bar-fill{height:100%}.acc-row{border-top:1px solid var(--hair);grid-template-columns:20px 1fr 190px 58px;align-items:center;gap:12px;padding:12px 0;display:grid}.acc-n{font-family:var(--mono);color:var(--faint);font-size:10px}.acc-label{font-size:13.5px;font-weight:500}.acc-bars{flex-direction:column;gap:3px;display:flex}.acc-bar-row{align-items:center;gap:6px;display:flex}.acc-bar-key{font-family:var(--mono);color:var(--faint);width:14px;font-size:9px}.acc-bar-track{background:var(--track);flex:1;height:5px;display:block}.acc-bar-fill{height:100%;display:block}.acc-f1{text-align:right;font-family:var(--mono);font-size:14px;font-weight:700}.comp-row{border-top:1px solid var(--hair);grid-template-columns:14px 1fr auto;align-items:center;gap:10px;padding:9px 0;display:grid}.comp-dot{flex-shrink:0;width:9px;height:9px}.comp-label{font-size:13px}.comp-val{font-family:var(--mono);font-size:12px;font-weight:500}.timing-row{grid-template-columns:22px 140px 1fr 48px;align-items:center;gap:12px;padding:8px 0;display:grid}.timing-n{font-family:var(--mono);color:var(--faint);font-size:10px}.timing-label{font-size:13px}.timing-bar{background:var(--track);height:18px}.timing-bar-fill{background:var(--ink);height:100%}.timing-val{text-align:right;font-family:var(--mono);font-size:11.5px}.rv-wrap{height:calc(100vh - 52px);min-height:400px;display:flex}.rv-list{background:var(--panel);border-right:1px solid var(--rule);flex-direction:column;flex:none;width:300px;display:flex;overflow:hidden}.rv-filters{border-bottom:1px solid var(--hair);flex-direction:column;gap:6px;padding:10px;display:flex}.rv-filters input,.rv-filters select{border:1px solid var(--rule);width:100%;font-size:12.5px;font-family:var(--sans);background:var(--panel);color:var(--ink);padding:6px 8px}.rv-items{flex:1;overflow-y:auto}.rv-item{text-align:left;width:100%;color:var(--ink);border:0;border-bottom:1px solid var(--hair);cursor:pointer;background:0 0;align-items:center;gap:8px;padding:10px 12px;display:flex}.rv-item:hover{background:var(--panel2)}.rv-item.sel{background:var(--accent-soft)}.rv-item .ttl{text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:12.5px;font-weight:600;overflow:hidden}.rv-item .sub2{color:var(--dim);font-size:11px}.rv-detail{background:var(--bg);flex:1;padding:20px 24px;overflow-y:auto}.rv-detail textarea{border:1px solid var(--rule);resize:vertical;width:100%;min-height:60px;font-size:12.5px;font-family:var(--sans);background:var(--panel);color:var(--ink);padding:8px}.rv-spec{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--panel);border:1px solid var(--rule);max-height:320px;padding:12px;font-size:12px;line-height:1.6;overflow-y:auto}.stbtn{border:1px solid var(--rule);background:var(--panel);cursor:pointer;font-size:12px;font-family:var(--sans);text-transform:uppercase;letter-spacing:.04em;margin-right:6px;padding:5px 12px;font-weight:600}.stbtn:hover{background:var(--panel2)}.stbtn.pass{background:var(--pass);border-color:var(--pass);color:#fff}.stbtn.fix{background:var(--revise);border-color:var(--revise);color:#fff}.stbtn.skip{background:var(--skip);border-color:var(--skip);color:#fff}.pill{font-size:11.5px;font-weight:600;font-family:var(--mono);padding:2px 8px;display:inline-block}.pill-ok{background:var(--pass-soft);color:var(--pass)}.pill-warn{background:var(--revise-soft);color:var(--revise)}.pill-bad{background:var(--accent-soft);color:var(--accent)}.dot{border:1.5px solid var(--faint);flex-shrink:0;width:8px;height:8px;margin-right:8px;display:inline-block}.dot.on{background:var(--pass);border-color:var(--pass)}.toast{background:var(--accent);color:var(--onAccent);z-index:999;padding:10px 18px;font-size:13px;position:fixed;top:16px;right:16px;box-shadow:0 4px 16px #0000002e}.loading{color:var(--dim);text-align:center;padding:40px 0}.error-banner{background:var(--accent-soft);border:1px solid var(--accent);color:var(--accent);margin-bottom:20px;padding:14px 18px}.auth-banner{background:var(--panel);border:1px solid var(--rule);border-left:4px solid var(--accent);max-width:560px;margin:48px auto;padding:24px 28px}.auth-banner h2{margin-bottom:10px;font-size:16px}.auth-banner p{color:var(--dim);font-size:13px;line-height:1.6}.auth-banner code{font-family:var(--mono);background:var(--panel2);border:1px solid var(--hair);padding:1px 5px;font-size:12px}.auth-banner pre{font-family:var(--mono);background:var(--panel2);border:1px solid var(--hair);-webkit-user-select:all;user-select:all;margin-top:14px;padding:10px 12px;font-size:12.5px}.stale-banner{background:var(--revise-soft);border:1px solid var(--revise);color:var(--ink);justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px;padding:12px 18px;display:flex}.stale-banner strong{color:var(--revise)}.stale-banner .stale-error{color:var(--accent);margin-top:6px}.empty-state{text-align:center;color:var(--dim);padding:60px 0}.empty-state strong{color:var(--ink)}.grid{gap:0;display:grid}.grid-4{grid-template-columns:repeat(4,1fr)}.grid-2{grid-template-columns:1fr 1fr}table{border-collapse:collapse;width:100%;font-size:13px}th,td{text-align:left;border-bottom:1px solid var(--hair);padding:8px 10px}th{color:var(--dim);font-size:12px;font-weight:600;font-family:var(--mono);letter-spacing:.06em}.table-wrap{overflow-x:auto}.card{background:var(--panel);border:1px solid var(--rule);margin-bottom:0;padding:20px 24px}.card+.card{border-top:none}h1,h2,h3{font-family:var(--sans)}h1{font-size:19px;font-weight:700}h2{margin-bottom:12px;font-size:14px;font-weight:700}h3{margin:16px 0 6px;font-size:13px;font-weight:700}.bar-track{background:var(--track);width:100%;height:7px;overflow:hidden}.bar-fill{height:7px}@media (width<=900px){.kpi-grid,.grid-4{grid-template-columns:repeat(2,1fr)}.grid-2{grid-template-columns:1fr}}@media (width<=768px){:root{--sidebar-w:0px}.sidebar{width:236px;height:100vh;position:fixed;transform:translate(-236px)}.sidebar.open{transform:translate(0);box-shadow:4px 0 32px #0000004d}.main{padding-top:52px}.hamburger{display:flex}.rv-wrap{flex-direction:column;height:auto}.rv-list{border-right:none;border-bottom:1px solid var(--rule);width:100%;max-height:280px}.screen-header{padding:10px 16px}.kpi-grid{grid-template-columns:1fr 1fr}.section-row{grid-template-columns:1fr!important}.section-cell+.section-cell{border-left:none;border-top:1px solid var(--rule)}.acc-row{grid-template-columns:20px 1fr 100px 50px;gap:8px}.timing-row{grid-template-columns:22px 100px 1fr 48px;gap:8px}}@media (width<=375px){.kpi-grid{grid-template-columns:1fr}.acc-row{grid-template-columns:1fr 80px}.acc-row .acc-n{display:none}}.license-banner{border:1px solid var(--rule);justify-content:space-between;align-items:center;gap:12px;margin-bottom:20px;padding:12px 18px;font-size:13px;display:flex}.license-banner.pill-ok{background:var(--pass-soft);border-color:var(--pass);color:var(--pass)}.license-banner.pill-warn{background:var(--revise-soft);border-color:var(--revise);color:var(--revise)}.license-banner .btn{flex-shrink:0}.run-input-row{gap:10px;margin-bottom:24px;display:flex}.run-path-input{border:1px solid var(--rule);font-size:13px;font-family:var(--mono);background:var(--panel);color:var(--ink);flex:1;padding:10px 12px}.run-path-input:disabled{opacity:.6}.run-steps{background:var(--panel);border:1px solid var(--rule);flex-wrap:wrap;gap:24px;margin-bottom:20px;padding:14px 18px;display:flex}.run-step{align-items:center;gap:8px;font-size:13px;display:flex}.run-step-label{font-weight:600}.run-step-detail{color:var(--dim);font-family:var(--mono);font-size:12px}.run-step-spinner{color:var(--accent);font-size:12px}.run-result{margin-top:4px}.component-group{border-top:1px solid var(--hair);padding:10px 0}.component-group:first-child{border-top:none}.component-group-label{margin-bottom:4px;font-size:13px;font-weight:600}.component-group-names{color:var(--dim);font-size:12.5px;line-height:1.5}.modal-backdrop{z-index:1000;background:#0006;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.modal{background:var(--panel);border:1px solid var(--rule);width:min(420px,90vw);padding:24px 28px;box-shadow:0 8px 32px #00000040}.modal h2{margin-bottom:6px}.modal .run-path-input{width:100%;margin-top:12px}.modal-message{margin-top:12px;padding:10px 12px;font-size:12.5px}.modal-actions{justify-content:flex-end;gap:8px;margin-top:18px;display:flex}@media (width<=600px){.run-input-row{flex-direction:column}.run-steps{gap:14px}}
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { createHash } from 'node:crypto';
|
|
4
|
-
import { sourceKey } from '../../dist/core/review-rerun.js';
|
|
5
|
-
import { loadReviewLedger, approveReview, saveReviewLedger } from '../../dist/core/review-ledger.js';
|
|
6
|
-
import { extractUseCaseSection } from '../../dist/utils/approval.js';
|
|
7
|
-
import { sha256File } from '../../dist/core/manifest.js';
|
|
8
|
-
import { currentReviewBaseFingerprint } from '../../dist/tools/review-tasks.js';
|
|
9
|
-
const output = (project) => path.join(project, 'archscribe-output');
|
|
10
|
-
const version = (project) => {
|
|
11
|
-
const file = path.join(project, '.archscribe', 'review.json');
|
|
12
|
-
return createHash('sha256').update(fs.existsSync(file) ? fs.readFileSync(file) : Buffer.from('')).digest('hex');
|
|
13
|
-
};
|
|
14
|
-
function current(project) {
|
|
15
|
-
const report = JSON.parse(fs.readFileSync(path.join(output(project), 'evaluation-report.json'), 'utf8'));
|
|
16
|
-
if (!Array.isArray(report.usecases))
|
|
17
|
-
throw new Error('Invalid evaluation use cases');
|
|
18
|
-
const flows = report.usecases.map((flow) => ({ ...flow, key: sourceKey(flow) }));
|
|
19
|
-
if (new Set(flows.map((flow) => flow.key)).size !== flows.length)
|
|
20
|
-
throw new Error('Ambiguous use case source');
|
|
21
|
-
return flows;
|
|
22
|
-
}
|
|
23
|
-
function reviewedFlows(project, ledger) {
|
|
24
|
-
const markdown = fs.readFileSync(path.join(output(project), 'report.md'), 'utf8');
|
|
25
|
-
return current(project).map((flow) => ({ ...flow,
|
|
26
|
-
spec: extractUseCaseSection(markdown, flow.id) ?? '',
|
|
27
|
-
draft: ledger.entries[flow.key]?.status === 'draft' ? Object.fromEntries(Object.entries(ledger.entries[flow.key].draft ?? {}).map(([kind, relative]) => [kind, fs.readFileSync(reviewArtifact(project, relative), 'utf8')])) : undefined,
|
|
28
|
-
sourceState: sourceState(project, flow, ledger.entries[flow.key]),
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
function reviewArtifact(project, relative) {
|
|
32
|
-
const base = path.resolve(project, '.archscribe', 'review');
|
|
33
|
-
const file = path.resolve(project, '.archscribe', relative);
|
|
34
|
-
if (!file.startsWith(base + path.sep))
|
|
35
|
-
throw new Error('Invalid review artifact path');
|
|
36
|
-
return file;
|
|
37
|
-
}
|
|
38
|
-
function sourceState(project, flow, entry) {
|
|
39
|
-
const file = flow.sourceTrace?.[0]?.split(' -> ')[0];
|
|
40
|
-
if (!file)
|
|
41
|
-
return 'missing';
|
|
42
|
-
const manifest = JSON.parse(fs.readFileSync(path.join(output(project), 'manifest.json'), 'utf8'));
|
|
43
|
-
const root = path.resolve(project, manifest.sourceRoot);
|
|
44
|
-
const source = path.resolve(root, file);
|
|
45
|
-
if (!source.startsWith(root + path.sep) || !fs.existsSync(source))
|
|
46
|
-
return 'missing';
|
|
47
|
-
const previous = entry?.sourceFingerprint ?? manifest.files?.[path.posix.join(manifest.sourceRoot.replace(/\\/g, '/'), file.replace(/\\/g, '/'))];
|
|
48
|
-
return previous && previous !== sha256File(source) ? 'changed' : 'current';
|
|
49
|
-
}
|
|
50
|
-
export function getReview(req, res, projects) {
|
|
51
|
-
const project = projects[req.params.name];
|
|
52
|
-
if (!project || !fs.existsSync(path.join(output(project), 'evaluation-report.json'))) {
|
|
53
|
-
res.status(404).json({ error: 'Project report not found' });
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
try {
|
|
57
|
-
const ledger = loadReviewLedger(project);
|
|
58
|
-
res.json({ version: version(project), entries: ledger.entries, usecases: reviewedFlows(project, ledger) });
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
res.status(500).json({ error: String(error) });
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
export function putReview(req, res, projects) {
|
|
65
|
-
const project = projects[req.params.name];
|
|
66
|
-
if (!project || !fs.existsSync(path.join(output(project), 'evaluation-report.json'))) {
|
|
67
|
-
res.status(404).json({ error: 'Project report not found' });
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
try {
|
|
71
|
-
const flow = current(project).find((item) => item.key === req.params.sourceKey);
|
|
72
|
-
if (!flow) {
|
|
73
|
-
res.status(404).json({ error: 'Use case not in current report' });
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const { version: expected, status, note } = req.body ?? {};
|
|
77
|
-
if (typeof expected !== 'string' || !['approved', 'needs-fix', 'pending'].includes(status) ||
|
|
78
|
-
(note !== undefined && (typeof note !== 'string' || note.length > 10000))) {
|
|
79
|
-
res.status(400).json({ error: 'Invalid review update' });
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const ledger = loadReviewLedger(project);
|
|
83
|
-
if (expected !== version(project)) {
|
|
84
|
-
res.status(409).json({ error: 'Review changed; reload before saving' });
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
let entry;
|
|
88
|
-
if (status === 'approved') {
|
|
89
|
-
const previous = ledger.entries[flow.key];
|
|
90
|
-
if (previous?.status === 'draft' && !previous.draft?.spec)
|
|
91
|
-
throw new Error('Incomplete review draft');
|
|
92
|
-
if (previous?.status === 'draft' && previous.baseFingerprint !== currentReviewBaseFingerprint(project, flow.key, previous.note)) {
|
|
93
|
-
res.status(409).json({ error: 'Review draft is based on an older report or source; rerun the agent review before approving' });
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
const specText = extractUseCaseSection(fs.readFileSync(path.join(output(project), 'report.md'), 'utf8'), flow.id);
|
|
97
|
-
if (!specText)
|
|
98
|
-
throw new Error('Use case spec not found in report');
|
|
99
|
-
const temp = path.join(project, '.archscribe', `review-spec-${process.pid}-${Date.now()}.md`);
|
|
100
|
-
fs.mkdirSync(path.dirname(temp), { recursive: true });
|
|
101
|
-
try {
|
|
102
|
-
fs.writeFileSync(temp, specText, { flag: 'wx' });
|
|
103
|
-
const artifacts = { spec: temp };
|
|
104
|
-
for (const kind of ['activity', 'sequence']) {
|
|
105
|
-
const relative = kind === 'activity' ? flow.activityDiagramPath : flow.sequenceDiagramPath;
|
|
106
|
-
if (!relative)
|
|
107
|
-
continue;
|
|
108
|
-
const base = path.resolve(output(project));
|
|
109
|
-
const file = path.resolve(base, relative);
|
|
110
|
-
if (!file.startsWith(base + path.sep) || path.extname(file) !== '.drawio')
|
|
111
|
-
throw new Error('Invalid diagram path');
|
|
112
|
-
artifacts[kind] = file;
|
|
113
|
-
}
|
|
114
|
-
if (previous?.status === 'draft')
|
|
115
|
-
for (const kind of ['spec', 'activity', 'sequence']) {
|
|
116
|
-
if (previous.draft?.[kind])
|
|
117
|
-
artifacts[kind] = reviewArtifact(project, previous.draft[kind]);
|
|
118
|
-
}
|
|
119
|
-
const relative = flow.sourceTrace?.[0]?.split(' -> ')[0];
|
|
120
|
-
const manifest = JSON.parse(fs.readFileSync(path.join(output(project), 'manifest.json'), 'utf8'));
|
|
121
|
-
const source = relative && path.resolve(project, manifest.sourceRoot, relative);
|
|
122
|
-
const base = path.resolve(project, manifest.sourceRoot);
|
|
123
|
-
if (!source || !source.startsWith(base + path.sep) || !fs.existsSync(source)) {
|
|
124
|
-
res.status(409).json({ error: 'Source missing; reconcile before approving' });
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
const sourceFingerprint = sha256File(source);
|
|
128
|
-
const manifestKey = relative && path.posix.join(manifest.sourceRoot.replace(/\\/g, '/'), relative.replace(/\\/g, '/'));
|
|
129
|
-
if (manifestKey && manifest.files?.[manifestKey] && sourceFingerprint !== manifest.files[manifestKey]) {
|
|
130
|
-
res.status(409).json({ error: 'Source changed since report generation; rerun before approving' });
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
entry = approveReview(project, flow.key, artifacts, { title: flow.title, endpoint: flow.endpoint, sourceFingerprint });
|
|
134
|
-
}
|
|
135
|
-
finally {
|
|
136
|
-
fs.rmSync(temp, { force: true });
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
entry = { ...ledger.entries[flow.key], key: flow.key, title: flow.title, endpoint: flow.endpoint,
|
|
141
|
-
status, note: note ?? ledger.entries[flow.key]?.note ?? '' };
|
|
142
|
-
ledger.entries[flow.key] = entry;
|
|
143
|
-
saveReviewLedger(project, ledger);
|
|
144
|
-
}
|
|
145
|
-
res.json({ version: version(project), entry });
|
|
146
|
-
}
|
|
147
|
-
catch (error) {
|
|
148
|
-
res.status(500).json({ error: String(error) });
|
|
149
|
-
}
|
|
150
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export type ReviewStatus = 'pending' | 'needs-fix' | 'draft' | 'approved' | 'unresolved';
|
|
2
|
-
export interface ReviewEntry {
|
|
3
|
-
key: string;
|
|
4
|
-
status: ReviewStatus;
|
|
5
|
-
note: string;
|
|
6
|
-
title?: string;
|
|
7
|
-
endpoint?: string;
|
|
8
|
-
baseFingerprint?: string;
|
|
9
|
-
sourceFingerprint?: string;
|
|
10
|
-
snapshots?: {
|
|
11
|
-
spec: string;
|
|
12
|
-
activity?: string;
|
|
13
|
-
sequence?: string;
|
|
14
|
-
};
|
|
15
|
-
draft?: {
|
|
16
|
-
spec?: string;
|
|
17
|
-
activity?: string;
|
|
18
|
-
sequence?: string;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export interface ReviewLedger {
|
|
22
|
-
version: 1;
|
|
23
|
-
entries: Record<string, ReviewEntry>;
|
|
24
|
-
}
|
|
25
|
-
export declare function loadReviewLedger(projectPath: string): ReviewLedger;
|
|
26
|
-
export declare function saveReviewLedger(projectPath: string, ledger: ReviewLedger): void;
|
|
27
|
-
export declare function setReviewNote(projectPath: string, sourceKey: string, note: string): ReviewEntry;
|
|
28
|
-
export declare function approveReview(projectPath: string, sourceKey: string, artifacts: {
|
|
29
|
-
spec: string;
|
|
30
|
-
activity?: string;
|
|
31
|
-
sequence?: string;
|
|
32
|
-
}, context?: {
|
|
33
|
-
title: string;
|
|
34
|
-
endpoint: string;
|
|
35
|
-
sourceFingerprint?: string;
|
|
36
|
-
}): ReviewEntry;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { createHash, randomUUID } from 'node:crypto';
|
|
4
|
-
const root = (project) => path.join(project, '.archscribe');
|
|
5
|
-
const ledgerFile = (project) => path.join(root(project), 'review.json');
|
|
6
|
-
function safeSnapshot(project, relative) {
|
|
7
|
-
const base = path.resolve(root(project), 'review');
|
|
8
|
-
const target = path.resolve(root(project), relative);
|
|
9
|
-
if (!target.startsWith(base + path.sep))
|
|
10
|
-
throw new Error('Invalid review snapshot path');
|
|
11
|
-
return target;
|
|
12
|
-
}
|
|
13
|
-
export function loadReviewLedger(projectPath) {
|
|
14
|
-
const file = ledgerFile(projectPath);
|
|
15
|
-
if (!fs.existsSync(file))
|
|
16
|
-
return { version: 1, entries: {} };
|
|
17
|
-
let value;
|
|
18
|
-
try {
|
|
19
|
-
value = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
20
|
-
}
|
|
21
|
-
catch (error) {
|
|
22
|
-
throw new Error(`Invalid review ledger: ${String(error)}`);
|
|
23
|
-
}
|
|
24
|
-
if (!value || typeof value !== 'object' || value.version !== 1 ||
|
|
25
|
-
!(value.entries instanceof Object) || Array.isArray(value.entries)) {
|
|
26
|
-
throw new Error('Invalid review ledger format');
|
|
27
|
-
}
|
|
28
|
-
const ledger = value;
|
|
29
|
-
for (const [key, entry] of Object.entries(ledger.entries)) {
|
|
30
|
-
if (!entry || entry.key !== key || !['pending', 'needs-fix', 'draft', 'approved', 'unresolved'].includes(entry.status) || typeof entry.note !== 'string' ||
|
|
31
|
-
(entry.status === 'approved' && !entry.snapshots?.spec)) {
|
|
32
|
-
throw new Error('Invalid review entry');
|
|
33
|
-
}
|
|
34
|
-
for (const relative of [...Object.values(entry.snapshots ?? {}), ...Object.values(entry.draft ?? {})]) {
|
|
35
|
-
const file = safeSnapshot(projectPath, relative);
|
|
36
|
-
if (!fs.existsSync(file))
|
|
37
|
-
throw new Error(`Missing review snapshot: ${relative}`);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return ledger;
|
|
41
|
-
}
|
|
42
|
-
export function saveReviewLedger(projectPath, ledger) {
|
|
43
|
-
if (ledger.version !== 1)
|
|
44
|
-
throw new Error('Invalid review ledger version');
|
|
45
|
-
for (const [key, entry] of Object.entries(ledger.entries)) {
|
|
46
|
-
if (entry.key !== key)
|
|
47
|
-
throw new Error('Invalid review entry key');
|
|
48
|
-
if (entry.status === 'approved' && !entry.snapshots?.spec)
|
|
49
|
-
throw new Error('Missing approved spec snapshot');
|
|
50
|
-
for (const relative of [...Object.values(entry.snapshots ?? {}), ...Object.values(entry.draft ?? {})]) {
|
|
51
|
-
const file = safeSnapshot(projectPath, relative);
|
|
52
|
-
if (!fs.existsSync(file))
|
|
53
|
-
throw new Error(`Missing review snapshot: ${relative}`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
fs.mkdirSync(root(projectPath), { recursive: true });
|
|
57
|
-
const file = ledgerFile(projectPath), temp = `${file}.${randomUUID()}.tmp`;
|
|
58
|
-
try {
|
|
59
|
-
fs.writeFileSync(temp, JSON.stringify(ledger, null, 2), { encoding: 'utf8', flag: 'wx' });
|
|
60
|
-
fs.renameSync(temp, file);
|
|
61
|
-
}
|
|
62
|
-
finally {
|
|
63
|
-
if (fs.existsSync(temp))
|
|
64
|
-
fs.unlinkSync(temp);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
export function setReviewNote(projectPath, sourceKey, note) {
|
|
68
|
-
if (!sourceKey.trim() || typeof note !== 'string')
|
|
69
|
-
throw new Error('Invalid review note');
|
|
70
|
-
const ledger = loadReviewLedger(projectPath);
|
|
71
|
-
const previous = ledger.entries[sourceKey];
|
|
72
|
-
const entry = { ...previous, key: sourceKey, status: note.trim() ? 'needs-fix' : (previous?.status ?? 'pending'), note };
|
|
73
|
-
ledger.entries[sourceKey] = entry;
|
|
74
|
-
saveReviewLedger(projectPath, ledger);
|
|
75
|
-
return entry;
|
|
76
|
-
}
|
|
77
|
-
export function approveReview(projectPath, sourceKey, artifacts, context) {
|
|
78
|
-
if (!sourceKey.trim())
|
|
79
|
-
throw new Error('Invalid review key');
|
|
80
|
-
const ledger = loadReviewLedger(projectPath);
|
|
81
|
-
const bytes = Object.entries(artifacts).map(([kind, file]) => {
|
|
82
|
-
if (!['spec', 'activity', 'sequence'].includes(kind) || typeof file !== 'string' || !fs.existsSync(file))
|
|
83
|
-
throw new Error(`Missing review artifact: ${kind}`);
|
|
84
|
-
return [kind, fs.readFileSync(file)];
|
|
85
|
-
});
|
|
86
|
-
const version = randomUUID();
|
|
87
|
-
const snapshots = { spec: '' };
|
|
88
|
-
for (const [kind, data] of bytes) {
|
|
89
|
-
const relative = path.join('review', version, `${kind}${kind === 'spec' ? '.md' : '.drawio'}`);
|
|
90
|
-
const dest = safeSnapshot(projectPath, relative);
|
|
91
|
-
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
92
|
-
fs.writeFileSync(dest, data, { flag: 'wx' });
|
|
93
|
-
snapshots[kind] = relative;
|
|
94
|
-
}
|
|
95
|
-
const entry = {
|
|
96
|
-
...ledger.entries[sourceKey], key: sourceKey, status: 'approved', note: '', snapshots, draft: undefined,
|
|
97
|
-
...context,
|
|
98
|
-
baseFingerprint: createHash('sha256').update(bytes.map(([, b]) => b).reduce((a, b) => Buffer.concat([a, b]), Buffer.alloc(0))).digest('hex'),
|
|
99
|
-
};
|
|
100
|
-
ledger.entries[sourceKey] = entry;
|
|
101
|
-
saveReviewLedger(projectPath, ledger);
|
|
102
|
-
return entry;
|
|
103
|
-
}
|
|
104
|
-
//# sourceMappingURL=review-ledger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"review-ledger.js","sourceRoot":"","sources":["../../src/core/review-ledger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAgBrD,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AACpE,MAAM,UAAU,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC;AAEhF,SAAS,YAAY,CAAC,OAAe,EAAE,QAAgB;IACrD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;IACrD,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACzF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,WAAmB;IAClD,MAAM,IAAI,GAA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C;QAC/F,MAAM,IAAI,GAAG,YAAY,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QACjD,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7C,SAAS,CAAC,IAA8B,CAAC,GAAG,QAAQ,CAAC;IACvD,CAAC;IACD,MAAM,KAAK,GAAgB;QACzB,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS;QACvG,GAAG,OAAO;QACV,eAAe,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;KAC7I,CAAC;IACF,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;IAClC,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { UseCaseFlow } from '../types/report.js';
|
|
2
|
-
type Source = Pick<UseCaseFlow, 'endpoint' | 'controllerName' | 'methodName'> & {
|
|
3
|
-
sourceFile?: string;
|
|
4
|
-
sourceTrace?: string[];
|
|
5
|
-
};
|
|
6
|
-
/** A display UC number is deliberately not part of this identity. */
|
|
7
|
-
export declare function sourceKey(flow: Source): string;
|
|
8
|
-
export declare function selectRerunWork(candidates: Array<{
|
|
9
|
-
key: string;
|
|
10
|
-
id: string;
|
|
11
|
-
}>, approvedKeys: Set<string>, requestedLimit: number, explicitKeys?: Set<string>): {
|
|
12
|
-
workKeys: string[];
|
|
13
|
-
retainedKeys: string[];
|
|
14
|
-
unresolvedKeys: string[];
|
|
15
|
-
};
|
|
16
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/** A display UC number is deliberately not part of this identity. */
|
|
2
|
-
export function sourceKey(flow) {
|
|
3
|
-
const file = flow.sourceFile ?? flow.sourceTrace?.[0]?.split(' -> ')[0];
|
|
4
|
-
if (!file || !flow.endpoint || !flow.controllerName || !flow.methodName) {
|
|
5
|
-
throw new Error('Cannot identify use case without source file, endpoint and method');
|
|
6
|
-
}
|
|
7
|
-
return JSON.stringify([
|
|
8
|
-
flow.endpoint.trim().replace(/\s+/g, ' ').toUpperCase(),
|
|
9
|
-
file.replace(/\\/g, '/').replace(/^\.\//, ''),
|
|
10
|
-
flow.controllerName.trim(),
|
|
11
|
-
flow.methodName.trim(),
|
|
12
|
-
]);
|
|
13
|
-
}
|
|
14
|
-
export function selectRerunWork(candidates, approvedKeys, requestedLimit, explicitKeys) {
|
|
15
|
-
if (!Number.isInteger(requestedLimit) || requestedLimit < 0)
|
|
16
|
-
throw new Error('Invalid work limit');
|
|
17
|
-
const keys = new Set();
|
|
18
|
-
for (const candidate of candidates) {
|
|
19
|
-
if (keys.has(candidate.key))
|
|
20
|
-
throw new Error(`Ambiguous duplicate use case: ${candidate.id}`);
|
|
21
|
-
keys.add(candidate.key);
|
|
22
|
-
}
|
|
23
|
-
const retainedKeys = [...approvedKeys];
|
|
24
|
-
return {
|
|
25
|
-
retainedKeys,
|
|
26
|
-
unresolvedKeys: retainedKeys.filter((key) => !keys.has(key)),
|
|
27
|
-
workKeys: candidates.filter((c) => !approvedKeys.has(c.key) && (!explicitKeys || explicitKeys.has(c.key)))
|
|
28
|
-
.slice(0, requestedLimit).map((c) => c.key),
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=review-rerun.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"review-rerun.js","sourceRoot":"","sources":["../../src/core/review-rerun.ts"],"names":[],"mappings":"AAOA,qEAAqE;AACrE,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;QACxE,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;IACvF,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC;QACpB,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE;QACvD,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QAC7C,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE;QAC1B,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;KACvB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,UAA8C,EAC9C,YAAyB,EACzB,cAAsB,EACtB,YAA0B;IAE1B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,cAAc,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACnG,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9F,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IACD,MAAM,YAAY,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC;IACvC,OAAO;QACL,YAAY;QACZ,cAAc,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5D,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,YAAY,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;aACvG,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;KAC9C,CAAC;AACJ,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { type ReviewEntry } from '../core/review-ledger.js';
|
|
2
|
-
type Kind = 'spec' | 'activity' | 'sequence';
|
|
3
|
-
export interface ReviewTask {
|
|
4
|
-
sourceKey: string;
|
|
5
|
-
id: string;
|
|
6
|
-
title: string;
|
|
7
|
-
endpoint: string;
|
|
8
|
-
note: string;
|
|
9
|
-
sourceTrace: string[];
|
|
10
|
-
spec: string;
|
|
11
|
-
activity?: string;
|
|
12
|
-
sequence?: string;
|
|
13
|
-
allowedKinds: Kind[];
|
|
14
|
-
baseFingerprint: string;
|
|
15
|
-
}
|
|
16
|
-
export declare function getReviewTasks({ projectPath }: {
|
|
17
|
-
projectPath: string;
|
|
18
|
-
}): ReviewTask[];
|
|
19
|
-
export declare function currentReviewBaseFingerprint(projectPath: string, key: string, note: string): string;
|
|
20
|
-
export declare function submitReviewRevision(input: {
|
|
21
|
-
projectPath: string;
|
|
22
|
-
sourceKey: string;
|
|
23
|
-
baseFingerprint: string;
|
|
24
|
-
spec?: string;
|
|
25
|
-
activity?: string;
|
|
26
|
-
sequence?: string;
|
|
27
|
-
}): ReviewEntry;
|
|
28
|
-
export {};
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { createHash, randomUUID } from 'node:crypto';
|
|
4
|
-
import { loadReviewLedger, saveReviewLedger } from '../core/review-ledger.js';
|
|
5
|
-
import { sourceKey } from '../core/review-rerun.js';
|
|
6
|
-
import { extractUseCaseSection } from '../utils/approval.js';
|
|
7
|
-
import { sha256File } from '../core/manifest.js';
|
|
8
|
-
function inside(base, relative) {
|
|
9
|
-
const absolute = path.resolve(base, relative);
|
|
10
|
-
if (!absolute.startsWith(path.resolve(base) + path.sep))
|
|
11
|
-
throw new Error('Invalid review artifact path');
|
|
12
|
-
return absolute;
|
|
13
|
-
}
|
|
14
|
-
function readCurrent(projectPath) {
|
|
15
|
-
const output = path.join(projectPath, 'archscribe-output');
|
|
16
|
-
const report = JSON.parse(fs.readFileSync(path.join(output, 'evaluation-report.json'), 'utf8'));
|
|
17
|
-
if (!Array.isArray(report.usecases))
|
|
18
|
-
throw new Error('Invalid review report');
|
|
19
|
-
const manifest = JSON.parse(fs.readFileSync(path.join(output, 'manifest.json'), 'utf8'));
|
|
20
|
-
if (typeof manifest.sourceRoot !== 'string')
|
|
21
|
-
throw new Error('Invalid review manifest');
|
|
22
|
-
return { flows: report.usecases, markdown: fs.readFileSync(path.join(output, 'report.md'), 'utf8'), output,
|
|
23
|
-
sourceRoot: manifest.sourceRoot };
|
|
24
|
-
}
|
|
25
|
-
function kinds(note) {
|
|
26
|
-
const result = ['spec'];
|
|
27
|
-
if (/activity|hoạt động/i.test(note))
|
|
28
|
-
result.push('activity');
|
|
29
|
-
if (/sequence|tuần tự/i.test(note))
|
|
30
|
-
result.push('sequence');
|
|
31
|
-
return result;
|
|
32
|
-
}
|
|
33
|
-
function validDrawio(xml) {
|
|
34
|
-
// ponytail: accepts the plain mxfile XML archscribe writes; add a declared XML parser if compressed diagrams are supported.
|
|
35
|
-
const tags = xml.match(/<[^>]*>/g) ?? [];
|
|
36
|
-
const stack = [];
|
|
37
|
-
if (!/^\s*(?:<\?xml[^>]*>\s*)?<mxfile\b/.test(xml) || /<!DOCTYPE|<!ENTITY/i.test(xml))
|
|
38
|
-
return false;
|
|
39
|
-
let offset = 0;
|
|
40
|
-
let diagrams = 0;
|
|
41
|
-
for (const tag of tags) {
|
|
42
|
-
const at = xml.indexOf(tag, offset);
|
|
43
|
-
if (at < 0 || xml.slice(offset, at).includes('<') || /&(?!#(?:\d+|x[\da-f]+);|(?:amp|lt|gt|quot|apos);)/i.test(xml.slice(offset, at)))
|
|
44
|
-
return false;
|
|
45
|
-
offset = at + tag.length;
|
|
46
|
-
if (/^<\?xml\s/.test(tag) && at === xml.search(/\S/))
|
|
47
|
-
continue;
|
|
48
|
-
const match = /^<(\/)?([A-Za-z_][\w.:-]*)(?:\s+(?:[\w.:-]+\s*=\s*(?:"[^"]*"|'[^']*')\s*)*)?\s*(\/?)>$/.exec(tag);
|
|
49
|
-
if (!match || /&(?!#(?:\d+|x[\da-f]+);|(?:amp|lt|gt|quot|apos);)/i.test(tag))
|
|
50
|
-
return false;
|
|
51
|
-
const [, closing, name, selfClosing] = match;
|
|
52
|
-
if (closing) {
|
|
53
|
-
if (stack.pop() !== name || selfClosing)
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
if (!stack.length && name !== 'mxfile')
|
|
58
|
-
return false;
|
|
59
|
-
if (name === 'diagram')
|
|
60
|
-
diagrams++;
|
|
61
|
-
if (!selfClosing)
|
|
62
|
-
stack.push(name);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return diagrams > 0 && !stack.length && !xml.slice(offset).trim();
|
|
66
|
-
}
|
|
67
|
-
export function getReviewTasks({ projectPath }) {
|
|
68
|
-
const ledger = loadReviewLedger(projectPath);
|
|
69
|
-
if (!Object.values(ledger.entries).some((entry) => entry.status === 'needs-fix' && entry.note.trim()))
|
|
70
|
-
return [];
|
|
71
|
-
const { flows, markdown, output, sourceRoot } = readCurrent(projectPath);
|
|
72
|
-
const tasks = [];
|
|
73
|
-
for (const entry of Object.values(ledger.entries)) {
|
|
74
|
-
if (entry.status !== 'needs-fix' || !entry.note.trim())
|
|
75
|
-
continue;
|
|
76
|
-
const flow = flows.find((item) => sourceKey(item) === entry.key);
|
|
77
|
-
if (!flow)
|
|
78
|
-
continue; // unresolved source: manual reconciliation, not an agent edit
|
|
79
|
-
const spec = extractUseCaseSection(markdown, flow.id);
|
|
80
|
-
if (!spec)
|
|
81
|
-
throw new Error(`Missing review spec for ${flow.id}`);
|
|
82
|
-
const sourceRelative = flow.sourceTrace?.[0]?.split(' -> ')[0];
|
|
83
|
-
const source = sourceRelative && inside(path.resolve(projectPath, sourceRoot), sourceRelative);
|
|
84
|
-
if (!source || !fs.existsSync(source))
|
|
85
|
-
throw new Error(`Missing source for review task ${flow.id}`);
|
|
86
|
-
const activity = flow.activityDiagramPath && inside(output, flow.activityDiagramPath);
|
|
87
|
-
const sequence = flow.sequenceDiagramPath && inside(output, flow.sequenceDiagramPath);
|
|
88
|
-
const requested = kinds(entry.note);
|
|
89
|
-
for (const kind of requested)
|
|
90
|
-
if (kind !== 'spec' && !((kind === 'activity' ? activity : sequence) && fs.existsSync((kind === 'activity' ? activity : sequence)))) {
|
|
91
|
-
throw new Error(`Missing ${kind} diagram for review task ${flow.id}`);
|
|
92
|
-
}
|
|
93
|
-
tasks.push({ sourceKey: entry.key, id: flow.id, title: flow.title, endpoint: flow.endpoint,
|
|
94
|
-
note: entry.note, sourceTrace: flow.sourceTrace, spec, activity, sequence,
|
|
95
|
-
allowedKinds: requested, baseFingerprint: reviewBaseFingerprint(spec, activity, sequence, entry.note, entry.key, source) });
|
|
96
|
-
}
|
|
97
|
-
return tasks;
|
|
98
|
-
}
|
|
99
|
-
function reviewBaseFingerprint(spec, activity, sequence, note, key, source) {
|
|
100
|
-
const files = [spec, ...(activity && fs.existsSync(activity) ? [fs.readFileSync(activity)] : []),
|
|
101
|
-
...(sequence && fs.existsSync(sequence) ? [fs.readFileSync(sequence)] : [])];
|
|
102
|
-
const fingerprint = createHash('sha256');
|
|
103
|
-
for (const file of files) {
|
|
104
|
-
const bytes = Buffer.from(file);
|
|
105
|
-
fingerprint.update(String(bytes.length)).update(':').update(bytes);
|
|
106
|
-
}
|
|
107
|
-
return fingerprint.update(note).update(key).update(sha256File(source)).digest('hex');
|
|
108
|
-
}
|
|
109
|
-
export function currentReviewBaseFingerprint(projectPath, key, note) {
|
|
110
|
-
const { flows, markdown, output, sourceRoot } = readCurrent(projectPath);
|
|
111
|
-
const flow = flows.find((item) => sourceKey(item) === key);
|
|
112
|
-
if (!flow)
|
|
113
|
-
throw new Error('Review source missing from current report');
|
|
114
|
-
const spec = extractUseCaseSection(markdown, flow.id);
|
|
115
|
-
const relative = flow.sourceTrace?.[0]?.split(' -> ')[0];
|
|
116
|
-
if (!spec || !relative)
|
|
117
|
-
throw new Error('Review base missing from current report');
|
|
118
|
-
const source = inside(path.resolve(projectPath, sourceRoot), relative);
|
|
119
|
-
if (!fs.existsSync(source))
|
|
120
|
-
throw new Error('Review source no longer exists');
|
|
121
|
-
const activity = flow.activityDiagramPath && inside(output, flow.activityDiagramPath);
|
|
122
|
-
const sequence = flow.sequenceDiagramPath && inside(output, flow.sequenceDiagramPath);
|
|
123
|
-
return reviewBaseFingerprint(spec, activity, sequence, note, key, source);
|
|
124
|
-
}
|
|
125
|
-
export function submitReviewRevision(input) {
|
|
126
|
-
const { projectPath, sourceKey: key, baseFingerprint } = input;
|
|
127
|
-
const task = getReviewTasks({ projectPath }).find((item) => item.sourceKey === key);
|
|
128
|
-
if (!task)
|
|
129
|
-
throw new Error('Unknown review task identity; refresh before submitting');
|
|
130
|
-
if (baseFingerprint !== task.baseFingerprint)
|
|
131
|
-
throw new Error('Stale review base fingerprint; refresh task');
|
|
132
|
-
const values = { spec: input.spec, activity: input.activity, sequence: input.sequence };
|
|
133
|
-
for (const kind of task.allowedKinds)
|
|
134
|
-
if (!values[kind]?.trim())
|
|
135
|
-
throw new Error(`Required review artifact missing: ${kind}`);
|
|
136
|
-
for (const kind of Object.keys(values)) {
|
|
137
|
-
const value = values[kind];
|
|
138
|
-
if (value === undefined)
|
|
139
|
-
continue;
|
|
140
|
-
if (!task.allowedKinds.includes(kind) || typeof value !== 'string' || value.length > 1024 * 1024)
|
|
141
|
-
throw new Error(`Invalid review artifact: ${kind}`);
|
|
142
|
-
}
|
|
143
|
-
if (!new RegExp(`^\\*\\*${task.id}\\s+-\\s+`, 'm').test(input.spec) ||
|
|
144
|
-
(input.spec.match(/^\*\*UC\d+\s+-\s+/gm)?.length ?? 0) !== 1)
|
|
145
|
-
throw new Error('Review spec heading does not match task identity');
|
|
146
|
-
for (const kind of ['activity', 'sequence'])
|
|
147
|
-
if (values[kind] !== undefined && !validDrawio(values[kind])) {
|
|
148
|
-
throw new Error(`Invalid ${kind} diagram XML`);
|
|
149
|
-
}
|
|
150
|
-
const ledger = loadReviewLedger(projectPath);
|
|
151
|
-
if (ledger.entries[key]?.status !== 'needs-fix' || ledger.entries[key]?.note !== task.note)
|
|
152
|
-
throw new Error('Stale review task');
|
|
153
|
-
const version = randomUUID();
|
|
154
|
-
const draft = {};
|
|
155
|
-
for (const kind of task.allowedKinds) {
|
|
156
|
-
const relative = path.join('review', version, `${kind}${kind === 'spec' ? '.md' : '.drawio'}`);
|
|
157
|
-
const dest = inside(path.join(projectPath, '.archscribe'), relative);
|
|
158
|
-
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
159
|
-
fs.writeFileSync(dest, values[kind], { encoding: 'utf8', flag: 'wx' });
|
|
160
|
-
draft[kind] = relative;
|
|
161
|
-
}
|
|
162
|
-
const entry = { ...ledger.entries[key], key, status: 'draft', draft, baseFingerprint,
|
|
163
|
-
title: task.title, endpoint: task.endpoint };
|
|
164
|
-
ledger.entries[key] = entry;
|
|
165
|
-
saveReviewLedger(projectPath, ledger);
|
|
166
|
-
return entry;
|
|
167
|
-
}
|
|
168
|
-
//# sourceMappingURL=review-tasks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"review-tasks.js","sourceRoot":"","sources":["../../src/tools/review-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAoB,MAAM,0BAA0B,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAkBjD,SAAS,MAAM,CAAC,IAAY,EAAE,QAAgB;IAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC9C,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACzG,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,WAAW,CAAC,WAAmB;IACtC,MAAM,MAAM,GAAG,IAAI,C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