@maycombhq/atticus 0.0.0-stage → 2.0.0-beta.10
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-23M2LUYM.js +55 -0
- package/dist/chunk-26PLPSQW.js +48 -0
- package/dist/chunk-2G4DFUWJ.js +43 -0
- package/dist/chunk-2HMWX4T6.js +226 -0
- package/dist/chunk-2KDSXJFJ.js +294 -0
- package/dist/chunk-2M6WXO73.js +38 -0
- package/dist/chunk-2RX7PI2Y.js +166 -0
- package/dist/chunk-2XM6PYQQ.js +199 -0
- package/dist/chunk-3G4YI4ZU.js +16 -0
- package/dist/chunk-3GTZ2OON.js +362 -0
- package/dist/chunk-3QAKDIEU.js +108 -0
- package/dist/chunk-47QE246J.js +6115 -0
- package/dist/chunk-4GZXS6S2.js +5401 -0
- package/dist/chunk-4PJADZRR.js +545 -0
- package/dist/chunk-4Q3NN7VF.js +32 -0
- package/dist/chunk-4QUQEBFT.js +143 -0
- package/dist/chunk-4SKZDI62.js +22 -0
- package/dist/chunk-4SVJNVEE.js +80 -0
- package/dist/chunk-52R2YXP5.js +80 -0
- package/dist/chunk-577AJVRS.js +44694 -0
- package/dist/chunk-5F3RJCHB.js +45 -0
- package/dist/chunk-5IALSMZ2.js +34 -0
- package/dist/chunk-5KTOPOEP.js +174 -0
- package/dist/chunk-5MI2SEV5.js +242 -0
- package/dist/chunk-5XDNUJ4P.js +2743 -0
- package/dist/chunk-5XN76FTF.js +22 -0
- package/dist/chunk-5YIBJXGB.js +2007 -0
- package/dist/chunk-62YMDXY6.js +38 -0
- package/dist/chunk-65C57N7P.js +116 -0
- package/dist/chunk-67J3VZBA.js +120 -0
- package/dist/chunk-6EDQE7GO.js +27809 -0
- package/dist/chunk-6GNS32SI.js +285 -0
- package/dist/chunk-6GWHKMQR.js +405 -0
- package/dist/chunk-6JLPXDWN.js +7923 -0
- package/dist/chunk-6TJCUYC5.js +22 -0
- package/dist/chunk-6VBXAGJX.js +234 -0
- package/dist/chunk-73VPWF5R.js +415 -0
- package/dist/chunk-76WKMA4J.js +14 -0
- package/dist/chunk-7DUDLVFJ.js +52 -0
- package/dist/chunk-7EFILTCI.js +67 -0
- package/dist/chunk-7EKESFWV.js +130 -0
- package/dist/chunk-7F2RUWPU.js +101 -0
- package/dist/chunk-7GB4ZRE2.js +378 -0
- package/dist/chunk-7TGYNOXD.js +189 -0
- package/dist/chunk-7UKVYFQ2.js +2078 -0
- package/dist/chunk-7URGP4DD.js +102 -0
- package/dist/chunk-7YYEKTYF.js +2522 -0
- package/dist/chunk-AJJK7GLO.js +252 -0
- package/dist/chunk-AKJTKMXU.js +25 -0
- package/dist/chunk-APSVL2AI.js +344 -0
- package/dist/chunk-AWECWW5Y.js +3206 -0
- package/dist/chunk-AY2IUF4K.js +5071 -0
- package/dist/chunk-B2VSVN4P.js +34 -0
- package/dist/chunk-B3O52AUQ.js +275 -0
- package/dist/chunk-B7434AE2.js +104 -0
- package/dist/chunk-BDEKREZH.js +155 -0
- package/dist/chunk-BJPMKJTL.js +1428 -0
- package/dist/chunk-BMCKL3VQ.js +324 -0
- package/dist/chunk-BMHGA7WD.js +25 -0
- package/dist/chunk-BUYJL3GJ.js +287 -0
- package/dist/chunk-BXIX7S7O.js +32 -0
- package/dist/chunk-CHC5FKTU.js +26 -0
- package/dist/chunk-CITDNDIZ.js +53 -0
- package/dist/chunk-CIUHAHM6.js +70 -0
- package/dist/chunk-CNKGYDMG.js +334 -0
- package/dist/chunk-CRE4BJHM.js +408 -0
- package/dist/chunk-D3PO4DOZ.js +261 -0
- package/dist/chunk-DAQBIK5G.js +47 -0
- package/dist/chunk-DDAHCPGA.js +212 -0
- package/dist/chunk-DPHCFZ7W.js +374 -0
- package/dist/chunk-DZRQDNPT.js +34 -0
- package/dist/chunk-E3JYO547.js +46 -0
- package/dist/chunk-E3Z67HRK.js +104 -0
- package/dist/chunk-EADP3PEN.js +450 -0
- package/dist/chunk-EX6ZXS5K.js +169 -0
- package/dist/chunk-EZIUFEN6.js +27 -0
- package/dist/chunk-F2FOQLJ7.js +430 -0
- package/dist/chunk-F7UQR4ZX.js +149 -0
- package/dist/chunk-F7YL2RZ4.js +94 -0
- package/dist/chunk-FEZE6NIA.js +69 -0
- package/dist/chunk-FJCFYKVO.js +1014 -0
- package/dist/chunk-FLOEZA6K.js +29 -0
- package/dist/chunk-FMKKVWZD.js +133 -0
- package/dist/chunk-FNHSVBRA.js +48 -0
- package/dist/chunk-FOGG4AUR.js +114 -0
- package/dist/chunk-FPGVOSOG.js +41 -0
- package/dist/chunk-FQSRHTTC.js +49 -0
- package/dist/chunk-FR7JPYBD.js +182 -0
- package/dist/chunk-FTV6I76U.js +211 -0
- package/dist/chunk-FV5YFR6I.js +540 -0
- package/dist/chunk-FZ2E5LGK.js +54 -0
- package/dist/chunk-FZL2HNWP.js +531 -0
- package/dist/chunk-G2E5MNYP.js +549 -0
- package/dist/chunk-G5SFOH7P.js +256 -0
- package/dist/chunk-GFXLPJWY.js +53 -0
- package/dist/chunk-GR6YKM55.js +480 -0
- package/dist/chunk-GXJVY6WT.js +250 -0
- package/dist/chunk-GZ4TKR3Q.js +928 -0
- package/dist/chunk-HB6XSGI6.js +131 -0
- package/dist/chunk-HE4ZQXZM.js +396 -0
- package/dist/chunk-HHUFVJF7.js +1019 -0
- package/dist/chunk-HKTUIMH4.js +76 -0
- package/dist/chunk-HUZQDKQK.js +48 -0
- package/dist/chunk-I7IWQIEB.js +58 -0
- package/dist/chunk-IDGSU7JF.js +1496 -0
- package/dist/chunk-ILFKECGI.js +69 -0
- package/dist/chunk-ISNZYKAS.js +53 -0
- package/dist/chunk-IUD3ME4E.js +251 -0
- package/dist/chunk-IV7BCWWN.js +101 -0
- package/dist/chunk-IZNSAEBX.js +164 -0
- package/dist/chunk-J5LHDJU4.js +400 -0
- package/dist/chunk-JAA53T23.js +172 -0
- package/dist/chunk-JF2NSTFO.js +47 -0
- package/dist/chunk-JMSEEBN4.js +41 -0
- package/dist/chunk-JQ7XQPQS.js +273 -0
- package/dist/chunk-KC5DROFC.js +16667 -0
- package/dist/chunk-KIAI6PWL.js +36 -0
- package/dist/chunk-KIHOIVST.js +18 -0
- package/dist/chunk-KM2FBM3T.js +659 -0
- package/dist/chunk-KQDZXGNR.js +14 -0
- package/dist/chunk-L4VJ4ETL.js +41 -0
- package/dist/chunk-LDKUC2QJ.js +49 -0
- package/dist/chunk-LK44ULGI.js +2043 -0
- package/dist/chunk-LRS573EX.js +104 -0
- package/dist/chunk-LTQANUDH.js +119 -0
- package/dist/chunk-LVGBKKSM.js +282 -0
- package/dist/chunk-MF7QH4AX.js +162 -0
- package/dist/chunk-MGVYVW7Q.js +915 -0
- package/dist/chunk-MH5OCRUM.js +240 -0
- package/dist/chunk-MKFYQQ5Q.js +36 -0
- package/dist/chunk-MKRBG5EF.js +1142 -0
- package/dist/chunk-MTAUZW2Z.js +2504 -0
- package/dist/chunk-MTEBM4Y4.js +39 -0
- package/dist/chunk-N3NBWIYQ.js +48 -0
- package/dist/chunk-N4QZJJVB.js +3851 -0
- package/dist/chunk-NGPU2ARF.js +1726 -0
- package/dist/chunk-NIXVDQVO.js +2929 -0
- package/dist/chunk-NNUASOAA.js +34 -0
- package/dist/chunk-NPCD54I7.js +226 -0
- package/dist/chunk-OEI7LVRP.js +856 -0
- package/dist/chunk-OGRWQ562.js +18 -0
- package/dist/chunk-OIU657QQ.js +95 -0
- package/dist/chunk-OJLRFGBP.js +128 -0
- package/dist/chunk-OS7PQ35Z.js +391 -0
- package/dist/chunk-OSGQW2Z6.js +104 -0
- package/dist/chunk-P3TKKBAH.js +131 -0
- package/dist/chunk-PEF5OEMB.js +163 -0
- package/dist/chunk-PGKHJYOB.js +706 -0
- package/dist/chunk-PIVKU64W.js +688 -0
- package/dist/chunk-PKCMRPPB.js +109 -0
- package/dist/chunk-QICFHVRW.js +15 -0
- package/dist/chunk-QKEFZRHS.js +166 -0
- package/dist/chunk-QWVBEK4P.js +113 -0
- package/dist/chunk-R4TBNKKC.js +3217 -0
- package/dist/chunk-R64GLVBO.js +2919 -0
- package/dist/chunk-R6B6XAKK.js +56 -0
- package/dist/chunk-R6RY4Q5T.js +51 -0
- package/dist/chunk-RK6MKKKP.js +471 -0
- package/dist/chunk-ROTY5J2L.js +25 -0
- package/dist/chunk-RRVT4MPS.js +150 -0
- package/dist/chunk-SS66Q4VE.js +231 -0
- package/dist/chunk-T4RTWMJD.js +310 -0
- package/dist/chunk-T6USVBEJ.js +105 -0
- package/dist/chunk-TM7LC37P.js +4044 -0
- package/dist/chunk-TV45EUGM.js +51 -0
- package/dist/chunk-TZDSDDSV.js +233 -0
- package/dist/chunk-UBWCUP3G.js +55 -0
- package/dist/chunk-UF7TAFJM.js +906 -0
- package/dist/chunk-UR7RMZ3R.js +19943 -0
- package/dist/chunk-UYYN2IUZ.js +1611 -0
- package/dist/chunk-V2TH46ZY.js +66 -0
- package/dist/chunk-VKMTFIWS.js +315 -0
- package/dist/chunk-VOGCSYOI.js +16 -0
- package/dist/chunk-W5OYJMBT.js +41 -0
- package/dist/chunk-WARBF2KY.js +296 -0
- package/dist/chunk-WGZWR4RF.js +130 -0
- package/dist/chunk-WLIIQ2A4.js +18 -0
- package/dist/chunk-X4W4XXWP.js +134 -0
- package/dist/chunk-XB5RFZHH.js +1217 -0
- package/dist/chunk-XEG3FE2R.js +766 -0
- package/dist/chunk-XIWYUQZQ.js +583 -0
- package/dist/chunk-XKS6THI5.js +31 -0
- package/dist/chunk-XKZHAD6Y.js +184 -0
- package/dist/chunk-XNYNEEBR.js +214 -0
- package/dist/chunk-XPCWQXTY.js +37 -0
- package/dist/chunk-XPEEICAO.js +325 -0
- package/dist/chunk-XQ3YIV5R.js +3507 -0
- package/dist/chunk-XRO65C7V.js +1079 -0
- package/dist/chunk-XTVDAHH2.js +203 -0
- package/dist/chunk-XZRON6IV.js +131 -0
- package/dist/chunk-Y4BRGOJR.js +523 -0
- package/dist/chunk-Y5PZHS4K.js +3898 -0
- package/dist/chunk-Y7KBQ4BD.js +230 -0
- package/dist/chunk-YFSSNGLR.js +277 -0
- package/dist/chunk-YGKYFMSL.js +60 -0
- package/dist/chunk-YGR6OCHQ.js +345 -0
- package/dist/chunk-YIEOFHOL.js +30 -0
- package/dist/chunk-YLAJAI2W.js +180 -0
- package/dist/chunk-YMOJD5BO.js +50 -0
- package/dist/chunk-YPBQNJHA.js +33 -0
- package/dist/chunk-YPIEYQF4.js +307 -0
- package/dist/chunk-YVLMBAYE.js +221 -0
- package/dist/chunk-YXJ4XOHF.js +376 -0
- package/dist/chunk-ZE3P35DA.js +1247 -0
- package/dist/chunk-ZONE6E3Z.js +32 -0
- package/dist/chunk-ZP4FJHR4.js +95 -0
- package/dist/chunk-ZZXF6OOJ.js +119 -0
- package/dist/files.json +1976 -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 +305 -0
- package/dist/packages/naysayer/starter/review.yaml +256 -0
- package/dist/packages/sdk/npm/index.js +9780 -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-Mo5w5xCa.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-Bp3XhPHX.css +1 -0
- package/dist/packages/ui/dist/assets/index-DM212ZbV.js +29 -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,408 @@
|
|
|
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
|
+
matchedRepoType
|
|
8
|
+
} from "./chunk-XIWYUQZQ.js";
|
|
9
|
+
import {
|
|
10
|
+
loadCatalog
|
|
11
|
+
} from "./chunk-P3TKKBAH.js";
|
|
12
|
+
import {
|
|
13
|
+
repoFor
|
|
14
|
+
} from "./chunk-XKS6THI5.js";
|
|
15
|
+
import {
|
|
16
|
+
draftSpec
|
|
17
|
+
} from "./chunk-Y5PZHS4K.js";
|
|
18
|
+
import {
|
|
19
|
+
stepJudges
|
|
20
|
+
} from "./chunk-KC5DROFC.js";
|
|
21
|
+
import "./chunk-RK6MKKKP.js";
|
|
22
|
+
import "./chunk-47QE246J.js";
|
|
23
|
+
import "./chunk-XQ3YIV5R.js";
|
|
24
|
+
import "./chunk-MGVYVW7Q.js";
|
|
25
|
+
import "./chunk-NGPU2ARF.js";
|
|
26
|
+
import {
|
|
27
|
+
checkSpec,
|
|
28
|
+
citedFileHashes,
|
|
29
|
+
staleFlows
|
|
30
|
+
} from "./chunk-AY2IUF4K.js";
|
|
31
|
+
import "./chunk-6JLPXDWN.js";
|
|
32
|
+
import "./chunk-4GZXS6S2.js";
|
|
33
|
+
import "./chunk-R4TBNKKC.js";
|
|
34
|
+
import "./chunk-NIXVDQVO.js";
|
|
35
|
+
import "./chunk-UR7RMZ3R.js";
|
|
36
|
+
import "./chunk-JF2NSTFO.js";
|
|
37
|
+
import "./chunk-N4QZJJVB.js";
|
|
38
|
+
import "./chunk-PGKHJYOB.js";
|
|
39
|
+
import {
|
|
40
|
+
fsRepo
|
|
41
|
+
} from "./chunk-MKRBG5EF.js";
|
|
42
|
+
import "./chunk-5XDNUJ4P.js";
|
|
43
|
+
import {
|
|
44
|
+
askedByStep,
|
|
45
|
+
listQuestions,
|
|
46
|
+
loadOrgPack,
|
|
47
|
+
orgPackDirOf,
|
|
48
|
+
questionsRelOf,
|
|
49
|
+
raiseQuestions,
|
|
50
|
+
readRepoSpec,
|
|
51
|
+
readSpecFindings,
|
|
52
|
+
reusedLine,
|
|
53
|
+
serializeRecord,
|
|
54
|
+
specFindingFingerprint,
|
|
55
|
+
specRelOf,
|
|
56
|
+
specTemplateFor,
|
|
57
|
+
templateRef,
|
|
58
|
+
writeFlow,
|
|
59
|
+
writeSpecFindings,
|
|
60
|
+
writeSpecHeader
|
|
61
|
+
} from "./chunk-577AJVRS.js";
|
|
62
|
+
import "./chunk-D3PO4DOZ.js";
|
|
63
|
+
import "./chunk-TV45EUGM.js";
|
|
64
|
+
|
|
65
|
+
// packages/cli/dist/spec-commands.js
|
|
66
|
+
import { execFile } from "node:child_process";
|
|
67
|
+
import { resolve } from "node:path";
|
|
68
|
+
var plural = (n, one, many = `${one}s`) => `${n} ${n === 1 ? one : many}`;
|
|
69
|
+
var quiet = { out: () => {
|
|
70
|
+
}, err: () => {
|
|
71
|
+
} };
|
|
72
|
+
function headOf(dir) {
|
|
73
|
+
const same = (a, b) => resolve(a).replace(/\\/g, "/").toLowerCase() === resolve(b).replace(/\\/g, "/").toLowerCase();
|
|
74
|
+
return new Promise((done) => execFile("git", ["-C", dir, "rev-parse", "--show-toplevel", "HEAD"], { timeout: 1e4 }, (e, out) => {
|
|
75
|
+
const [top, head] = out.trim().split(/\r?\n/);
|
|
76
|
+
done(!e && top && head && same(top, dir) && /^[0-9a-f]{40}$/.test(head) ? head : void 0);
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
var noRepo = (target) => `${target} isn't a cloned repo of the manifest or a folder; clone it with atticus workspace sync, or give its folder.`;
|
|
80
|
+
async function context(root, target, io) {
|
|
81
|
+
const repo = await repoFor(root, target);
|
|
82
|
+
if (!repo)
|
|
83
|
+
return void 0;
|
|
84
|
+
const op = await loadOrgPack(orgPackDirOf(root));
|
|
85
|
+
const commit = await headOf(repo.dir);
|
|
86
|
+
const handle = fsRepo(repo.id, repo.dir, commit ?? "0".repeat(40));
|
|
87
|
+
const repoType = await matchedRepoType(handle, repo.id, op, io);
|
|
88
|
+
const template = specTemplateFor(op.specTemplates, repoType?.type.id);
|
|
89
|
+
return { repo, op, handle, commit, repoType, template };
|
|
90
|
+
}
|
|
91
|
+
async function specDraft(root, target, o, deps, io) {
|
|
92
|
+
const c = await context(root, target, io);
|
|
93
|
+
if (!c) {
|
|
94
|
+
io.err(noRepo(target));
|
|
95
|
+
return 2;
|
|
96
|
+
}
|
|
97
|
+
const { repo, op, handle, commit, repoType, template } = c;
|
|
98
|
+
const { records } = await loadCatalog(root, { out: () => {
|
|
99
|
+
}, err: (l) => io.err(l) });
|
|
100
|
+
const before = await readRepoSpec(root, repo.id, { cacheRoot: root });
|
|
101
|
+
for (const p of before.problems)
|
|
102
|
+
io.err(`${p.file}: ${p.message}`);
|
|
103
|
+
const stale = o.force ? [] : await staleFlows(handle, before.flows, before.header?.files ?? {});
|
|
104
|
+
const staleIds = new Set(stale.map((s) => s.flow));
|
|
105
|
+
for (const s of stale)
|
|
106
|
+
io.out(`${s.flow} cites ${s.files.join(", ")}, which changed since it was drafted; it is drafted again.`);
|
|
107
|
+
const last = await readSpecFindings(root, repo.id);
|
|
108
|
+
const critic = (last?.findings ?? []).filter((f) => !f.question).map((f) => f.message);
|
|
109
|
+
const flagged = new Set((last?.findings ?? []).filter((f) => !f.question).map((f) => before.flows.find((x) => f.target.startsWith(`${x.id} `) || f.target === x.id)?.id).filter((x) => !!x));
|
|
110
|
+
if (flagged.size)
|
|
111
|
+
io.out(`The last spec check found problems in ${[...flagged].join(", ")}; they are drafted again.`);
|
|
112
|
+
const redo = /* @__PURE__ */ new Set([...staleIds, ...flagged]);
|
|
113
|
+
const keep = o.force ? [] : before.flows.filter((f) => !redo.has(f.id));
|
|
114
|
+
if (!o.force && !o.resume && before.header && redo.size === 0 && critic.length === 0) {
|
|
115
|
+
if (!await draftSpecNeeded(handle, repo.id, records, template, keep)) {
|
|
116
|
+
io.out(`Every trigger of ${repo.id} has a flow, no cited file changed and the last check found nothing to fix. Re-run with --force to draft the spec again.`);
|
|
117
|
+
return 0;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const questions = (await listQuestions(root, { repo: repo.id })).questions.filter((q) => askedByStep(q, "spec-draft") || askedByStep(q, "spec-check"));
|
|
121
|
+
const r = await draftSpec(handle, {
|
|
122
|
+
repoId: repo.id,
|
|
123
|
+
runtime: deps.runtime,
|
|
124
|
+
records,
|
|
125
|
+
template,
|
|
126
|
+
orgPack: op,
|
|
127
|
+
...repoType ? { repoType } : {},
|
|
128
|
+
questions,
|
|
129
|
+
keep,
|
|
130
|
+
onFile: before.flows,
|
|
131
|
+
critic,
|
|
132
|
+
maxAttempts: o.attempts ?? 3,
|
|
133
|
+
...deps.now ? { now: deps.now } : {},
|
|
134
|
+
...o.resume ? { resume: o.resume } : {}
|
|
135
|
+
});
|
|
136
|
+
if (r.status === "waiting") {
|
|
137
|
+
io.out(`Handed the spec to your assistant (run ${r.runId}). When it is done: atticus handoff done ${r.runId}, then atticus spec draft ${repo.id} --resume ${r.runId}`);
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
for (const a of r.attempts.filter((x) => x.problems.length > 0)) {
|
|
141
|
+
io.out(`Attempt ${a.attempt}: ${plural(a.problems.length, "problem")}, handed back:`);
|
|
142
|
+
for (const p of a.problems)
|
|
143
|
+
io.out(` - ${p}`);
|
|
144
|
+
}
|
|
145
|
+
const at = (deps.now ?? /* @__PURE__ */ new Date()).toISOString();
|
|
146
|
+
const rel = specRelOf(root, repo.id);
|
|
147
|
+
for (const f of r.flows)
|
|
148
|
+
await writeFlow(root, repo.id, f);
|
|
149
|
+
const fresh = new Set(r.flows.map((f) => f.id));
|
|
150
|
+
const left = [];
|
|
151
|
+
for (const f of before.flows.filter((x) => redo.has(x.id) && !fresh.has(x.id))) {
|
|
152
|
+
if (!staleIds.has(f.id)) {
|
|
153
|
+
left.push(f);
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
const marked = { ...f, flags: [.../* @__PURE__ */ new Set([...f.flags ?? [], "stale"])] };
|
|
157
|
+
await writeFlow(root, repo.id, marked);
|
|
158
|
+
left.push(marked);
|
|
159
|
+
}
|
|
160
|
+
const byId = new Map([...keep, ...left].map((f) => [f.id, f]));
|
|
161
|
+
for (const f of r.flows)
|
|
162
|
+
byId.set(f.id, f);
|
|
163
|
+
const all = [...byId.values()].sort((a, b) => a.id.localeCompare(b.id));
|
|
164
|
+
const hashes = {
|
|
165
|
+
...before.header?.files ?? {},
|
|
166
|
+
...await citedFileHashes(handle, [...keep.filter((f) => !fresh.has(f.id)), ...r.flows])
|
|
167
|
+
};
|
|
168
|
+
const rerun = `atticus spec draft ${repo.id}`;
|
|
169
|
+
const judges = stepJudges(root, deps.runtime, repo.id, new Date(at));
|
|
170
|
+
const { raised, known, reused } = await raiseQuestions(root, r.questions, {
|
|
171
|
+
step: "spec-draft",
|
|
172
|
+
repo: repo.id,
|
|
173
|
+
command: rerun,
|
|
174
|
+
rerun,
|
|
175
|
+
...r.runId ? { run: r.runId } : {},
|
|
176
|
+
at
|
|
177
|
+
}, judges);
|
|
178
|
+
const open = [...raised, ...known.filter((q) => q.state === "open")].map((q) => q.id);
|
|
179
|
+
const header = {
|
|
180
|
+
schemaVersion: 1,
|
|
181
|
+
repo: repo.id,
|
|
182
|
+
...commit ? { commit } : {},
|
|
183
|
+
template: templateRef(template),
|
|
184
|
+
// The default template ships with Atticus; a repo type's is reviewed in its PR, and a
|
|
185
|
+
// person sets this once it has merged.
|
|
186
|
+
templateReviewed: template.repoType === "default" || before.header?.template === templateRef(template) && before.header.templateReviewed,
|
|
187
|
+
drafted: { at, ...r.runId ? { run: r.runId } : {} },
|
|
188
|
+
flows: all.map((f) => f.id),
|
|
189
|
+
files: hashes,
|
|
190
|
+
questions: [.../* @__PURE__ */ new Set([...before.header?.questions ?? [], ...open])].sort()
|
|
191
|
+
};
|
|
192
|
+
if (r.flows.length || !before.header)
|
|
193
|
+
await writeSpecHeader(root, header);
|
|
194
|
+
else
|
|
195
|
+
await writeSpecHeader(root, { ...header, drafted: before.header.drafted ?? header.drafted });
|
|
196
|
+
if (r.flows.length)
|
|
197
|
+
io.out(`Wrote ${plural(r.flows.length, "flow")} in ${rel}/ (template ${header.template}${header.templateReviewed ? "" : ", not yet reviewed"}):`);
|
|
198
|
+
for (const f of r.flows) {
|
|
199
|
+
const checked = f.steps.filter((s) => s.confirmedBy === "check").length;
|
|
200
|
+
io.out(` ${f.id}: ${f.name} (${plural(f.steps.length, "step")}, ${checked} confirmed by the check${f.family.length ? `, stands for ${f.family.length} more` : ""})`);
|
|
201
|
+
}
|
|
202
|
+
for (const f of r.failed)
|
|
203
|
+
io.out(` not written: ${f.flow}, still failing: ${f.problems.join("; ")}`);
|
|
204
|
+
for (const t of r.uncovered)
|
|
205
|
+
io.out(` no flow yet: ${t.kind} ${t.label} (${t.id})`);
|
|
206
|
+
if (raised.length) {
|
|
207
|
+
io.out(`${plural(raised.length, "question")} for a person, in ${questionsRelOf(root)}/:`);
|
|
208
|
+
for (const q of raised)
|
|
209
|
+
io.out(` ${q.id} ${q.question}`);
|
|
210
|
+
}
|
|
211
|
+
for (const q of reused)
|
|
212
|
+
io.out(reusedLine(q));
|
|
213
|
+
if (r.status === "failed") {
|
|
214
|
+
io.out(`No flow passed its checks in ${plural(r.attempts.length, "attempt")}; nothing new was written.`);
|
|
215
|
+
return 1;
|
|
216
|
+
}
|
|
217
|
+
io.out(`Next: atticus spec check ${repo.id}, then review ${rel}/ in a pull request.`);
|
|
218
|
+
return 0;
|
|
219
|
+
}
|
|
220
|
+
async function draftSpecNeeded(handle, repoId, records, template, flows) {
|
|
221
|
+
const r = await checkSpec({ repo: handle, repoId, flows, records, template });
|
|
222
|
+
return r.triggers.some((t) => !t.flow);
|
|
223
|
+
}
|
|
224
|
+
function findingQuestion(f, evidence) {
|
|
225
|
+
return {
|
|
226
|
+
question: `The spec check found this again after the flows were drafted again: ${f.message}. What should the flow say?`,
|
|
227
|
+
options: [],
|
|
228
|
+
evidence: [evidence],
|
|
229
|
+
scope: "repo"
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
async function specCheck(root, target, o, io) {
|
|
233
|
+
const c = await context(root, target, o.json ? quiet : io);
|
|
234
|
+
if (!c) {
|
|
235
|
+
io.err(noRepo(target));
|
|
236
|
+
return 2;
|
|
237
|
+
}
|
|
238
|
+
const { repo, handle, template } = c;
|
|
239
|
+
const spec = await readRepoSpec(root, repo.id, { cacheRoot: root });
|
|
240
|
+
if (!spec.header && spec.flows.length === 0) {
|
|
241
|
+
io.err(`${repo.id} has no spec yet. Draft it: atticus spec draft ${repo.id}`);
|
|
242
|
+
return 2;
|
|
243
|
+
}
|
|
244
|
+
const { records } = await loadCatalog(root, { out: () => {
|
|
245
|
+
}, err: (l) => io.err(l) });
|
|
246
|
+
const onFile = (await listQuestions(root, { repo: repo.id })).questions.filter((q) => q.state !== "retired");
|
|
247
|
+
const r = await checkSpec({
|
|
248
|
+
repo: handle,
|
|
249
|
+
repoId: repo.id,
|
|
250
|
+
flows: spec.flows,
|
|
251
|
+
records,
|
|
252
|
+
template,
|
|
253
|
+
questions: onFile
|
|
254
|
+
});
|
|
255
|
+
const findings = [...r.findings];
|
|
256
|
+
for (const p of spec.problems)
|
|
257
|
+
findings.push({
|
|
258
|
+
rule: "line-missing",
|
|
259
|
+
target: p.file,
|
|
260
|
+
message: `${p.file}: ${p.message}`,
|
|
261
|
+
fingerprint: specFindingFingerprint("unreadable", p.file)
|
|
262
|
+
});
|
|
263
|
+
for (const s of await staleFlows(handle, spec.flows, spec.header?.files ?? {}))
|
|
264
|
+
findings.push({
|
|
265
|
+
rule: "stale",
|
|
266
|
+
target: s.flow,
|
|
267
|
+
message: `${s.flow} cites ${s.files.join(", ")}, which changed since it was drafted; run atticus spec draft ${repo.id}`,
|
|
268
|
+
fingerprint: specFindingFingerprint("stale", s.flow, s.files.join(",")),
|
|
269
|
+
flow: s.flow
|
|
270
|
+
});
|
|
271
|
+
let confirmedNow = 0;
|
|
272
|
+
for (const f of r.flows) {
|
|
273
|
+
const was = spec.flows.find((x) => x.id === f.id);
|
|
274
|
+
if (serializeRecord(was) === serializeRecord(f))
|
|
275
|
+
continue;
|
|
276
|
+
await writeFlow(root, repo.id, f);
|
|
277
|
+
confirmedNow++;
|
|
278
|
+
}
|
|
279
|
+
const prev = await readSpecFindings(root, repo.id);
|
|
280
|
+
const draftedAt = spec.header?.drafted?.at;
|
|
281
|
+
const redrafted = !!prev && prev.draftedAt !== draftedAt;
|
|
282
|
+
const now = (o.now ?? /* @__PURE__ */ new Date()).toISOString();
|
|
283
|
+
const lines = /* @__PURE__ */ new Map();
|
|
284
|
+
const exists = async (a) => {
|
|
285
|
+
const cut = a.lastIndexOf(":");
|
|
286
|
+
const path = a.slice(0, cut);
|
|
287
|
+
if (!lines.has(path)) {
|
|
288
|
+
const t = await handle.readText(path).catch(() => void 0);
|
|
289
|
+
lines.set(path, t === void 0 ? 0 : t.replace(/\n$/, "").split(/\r?\n/).length);
|
|
290
|
+
}
|
|
291
|
+
const n = Number(a.slice(cut + 1));
|
|
292
|
+
return n >= 1 && n <= lines.get(path);
|
|
293
|
+
};
|
|
294
|
+
const stored = [];
|
|
295
|
+
const toAsk = [];
|
|
296
|
+
const callers = /* @__PURE__ */ new Map();
|
|
297
|
+
for (const f of findings) {
|
|
298
|
+
const p = prev?.findings.find((x) => x.fingerprint === f.fingerprint);
|
|
299
|
+
const seen = p ? redrafted ? p.seen + 1 : p.seen : 1;
|
|
300
|
+
let evidence = f.evidence && await exists(f.evidence) ? f.evidence : void 0;
|
|
301
|
+
if (!evidence && f.flow) {
|
|
302
|
+
const t = spec.flows.find((x) => x.id === f.flow)?.trigger.evidence[0];
|
|
303
|
+
const a = t?.path && t.line ? `${t.path}:${t.line}` : void 0;
|
|
304
|
+
if (a && await exists(a))
|
|
305
|
+
evidence = a;
|
|
306
|
+
}
|
|
307
|
+
const flow = f.flow ? spec.flows.find((x) => x.id === f.flow) : void 0;
|
|
308
|
+
if (f.rule === "caller-unknown" && !f.callers?.length && !p?.question && evidence && flow) {
|
|
309
|
+
const c2 = callers.get(flow.component) ?? { fs: [], labels: [], at: [] };
|
|
310
|
+
const t = r.triggers.find((x) => x.id === flow.trigger.ref);
|
|
311
|
+
c2.fs.push(f);
|
|
312
|
+
c2.labels.push(t?.label ?? flow.trigger.what);
|
|
313
|
+
if (!c2.at.includes(evidence))
|
|
314
|
+
c2.at.push(evidence);
|
|
315
|
+
callers.set(flow.component, c2);
|
|
316
|
+
} else if (!p?.question && seen >= 2 && evidence)
|
|
317
|
+
toAsk.push({ fs: [f], q: findingQuestion(f, evidence) });
|
|
318
|
+
stored.push({
|
|
319
|
+
fingerprint: f.fingerprint,
|
|
320
|
+
rule: f.rule,
|
|
321
|
+
target: f.target,
|
|
322
|
+
...f.evidence ? { evidence: f.evidence } : {},
|
|
323
|
+
message: f.message,
|
|
324
|
+
seen,
|
|
325
|
+
...p?.question ? { question: p.question } : {}
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
for (const [component, c2] of callers)
|
|
329
|
+
toAsk.push({
|
|
330
|
+
fs: c2.fs,
|
|
331
|
+
q: {
|
|
332
|
+
question: `Who calls ${c2.labels.length === 1 ? "this entry point" : "these entry points"} of ${component}, and how does each call arrive (through which gateway, or direct)? ${c2.labels.join("; ")}`,
|
|
333
|
+
options: [],
|
|
334
|
+
evidence: c2.at,
|
|
335
|
+
scope: "repo"
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
const rerun = `atticus spec draft ${repo.id}`;
|
|
339
|
+
const asked = await raiseQuestions(root, toAsk.map((x) => x.q), { step: "spec-check", repo: repo.id, command: `atticus spec check ${repo.id}`, rerun, at: now });
|
|
340
|
+
const questionIds = [];
|
|
341
|
+
const callerIds = /* @__PURE__ */ new Set();
|
|
342
|
+
for (const [i, x] of toAsk.entries()) {
|
|
343
|
+
const q = asked.of[i];
|
|
344
|
+
if (!q)
|
|
345
|
+
continue;
|
|
346
|
+
questionIds.push(q.id);
|
|
347
|
+
if (x.fs[0]?.rule === "caller-unknown")
|
|
348
|
+
callerIds.add(q.id);
|
|
349
|
+
for (const f of x.fs) {
|
|
350
|
+
const s = stored.find((y) => y.fingerprint === f.fingerprint);
|
|
351
|
+
s.question = q.id;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
await writeSpecFindings(root, {
|
|
355
|
+
schemaVersion: 1,
|
|
356
|
+
repo: repo.id,
|
|
357
|
+
checkedAt: now,
|
|
358
|
+
...draftedAt ? { draftedAt } : {},
|
|
359
|
+
findings: stored
|
|
360
|
+
});
|
|
361
|
+
if (spec.header && questionIds.length)
|
|
362
|
+
await writeSpecHeader(root, {
|
|
363
|
+
...spec.header,
|
|
364
|
+
questions: [.../* @__PURE__ */ new Set([...spec.header.questions, ...questionIds])].sort()
|
|
365
|
+
});
|
|
366
|
+
const steps = r.flows.reduce((n, f) => n + f.steps.length, 0);
|
|
367
|
+
const covered = r.triggers.filter((t) => t.flow).length;
|
|
368
|
+
if (o.json) {
|
|
369
|
+
io.out(JSON.stringify({
|
|
370
|
+
repo: repo.id,
|
|
371
|
+
template: templateRef(template),
|
|
372
|
+
flows: r.flows.length,
|
|
373
|
+
steps,
|
|
374
|
+
confirmedByCheck: r.confirmed,
|
|
375
|
+
triggers: { total: r.triggers.length, covered },
|
|
376
|
+
findings: stored,
|
|
377
|
+
questions: asked.raised.map((q) => q.id)
|
|
378
|
+
}, null, 2));
|
|
379
|
+
return stored.length ? 1 : 0;
|
|
380
|
+
}
|
|
381
|
+
io.out(`${repo.id}: ${plural(r.flows.length, "flow")}, ${plural(steps, "step")}; ${covered} of ${plural(r.triggers.length, "trigger")} in the catalog have a flow; the check confirmed ${r.confirmed} ${r.confirmed === 1 ? "step" : "steps"} on its cited lines${confirmedNow ? ` (${plural(confirmedNow, "flow file")} updated)` : ""}.`);
|
|
382
|
+
if (r.unconfirmable)
|
|
383
|
+
io.out(` ${plural(r.unconfirmable, "step")} the check can't confirm (transforms, branches, validations, or nothing named to look for); the AI pass and your review confirm those.`);
|
|
384
|
+
if (stored.length === 0) {
|
|
385
|
+
io.out("No findings.");
|
|
386
|
+
return 0;
|
|
387
|
+
}
|
|
388
|
+
io.out(`${plural(stored.length, "finding")}:`);
|
|
389
|
+
for (const f of stored)
|
|
390
|
+
io.out(` [${f.rule}] ${f.message}${f.question ? ` (question ${f.question})` : ""}`);
|
|
391
|
+
const callerQs = asked.raised.filter((q) => callerIds.has(q.id));
|
|
392
|
+
const backQs = asked.raised.filter((q) => !callerQs.includes(q));
|
|
393
|
+
if (callerQs.length)
|
|
394
|
+
io.out(`Nothing in the code or config says who calls some entry points, so ${callerQs.length === 1 ? "a question asks" : "questions ask"} a person in ${questionsRelOf(root)}/: ${callerQs.map((q) => q.id).join(", ")}`);
|
|
395
|
+
if (backQs.length)
|
|
396
|
+
io.out(`${plural(backQs.length, "finding")} came back unchanged after a redraft, so ${backQs.length === 1 ? "it is" : "they are"} now ${backQs.length === 1 ? "a question" : "questions"} for a person in ${questionsRelOf(root)}/: ${backQs.map((q) => q.id).join(", ")}`);
|
|
397
|
+
for (const q of asked.reused)
|
|
398
|
+
io.out(reusedLine(q));
|
|
399
|
+
if (asked.raised.length)
|
|
400
|
+
io.out(`Answer with atticus questions answer <id> --text "...", then run ${rerun}`);
|
|
401
|
+
else
|
|
402
|
+
io.out(`Next: ${rerun} hands the findings back to your assistant.`);
|
|
403
|
+
return 1;
|
|
404
|
+
}
|
|
405
|
+
export {
|
|
406
|
+
specCheck,
|
|
407
|
+
specDraft
|
|
408
|
+
};
|
|
@@ -0,0 +1,261 @@
|
|
|
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
|
+
|
|
7
|
+
// packages/core/dist/schema/version.js
|
|
8
|
+
var SCHEMA_VERSION = 3;
|
|
9
|
+
|
|
10
|
+
// packages/core/dist/fs.js
|
|
11
|
+
import { randomBytes } from "node:crypto";
|
|
12
|
+
import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
13
|
+
import { hostname } from "node:os";
|
|
14
|
+
import { dirname, join } from "node:path";
|
|
15
|
+
async function writeFileAtomic(path, data) {
|
|
16
|
+
await mkdir(dirname(path), { recursive: true });
|
|
17
|
+
const tmp = `${path}.${process.pid}.${randomBytes(4).toString("hex")}.tmp`;
|
|
18
|
+
try {
|
|
19
|
+
await writeFile(tmp, data, typeof data === "string" ? "utf8" : void 0);
|
|
20
|
+
await renameRetrying(tmp, path);
|
|
21
|
+
} catch (e) {
|
|
22
|
+
await rm(tmp, { force: true });
|
|
23
|
+
throw e;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
var BUSY = /* @__PURE__ */ new Set(["EPERM", "EBUSY", "EACCES"]);
|
|
27
|
+
async function renameRetrying(from, to, tries = 9) {
|
|
28
|
+
for (let i = 0; ; i++) {
|
|
29
|
+
try {
|
|
30
|
+
await rename(from, to);
|
|
31
|
+
return;
|
|
32
|
+
} catch (e) {
|
|
33
|
+
const code = e.code ?? "";
|
|
34
|
+
if (!BUSY.has(code) || i >= tries - 1)
|
|
35
|
+
throw e;
|
|
36
|
+
await new Promise((r) => setTimeout(r, 20 * 2 ** i));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
var LockHeldError = class extends Error {
|
|
41
|
+
held;
|
|
42
|
+
constructor(held) {
|
|
43
|
+
super(`Another ${held.what} is running (process ${held.pid} on ${held.host}, since ${held.startedAt}). Wait for it to finish.`);
|
|
44
|
+
this.held = held;
|
|
45
|
+
this.name = "LockHeldError";
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var lockFileOf = (root, name) => join(root, ".atticus", "locks", `${name}.json`);
|
|
49
|
+
function alive(pid) {
|
|
50
|
+
try {
|
|
51
|
+
process.kill(pid, 0);
|
|
52
|
+
return true;
|
|
53
|
+
} catch (e) {
|
|
54
|
+
return e.code === "EPERM";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async function readLock(root, name) {
|
|
58
|
+
try {
|
|
59
|
+
const info = JSON.parse(await readFile(lockFileOf(root, name), "utf8"));
|
|
60
|
+
const stale = info.host === hostname() ? !alive(info.pid) : false;
|
|
61
|
+
return { ...info, stale };
|
|
62
|
+
} catch {
|
|
63
|
+
return void 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async function acquireLock(root, name, what, now = () => /* @__PURE__ */ new Date()) {
|
|
67
|
+
const file = lockFileOf(root, name);
|
|
68
|
+
await ensureLocalIgnore(root);
|
|
69
|
+
await mkdir(dirname(file), { recursive: true });
|
|
70
|
+
const info = {
|
|
71
|
+
pid: process.pid,
|
|
72
|
+
host: hostname(),
|
|
73
|
+
startedAt: now().toISOString(),
|
|
74
|
+
what
|
|
75
|
+
};
|
|
76
|
+
let interrupted;
|
|
77
|
+
for (let attempt = 0; attempt < 2; attempt++) {
|
|
78
|
+
try {
|
|
79
|
+
await writeFile(file, JSON.stringify(info), { encoding: "utf8", flag: "wx" });
|
|
80
|
+
const release = async () => {
|
|
81
|
+
const cur = await readLock(root, name);
|
|
82
|
+
if (cur && cur.pid === info.pid && cur.startedAt === info.startedAt)
|
|
83
|
+
await rm(file, { force: true });
|
|
84
|
+
};
|
|
85
|
+
return interrupted ? { release, interrupted } : { release };
|
|
86
|
+
} catch (e) {
|
|
87
|
+
if (e.code !== "EEXIST")
|
|
88
|
+
throw e;
|
|
89
|
+
const held = await readLock(root, name);
|
|
90
|
+
if (held && !held.stale)
|
|
91
|
+
throw new LockHeldError(held);
|
|
92
|
+
if (held) {
|
|
93
|
+
const { stale: _s, ...rest } = held;
|
|
94
|
+
interrupted = rest;
|
|
95
|
+
}
|
|
96
|
+
await rm(file, { force: true });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
throw new Error(`Couldn't take the ${name} lock at ${file}.`);
|
|
100
|
+
}
|
|
101
|
+
var LOCAL_ONLY = [
|
|
102
|
+
"me.yaml",
|
|
103
|
+
"logs/",
|
|
104
|
+
"locks/",
|
|
105
|
+
"backups/",
|
|
106
|
+
"history/",
|
|
107
|
+
"probe/",
|
|
108
|
+
"cache/"
|
|
109
|
+
];
|
|
110
|
+
async function ensureLocalIgnore(root) {
|
|
111
|
+
const file = join(root, ".atticus", ".gitignore");
|
|
112
|
+
const text = await readFile(file, "utf8").catch(() => "");
|
|
113
|
+
const have = new Set(text.split(/\r?\n/).map((l) => l.trim()));
|
|
114
|
+
const missing = LOCAL_ONLY.filter((l) => !have.has(l));
|
|
115
|
+
if (!missing.length)
|
|
116
|
+
return;
|
|
117
|
+
await mkdir(dirname(file), { recursive: true });
|
|
118
|
+
const prefix = text && !text.endsWith("\n") ? `${text}
|
|
119
|
+
` : text;
|
|
120
|
+
await writeFile(file, `${prefix}${prefix ? "" : "# This machine's own files: never committed.\n"}${missing.join("\n")}
|
|
121
|
+
`, "utf8");
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// packages/core/dist/log.js
|
|
125
|
+
import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
126
|
+
import { homedir, userInfo } from "node:os";
|
|
127
|
+
import { join as join2 } from "node:path";
|
|
128
|
+
var ORDER = { debug: 10, info: 20, warn: 30, error: 40, off: 100 };
|
|
129
|
+
var LOG_MAX_BYTES = 5 * 1024 * 1024;
|
|
130
|
+
var LOG_KEEP = 3;
|
|
131
|
+
var logFileOf = (root) => join2(root, ".atticus", "logs", "atticus.log");
|
|
132
|
+
var SECRET_KEY = /(token|password|passwd|pwd|secret|api[-_]?key|private[-_]?key|credential|authorization|cookie|session)/i;
|
|
133
|
+
function redactText(s, o = {}) {
|
|
134
|
+
let out = s.replace(/([a-z][a-z0-9+.-]*:\/\/)[^/@\s:]+:[^/@\s]+@/gi, "$1***@").replace(/\b(bearer|basic)\s+[A-Za-z0-9._~+/=-]{8,}/gi, "$1 ***").replace(new RegExp(`(${SECRET_KEY.source})(["']?\\s*[:=]\\s*["']?)([^\\s"',;&]+)`, "gi"), "$1$3***").replace(/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{5,}/g, "***").replace(/\b(?=[A-Za-z0-9+_-]*\d)(?=[A-Za-z0-9+_-]*[A-Z])(?=[A-Za-z0-9+_-]*[a-z])[A-Za-z0-9+_-]{32,}={0,2}/g, "***");
|
|
135
|
+
const home = o.home ?? safeHome();
|
|
136
|
+
if (home && home.length > 3)
|
|
137
|
+
out = out.split(home).join("~");
|
|
138
|
+
const user = o.user ?? safeUser();
|
|
139
|
+
if (user && user.length > 2)
|
|
140
|
+
out = out.replace(new RegExp(`([\\\\/])${escapeRe(user)}(?=[\\\\/])`, "g"), "$1<user>");
|
|
141
|
+
return out;
|
|
142
|
+
}
|
|
143
|
+
function redact(v, o = {}) {
|
|
144
|
+
if (typeof v === "string")
|
|
145
|
+
return redactText(v, o);
|
|
146
|
+
if (Array.isArray(v))
|
|
147
|
+
return v.map((x) => redact(x, o));
|
|
148
|
+
if (v && typeof v === "object") {
|
|
149
|
+
const out = {};
|
|
150
|
+
for (const [k, x] of Object.entries(v))
|
|
151
|
+
out[k] = SECRET_KEY.test(k) ? "***" : redact(x, o);
|
|
152
|
+
return out;
|
|
153
|
+
}
|
|
154
|
+
return v;
|
|
155
|
+
}
|
|
156
|
+
var escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
157
|
+
function safeHome() {
|
|
158
|
+
try {
|
|
159
|
+
return homedir();
|
|
160
|
+
} catch {
|
|
161
|
+
return void 0;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
function safeUser() {
|
|
165
|
+
try {
|
|
166
|
+
return userInfo().username;
|
|
167
|
+
} catch {
|
|
168
|
+
return void 0;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
function rotate(file, max, keep) {
|
|
172
|
+
try {
|
|
173
|
+
if (statSync(file).size < max)
|
|
174
|
+
return;
|
|
175
|
+
} catch {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
rmSync(`${file}.${keep}`, { force: true });
|
|
179
|
+
for (let i = keep - 1; i >= 1; i--) {
|
|
180
|
+
try {
|
|
181
|
+
renameSync(`${file}.${i}`, `${file}.${i + 1}`);
|
|
182
|
+
} catch {
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
try {
|
|
186
|
+
renameSync(file, `${file}.1`);
|
|
187
|
+
} catch {
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function logLevelFrom(env = process.env) {
|
|
191
|
+
const v = (env.ATTICUS_LOG ?? "").toLowerCase();
|
|
192
|
+
return v in ORDER ? v : "info";
|
|
193
|
+
}
|
|
194
|
+
function createLog(root, o = {}) {
|
|
195
|
+
const file = logFileOf(root);
|
|
196
|
+
const level = o.level ?? logLevelFrom();
|
|
197
|
+
const now = o.now ?? (() => /* @__PURE__ */ new Date());
|
|
198
|
+
const write = (lvl, event, fields) => {
|
|
199
|
+
if (ORDER[lvl] < ORDER[level])
|
|
200
|
+
return;
|
|
201
|
+
try {
|
|
202
|
+
mkdirSync(join2(file, ".."), { recursive: true });
|
|
203
|
+
ignoreLocalSync(root);
|
|
204
|
+
rotate(file, o.maxBytes ?? LOG_MAX_BYTES, o.keep ?? LOG_KEEP);
|
|
205
|
+
const entry = redact({ at: now().toISOString(), level: lvl, event, ...fields });
|
|
206
|
+
appendFileSync(file, `${JSON.stringify(entry)}
|
|
207
|
+
`, "utf8");
|
|
208
|
+
} catch {
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
return {
|
|
212
|
+
file,
|
|
213
|
+
debug: (e, f = {}) => write("debug", e, f),
|
|
214
|
+
info: (e, f = {}) => write("info", e, f),
|
|
215
|
+
warn: (e, f = {}) => write("warn", e, f),
|
|
216
|
+
error: (e, err, f = {}) => write("error", e, {
|
|
217
|
+
...f,
|
|
218
|
+
error: err instanceof Error ? { name: err.name, message: err.message, stack: err.stack?.split("\n").slice(0, 25) } : { message: String(err) }
|
|
219
|
+
})
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
function ignoreLocalSync(root) {
|
|
223
|
+
const f = join2(root, ".atticus", ".gitignore");
|
|
224
|
+
const text = existsSync(f) ? readFileSync(f, "utf8") : "";
|
|
225
|
+
const have = new Set(text.split(/\r?\n/).map((l) => l.trim()));
|
|
226
|
+
const missing = LOCAL_ONLY.filter((l) => !have.has(l));
|
|
227
|
+
if (!missing.length)
|
|
228
|
+
return;
|
|
229
|
+
const prefix = text && !text.endsWith("\n") ? `${text}
|
|
230
|
+
` : text;
|
|
231
|
+
const head = prefix ? "" : "# This machine's own files: never committed.\n";
|
|
232
|
+
writeFileSync(f, `${prefix}${head}${missing.join("\n")}
|
|
233
|
+
`, "utf8");
|
|
234
|
+
}
|
|
235
|
+
var NO_LOG = {
|
|
236
|
+
file: "",
|
|
237
|
+
debug: () => void 0,
|
|
238
|
+
info: () => void 0,
|
|
239
|
+
warn: () => void 0,
|
|
240
|
+
error: () => void 0
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
export {
|
|
244
|
+
SCHEMA_VERSION,
|
|
245
|
+
writeFileAtomic,
|
|
246
|
+
renameRetrying,
|
|
247
|
+
LockHeldError,
|
|
248
|
+
lockFileOf,
|
|
249
|
+
readLock,
|
|
250
|
+
acquireLock,
|
|
251
|
+
LOCAL_ONLY,
|
|
252
|
+
ensureLocalIgnore,
|
|
253
|
+
LOG_MAX_BYTES,
|
|
254
|
+
LOG_KEEP,
|
|
255
|
+
logFileOf,
|
|
256
|
+
redactText,
|
|
257
|
+
redact,
|
|
258
|
+
logLevelFrom,
|
|
259
|
+
createLog,
|
|
260
|
+
NO_LOG
|
|
261
|
+
};
|