@maycombhq/atticus 0.0.0-stage → 2.0.0-beta.3
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/LICENSE +177 -0
- package/README.md +17 -2
- package/THIRD-PARTY-LICENSES.txt +2607 -0
- package/dist/bin.js +47 -0
- package/dist/chunk-23W7VWKR.js +2609 -0
- package/dist/chunk-2C5B464C.js +106 -0
- package/dist/chunk-2LLFKP7C.js +53 -0
- package/dist/chunk-2MD7TXSG.js +166 -0
- package/dist/chunk-2UIQBDJO.js +131 -0
- package/dist/chunk-32MPK524.js +378 -0
- package/dist/chunk-3ALD2W2A.js +95 -0
- package/dist/chunk-3G4YI4ZU.js +16 -0
- package/dist/chunk-4AK7IBVP.js +915 -0
- package/dist/chunk-4BMDGTED.js +69 -0
- package/dist/chunk-4NDAAFQT.js +103 -0
- package/dist/chunk-4Q3NN7VF.js +32 -0
- package/dist/chunk-4RS5KZQD.js +25 -0
- package/dist/chunk-4SKZDI62.js +22 -0
- package/dist/chunk-55YODD3N.js +385 -0
- package/dist/chunk-56YQ6ROQ.js +3479 -0
- package/dist/chunk-5A5L3T2U.js +583 -0
- package/dist/chunk-5FEOD73Z.js +374 -0
- package/dist/chunk-5GDRCDQB.js +32 -0
- package/dist/chunk-5WS2YOGD.js +95 -0
- package/dist/chunk-65NYPGRC.js +766 -0
- package/dist/chunk-6BVONWJ7.js +50 -0
- package/dist/chunk-6D4FRTFF.js +53 -0
- package/dist/chunk-6GPJOFV4.js +149 -0
- package/dist/chunk-6JCPI55B.js +92 -0
- package/dist/chunk-6JUBZBMW.js +56 -0
- package/dist/chunk-6SCVQZX5.js +2522 -0
- package/dist/chunk-6TACQN3N.js +41 -0
- package/dist/chunk-72TXNLOC.js +496 -0
- package/dist/chunk-76WKMA4J.js +14 -0
- package/dist/chunk-7EFILTCI.js +67 -0
- package/dist/chunk-7EKXJZ2Y.js +2902 -0
- package/dist/chunk-7EOBHUMC.js +133 -0
- package/dist/chunk-7JUKDRSZ.js +1726 -0
- package/dist/chunk-7NN5VWDC.js +43 -0
- package/dist/chunk-7UFQZXZA.js +5949 -0
- package/dist/chunk-A3KPZJ5M.js +131 -0
- package/dist/chunk-A6AC72A5.js +48 -0
- package/dist/chunk-A7KZKIZX.js +166 -0
- package/dist/chunk-ABWHYWNI.js +101 -0
- package/dist/chunk-AFFIK6JI.js +46 -0
- package/dist/chunk-AHOQZ4OK.js +37 -0
- package/dist/chunk-AVJDSJ2F.js +18 -0
- package/dist/chunk-AXXCPAP6.js +203 -0
- package/dist/chunk-AY3QXYMB.js +41 -0
- package/dist/chunk-B2OKWJIU.js +143 -0
- package/dist/chunk-B632FH3I.js +251 -0
- package/dist/chunk-BLW4SXCU.js +38 -0
- package/dist/chunk-BVS2K73A.js +33 -0
- package/dist/chunk-BWZ77RQT.js +25 -0
- package/dist/chunk-BYBUDX4T.js +163 -0
- package/dist/chunk-BYZCY6SP.js +230 -0
- package/dist/chunk-C6EKFH7J.js +169 -0
- package/dist/chunk-C6MZFGN7.js +271 -0
- package/dist/chunk-CAQZUNOH.js +1150 -0
- package/dist/chunk-CD4XHYGY.js +856 -0
- package/dist/chunk-CEZQOLEO.js +1217 -0
- package/dist/chunk-CHWTETW7.js +128 -0
- package/dist/chunk-CMV7TGU6.js +31 -0
- package/dist/chunk-CNUKCS2T.js +2741 -0
- package/dist/chunk-CP3L3FH7.js +549 -0
- package/dist/chunk-CPGCA6GZ.js +41 -0
- package/dist/chunk-CWM6KM5G.js +315 -0
- package/dist/chunk-CXDSTRUJ.js +873 -0
- package/dist/chunk-D3PO4DOZ.js +261 -0
- package/dist/chunk-DFBCSHVT.js +69 -0
- package/dist/chunk-DHPACDG7.js +104 -0
- package/dist/chunk-DPC5Y5DL.js +3898 -0
- package/dist/chunk-DPUYDDQG.js +164 -0
- package/dist/chunk-DQN7TF5D.js +325 -0
- package/dist/chunk-EADP3PEN.js +450 -0
- package/dist/chunk-ED2LWWIP.js +878 -0
- package/dist/chunk-EHVTK3UE.js +116 -0
- package/dist/chunk-EPTBZ3GP.js +101 -0
- package/dist/chunk-EXIMEJ2X.js +545 -0
- package/dist/chunk-EYWIDJFU.js +130 -0
- package/dist/chunk-F44OMYIN.js +54 -0
- package/dist/chunk-F7HYOUFF.js +287 -0
- package/dist/chunk-FALXWAMD.js +182 -0
- package/dist/chunk-FBNPE7HS.js +49 -0
- package/dist/chunk-FSWUD5QB.js +108 -0
- package/dist/chunk-FVQISWPW.js +296 -0
- package/dist/chunk-G2B4ZQGH.js +240 -0
- package/dist/chunk-GK6XK5SP.js +1227 -0
- package/dist/chunk-GLEBK5L3.js +34 -0
- package/dist/chunk-GNB5QDDI.js +25 -0
- package/dist/chunk-GQ4N4WKF.js +1142 -0
- package/dist/chunk-GRMR5TRQ.js +119 -0
- package/dist/chunk-HC6XKREB.js +334 -0
- package/dist/chunk-HFQCFSJR.js +60 -0
- package/dist/chunk-HJDICQA4.js +102 -0
- package/dist/chunk-HLJAXMM4.js +233 -0
- package/dist/chunk-HVIMMDVB.js +162 -0
- package/dist/chunk-HZVLAPN5.js +32 -0
- package/dist/chunk-I3E7CX4H.js +155 -0
- package/dist/chunk-IQFTZ37C.js +2919 -0
- package/dist/chunk-ITY3VJRX.js +285 -0
- package/dist/chunk-JBTK5OP2.js +55 -0
- package/dist/chunk-JPGCERE2.js +26 -0
- package/dist/chunk-JQDNHIBC.js +38 -0
- package/dist/chunk-JRBCWLOR.js +307 -0
- package/dist/chunk-JRZQA2JM.js +212 -0
- package/dist/chunk-KCBJCA66.js +45 -0
- package/dist/chunk-KJPMEAI4.js +705 -0
- package/dist/chunk-KQDZXGNR.js +14 -0
- package/dist/chunk-KUUQR4HA.js +264 -0
- package/dist/chunk-L24C55VN.js +7923 -0
- package/dist/chunk-L3BX5ZIB.js +400 -0
- package/dist/chunk-L6SGQIR3.js +471 -0
- package/dist/chunk-LBENYT3H.js +66 -0
- package/dist/chunk-LNAJW6FB.js +47 -0
- package/dist/chunk-MC3H7736.js +19910 -0
- package/dist/chunk-MMOSZPWJ.js +273 -0
- package/dist/chunk-MXCHWULV.js +285 -0
- package/dist/chunk-N3E56YPN.js +344 -0
- package/dist/chunk-NHFQMOVK.js +180 -0
- package/dist/chunk-NQU6KNQF.js +27 -0
- package/dist/chunk-OIK5YPTN.js +391 -0
- package/dist/chunk-OLWFG75W.js +4330 -0
- package/dist/chunk-ONPUIE7Y.js +29 -0
- package/dist/chunk-OW7D2PJL.js +376 -0
- package/dist/chunk-P63VL4HE.js +2357 -0
- package/dist/chunk-PA4YNUMU.js +45 -0
- package/dist/chunk-PAMPPUR6.js +4500 -0
- package/dist/chunk-PBS3OFNN.js +113 -0
- package/dist/chunk-PFT3VTS4.js +214 -0
- package/dist/chunk-PFTA6BZF.js +49 -0
- package/dist/chunk-PNN5KLAY.js +119 -0
- package/dist/chunk-PRPPGYZG.js +104 -0
- package/dist/chunk-PUKEZ37F.js +666 -0
- package/dist/chunk-Q3HOFXZJ.js +76 -0
- package/dist/chunk-Q5AMFEWD.js +119 -0
- package/dist/chunk-QKRNMBJO.js +80 -0
- package/dist/chunk-QSU47IQ5.js +36 -0
- package/dist/chunk-QSXK2RGH.js +688 -0
- package/dist/chunk-QXNWYUYI.js +52 -0
- package/dist/chunk-R6RY4Q5T.js +51 -0
- package/dist/chunk-RCU3MPY2.js +1496 -0
- package/dist/chunk-RLIB4JUN.js +174 -0
- package/dist/chunk-RYSCLMU3.js +1991 -0
- package/dist/chunk-RZUZ4RJJ.js +415 -0
- package/dist/chunk-S2A7YC3Q.js +41433 -0
- package/dist/chunk-S2FBBX7D.js +540 -0
- package/dist/chunk-S34B4QPI.js +430 -0
- package/dist/chunk-SETWVXOJ.js +2078 -0
- package/dist/chunk-SMA4N4AC.js +211 -0
- package/dist/chunk-SP2I63OO.js +252 -0
- package/dist/chunk-STHSY74Q.js +242 -0
- package/dist/chunk-STUPFGXY.js +3206 -0
- package/dist/chunk-T5I4S2W3.js +34 -0
- package/dist/chunk-T6AIP7H5.js +3851 -0
- package/dist/chunk-TANFV3MZ.js +531 -0
- package/dist/chunk-TAVDMUV3.js +189 -0
- package/dist/chunk-TBSQJ6IV.js +324 -0
- package/dist/chunk-TIZHP7KE.js +408 -0
- package/dist/chunk-TV45EUGM.js +51 -0
- package/dist/chunk-TW2KPPUC.js +4087 -0
- package/dist/chunk-V2YTAIQO.js +1075 -0
- package/dist/chunk-V5PKHHQQ.js +1963 -0
- package/dist/chunk-VF4IOZZO.js +184 -0
- package/dist/chunk-VJTINHZI.js +48 -0
- package/dist/chunk-VKLILA2D.js +205 -0
- package/dist/chunk-VOGCSYOI.js +16 -0
- package/dist/chunk-VPTTCYOC.js +16101 -0
- package/dist/chunk-WY6PP6AA.js +53 -0
- package/dist/chunk-WYFIXP54.js +174 -0
- package/dist/chunk-WZ2BXIGG.js +34 -0
- package/dist/chunk-XJNDSYGO.js +147 -0
- package/dist/chunk-XPCM366L.js +70 -0
- package/dist/chunk-XSQKGVYA.js +69 -0
- package/dist/chunk-XUPVB7TL.js +207 -0
- package/dist/chunk-XZRON6IV.js +131 -0
- package/dist/chunk-Y4NG2FP5.js +94 -0
- package/dist/chunk-YEDDOYSC.js +27809 -0
- package/dist/chunk-YGMCXNTY.js +41 -0
- package/dist/chunk-YJKPTX6J.js +228 -0
- package/dist/chunk-YMZ3TNYB.js +18 -0
- package/dist/chunk-Z6LF7HQN.js +22 -0
- package/dist/chunk-Z7SG32ZY.js +55 -0
- package/dist/chunk-ZDPAS56H.js +76 -0
- package/dist/chunk-ZJSP24X4.js +1247 -0
- package/dist/chunk-ZMAINWBW.js +18 -0
- package/dist/chunk-ZMFPW66A.js +22 -0
- package/dist/chunk-ZUIAOKXI.js +1611 -0
- package/dist/chunk-ZVM6AKKM.js +47 -0
- package/dist/files.json +1888 -0
- package/dist/fixtures/forge/README.md +19 -0
- package/dist/fixtures/forge/expected/discrepancies.yaml +54 -0
- package/dist/fixtures/forge/expected/inputs.yaml +38 -0
- package/dist/fixtures/forge/expected/scan.yaml +342 -0
- package/dist/fixtures/forge/inputs/diagrams/forge-context.drawio +23 -0
- package/dist/fixtures/forge/inputs/partner-specs/northwind-pay-openapi.yaml +11 -0
- package/dist/fixtures/forge/inputs/tickets/ado-stories.json +4 -0
- package/dist/fixtures/forge/inputs/tickets/closed-service-requests.json +5 -0
- package/dist/fixtures/forge/inputs/wiki/integration-patterns.md +11 -0
- package/dist/fixtures/forge/inputs/wiki/ledger-solution-spec.md +9 -0
- package/dist/fixtures/forge/inputs/wiki/snow-firewall-request.md +4 -0
- package/dist/fixtures/forge/metarepo/judgments/reaches/84af5b6af24f7ca8c23013f3.yaml +17 -0
- package/dist/fixtures/forge/metarepo/judgments/reaches/c3917555edebddce8cecb647.yaml +17 -0
- package/dist/fixtures/forge/metarepo/judgments/reaches/c5fafd6601f8ca9e34e0bbd0.yaml +17 -0
- package/dist/fixtures/forge/metarepo/org-pack/agents/architecture-critic.yaml +9 -0
- package/dist/fixtures/forge/metarepo/org-pack/agents/story-writer.yaml +10 -0
- package/dist/fixtures/forge/metarepo/org-pack/checklists/architecture.yaml +115 -0
- package/dist/fixtures/forge/metarepo/org-pack/dialects/forge.yaml +111 -0
- package/dist/fixtures/forge/metarepo/org-pack/gates.yaml +22 -0
- package/dist/fixtures/forge/metarepo/org-pack/pack.yaml +11 -0
- package/dist/fixtures/forge/metarepo/org-pack/patterns/A.EB.PUB.yaml +12 -0
- package/dist/fixtures/forge/metarepo/org-pack/patterns/D.JDBC.yaml +12 -0
- package/dist/fixtures/forge/metarepo/org-pack/patterns/S.DIR.BFF.yaml +12 -0
- package/dist/fixtures/forge/metarepo/org-pack/patterns/S.GW.SOR.yaml +13 -0
- package/dist/fixtures/forge/metarepo/org-pack/patterns/S.GW.VND.yaml +14 -0
- package/dist/fixtures/forge/metarepo/org-pack/process/change-templates/feature.md +37 -0
- package/dist/fixtures/forge/metarepo/org-pack/process/skills/add-forge-endpoint/SKILL.md +17 -0
- package/dist/fixtures/forge/metarepo/org-pack/process/snow/firewall-rule.yaml +14 -0
- package/dist/fixtures/forge/metarepo/org-pack/process/snow/gateway-route.yaml +13 -0
- package/dist/fixtures/forge/metarepo/org-pack/profiles/forge/profile.yaml +12 -0
- package/dist/fixtures/forge/metarepo/org-pack/profiles/forge/repos.manifest.yaml +44 -0
- package/dist/fixtures/forge/metarepo/org-pack/roles.yaml +14 -0
- package/dist/fixtures/forge/metarepo/org-pack/runtime.yaml +14 -0
- package/dist/fixtures/forge/metarepo/org-pack/sources.yaml +3 -0
- package/dist/fixtures/forge/repos/forge-events/topics/payments.initiated.yaml +4 -0
- package/dist/fixtures/forge/repos/forge-events/topics/transfers.completed.yaml +4 -0
- package/dist/fixtures/forge/repos/forge-gateway/proxies/ledger-v1/apiproxy/ledger-v1.xml +3 -0
- package/dist/fixtures/forge/repos/forge-gateway/proxies/ledger-v1/apiproxy/policies/SpikeArrest.xml +3 -0
- package/dist/fixtures/forge/repos/forge-gateway/proxies/ledger-v1/apiproxy/policies/VerifyOAuth.xml +4 -0
- package/dist/fixtures/forge/repos/forge-gateway/proxies/ledger-v1/apiproxy/proxies/default.xml +14 -0
- package/dist/fixtures/forge/repos/forge-gateway/proxies/ledger-v1/apiproxy/targets/ledger.xml +5 -0
- package/dist/fixtures/forge/repos/forge-infra/alerts/ledger-api.yaml +5 -0
- package/dist/fixtures/forge/repos/forge-infra/k8s/ledger-api.yaml +15 -0
- package/dist/fixtures/forge/repos/forge-infra/k8s/portal-bff.yaml +7 -0
- package/dist/fixtures/forge/repos/forge-infra/terraform/ledger-db.tf +9 -0
- package/dist/fixtures/forge/repos/forge-ledger/api/ledger-openapi.yaml +31 -0
- package/dist/fixtures/forge/repos/forge-ledger/forge.yaml +4 -0
- package/dist/fixtures/forge/repos/forge-ledger/src/main/java/forge/ledger/LedgerEndpoints.java +13 -0
- package/dist/fixtures/forge/repos/forge-ledger/src/main/java/forge/ledger/LedgerEvents.java +11 -0
- package/dist/fixtures/forge/repos/forge-ledger/src/main/java/forge/ledger/NorthwindClient.java +10 -0
- package/dist/fixtures/forge/repos/forge-ledger/src/main/resources/application.yml +3 -0
- package/dist/fixtures/forge/repos/forge-ledger/src/main/resources/db/migration/V1__create_account.sql +5 -0
- package/dist/fixtures/forge/repos/forge-ledger/src/main/resources/db/migration/V2__create_entry.sql +7 -0
- package/dist/fixtures/forge/repos/forge-portal-bff/pom.xml +1 -0
- package/dist/fixtures/forge/repos/forge-portal-bff/src/main/java/forge/portal/AuditPublisher.java +12 -0
- package/dist/fixtures/forge/repos/forge-portal-bff/src/main/java/forge/portal/BalanceController.java +16 -0
- package/dist/fixtures/forge/repos/forge-portal-bff/src/main/java/forge/portal/LedgerClient.java +13 -0
- package/dist/fixtures/forge/repos/forge-portal-bff/src/main/java/forge/portal/PaymentEvents.java +13 -0
- package/dist/fixtures/forge/repos/forge-portal-bff/src/main/resources/application.yml +8 -0
- package/dist/fixtures/forge/repos/forge-portal-ui/package.json +1 -0
- package/dist/fixtures/forge/repos/forge-portal-ui/src/api/balance.ts +5 -0
- package/dist/fixtures/forge/repos/forge-reports-job/src/main/java/forge/reports/DailyEntriesJob.java +19 -0
- package/dist/fixtures/forge/repos/forge-reports-job/src/main/resources/application.yml +3 -0
- package/dist/fixtures/forge-change/README.md +41 -0
- package/dist/fixtures/forge-change/expected/findings.yaml +301 -0
- package/dist/fixtures/forge-change/expected/stories.yaml +101 -0
- package/dist/fixtures/forge-change/judgments/personal-data/0b5f3dbf5257a22275d8c74b.yaml +18 -0
- package/dist/fixtures/forge-change/judgments/personal-data/2759a66770134c417440bf2d.yaml +18 -0
- package/dist/fixtures/forge-change/judgments/personal-data/31b1ea2f14d0737f1aca79fd.yaml +18 -0
- package/dist/fixtures/forge-change/judgments/personal-data/49afd70c08228e65ad6ca1ed.yaml +18 -0
- package/dist/fixtures/forge-change/judgments/personal-data/761cabcb8a39f5e5866d2dd6.yaml +18 -0
- package/dist/fixtures/forge-change/judgments/personal-data/adae902b90cc8ffa0c765145.yaml +18 -0
- package/dist/fixtures/forge-change/judgments/personal-data/ba11bb933105ec9493e065dd.yaml +18 -0
- package/dist/fixtures/forge-change/judgments/personal-data/bdbcd1cdac3021c68063c3e7.yaml +18 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/brief.md +35 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/change.yaml +120 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/data.md +18 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/design.md +29 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/interfaces.md +17 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/mappings.md +26 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/proposal.md +35 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/snow.md +12 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/specs/transfer-limits/spec.md +19 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/stories/s1-refuse-over-limit.md +17 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/stories/s2-show-remaining.md +16 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/stories/s3-audit-refusals.md +18 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/stories/s4-velocity-check.md +16 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/stories.md +8 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/tasks.md +12 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/ux.md +7 -0
- package/dist/fixtures/forge-change/org-pack/agents/code-and-test-critic.yaml +13 -0
- package/dist/fixtures/forge-change/org-pack/agents/complete-critic.yaml +12 -0
- package/dist/fixtures/forge-change/org-pack/agents/safe-critic.yaml +12 -0
- package/dist/fixtures/forge-change/org-pack/agents/ship-critic.yaml +11 -0
- package/dist/fixtures/forge-change/org-pack/agents/true-critic.yaml +11 -0
- package/dist/fixtures/forge-change/org-pack/checklists/review.yaml +54 -0
- package/dist/fixtures/forge-change/org-pack/gates.yaml +25 -0
- package/dist/fixtures/forge-change/org-pack/teams/team-ledger/checklists/ledger-team.yaml +227 -0
- package/dist/fixtures/forge-change/recordings/complete-critic/2ad84f84bf39c1d5412697e69fe23034d6983ec45a00314bf0975e627589a3c5.json +12 -0
- package/dist/fixtures/forge-change/recordings/complete-critic/417c98d8e54a4387d0fd93441c49f44c2868958739070d855c1dce0c41e24db3.json +12 -0
- package/dist/fixtures/forge-change/recordings/complete-critic/50203ee22e9cb3ef047295edb6538fe7d5695e1e4b139f3c929013dc6ce47021.json +12 -0
- package/dist/fixtures/forge-change/recordings/complete-critic/89f18d67f5d9c325bf35e2a9e020f9ddb6ee13b8523315037f0905cc57c040b1.json +12 -0
- package/dist/fixtures/forge-change/recordings/complete-critic/b4097867d26ae8eadc8b9efa8cdd86897013358035f0b40086c299a59c4ba121.json +12 -0
- package/dist/fixtures/forge-change/recordings/safe-critic/302d06f49664dd67ad2e21ab9cf74c1b0f7d3f750709c6ed8eff2b70983274e2.json +12 -0
- package/dist/fixtures/forge-change/recordings/safe-critic/32f1049c9a5ab4a759543290db4644ec6e221cc45fdfdcf06193837c6a8ce0b9.json +12 -0
- package/dist/fixtures/forge-change/recordings/safe-critic/4e4a84bfc04b9f26ca4250319a879901ff7a1c081c71e46a117675fee05026b0.json +12 -0
- package/dist/fixtures/forge-change/recordings/safe-critic/604af0fcdd6df6b76208fa88305fdc15c37606c2a4d1ae816477e46ac8c2dd04.json +12 -0
- package/dist/fixtures/forge-change/recordings/safe-critic/f0bf50af11f14c50d07904f0dffe1c8c20fb0cd89770645a8824c1d30a443955.json +12 -0
- package/dist/fixtures/forge-change/recordings/ship-critic/350954b58833b2c04880c67db45a1b328b7fd541d9f0d943b63905b8875488a6.json +12 -0
- package/dist/fixtures/forge-change/recordings/ship-critic/4af95c6c96a206777cec9de1f9c2d8c55a36ddc9b8db2f81d6eb83217b835efa.json +12 -0
- package/dist/fixtures/forge-change/recordings/ship-critic/76c34522a49cf7587a4e5689a5030d384603fa780b8aba97d27815cbc829683e.json +12 -0
- package/dist/fixtures/forge-change/recordings/ship-critic/a3b2cd1ace48587e5994333db03b34c3a0f9dec4f1932f1730ddfb687f6918c8.json +12 -0
- package/dist/fixtures/forge-change/recordings/ship-critic/de288a4fa64d0fc20890f9a787080ce6eac5203b7b9b72d884df11e8cf111835.json +12 -0
- package/dist/fixtures/forge-change/recordings/story-writer/1ddb00eac2aaf91a5ec5d9dfd220116be9f75aec6546a4a3a3b050ed89af2864.json +12 -0
- package/dist/packages/assistant-kit/frameworks-kit/README.md +86 -0
- package/dist/packages/assistant-kit/frameworks-kit/checklist.md +11 -0
- package/dist/packages/assistant-kit/frameworks-kit/examples/tide-lantern.yaml +56 -0
- package/dist/packages/assistant-kit/frameworks-kit/examples/tide-platform.yaml +43 -0
- package/dist/packages/assistant-kit/frameworks-kit/prompts/write-framework-model.md +12 -0
- package/dist/packages/assistant-kit/kit/README.md +98 -0
- package/dist/packages/assistant-kit/kit/c2-reference.md +334 -0
- package/dist/packages/assistant-kit/kit/checklist.md +39 -0
- package/dist/packages/assistant-kit/kit/examples/house-http-client.yaml +102 -0
- package/dist/packages/assistant-kit/kit/examples/tide-apigee.yaml +56 -0
- package/dist/packages/assistant-kit/kit/examples/tide-apim.yaml +32 -0
- package/dist/packages/assistant-kit/kit/examples/tide-kong.yaml +44 -0
- package/dist/packages/assistant-kit/kit/prompts/write-dialect.md +34 -0
- package/dist/packages/assistant-kit/kit/worked-example.md +198 -0
- package/dist/packages/conformance/sample/README.md +4 -0
- package/dist/packages/conformance/sample/inputs/notes.md +3 -0
- package/dist/packages/conformance/sample/inputs/systems.csv +3 -0
- package/dist/packages/conformance/sample/repo/api/greeter.proto +6 -0
- package/dist/packages/conformance/sample/repo/api/openapi.yaml +10 -0
- package/dist/packages/conformance/sample/repo/api/schema.graphql +3 -0
- package/dist/packages/conformance/sample/repo/db/V1__create_greeting.sql +4 -0
- package/dist/packages/conformance/sample/repo/package.json +7 -0
- package/dist/packages/conformance/sample/repo/src/main/java/sample/HelloController.java +10 -0
- package/dist/packages/conformance/sample/repo/web/app.ts +4 -0
- package/dist/packages/evals/datasets/critic-lenses.yaml +62 -0
- package/dist/packages/evals/datasets/dialect-writer.yaml +14 -0
- package/dist/packages/evals/datasets/feature-namer.yaml +34 -0
- package/dist/packages/evals/datasets/glossary-definer.yaml +25 -0
- package/dist/packages/evals/datasets/story-writer.yaml +13 -0
- package/dist/packages/evals/datasets/template-writer.yaml +16 -0
- package/dist/packages/evals/datasets/test-writer.yaml +18 -0
- package/dist/packages/executors/reference/reference-executor.mjs +233 -0
- package/dist/packages/extractors/dialects/argocd.yaml +45 -0
- package/dist/packages/extractors/dialects/fixtures/jaxrs/accounts-service/src/main/java/forge/accounts/AccountResource.java +47 -0
- package/dist/packages/extractors/dialects/fixtures/jaxrs/accounts-service/src/main/java/forge/accounts/AuditClient.java +12 -0
- package/dist/packages/extractors/dialects/fixtures/jaxrs/accounts-service/src/main/java/forge/accounts/LedgerClient.java +17 -0
- package/dist/packages/extractors/dialects/fixtures/micronaut/statements-service/src/main/java/forge/statements/LedgerClient.java +14 -0
- package/dist/packages/extractors/dialects/fixtures/micronaut/statements-service/src/main/java/forge/statements/RatesClient.java +11 -0
- package/dist/packages/extractors/dialects/fixtures/micronaut/statements-service/src/main/java/forge/statements/StatementController.java +36 -0
- package/dist/packages/extractors/dialects/fixtures/micronaut/statements-service/src/main/resources/application.yml +7 -0
- package/dist/packages/extractors/dialects/fixtures/quarkus-reactive-messaging/fraud-service/src/main/java/forge/fraud/FraudScorer.java +27 -0
- package/dist/packages/extractors/dialects/fixtures/quarkus-reactive-messaging/fraud-service/src/main/resources/application.properties +4 -0
- package/dist/packages/extractors/dialects/fixtures/terraform-aws/forge-aws-infra/envs/prod/api.tf +38 -0
- package/dist/packages/extractors/dialects/fixtures/terraform-aws/forge-aws-infra/envs/prod/main.tf +95 -0
- package/dist/packages/extractors/dialects/fixtures/terraform-aws/forge-aws-infra/envs/prod/terraform.tfvars +1 -0
- package/dist/packages/extractors/dialects/fixtures/terraform-aws/forge-aws-infra/envs/prod/variables.tf +4 -0
- package/dist/packages/extractors/dialects/fixtures/terraform-azure/forge-azure-infra/main.tf +102 -0
- package/dist/packages/extractors/dialects/fixtures/terraform-gcp/forge-gcp-infra/main.tf +51 -0
- package/dist/packages/extractors/dialects/harness.yaml +101 -0
- package/dist/packages/extractors/dialects/jaxrs.yaml +155 -0
- package/dist/packages/extractors/dialects/micronaut.yaml +207 -0
- package/dist/packages/extractors/dialects/quarkus-reactive-messaging.yaml +158 -0
- package/dist/packages/extractors/dialects/tekton.yaml +71 -0
- package/dist/packages/extractors/dialects/terraform-aws.yaml +267 -0
- package/dist/packages/extractors/dialects/terraform-azure.yaml +212 -0
- package/dist/packages/extractors/dialects/terraform-gcp.yaml +109 -0
- package/dist/packages/extractors/grammars/README.md +11 -0
- package/dist/packages/extractors/grammars/tree-sitter-groovy.LICENSE +21 -0
- package/dist/packages/extractors/grammars/tree-sitter-groovy.wasm +0 -0
- package/dist/packages/extractors/grammars/vendored.json +11 -0
- package/dist/packages/learn/lessons/architect-diagrams-and-code.yaml +69 -0
- package/dist/packages/learn/lessons/business-analyst-story-bar.yaml +94 -0
- package/dist/packages/learn/lessons/delivery-lead-release-readiness.yaml +44 -0
- package/dist/packages/learn/lessons/designer-features-in-user-words.yaml +57 -0
- package/dist/packages/learn/lessons/developer-find-your-way.yaml +60 -0
- package/dist/packages/learn/lessons/everyone-first-hour.yaml +74 -0
- package/dist/packages/learn/lessons/platform-lead-coverage-and-defences.yaml +58 -0
- package/dist/packages/learn/lessons/product-owner-first-change.yaml +167 -0
- package/dist/packages/learn/lessons/qa-tests-and-trace.yaml +53 -0
- package/dist/packages/learn/lessons/team-lead-initiative.yaml +146 -0
- package/dist/packages/naysayer/constitution/constitution.yaml +286 -0
- package/dist/packages/naysayer/starter/review.yaml +256 -0
- package/dist/packages/sdk/npm/index.js +8892 -0
- package/dist/packages/speckit/rules/drift.yaml +78 -0
- package/dist/packages/taskrun/rules/conform.yaml +38 -0
- package/dist/packages/testgen/rules/trace.yaml +49 -0
- package/dist/packages/ui/dist/assets/elk-api-tma0MCuh.js +2 -0
- package/dist/packages/ui/dist/assets/elk-worker.min--dAJroGl.js +6401 -0
- package/dist/packages/ui/dist/assets/elk-worker.min-DdYmS5kP.js +2 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-400-normal-BTotfTJu.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-400-normal-DZqxrq2p.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-500-normal-ByOcLdNv.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-500-normal-CocWQlwt.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-600-normal-71GNu3SW.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-600-normal-BGq0mW3O.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-ext-400-normal-Dsrv2Tcn.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-ext-400-normal-g30qAdWV.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-ext-500-normal-Cs5J6C77.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-ext-500-normal-DB5PtV2g.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-ext-600-normal-Bz0x94Yp.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-ext-600-normal-DUMzJB7m.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-greek-400-normal-D9ESIMu3.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-greek-400-normal-_efipK4i.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-greek-500-normal-CuWXN6rf.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-greek-500-normal-JMMifIXV.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-greek-600-normal-D-CqTdkO.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-greek-600-normal-DzTrcv_p.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-ext-400-normal-C5H60-Va.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-ext-400-normal-RBey6euL.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-ext-500-normal-D0aIdm-b.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-ext-500-normal-DakdToA3.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-ext-600-normal-DIrixKbi.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-ext-600-normal-DOrvGEcy.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-vietnamese-400-normal-DG4YqDda.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-vietnamese-400-normal-fK1oJ5dG.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-vietnamese-500-normal-BEb3_waV.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-vietnamese-500-normal-e4dixQRQ.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-vietnamese-600-normal-DgdngZtN.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-vietnamese-600-normal-DpPYBSTl.woff2 +0 -0
- package/dist/packages/ui/dist/assets/index-B54fm9FQ.js +29 -0
- package/dist/packages/ui/dist/assets/index-DD_hufQz.css +1 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-devanagari-600-normal-BtY48IV_.woff +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-devanagari-600-normal-DhS7ScYx.woff2 +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-devanagari-700-normal-BQQOj9BB.woff2 +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-devanagari-700-normal-DBRwWuxA.woff +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-600-normal-CXCVEoA9.woff2 +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-600-normal-Dx02qI2_.woff +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-700-normal-BPDUZo87.woff2 +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-700-normal-e0Uj8ZlN.woff +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-ext-600-normal-BleIgkPp.woff +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-ext-600-normal-C9ZjJQAt.woff2 +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-ext-700-normal-BPaQ7tlD.woff +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-ext-700-normal-S6aYESQK.woff2 +0 -0
- package/dist/packages/ui/dist/favicon.svg +1 -0
- package/dist/packages/ui/dist/index.html +15 -0
- package/dist/third-party.json +575 -0
- package/dist/vendor/@fission-ai/openspec/bin/openspec.js +85986 -0
- package/dist/vendor/@fission-ai/openspec/package.json +82 -0
- package/dist/vendor/@fission-ai/openspec/schemas/spec-driven/schema.yaml +248 -0
- package/dist/vendor/@fission-ai/openspec/schemas/spec-driven/templates/design.md +21 -0
- package/dist/vendor/@fission-ai/openspec/schemas/spec-driven/templates/proposal.md +34 -0
- package/dist/vendor/@fission-ai/openspec/schemas/spec-driven/templates/spec.md +13 -0
- package/dist/vendor/@fission-ai/openspec/schemas/spec-driven/templates/tasks.md +11 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-c_sharp.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-go.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-java.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-javascript.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-kotlin.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-php.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-python.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-ruby.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-rust.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-scala.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-tsx.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-typescript.wasm +0 -0
- package/dist/vendor/web-tree-sitter/tree-sitter.wasm +0 -0
- package/package.json +36 -3
|
@@ -0,0 +1,856 @@
|
|
|
1
|
+
import { createRequire as __atticusCreateRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __atticusFileURLToPath } from "node:url";
|
|
3
|
+
var require = __atticusCreateRequire(import.meta.url);
|
|
4
|
+
var __atticusUrl = (p) => new URL("./" + p, import.meta.url).href;
|
|
5
|
+
var __atticusPath = (p) => __atticusFileURLToPath(__atticusUrl(p));
|
|
6
|
+
import {
|
|
7
|
+
prepareKnowledgeBench,
|
|
8
|
+
runKnowledgeBench
|
|
9
|
+
} from "./chunk-STUPFGXY.js";
|
|
10
|
+
import "./chunk-RYSCLMU3.js";
|
|
11
|
+
import "./chunk-ZUIAOKXI.js";
|
|
12
|
+
import "./chunk-DPC5Y5DL.js";
|
|
13
|
+
import "./chunk-6SCVQZX5.js";
|
|
14
|
+
import "./chunk-65NYPGRC.js";
|
|
15
|
+
import {
|
|
16
|
+
table
|
|
17
|
+
} from "./chunk-VOGCSYOI.js";
|
|
18
|
+
import {
|
|
19
|
+
codeFactRecords
|
|
20
|
+
} from "./chunk-VPTTCYOC.js";
|
|
21
|
+
import "./chunk-L6SGQIR3.js";
|
|
22
|
+
import "./chunk-7UFQZXZA.js";
|
|
23
|
+
import "./chunk-56YQ6ROQ.js";
|
|
24
|
+
import "./chunk-4AK7IBVP.js";
|
|
25
|
+
import "./chunk-7JUKDRSZ.js";
|
|
26
|
+
import "./chunk-OLWFG75W.js";
|
|
27
|
+
import {
|
|
28
|
+
askKnowledge,
|
|
29
|
+
conflictLine,
|
|
30
|
+
correctableFields,
|
|
31
|
+
fieldName,
|
|
32
|
+
filterItems,
|
|
33
|
+
findKnowledge,
|
|
34
|
+
itemTitle,
|
|
35
|
+
keepCandidate,
|
|
36
|
+
knowledgeScanRoom,
|
|
37
|
+
planRescan,
|
|
38
|
+
readConflicts,
|
|
39
|
+
readFind,
|
|
40
|
+
readFinds,
|
|
41
|
+
readKnowledge,
|
|
42
|
+
readReviews,
|
|
43
|
+
readSnapshot,
|
|
44
|
+
reviewItem,
|
|
45
|
+
saveFind,
|
|
46
|
+
scanKnowledge,
|
|
47
|
+
setSourceTags,
|
|
48
|
+
snapshotSources,
|
|
49
|
+
tagList,
|
|
50
|
+
writeKnowledge,
|
|
51
|
+
writeReview
|
|
52
|
+
} from "./chunk-L24C55VN.js";
|
|
53
|
+
import "./chunk-PAMPPUR6.js";
|
|
54
|
+
import "./chunk-23W7VWKR.js";
|
|
55
|
+
import "./chunk-7EKXJZ2Y.js";
|
|
56
|
+
import "./chunk-MC3H7736.js";
|
|
57
|
+
import "./chunk-T6AIP7H5.js";
|
|
58
|
+
import "./chunk-KJPMEAI4.js";
|
|
59
|
+
import "./chunk-GQ4N4WKF.js";
|
|
60
|
+
import {
|
|
61
|
+
RuntimeConfigError,
|
|
62
|
+
runtimeForCli
|
|
63
|
+
} from "./chunk-CNUKCS2T.js";
|
|
64
|
+
import {
|
|
65
|
+
KNOWLEDGE_KINDS,
|
|
66
|
+
fileJudgments,
|
|
67
|
+
knowledgeKindOf,
|
|
68
|
+
knowledgeRelOf,
|
|
69
|
+
loadOrgPack,
|
|
70
|
+
orgPackDirOf
|
|
71
|
+
} from "./chunk-S2A7YC3Q.js";
|
|
72
|
+
import "./chunk-D3PO4DOZ.js";
|
|
73
|
+
import "./chunk-TV45EUGM.js";
|
|
74
|
+
|
|
75
|
+
// packages/cli/dist/knowledge-scan-commands.js
|
|
76
|
+
import { copyFile, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
77
|
+
import { homedir } from "node:os";
|
|
78
|
+
import { join, resolve } from "node:path";
|
|
79
|
+
var plural = (n, w) => `${n} ${w}${n === 1 ? "" : "s"}`;
|
|
80
|
+
var stamp = (d) => d.toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
81
|
+
async function sourcesTag(root, source, o, io) {
|
|
82
|
+
if (!o.kinds && !o.frameworks && o.owner === void 0) {
|
|
83
|
+
io.err('Say what to tag, for example: atticus sources tag forge-wiki --kind integration-patterns,security-standard --framework anvil --owner "Enterprise Architecture"');
|
|
84
|
+
return 2;
|
|
85
|
+
}
|
|
86
|
+
const file = join(orgPackDirOf(root), "sources.yaml");
|
|
87
|
+
const text = await readFile(file, "utf8").catch(() => void 0);
|
|
88
|
+
if (text === void 0) {
|
|
89
|
+
io.err("There is no org-pack/sources.yaml. Add a source first: atticus sources add <type> <location>");
|
|
90
|
+
return 2;
|
|
91
|
+
}
|
|
92
|
+
const r = setSourceTags(text, source, {
|
|
93
|
+
...o.kinds ? { kinds: o.kinds } : {},
|
|
94
|
+
...o.frameworks ? { frameworks: o.frameworks } : {},
|
|
95
|
+
...o.owner !== void 0 ? { owner: o.owner } : {}
|
|
96
|
+
});
|
|
97
|
+
if (!r.ok) {
|
|
98
|
+
io.err(r.error);
|
|
99
|
+
return 1;
|
|
100
|
+
}
|
|
101
|
+
await writeFile(file, r.text, "utf8");
|
|
102
|
+
io.out(`Tagged ${source}: kinds ${r.tags.kinds.join(", ") || "none"}; frameworks ${r.tags.frameworks.join(", ") || "none"}; owner ${r.tags.owner ?? "none"}.`);
|
|
103
|
+
if (r.unusualKinds.length)
|
|
104
|
+
io.out(`${r.unusualKinds.join(", ")} ${r.unusualKinds.length === 1 ? "isn't a suggested kind" : "aren't suggested kinds"} (enterprise-architecture, integration-patterns, platform-runbook, security-standard, change-process, framework). Your own kinds are fine; check for a typo.`);
|
|
105
|
+
io.out("org-pack/sources.yaml changed: commit it through a pull request. The next knowledge scan uses the tags.");
|
|
106
|
+
return 0;
|
|
107
|
+
}
|
|
108
|
+
async function snapshotsFor(root, source, io) {
|
|
109
|
+
const ids = source ? [source] : await snapshotSources(root);
|
|
110
|
+
const out = [];
|
|
111
|
+
for (const id of ids) {
|
|
112
|
+
const s = await readSnapshot(root, id);
|
|
113
|
+
if (s)
|
|
114
|
+
out.push(s);
|
|
115
|
+
}
|
|
116
|
+
if (!out.length) {
|
|
117
|
+
io.err(source ? `There is no snapshot of ${source} yet. Run atticus sources sync --source ${source} first.` : "There is no snapshot yet. Run atticus sources sync first: the knowledge scan reads only snapshots.");
|
|
118
|
+
return void 0;
|
|
119
|
+
}
|
|
120
|
+
const op = await loadOrgPack(orgPackDirOf(root));
|
|
121
|
+
for (const s of out) {
|
|
122
|
+
const w = op.sources.wikis.find((x) => x.id === s.manifest.source);
|
|
123
|
+
if (w?.tags)
|
|
124
|
+
s.manifest.tags = { kinds: w.tags.kinds, frameworks: w.tags.frameworks };
|
|
125
|
+
if (w?.owner)
|
|
126
|
+
s.manifest.owner = w.owner;
|
|
127
|
+
}
|
|
128
|
+
return out;
|
|
129
|
+
}
|
|
130
|
+
async function knowledgeScan(root, o, deps, io) {
|
|
131
|
+
const snapshots = await snapshotsFor(root, o.source, io);
|
|
132
|
+
if (!snapshots)
|
|
133
|
+
return 2;
|
|
134
|
+
const op = await loadOrgPack(orgPackDirOf(root));
|
|
135
|
+
const now = deps.now ?? /* @__PURE__ */ new Date();
|
|
136
|
+
const room = o.batchTokens ?? knowledgeScanRoom(snapshots, op);
|
|
137
|
+
const once = o.resume !== void 0 || deps.runtime.kind === "hand-off";
|
|
138
|
+
const batches = [];
|
|
139
|
+
const readNow = {};
|
|
140
|
+
const tooBig = [];
|
|
141
|
+
const passed = () => {
|
|
142
|
+
const out = {};
|
|
143
|
+
for (const [s, ps] of Object.entries(readNow))
|
|
144
|
+
out[s] = [...ps];
|
|
145
|
+
for (const t of tooBig)
|
|
146
|
+
(out[t.source] ??= []).push(t.page);
|
|
147
|
+
return out;
|
|
148
|
+
};
|
|
149
|
+
let pending;
|
|
150
|
+
let plan;
|
|
151
|
+
let r;
|
|
152
|
+
for (; ; ) {
|
|
153
|
+
const before = await readKnowledge(root, { raw: true, cacheRoot: root });
|
|
154
|
+
const caps = Object.fromEntries(op.sources.wikis.filter((w2) => w2.maxPages).map((w2) => [w2.id, Math.max(0, w2.maxPages - (readNow[w2.id]?.length ?? 0))]));
|
|
155
|
+
plan = planRescan(snapshots, before.report, before.items, {
|
|
156
|
+
full: o.full === true,
|
|
157
|
+
batchTokens: room,
|
|
158
|
+
read: passed(),
|
|
159
|
+
caps
|
|
160
|
+
});
|
|
161
|
+
const gone = Object.values(plan.removed).flat().length;
|
|
162
|
+
if (!plan.snapshots.length && !gone) {
|
|
163
|
+
pending = Object.entries(plan.deferred).flatMap(([s, ps]) => ps.map((p) => `${s}/${p}`));
|
|
164
|
+
if (batches.length)
|
|
165
|
+
break;
|
|
166
|
+
for (const s of snapshots)
|
|
167
|
+
io.out(`Nothing changed in ${s.manifest.source} since the last scan (snapshot ${s.manifest.date}, ${plural(s.manifest.pages.length, "page")}). --full reads every page again.`);
|
|
168
|
+
return 0;
|
|
169
|
+
}
|
|
170
|
+
r = plan.snapshots.length ? await scanKnowledge(plan.snapshots, {
|
|
171
|
+
runtime: deps.runtime,
|
|
172
|
+
orgPack: op,
|
|
173
|
+
now,
|
|
174
|
+
maxAttempts: o.attempts ?? 3,
|
|
175
|
+
...o.resume && !batches.length ? { resume: o.resume } : {},
|
|
176
|
+
...plan.previous.length ? { previous: plan.previous } : {},
|
|
177
|
+
judgments: fileJudgments(root)
|
|
178
|
+
}) : {
|
|
179
|
+
status: "scanned",
|
|
180
|
+
attempts: [],
|
|
181
|
+
items: [],
|
|
182
|
+
conflicts: [],
|
|
183
|
+
superseded: [],
|
|
184
|
+
injections: [],
|
|
185
|
+
failed: [],
|
|
186
|
+
snapshots: []
|
|
187
|
+
};
|
|
188
|
+
const deferred = Object.entries(plan.deferred).flatMap(([s, ps]) => ps.map((p) => `${s}/${p}`));
|
|
189
|
+
const unread = new Set((r.leftOut ?? []).map((l) => `${l.source}/${l.page}`));
|
|
190
|
+
pending = [...deferred, ...unread];
|
|
191
|
+
if (r.status !== "scanned")
|
|
192
|
+
break;
|
|
193
|
+
const w = await writeKnowledge(root, r, stamp(now), { snapshots, plan });
|
|
194
|
+
batches.push({ plan, r, changes: w.changes });
|
|
195
|
+
let read = 0;
|
|
196
|
+
for (const [source, pages] of Object.entries(plan.changed))
|
|
197
|
+
for (const p of pages)
|
|
198
|
+
if (!unread.has(`${source}/${p}`)) {
|
|
199
|
+
(readNow[source] ??= []).push(p);
|
|
200
|
+
read++;
|
|
201
|
+
}
|
|
202
|
+
if (!read && unread.size) {
|
|
203
|
+
tooBig.push(...r.leftOut ?? []);
|
|
204
|
+
pending = deferred;
|
|
205
|
+
if (pending.length)
|
|
206
|
+
continue;
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
if (!pending.length || once)
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
const named = (xs) => xs.length > 10 ? `${xs.slice(0, 10).join(", ")} and ${xs.length - 10} more` : xs.join(", ");
|
|
213
|
+
if (r.status === "waiting" && pending.length) {
|
|
214
|
+
const inBatch = Object.values(plan.changed).flat().length - (r.leftOut?.length ?? 0);
|
|
215
|
+
io.out(`This batch holds ${plural(inBatch, "page")}, as many as fit the reader's prompt; ${plural(pending.length, "page")} wait for the next (${named(pending)}). After this one, run atticus knowledge scan again.`);
|
|
216
|
+
}
|
|
217
|
+
if (r.status === "waiting") {
|
|
218
|
+
const failed2 = r.attempts.filter((a) => a.state !== "waiting" && a.problems.length).at(-1);
|
|
219
|
+
if (o.resume && failed2) {
|
|
220
|
+
io.out(`The answer of run ${failed2.runId} failed ${plural(failed2.problems.length, "check")}, handed back with the next prompt:`);
|
|
221
|
+
for (const p of failed2.problems)
|
|
222
|
+
io.out(` ${p}`);
|
|
223
|
+
if (failed2.kept)
|
|
224
|
+
io.out(`${failed2.kept === 1 ? "1 item passed and is" : `${failed2.kept} items passed and are`} kept for the next attempt.`);
|
|
225
|
+
}
|
|
226
|
+
io.out(`Handed the knowledge scan to your assistant (run ${r.runId}). When it is done: atticus handoff done ${r.runId}, then atticus knowledge scan${o.source ? ` --source ${o.source}` : ""} --resume ${r.runId}`);
|
|
227
|
+
return 0;
|
|
228
|
+
}
|
|
229
|
+
if (r.status === "failed") {
|
|
230
|
+
io.err(`The knowledge scan got no answer it could read after ${plural(r.attempts.length, "attempt")}: ${r.attempts.at(-1)?.problems.join("; ") ?? "no run"}. ${batches.length ? `The ${plural(batches.length, "batch")} before it ${batches.length === 1 ? "was" : "were"} written; nothing of this one was.` : "Nothing was written."}`);
|
|
231
|
+
return 1;
|
|
232
|
+
}
|
|
233
|
+
const first = batches[0].plan;
|
|
234
|
+
const all = (f) => batches.flatMap((b) => f(b.r));
|
|
235
|
+
const total = {
|
|
236
|
+
...r,
|
|
237
|
+
items: all((x) => x.items),
|
|
238
|
+
conflicts: all((x) => x.conflicts),
|
|
239
|
+
superseded: all((x) => x.superseded),
|
|
240
|
+
injections: all((x) => x.injections),
|
|
241
|
+
failed: all((x) => x.failed),
|
|
242
|
+
attempts: all((x) => x.attempts)
|
|
243
|
+
};
|
|
244
|
+
const was = new Set(batches.flatMap((b) => [...b.changes.added, ...b.changes.changed]));
|
|
245
|
+
const c = {
|
|
246
|
+
added: [...new Set(batches.flatMap((b) => b.changes.added))].sort(),
|
|
247
|
+
changed: [...new Set(batches.flatMap((b) => b.changes.changed))].sort(),
|
|
248
|
+
removed: [...new Set(batches.flatMap((b) => b.changes.removed))].filter((id) => !was.has(id)).sort()
|
|
249
|
+
};
|
|
250
|
+
const left = pending.length;
|
|
251
|
+
const big = tooBig.map((t) => `${t.source}/${t.page}`);
|
|
252
|
+
const after = await readKnowledge(root, { cacheRoot: root });
|
|
253
|
+
const recheck = Object.entries(after.reviews).filter(([, v]) => v.state === "stale").map(([id]) => id);
|
|
254
|
+
if (o.json) {
|
|
255
|
+
io.out(JSON.stringify({
|
|
256
|
+
...total,
|
|
257
|
+
changes: c,
|
|
258
|
+
recheck,
|
|
259
|
+
plan: { changed: first.changed, removed: first.removed, unchanged: first.unchanged },
|
|
260
|
+
batches: batches.length,
|
|
261
|
+
pagesLeft: left,
|
|
262
|
+
...left ? { left: pending } : {},
|
|
263
|
+
...big.length ? { tooBig } : {}
|
|
264
|
+
}, null, 2));
|
|
265
|
+
if (left)
|
|
266
|
+
io.report?.({ pagesLeft: left });
|
|
267
|
+
return total.failed.length ? 1 : 0;
|
|
268
|
+
}
|
|
269
|
+
for (const s of snapshots) {
|
|
270
|
+
const id = s.manifest.source;
|
|
271
|
+
const read = readNow[id]?.length ?? 0;
|
|
272
|
+
const kept = first.unchanged[id] ?? 0;
|
|
273
|
+
const removed = first.removed[id]?.length ?? 0;
|
|
274
|
+
const n = batches.filter((b) => b.r.attempts.length).length;
|
|
275
|
+
const inBatches = n > 1 ? ` in ${n} batches, each within the reader's prompt` : "";
|
|
276
|
+
io.out(kept || removed ? `Read ${plural(read, "page")} of ${id} that changed or are new${inBatches} (snapshot ${s.manifest.date}); kept ${plural(kept, "page")}'s items as they were${removed ? `; ${plural(removed, "page")} gone` : ""}.` : `Read ${plural(read, "page")} of ${id}${inBatches} (snapshot ${s.manifest.date}).`);
|
|
277
|
+
}
|
|
278
|
+
if (c.added.length)
|
|
279
|
+
io.out(`New: ${c.added.join(", ")}`);
|
|
280
|
+
if (c.changed.length)
|
|
281
|
+
io.out(`Changed: ${c.changed.join(", ")}`);
|
|
282
|
+
if (c.removed.length)
|
|
283
|
+
io.out(`Gone: ${c.removed.join(", ")}`);
|
|
284
|
+
if (!c.added.length && !c.changed.length && !c.removed.length)
|
|
285
|
+
io.out("No item changed.");
|
|
286
|
+
if (recheck.length)
|
|
287
|
+
io.out(`Reviews to check again, their page changed: ${recheck.join(", ")} (atticus knowledge verify <item>).`);
|
|
288
|
+
const items = total.items;
|
|
289
|
+
const count = (k) => items.filter((i) => knowledgeKindOf(i) === k).length;
|
|
290
|
+
io.out(`Kept ${plural(items.length, "item")}${items.length ? `, each quote checked on its page: ${KNOWLEDGE_KINDS.filter((k) => count(k) > 0).map((k) => `${count(k)} ${k}`).join(", ")}` : ""}.`);
|
|
291
|
+
io.out(`Written to ${knowledgeRelOf(root)}/items/ and ${knowledgeRelOf(root)}/scan.yaml.`);
|
|
292
|
+
if (big.length)
|
|
293
|
+
io.out(`${plural(big.length, "page")} didn't fit the reader's prompt on ${big.length === 1 ? "its" : "their"} own and ${big.length === 1 ? "isn't" : "aren't"} read: ${named(big)} (${tooBig[0].reason}). Give the knowledge reader more room (budgets.perAgent.knowledge-reader in org-pack/runtime.yaml), or use a model with a bigger limit, then run atticus knowledge scan again.`);
|
|
294
|
+
if (left) {
|
|
295
|
+
io.out(`${plural(left, "page")} left to read: run atticus knowledge scan again for the next batch (${named(pending)}).`);
|
|
296
|
+
io.report?.({ pagesLeft: left });
|
|
297
|
+
}
|
|
298
|
+
if (total.conflicts.length) {
|
|
299
|
+
io.out(`${plural(total.conflicts.length, "conflict")} between pages (both kept, for an owner to settle):`);
|
|
300
|
+
for (const x of total.conflicts)
|
|
301
|
+
io.out(` ${x.about.join(", ")}: ${x.pages.map((p, k) => `${p.page} says "${x.says[k]}"`).join("; ")}. ${x.owner ? `${x.owner.page} is suggested (${x.owner.signal}: ${x.owner.detail}); a change that relies on it asks a person` : "A change that relies on it asks a person which page applies"}.`);
|
|
302
|
+
}
|
|
303
|
+
for (const s of total.superseded)
|
|
304
|
+
io.out(`Superseded: ${s.old.page} is replaced by ${s.new.page}; nothing on it was kept as a current rule.`);
|
|
305
|
+
const inj = total.injections;
|
|
306
|
+
if (inj.length) {
|
|
307
|
+
io.out(`${plural(inj.length, "passage")} that tr${inj.length === 1 ? "ies" : "y"} to instruct AI tools (data, never followed; a person should review the page):`);
|
|
308
|
+
for (const i of inj)
|
|
309
|
+
io.out(` ${i.source}/${i.page}:${i.line}${i.section ? ` (${i.section})` : ""}${i.hidden ? ", hidden from readers" : ""}: "${i.text}"`);
|
|
310
|
+
}
|
|
311
|
+
const failed = total.failed;
|
|
312
|
+
if (failed.length) {
|
|
313
|
+
io.out(`${plural(failed.length, "item")} still fail${failed.length === 1 ? "s" : ""} the checks and ${failed.length === 1 ? "was" : "were"} not kept:`);
|
|
314
|
+
for (const f of failed)
|
|
315
|
+
io.out(` ${f.kind} ${f.id}: ${f.problems.join("; ")}`);
|
|
316
|
+
return 1;
|
|
317
|
+
}
|
|
318
|
+
return 0;
|
|
319
|
+
}
|
|
320
|
+
var where = (r) => r.quote ? `${r.quote.source}/${r.quote.page}${r.quote.section ? ` (${r.quote.section})` : ""}` : "";
|
|
321
|
+
async function knowledgeList(root, o, io) {
|
|
322
|
+
if (o.kind && !KNOWLEDGE_KINDS.includes(o.kind)) {
|
|
323
|
+
io.err(`There is no knowledge kind ${o.kind}. Use one of: ${KNOWLEDGE_KINDS.join(", ")}.`);
|
|
324
|
+
return 2;
|
|
325
|
+
}
|
|
326
|
+
const k = await readKnowledge(root, { cacheRoot: root });
|
|
327
|
+
for (const p of k.problems)
|
|
328
|
+
io.err(`${knowledgeRelOf(root)}/items/${p.file}: ${p.message}`);
|
|
329
|
+
if (!k.items.length) {
|
|
330
|
+
io.err("There are no knowledge items yet. Run atticus sources sync, then atticus knowledge scan.");
|
|
331
|
+
return 2;
|
|
332
|
+
}
|
|
333
|
+
const items = filterItems([...k.items, ...k.rejected], {
|
|
334
|
+
...o.tag ? { tag: o.tag } : {},
|
|
335
|
+
...o.kind ? { kind: o.kind } : {}
|
|
336
|
+
}).sort((a, b) => a.id.localeCompare(b.id));
|
|
337
|
+
const reviews = k.reviews;
|
|
338
|
+
if (o.unverified)
|
|
339
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
340
|
+
const st = reviews[items[i].id]?.state;
|
|
341
|
+
if (st === "verified" || st === "corrected" || st === "rejected")
|
|
342
|
+
items.splice(i, 1);
|
|
343
|
+
}
|
|
344
|
+
if (o.json) {
|
|
345
|
+
io.out(JSON.stringify(items.map((i) => ({
|
|
346
|
+
...i,
|
|
347
|
+
knowledgeKind: knowledgeKindOf(i),
|
|
348
|
+
...reviews[i.id] ? { review: reviews[i.id] } : {}
|
|
349
|
+
})), null, 2));
|
|
350
|
+
return 0;
|
|
351
|
+
}
|
|
352
|
+
if (!items.length) {
|
|
353
|
+
io.out("No item matches.");
|
|
354
|
+
return 0;
|
|
355
|
+
}
|
|
356
|
+
for (const l of table(["KIND", "ID", "TITLE", "REVIEW", "FROM"], items.map((r) => [
|
|
357
|
+
knowledgeKindOf(r) ?? r.kind,
|
|
358
|
+
r.id + (r.flags?.some((f) => f.startsWith("conflict:")) ? " !" : ""),
|
|
359
|
+
itemTitle(r),
|
|
360
|
+
reviewWord(reviews[r.id]),
|
|
361
|
+
where(r)
|
|
362
|
+
])))
|
|
363
|
+
io.out(l);
|
|
364
|
+
if (Object.values(reviews).some((v) => v.state === "stale"))
|
|
365
|
+
io.out("check again: a person reviewed it, then its page changed (atticus knowledge verify <item>)");
|
|
366
|
+
if (items.some((r) => r.flags?.some((f) => f.startsWith("conflict:"))))
|
|
367
|
+
io.out("! another page disagrees: atticus knowledge conflicts says what each page says and which applies");
|
|
368
|
+
return 0;
|
|
369
|
+
}
|
|
370
|
+
async function knowledgeAsk(root, question, o, deps, io) {
|
|
371
|
+
const k = await readKnowledge(root, { cacheRoot: root });
|
|
372
|
+
if (!k.items.length) {
|
|
373
|
+
io.err("There are no knowledge items yet. Run atticus sources sync, then atticus knowledge scan.");
|
|
374
|
+
return 2;
|
|
375
|
+
}
|
|
376
|
+
const op = await loadOrgPack(orgPackDirOf(root));
|
|
377
|
+
const r = await askKnowledge([question], {
|
|
378
|
+
items: k.items,
|
|
379
|
+
conflicts: k.report?.conflicts ?? [],
|
|
380
|
+
runtime: deps.runtime,
|
|
381
|
+
orgPack: op,
|
|
382
|
+
...deps.now ? { now: deps.now } : {},
|
|
383
|
+
...o.resume ? { resume: o.resume } : {}
|
|
384
|
+
});
|
|
385
|
+
if (r.status === "waiting") {
|
|
386
|
+
io.out(`Handed the question to your assistant (run ${r.runId}). When it is done: atticus handoff done ${r.runId}, then atticus knowledge ask ${JSON.stringify(question)} --resume ${r.runId}`);
|
|
387
|
+
return 0;
|
|
388
|
+
}
|
|
389
|
+
const a = r.answers[0];
|
|
390
|
+
if (o.json) {
|
|
391
|
+
io.out(JSON.stringify(a, null, 2));
|
|
392
|
+
return a.status === "answered" ? 0 : 1;
|
|
393
|
+
}
|
|
394
|
+
if (a.status !== "answered") {
|
|
395
|
+
io.out(`Atticus can't answer that from the knowledge items: ${a.problems.join(" ")}`);
|
|
396
|
+
return 1;
|
|
397
|
+
}
|
|
398
|
+
io.out(a.answer);
|
|
399
|
+
io.out("");
|
|
400
|
+
io.out("From:");
|
|
401
|
+
const byId = new Map(k.items.map((i) => [i.id, i]));
|
|
402
|
+
for (const id of a.cites) {
|
|
403
|
+
const item = byId.get(id);
|
|
404
|
+
io.out(` ${id}: ${itemTitle(item)}, ${where(item)}${item.quote ? `: "${item.quote.text}"` : ""}`);
|
|
405
|
+
}
|
|
406
|
+
return 0;
|
|
407
|
+
}
|
|
408
|
+
function candidateJson(c) {
|
|
409
|
+
const r = c.record;
|
|
410
|
+
return {
|
|
411
|
+
id: r.id,
|
|
412
|
+
kind: knowledgeKindOf(r),
|
|
413
|
+
title: itemTitle(r),
|
|
414
|
+
...typeof r.appliesWhen === "string" ? { appliesWhen: r.appliesWhen } : {},
|
|
415
|
+
...Array.isArray(r.steps) && r.steps.length ? { steps: r.steps } : {},
|
|
416
|
+
...Array.isArray(r.urls) && r.urls.length ? { urls: r.urls } : {},
|
|
417
|
+
page: r.quote?.page,
|
|
418
|
+
section: r.quote?.section,
|
|
419
|
+
quote: r.quote?.text,
|
|
420
|
+
...c.known ? { known: c.known } : {},
|
|
421
|
+
...c.kept ? { kept: c.kept } : {}
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
async function knowledgeFind(root, phrase, o, deps, io) {
|
|
425
|
+
const snapshots = await snapshotsFor(root, o.source, io);
|
|
426
|
+
if (!snapshots)
|
|
427
|
+
return 2;
|
|
428
|
+
const op = await loadOrgPack(orgPackDirOf(root));
|
|
429
|
+
const now = deps.now ?? /* @__PURE__ */ new Date();
|
|
430
|
+
const k = await readKnowledge(root, { cacheRoot: root });
|
|
431
|
+
const r = await findKnowledge(snapshots, phrase, {
|
|
432
|
+
runtime: deps.runtime,
|
|
433
|
+
items: [...k.items, ...k.rejected],
|
|
434
|
+
orgPack: op,
|
|
435
|
+
judgments: fileJudgments(root),
|
|
436
|
+
now,
|
|
437
|
+
maxAttempts: o.attempts ?? 3,
|
|
438
|
+
...o.resume ? { resume: o.resume } : {}
|
|
439
|
+
});
|
|
440
|
+
if (r.status === "waiting") {
|
|
441
|
+
io.out(`Handed the search to your assistant (run ${r.runId}). When it is done: atticus handoff done ${r.runId}, then atticus knowledge find ${JSON.stringify(phrase)}${o.source ? ` --source ${o.source}` : ""} --resume ${r.runId}`);
|
|
442
|
+
return 0;
|
|
443
|
+
}
|
|
444
|
+
const slug = r.status === "found" ? await saveFind(root, r, stamp(now)) : void 0;
|
|
445
|
+
const file = slug ? `${knowledgeRelOf(root)}/finds/${slug}.yaml` : void 0;
|
|
446
|
+
if (o.json) {
|
|
447
|
+
io.out(JSON.stringify({
|
|
448
|
+
status: r.status,
|
|
449
|
+
...r.runId ? { runId: r.runId } : {},
|
|
450
|
+
phrase,
|
|
451
|
+
...slug ? { slug, file } : {},
|
|
452
|
+
pages: [...new Set(r.matches.map((m) => `${m.source}/${m.page}`))],
|
|
453
|
+
matches: r.matches,
|
|
454
|
+
candidates: r.candidates.map(candidateJson),
|
|
455
|
+
failed: r.failed,
|
|
456
|
+
problems: r.problems
|
|
457
|
+
}, null, 2));
|
|
458
|
+
return r.status === "failed" ? 1 : 0;
|
|
459
|
+
}
|
|
460
|
+
if (r.status === "nothing") {
|
|
461
|
+
io.out(`No page of the wikis mentions "${phrase}". Nothing was sent to the assistant.`);
|
|
462
|
+
return 0;
|
|
463
|
+
}
|
|
464
|
+
if (r.status === "failed") {
|
|
465
|
+
io.err(`The assistant's answer failed its checks: ${r.problems.join("; ")}. Nothing was kept.`);
|
|
466
|
+
return 1;
|
|
467
|
+
}
|
|
468
|
+
const pages = [...new Set(r.matches.map((m) => `${m.source}/${m.page}`))];
|
|
469
|
+
io.out(`"${phrase}" is on ${plural(pages.length, "page")}: ${pages.join(", ")}.`);
|
|
470
|
+
const fresh = r.candidates.filter((c) => !c.known);
|
|
471
|
+
io.out(`The assistant found ${plural(r.candidates.length, "item")} about it, each quote checked${fresh.length < r.candidates.length ? `; ${r.candidates.length - fresh.length} already known` : ""}:`);
|
|
472
|
+
for (const c of r.candidates)
|
|
473
|
+
io.out(` ${c.known ? "known" : "new "} ${knowledgeKindOf(c.record)} ${c.record.id}: ${itemTitle(c.record)} (${c.record.quote?.page})`);
|
|
474
|
+
if (r.failed.length)
|
|
475
|
+
io.out(`${plural(r.failed.length, "item")} failed the checks and ${r.failed.length === 1 ? "was" : "were"} left out.`);
|
|
476
|
+
io.out(`Saved in ${file}. Keep one with atticus knowledge keep <item> --find ${slug} [--as <kind>] [--set field=value].`);
|
|
477
|
+
return 0;
|
|
478
|
+
}
|
|
479
|
+
async function knowledgeKeep(root, id, o, io) {
|
|
480
|
+
let slug = o.find;
|
|
481
|
+
if (!slug) {
|
|
482
|
+
const all = await readFinds(root);
|
|
483
|
+
const having = [];
|
|
484
|
+
for (const f2 of all)
|
|
485
|
+
if ((await readFind(root, f2.slug))?.candidates.some((c) => c.record.id === id))
|
|
486
|
+
having.push(f2.slug);
|
|
487
|
+
if (having.length !== 1) {
|
|
488
|
+
io.err(having.length ? `${id} is in more than one search (${having.join(", ")}): say which with --find.` : `No saved search has a candidate ${id}. atticus knowledge finds lists the searches.`);
|
|
489
|
+
return 2;
|
|
490
|
+
}
|
|
491
|
+
slug = having[0];
|
|
492
|
+
}
|
|
493
|
+
if (o.as && !KNOWLEDGE_KINDS.includes(o.as)) {
|
|
494
|
+
io.err(`There is no knowledge kind ${o.as}. Use one of: ${KNOWLEDGE_KINDS.join(", ")}.`);
|
|
495
|
+
return 2;
|
|
496
|
+
}
|
|
497
|
+
const f = await readFind(root, slug);
|
|
498
|
+
const cand = f?.candidates.find((c) => c.record.id === id);
|
|
499
|
+
const fields = cand ? correctableFields(cand.record) : {};
|
|
500
|
+
const set = {};
|
|
501
|
+
for (const pair of o.set ?? []) {
|
|
502
|
+
const at = pair.indexOf("=");
|
|
503
|
+
if (at < 1) {
|
|
504
|
+
io.err(`--set takes field=value, not ${pair}.`);
|
|
505
|
+
return 2;
|
|
506
|
+
}
|
|
507
|
+
const field = fieldName(pair.slice(0, at).trim(), fields);
|
|
508
|
+
const value = pair.slice(at + 1);
|
|
509
|
+
set[field] = fields[field] === "list" || fields[field] === "links" ? value.split("|").map((x) => x.trim()) : value.trim();
|
|
510
|
+
}
|
|
511
|
+
const r = await keepCandidate(root, slug, id, {
|
|
512
|
+
...o.as ? { as: o.as } : {},
|
|
513
|
+
by: o.by,
|
|
514
|
+
at: stamp(o.now ?? /* @__PURE__ */ new Date()),
|
|
515
|
+
...o.note ? { note: o.note } : {},
|
|
516
|
+
...Object.keys(set).length ? { set } : {}
|
|
517
|
+
});
|
|
518
|
+
if ("error" in r) {
|
|
519
|
+
io.err(r.error);
|
|
520
|
+
return 2;
|
|
521
|
+
}
|
|
522
|
+
if (o.json) {
|
|
523
|
+
io.out(JSON.stringify({ item: r.item, as: r.as, find: slug }, null, 2));
|
|
524
|
+
return 0;
|
|
525
|
+
}
|
|
526
|
+
io.out(`Kept ${id} as a ${r.as}, verified by ${o.by}: plans, answers and lists read it from now on.`);
|
|
527
|
+
io.out(`Written to ${knowledgeRelOf(root)}/items/ and reviews/: commit them through a pull request.`);
|
|
528
|
+
return 0;
|
|
529
|
+
}
|
|
530
|
+
async function knowledgeConflicts(root, o, io) {
|
|
531
|
+
const all = await readConflicts(root, { records: await codeFactRecords(root) });
|
|
532
|
+
if (o.json) {
|
|
533
|
+
io.out(JSON.stringify(all, null, 2));
|
|
534
|
+
return 0;
|
|
535
|
+
}
|
|
536
|
+
if (!all.length) {
|
|
537
|
+
io.out("No pages disagree in the last knowledge scan (knowledge/scan.yaml).");
|
|
538
|
+
return 0;
|
|
539
|
+
}
|
|
540
|
+
io.out(`${plural(all.length, "conflict")} between pages:`);
|
|
541
|
+
for (const v of all)
|
|
542
|
+
io.out(`- ${conflictLine(v)}`);
|
|
543
|
+
const open = all.filter((v) => v.question?.state === "open");
|
|
544
|
+
if (open.length)
|
|
545
|
+
io.out(`${plural(open.length, "question")} wait${open.length === 1 ? "s" : ""} for a person: atticus questions answer <id> --option <n>, or in the app.`);
|
|
546
|
+
return 0;
|
|
547
|
+
}
|
|
548
|
+
async function knowledgeFinds(root, o, io) {
|
|
549
|
+
const all = await readFinds(root);
|
|
550
|
+
if (o.json) {
|
|
551
|
+
const out = [];
|
|
552
|
+
for (const f of all) {
|
|
553
|
+
const s = await readFind(root, f.slug);
|
|
554
|
+
out.push({ ...f, candidateList: (s?.candidates ?? []).map(candidateJson) });
|
|
555
|
+
}
|
|
556
|
+
io.out(JSON.stringify(out, null, 2));
|
|
557
|
+
return 0;
|
|
558
|
+
}
|
|
559
|
+
if (!all.length) {
|
|
560
|
+
io.out('No search yet. atticus knowledge find "<term or phrase>" searches every wiki.');
|
|
561
|
+
return 0;
|
|
562
|
+
}
|
|
563
|
+
for (const l of table(["SEARCH", "PHRASE", "WHEN", "FOUND", "KEPT"], all.map((f) => [f.slug, f.phrase, f.at.slice(0, 10), String(f.candidates), String(f.kept)])))
|
|
564
|
+
io.out(l);
|
|
565
|
+
return 0;
|
|
566
|
+
}
|
|
567
|
+
function reviewWord(r) {
|
|
568
|
+
if (!r)
|
|
569
|
+
return "";
|
|
570
|
+
if (r.state === "verified")
|
|
571
|
+
return `\u2713 ${r.by}`;
|
|
572
|
+
if (r.state === "corrected")
|
|
573
|
+
return `\u2713 corrected by ${r.by}`;
|
|
574
|
+
if (r.state === "rejected")
|
|
575
|
+
return `\u2717 rejected by ${r.by}`;
|
|
576
|
+
return "check again";
|
|
577
|
+
}
|
|
578
|
+
async function knowledgeReview(root, verdict, id, o, io) {
|
|
579
|
+
const k = await readKnowledge(root, { raw: true, cacheRoot: root });
|
|
580
|
+
const item = k.items.find((i) => i.id === id);
|
|
581
|
+
if (!item) {
|
|
582
|
+
io.err(`There is no knowledge item ${id}. atticus knowledge list shows them; atticus knowledge scan reads them.`);
|
|
583
|
+
return 1;
|
|
584
|
+
}
|
|
585
|
+
const fields = correctableFields(item);
|
|
586
|
+
const set = {};
|
|
587
|
+
for (const pair of o.set ?? []) {
|
|
588
|
+
const at = pair.indexOf("=");
|
|
589
|
+
if (at < 1) {
|
|
590
|
+
io.err(`--set takes field=value, not ${pair}.`);
|
|
591
|
+
return 2;
|
|
592
|
+
}
|
|
593
|
+
const field = fieldName(pair.slice(0, at).trim(), fields);
|
|
594
|
+
const value = pair.slice(at + 1);
|
|
595
|
+
set[field] = fields[field] === "list" || fields[field] === "links" ? value.split("|").map((x) => x.trim()) : value.trim();
|
|
596
|
+
}
|
|
597
|
+
if (verdict === "corrected") {
|
|
598
|
+
const before = (await readReviews(root)).reviews.get(id)?.corrections ?? {};
|
|
599
|
+
for (const [k2, v] of Object.entries(before))
|
|
600
|
+
if (!(k2 in set))
|
|
601
|
+
set[k2] = Array.isArray(v) ? v.map((x) => typeof x === "string" ? x : x.label ? `${x.label}=${x.url}` : x.url) : v;
|
|
602
|
+
}
|
|
603
|
+
const r = reviewItem(item, {
|
|
604
|
+
verdict,
|
|
605
|
+
by: o.by,
|
|
606
|
+
at: stamp(o.now ?? /* @__PURE__ */ new Date()),
|
|
607
|
+
...o.note ? { note: o.note } : {},
|
|
608
|
+
...Object.keys(set).length ? { set } : {}
|
|
609
|
+
});
|
|
610
|
+
if ("error" in r) {
|
|
611
|
+
io.err(r.error);
|
|
612
|
+
return 2;
|
|
613
|
+
}
|
|
614
|
+
const file = await writeReview(root, r.review);
|
|
615
|
+
if (o.json) {
|
|
616
|
+
io.out(JSON.stringify({ review: r.review, item: r.item, file: `${knowledgeRelOf(root)}/${file}` }, null, 2));
|
|
617
|
+
return 0;
|
|
618
|
+
}
|
|
619
|
+
io.out(verdict === "verified" ? `Verified ${id}, by ${o.by}.` : verdict === "corrected" ? `Corrected ${id} (${Object.keys(r.review.corrections ?? {}).join(", ")}), by ${o.by}.` : `Rejected ${id}, by ${o.by}: plans and answers leave it out.`);
|
|
620
|
+
io.out(`Written to ${knowledgeRelOf(root)}/${file}: commit it through a pull request. A rescan that changes the item asks for it to be checked again.`);
|
|
621
|
+
return 0;
|
|
622
|
+
}
|
|
623
|
+
var defaultCache = () => process.env.LOCALAPPDATA ? join(process.env.LOCALAPPDATA, "atticus", "bench") : join(homedir(), ".cache", "atticus", "bench");
|
|
624
|
+
var pct = (x) => `${Math.round(x * 100)}%`;
|
|
625
|
+
function printKnowledgeScore(s, io) {
|
|
626
|
+
const i = s.items;
|
|
627
|
+
io.out(`Items: ${i.found} found, ${i.missed} missed, ${i.wrong} wrong (precision ${pct(i.precision)}, recall ${pct(i.recall)})`);
|
|
628
|
+
io.out(` ${Object.entries(i.byKind).map(([k, v]) => `${k} ${v.found}/${v.found + v.missed}${v.wrong ? ` (+${v.wrong} wrong)` : ""}`).join(", ")}`);
|
|
629
|
+
if (i.missedIds.length)
|
|
630
|
+
io.out(` Missed: ${i.missedIds.join(", ")}`);
|
|
631
|
+
if (i.wrongIds.length)
|
|
632
|
+
io.out(` Wrong: ${i.wrongIds.join(", ")}`);
|
|
633
|
+
io.out(`Quotes: ${s.quotes.correct} of ${s.quotes.of} on the right page and heading, word for word`);
|
|
634
|
+
if (s.quotes.wrongIds.length)
|
|
635
|
+
io.out(` Wrong: ${s.quotes.wrongIds.join(", ")}`);
|
|
636
|
+
io.out(`Conflicts: ${s.conflicts.flagged} of ${s.conflicts.of} flagged${s.conflicts.missed.length ? ` (missed: ${s.conflicts.missed.join(", ")})` : ""}`);
|
|
637
|
+
io.out(`Superseded pages: ${s.superseded.flagged} of ${s.superseded.of} flagged; ${s.superseded.itemsFromOldPages.length ? `items from an old page: ${s.superseded.itemsFromOldPages.join(", ")}` : "no item from an old page"}`);
|
|
638
|
+
io.out(`Injections: ${s.injections.flagged} of ${s.injections.of} flagged; ${s.injections.followed.length ? `FOLLOWED by ${s.injections.followed.join(", ")}` : "not followed"}`);
|
|
639
|
+
io.out(`Questions: ${s.questions.correct} of ${s.questions.of} answered citing the right items`);
|
|
640
|
+
for (const q of s.questions.results.filter((x) => !x.correct))
|
|
641
|
+
io.out(` "${q.ask}": ${q.refused ? "refused" : `missing ${q.missing.join(", ")}`}`);
|
|
642
|
+
io.out("Not scored here: whether each answer's words agree with the expected answer. Read them in the results file.");
|
|
643
|
+
}
|
|
644
|
+
async function benchKnowledge(root, o, deps, io) {
|
|
645
|
+
const bench = resolve(o.bench ?? join("bench", "knowledge"));
|
|
646
|
+
const cache = resolve(o.cache ?? defaultCache());
|
|
647
|
+
const work = join(cache, "knowledge");
|
|
648
|
+
const stateFile = join(work, "bench-state.json");
|
|
649
|
+
let resumeScan;
|
|
650
|
+
let resumeAsk;
|
|
651
|
+
if (o.resume) {
|
|
652
|
+
const state = JSON.parse(await readFile(stateFile, "utf8").catch(() => "{}") || "{}");
|
|
653
|
+
if (state.runId !== o.resume) {
|
|
654
|
+
io.err(`${o.resume} isn't the run the knowledge bench is waiting for${state.runId ? ` (it waits for ${state.runId})` : ""}.`);
|
|
655
|
+
return 2;
|
|
656
|
+
}
|
|
657
|
+
if (state.step === "ask")
|
|
658
|
+
resumeAsk = o.resume;
|
|
659
|
+
else
|
|
660
|
+
resumeScan = o.resume;
|
|
661
|
+
} else {
|
|
662
|
+
try {
|
|
663
|
+
await prepareKnowledgeBench(bench, work);
|
|
664
|
+
} catch (e) {
|
|
665
|
+
io.err(`There is no knowledge bench at ${bench}: ${e.message}`);
|
|
666
|
+
return 2;
|
|
667
|
+
}
|
|
668
|
+
await copyFile(join(orgPackDirOf(root), "runtime.yaml"), join(work, "org-pack", "runtime.yaml")).catch(() => {
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
let runtime = deps.runtime;
|
|
672
|
+
if (!runtime) {
|
|
673
|
+
try {
|
|
674
|
+
runtime = (await runtimeForCli(work, deps.mode ? { mode: deps.mode } : {})).runtime;
|
|
675
|
+
} catch (e) {
|
|
676
|
+
if (e instanceof RuntimeConfigError) {
|
|
677
|
+
io.err(e.message);
|
|
678
|
+
return 2;
|
|
679
|
+
}
|
|
680
|
+
throw e;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
const now = deps.now ?? /* @__PURE__ */ new Date();
|
|
684
|
+
const r = await runKnowledgeBench({
|
|
685
|
+
bench,
|
|
686
|
+
work,
|
|
687
|
+
runtime,
|
|
688
|
+
now,
|
|
689
|
+
...resumeScan ? { resumeScan } : {},
|
|
690
|
+
...resumeAsk ? { resumeAsk } : {}
|
|
691
|
+
});
|
|
692
|
+
if (r.status === "waiting") {
|
|
693
|
+
await mkdir(work, { recursive: true });
|
|
694
|
+
await writeFile(stateFile, JSON.stringify({ step: r.step, runId: r.runId }) + "\n", "utf8");
|
|
695
|
+
io.out(`Handed the ${r.step === "scan" ? "knowledge scan" : "bench questions"} to your assistant (run ${r.runId}, in ${work}). When it is done: atticus handoff done ${r.runId} --root ${JSON.stringify(work)}, then atticus bench knowledge --resume ${r.runId}`);
|
|
696
|
+
return 0;
|
|
697
|
+
}
|
|
698
|
+
const results = join(cache, "knowledge-results");
|
|
699
|
+
await mkdir(results, { recursive: true });
|
|
700
|
+
const file = join(results, `${stamp(now).replace(/[:.]/g, "-")}.json`);
|
|
701
|
+
await writeFile(file, JSON.stringify({ at: stamp(now), ...r }, null, 2) + "\n", "utf8");
|
|
702
|
+
await writeFile(stateFile, "{}\n", "utf8");
|
|
703
|
+
if (o.json) {
|
|
704
|
+
io.out(JSON.stringify(r.score, null, 2));
|
|
705
|
+
return 0;
|
|
706
|
+
}
|
|
707
|
+
io.out(`Knowledge bench: ${bench}`);
|
|
708
|
+
printKnowledgeScore(r.score, io);
|
|
709
|
+
if (r.scanProblems.length)
|
|
710
|
+
io.out(`The scan's last attempt still had ${plural(r.scanProblems.length, "problem")}; they are in the results file.`);
|
|
711
|
+
io.out(`Details: ${file}`);
|
|
712
|
+
return 0;
|
|
713
|
+
}
|
|
714
|
+
async function knowledgeCli(root, positionals, values, io, who = () => "someone") {
|
|
715
|
+
const [group, command, arg] = positionals;
|
|
716
|
+
const str = (v) => typeof v === "string" && v.trim() ? v : void 0;
|
|
717
|
+
const list = (v) => Array.isArray(v) ? tagList(v.map(String)) : typeof v === "string" ? tagList([v]) : void 0;
|
|
718
|
+
const json = values.json === true;
|
|
719
|
+
const attempts = Number(str(values.attempts) ?? "3");
|
|
720
|
+
const runtime = async () => {
|
|
721
|
+
try {
|
|
722
|
+
return (await runtimeForCli(root, str(values.mode) ? { mode: str(values.mode) } : {})).runtime;
|
|
723
|
+
} catch (e) {
|
|
724
|
+
if (e instanceof RuntimeConfigError) {
|
|
725
|
+
io.err(e.message);
|
|
726
|
+
return void 0;
|
|
727
|
+
}
|
|
728
|
+
throw e;
|
|
729
|
+
}
|
|
730
|
+
};
|
|
731
|
+
if (group === "sources" && command === "tag") {
|
|
732
|
+
if (!arg) {
|
|
733
|
+
io.err("Usage: atticus sources tag <source> [--kind k,k] [--framework f,f] [--owner o]");
|
|
734
|
+
return 2;
|
|
735
|
+
}
|
|
736
|
+
const owner = Array.isArray(values.owner) ? values.owner.map(String).join(" ") : str(values.owner);
|
|
737
|
+
const kinds = list(values.kind);
|
|
738
|
+
const frameworks = list(values.framework);
|
|
739
|
+
return sourcesTag(root, arg, {
|
|
740
|
+
...kinds ? { kinds } : {},
|
|
741
|
+
...frameworks ? { frameworks } : {},
|
|
742
|
+
...owner !== void 0 ? { owner } : {}
|
|
743
|
+
}, io);
|
|
744
|
+
}
|
|
745
|
+
if (group === "knowledge" && command === "scan") {
|
|
746
|
+
if (!Number.isInteger(attempts) || attempts < 1 || attempts > 10) {
|
|
747
|
+
io.err("--attempts is a whole number from 1 to 10.");
|
|
748
|
+
return 2;
|
|
749
|
+
}
|
|
750
|
+
const bt = str(values["batch-tokens"]);
|
|
751
|
+
const batchTokens = bt === void 0 ? void 0 : Number(bt);
|
|
752
|
+
if (batchTokens !== void 0 && !(Number.isInteger(batchTokens) && batchTokens >= 500)) {
|
|
753
|
+
io.err("--batch-tokens is a whole number of 500 or more: the room for pages in one prompt.");
|
|
754
|
+
return 2;
|
|
755
|
+
}
|
|
756
|
+
const rt = await runtime();
|
|
757
|
+
if (!rt)
|
|
758
|
+
return 2;
|
|
759
|
+
return knowledgeScan(root, {
|
|
760
|
+
attempts,
|
|
761
|
+
json,
|
|
762
|
+
...values.full === true ? { full: true } : {},
|
|
763
|
+
...str(values.source) ? { source: str(values.source) } : {},
|
|
764
|
+
...str(values.resume) ? { resume: str(values.resume) } : {},
|
|
765
|
+
...batchTokens ? { batchTokens } : {}
|
|
766
|
+
}, { runtime: rt }, io);
|
|
767
|
+
}
|
|
768
|
+
if (group === "knowledge" && command === "list")
|
|
769
|
+
return knowledgeList(root, {
|
|
770
|
+
json,
|
|
771
|
+
...str(values.tag) ? { tag: str(values.tag) } : {},
|
|
772
|
+
...str(values.kind) ? { kind: str(values.kind) } : {},
|
|
773
|
+
...values.unverified === true ? { unverified: true } : {}
|
|
774
|
+
}, io);
|
|
775
|
+
if (group === "knowledge" && command === "ask") {
|
|
776
|
+
const question = positionals.slice(2).join(" ").trim();
|
|
777
|
+
if (!question) {
|
|
778
|
+
io.err('Usage: atticus knowledge ask "<question>" [--mode m] [--resume run] [--json]');
|
|
779
|
+
return 2;
|
|
780
|
+
}
|
|
781
|
+
const rt = await runtime();
|
|
782
|
+
if (!rt)
|
|
783
|
+
return 2;
|
|
784
|
+
return knowledgeAsk(root, question, { json, ...str(values.resume) ? { resume: str(values.resume) } : {} }, { runtime: rt }, io);
|
|
785
|
+
}
|
|
786
|
+
if (group === "bench" && command === "knowledge")
|
|
787
|
+
return benchKnowledge(root, {
|
|
788
|
+
json,
|
|
789
|
+
...str(values.bench) ? { bench: str(values.bench) } : {},
|
|
790
|
+
...str(values.cache) ? { cache: str(values.cache) } : {},
|
|
791
|
+
...str(values.resume) ? { resume: str(values.resume) } : {}
|
|
792
|
+
}, str(values.mode) ? { mode: str(values.mode) } : {}, io);
|
|
793
|
+
if (group === "knowledge" && command === "find") {
|
|
794
|
+
const phrase = positionals.slice(2).join(" ").trim();
|
|
795
|
+
if (!phrase) {
|
|
796
|
+
io.err('Usage: atticus knowledge find "<term or phrase>" [--source s] [--mode m] [--resume run] [--json]');
|
|
797
|
+
return 2;
|
|
798
|
+
}
|
|
799
|
+
const rt = await runtime();
|
|
800
|
+
if (!rt)
|
|
801
|
+
return 2;
|
|
802
|
+
return knowledgeFind(root, phrase, {
|
|
803
|
+
json,
|
|
804
|
+
attempts,
|
|
805
|
+
...str(values.source) ? { source: str(values.source) } : {},
|
|
806
|
+
...str(values.resume) ? { resume: str(values.resume) } : {}
|
|
807
|
+
}, { runtime: rt }, io);
|
|
808
|
+
}
|
|
809
|
+
if (group === "knowledge" && command === "keep") {
|
|
810
|
+
if (!arg) {
|
|
811
|
+
io.err("Usage: atticus knowledge keep <item> [--find search] [--as kind] [--set field=value] [--note text]");
|
|
812
|
+
return 2;
|
|
813
|
+
}
|
|
814
|
+
const set = Array.isArray(values.set) ? values.set.map(String) : typeof values.set === "string" ? [values.set] : [];
|
|
815
|
+
return knowledgeKeep(root, arg, {
|
|
816
|
+
set,
|
|
817
|
+
by: who(),
|
|
818
|
+
json,
|
|
819
|
+
...str(values.find) ? { find: str(values.find) } : {},
|
|
820
|
+
...str(values.as) ? { as: str(values.as) } : {},
|
|
821
|
+
...str(values.note) ? { note: str(values.note) } : {}
|
|
822
|
+
}, io);
|
|
823
|
+
}
|
|
824
|
+
if (group === "knowledge" && command === "finds")
|
|
825
|
+
return knowledgeFinds(root, { json }, io);
|
|
826
|
+
if (group === "knowledge" && command === "conflicts")
|
|
827
|
+
return knowledgeConflicts(root, { json }, io);
|
|
828
|
+
if (group === "knowledge" && (command === "verify" || command === "correct" || command === "reject")) {
|
|
829
|
+
if (!arg) {
|
|
830
|
+
io.err(`Usage: atticus knowledge ${command} <item>${command === "correct" ? " --set field=value" : ""}${command === "reject" ? " --note why" : " [--note text]"}`);
|
|
831
|
+
return 2;
|
|
832
|
+
}
|
|
833
|
+
const set = Array.isArray(values.set) ? values.set.map(String) : typeof values.set === "string" ? [values.set] : [];
|
|
834
|
+
return knowledgeReview(root, command === "verify" ? "verified" : command === "correct" ? "corrected" : "rejected", arg, { set, by: who(), json, ...str(values.note) ? { note: str(values.note) } : {} }, io);
|
|
835
|
+
}
|
|
836
|
+
if (group === "knowledge") {
|
|
837
|
+
io.err("Usage: atticus knowledge scan|list|ask|find|keep|finds|verify|correct|reject. See atticus --help.");
|
|
838
|
+
return 2;
|
|
839
|
+
}
|
|
840
|
+
return void 0;
|
|
841
|
+
}
|
|
842
|
+
export {
|
|
843
|
+
benchKnowledge,
|
|
844
|
+
knowledgeAsk,
|
|
845
|
+
knowledgeCli,
|
|
846
|
+
knowledgeConflicts,
|
|
847
|
+
knowledgeFind,
|
|
848
|
+
knowledgeFinds,
|
|
849
|
+
knowledgeKeep,
|
|
850
|
+
knowledgeList,
|
|
851
|
+
knowledgeReview,
|
|
852
|
+
knowledgeScan,
|
|
853
|
+
printKnowledgeScore,
|
|
854
|
+
reviewWord,
|
|
855
|
+
sourcesTag
|
|
856
|
+
};
|