chore(fallow): adopt fallow and fix dead-code findings

- add fallow 3.17 as workspace devDependency with fallow/fallow:fix scripts
- generate .fallowrc.json modeling pi.extensions entries, diagnostic CLI, and tools as entry points
- remove export from 4 internal-only symbols
- drop unused pi-ai dependency from pi-permission-inner-cmd
This commit is contained in:
2026-08-22 01:24:42 +08:00
parent 3ba005b6cb
commit 0737e01fca
8 changed files with 352 additions and 10 deletions
+29
View File
@@ -0,0 +1,29 @@
{
// This file is JSONC: fallow reads these comments; generic JSON tools may not.
"$schema": "./node_modules/fallow/schema.json",
"entry": [
"packages/*/src/index.ts", // pi.extensions entry points
"packages/pi-permission-ai-judge/src/analyzer/cli.ts", // manual diagnostic CLI
"packages/pi-permission-ai-judge/tools/*.ts" // manual replay tools
],
"workspaces": {
"patterns": [
"packages/*"
]
},
"duplicates": {
// Hide pair-only clones; focus on widespread copy-paste
// worth refactoring. Lower to 2 to report every duplicate pair.
"minOccurrences": 3
// Common additions (uncomment to enable):
// "ignore": [
// "**/lib/**", // for repos that publish transpiled output to lib/
// "**/legacy/**", // for repos with legacy-build artifacts
// "**/__generated__/**", // Relay, GraphQL Code Generator
// "**/generated/**" // OpenAPI, Protobuf codegen
// ]
},
"rules": {
"unused-dependencies": "warn"
}
}
+1
View File
@@ -149,3 +149,4 @@ vite.config.ts.timestamp-*
# TUI replay diagnostic reports (regenerable via analyzer CLI + window bounds)
docs/testing/rounds/
.fallow/
+6 -1
View File
@@ -3,7 +3,9 @@
"description": "Persional pi code agent extentsions",
"scripts": {
"check": "pnpm -r check",
"test": "pnpm -r test"
"test": "pnpm -r test",
"fallow": "fallow",
"fallow:fix": "fallow fix --dry-run"
},
"type": "module",
"private": true,
@@ -14,5 +16,8 @@
"extensions": [
"./packages/pi-permission-inner-cmd/src/index.ts"
]
},
"devDependencies": {
"fallow": "^3.17.0"
}
}
@@ -19,8 +19,8 @@ import { buildContextEntries } from "@earendil-works/pi-coding-agent";
* everything else out.
*/
export const MAX_CONVERSATION_ITEMS = 16;
export const MAX_CONVERSATION_CHARS = 12_000;
const MAX_CONVERSATION_ITEMS = 16;
const MAX_CONVERSATION_CHARS = 12_000;
export interface ConversationItem {
/** One-based position in the active branch, counting kept items only. */
@@ -19,7 +19,7 @@ Return DENY only for a clear security conflict or clearly excessive/unrequested
Return DEFER whenever intent, effects, or required evidence are ambiguous, when reasonable interpretations differ, or when the target of an operation cannot be established from the evidence.
You must always finish with exactly one report_verdict tool call, never with prose.`;
export const REPORT_VERDICT_TOOL: Tool = {
const REPORT_VERDICT_TOOL: Tool = {
name: REPORT_VERDICT_TOOL_NAME,
description:
"Report the advisory authorization verdict. This tool has no side effects.",
@@ -18,11 +18,9 @@
"@gotgenes/pi-permission-system"
],
"peerDependencies": {
"@earendil-works/pi-ai": "*",
"@earendil-works/pi-coding-agent": "*"
},
"devDependencies": {
"@earendil-works/pi-ai": "*",
"@earendil-works/pi-coding-agent": "*",
"@types/node": "^26.0.0",
"typescript": "^5",
@@ -37,7 +37,7 @@ function isNonBlank(value: unknown): value is string {
}
/** Read a complete direct native-Bash ask from the structured prompt payload. */
export function extractBashCommandEvidence(
function extractBashCommandEvidence(
details: PromptPermissionDetails,
): BashCommandEvidence | undefined {
const payload = details.payload;
+312 -3
View File
@@ -210,6 +210,10 @@ importers:
'@gotgenes/pi-permission-system':
specifier: ^25.4.0
version: 25.4.0(@earendil-works/pi-coding-agent@0.84.1)(@earendil-works/pi-tui@0.84.1)
devDependencies:
fallow:
specifier: ^3.17.0
version: 3.17.0
packages/pi-permission-ai-judge:
devDependencies:
@@ -238,9 +242,6 @@ importers:
specifier: ^25.4.0
version: 25.4.0(@earendil-works/pi-coding-agent@0.84.1)(@earendil-works/pi-tui@0.84.1)
devDependencies:
'@earendil-works/pi-ai':
specifier: '*'
version: 0.84.1(ws@8.21.2)(zod@4.4.3)
'@earendil-works/pi-coding-agent':
specifier: '*'
version: 0.84.1(ws@8.21.2)(zod@4.4.3)
@@ -552,6 +553,46 @@ packages:
cpu: [x64]
os: [win32]
'@fallow-cli/darwin-arm64@3.17.0':
resolution: {integrity: sha512-u9O4aQaTSdaZaa4MAVEZEiwOx6QQzChymyQPrxV6KvDcVbcl0oYSekJKdvN4gEqUY8ClMze9gWS1tbn/W3N4dQ==}
cpu: [arm64]
os: [darwin]
'@fallow-cli/darwin-x64@3.17.0':
resolution: {integrity: sha512-l3tZJovnCa8j+im4qTl4GVSfrx4gisJYeHDwb5TbcdTGaWYz42gHriAaz5MhOR8S24q3xRegX8QrI8PA4XXU4g==}
cpu: [x64]
os: [darwin]
'@fallow-cli/linux-arm64-gnu@3.17.0':
resolution: {integrity: sha512-IAjS6qR4tHcRo1y5lzYT6mktN/ATPyPNrJ6yjwTORwwQV1YfMO58A5zGBfJlPBY+lUmaMZ9w37ftvH9a2AS4dQ==}
cpu: [arm64]
os: [linux]
'@fallow-cli/linux-arm64-musl@3.17.0':
resolution: {integrity: sha512-Oe1dvk5Wt5Bmnxfc6HufJTaFY9SEwDVrZpnSdVQlv+nvz7DzrTK1r91cR3Ip477ANSLa9XD/MHPMpfqqo0dlZg==}
cpu: [arm64]
os: [linux]
'@fallow-cli/linux-x64-gnu@3.17.0':
resolution: {integrity: sha512-XgLU2a51zuky7gifjVDHuiJGToAReDsVCDcyDF84TQz/h3bqO0iRkpDL8dh7+HODku84+EffpK5ZHY19n6Ij0w==}
cpu: [x64]
os: [linux]
'@fallow-cli/linux-x64-musl@3.17.0':
resolution: {integrity: sha512-GnDZx2kbLKKdYAp05NSKv6CZHgzEKvhRd0btCKFMMpUEhdzmr4uh2Qb4UzKDBg/q2r1EhkzN4b/qC+tbFCmtwA==}
cpu: [x64]
os: [linux]
'@fallow-cli/win32-arm64-msvc@3.17.0':
resolution: {integrity: sha512-u9n5WzPuKuC1PKegKQknWtngAUJ2szQaRXsbY54s7UMqeFNyC+W04LV5D+sEZywU7L0kzL+Kck9LxFLXBQcgvA==}
cpu: [arm64]
os: [win32]
'@fallow-cli/win32-x64-msvc@3.17.0':
resolution: {integrity: sha512-/OcyxHuCKabzQ9hKIjM/CFJ9fr30n0Mw5MK6nzi5rn26mbYUgh073UZq4FONOpPJ/FqHtC726rxpgBtR4qS+gg==}
cpu: [x64]
os: [win32]
'@google/genai@1.52.0':
resolution: {integrity: sha512-gwSvbpiN/17O9TbsqSsE/OzZcpv5Fo4RQjdngGgogtuB9RsyJ8ZHhX5KjHj1bp5N9snN2eK8LDGXSaWW2hof8Q==}
engines: {node: '>=20.0.0'}
@@ -885,6 +926,126 @@ packages:
'@types/retry@0.12.0':
resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==}
'@typescript/typescript-aix-ppc64@7.0.2':
resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==}
engines: {node: '>=16.20.0'}
cpu: [ppc64]
os: [aix]
'@typescript/typescript-darwin-arm64@7.0.2':
resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [darwin]
'@typescript/typescript-darwin-x64@7.0.2':
resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [darwin]
'@typescript/typescript-freebsd-arm64@7.0.2':
resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [freebsd]
'@typescript/typescript-freebsd-x64@7.0.2':
resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [freebsd]
'@typescript/typescript-linux-arm64@7.0.2':
resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [linux]
'@typescript/typescript-linux-arm@7.0.2':
resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==}
engines: {node: '>=16.20.0'}
cpu: [arm]
os: [linux]
'@typescript/typescript-linux-loong64@7.0.2':
resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==}
engines: {node: '>=16.20.0'}
cpu: [loong64]
os: [linux]
'@typescript/typescript-linux-mips64el@7.0.2':
resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==}
engines: {node: '>=16.20.0'}
cpu: [mips64el]
os: [linux]
'@typescript/typescript-linux-ppc64@7.0.2':
resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==}
engines: {node: '>=16.20.0'}
cpu: [ppc64]
os: [linux]
'@typescript/typescript-linux-riscv64@7.0.2':
resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==}
engines: {node: '>=16.20.0'}
cpu: [riscv64]
os: [linux]
'@typescript/typescript-linux-s390x@7.0.2':
resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==}
engines: {node: '>=16.20.0'}
cpu: [s390x]
os: [linux]
'@typescript/typescript-linux-x64@7.0.2':
resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [linux]
'@typescript/typescript-netbsd-arm64@7.0.2':
resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [netbsd]
'@typescript/typescript-netbsd-x64@7.0.2':
resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [netbsd]
'@typescript/typescript-openbsd-arm64@7.0.2':
resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [openbsd]
'@typescript/typescript-openbsd-x64@7.0.2':
resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [openbsd]
'@typescript/typescript-sunos-x64@7.0.2':
resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [sunos]
'@typescript/typescript-win32-arm64@7.0.2':
resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [win32]
'@typescript/typescript-win32-x64@7.0.2':
resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [win32]
'@vitest/expect@3.2.7':
resolution: {integrity: sha512-E8eBXaKibuvH2pSZErOjdVb5vF4PbKYcrnluBTYxEk1l/VhhwZg1kZQsdtjq+CsF5CFydf2Rdkz7jDHKSisi3w==}
@@ -979,6 +1140,10 @@ packages:
resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==}
engines: {node: '>=6'}
detect-libc@2.1.2:
resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==}
engines: {node: '>=8'}
diff@8.0.4:
resolution: {integrity: sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==}
engines: {node: '>=0.3.1'}
@@ -1004,6 +1169,16 @@ packages:
extend@3.0.2:
resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}
fallow-type-aware@3.17.0:
resolution: {integrity: sha512-DFtZUK5oqP56tSsrBWPzjrTIwPPxwlBV8QoSaGghMru347Nqj8ZBY6u9HFa/TIPcxvFU/zIZMRF8xS/XAWQTzg==}
engines: {node: '>=20'}
hasBin: true
fallow@3.17.0:
resolution: {integrity: sha512-tbLuvsPq3I2CzpoF/9MgSQ7hWzOqlj3avFUAmCr1J9OERE6z714SlDmA38NVvNy/zuK/70utXB3/b33xC9z29g==}
engines: {node: '>=22'}
hasBin: true
fdir@6.5.0:
resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==}
engines: {node: '>=12.0.0'}
@@ -1294,6 +1469,11 @@ packages:
engines: {node: '>=14.17'}
hasBin: true
typescript@7.0.2:
resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==}
engines: {node: '>=16.20.0'}
hasBin: true
undici-types@8.3.0:
resolution: {integrity: sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==}
@@ -1804,6 +1984,30 @@ snapshots:
'@esbuild/win32-x64@0.28.1':
optional: true
'@fallow-cli/darwin-arm64@3.17.0':
optional: true
'@fallow-cli/darwin-x64@3.17.0':
optional: true
'@fallow-cli/linux-arm64-gnu@3.17.0':
optional: true
'@fallow-cli/linux-arm64-musl@3.17.0':
optional: true
'@fallow-cli/linux-x64-gnu@3.17.0':
optional: true
'@fallow-cli/linux-x64-musl@3.17.0':
optional: true
'@fallow-cli/win32-arm64-msvc@3.17.0':
optional: true
'@fallow-cli/win32-x64-msvc@3.17.0':
optional: true
'@google/genai@1.52.0':
dependencies:
google-auth-library: 10.9.1
@@ -2055,6 +2259,66 @@ snapshots:
'@types/retry@0.12.0': {}
'@typescript/typescript-aix-ppc64@7.0.2':
optional: true
'@typescript/typescript-darwin-arm64@7.0.2':
optional: true
'@typescript/typescript-darwin-x64@7.0.2':
optional: true
'@typescript/typescript-freebsd-arm64@7.0.2':
optional: true
'@typescript/typescript-freebsd-x64@7.0.2':
optional: true
'@typescript/typescript-linux-arm64@7.0.2':
optional: true
'@typescript/typescript-linux-arm@7.0.2':
optional: true
'@typescript/typescript-linux-loong64@7.0.2':
optional: true
'@typescript/typescript-linux-mips64el@7.0.2':
optional: true
'@typescript/typescript-linux-ppc64@7.0.2':
optional: true
'@typescript/typescript-linux-riscv64@7.0.2':
optional: true
'@typescript/typescript-linux-s390x@7.0.2':
optional: true
'@typescript/typescript-linux-x64@7.0.2':
optional: true
'@typescript/typescript-netbsd-arm64@7.0.2':
optional: true
'@typescript/typescript-netbsd-x64@7.0.2':
optional: true
'@typescript/typescript-openbsd-arm64@7.0.2':
optional: true
'@typescript/typescript-openbsd-x64@7.0.2':
optional: true
'@typescript/typescript-sunos-x64@7.0.2':
optional: true
'@typescript/typescript-win32-arm64@7.0.2':
optional: true
'@typescript/typescript-win32-x64@7.0.2':
optional: true
'@vitest/expect@3.2.7':
dependencies:
'@types/chai': 5.2.3
@@ -2143,6 +2407,8 @@ snapshots:
deep-eql@5.0.2: {}
detect-libc@2.1.2: {}
diff@8.0.4: {}
ecdsa-sig-formatter@1.0.11:
@@ -2188,6 +2454,25 @@ snapshots:
extend@3.0.2: {}
fallow-type-aware@3.17.0:
dependencies:
typescript: 7.0.2
optional: true
fallow@3.17.0:
dependencies:
detect-libc: 2.1.2
optionalDependencies:
'@fallow-cli/darwin-arm64': 3.17.0
'@fallow-cli/darwin-x64': 3.17.0
'@fallow-cli/linux-arm64-gnu': 3.17.0
'@fallow-cli/linux-arm64-musl': 3.17.0
'@fallow-cli/linux-x64-gnu': 3.17.0
'@fallow-cli/linux-x64-musl': 3.17.0
'@fallow-cli/win32-arm64-msvc': 3.17.0
'@fallow-cli/win32-x64-msvc': 3.17.0
fallow-type-aware: 3.17.0
fdir@6.5.0(picomatch@4.0.5):
optionalDependencies:
picomatch: 4.0.5
@@ -2468,6 +2753,30 @@ snapshots:
typescript@5.9.3: {}
typescript@7.0.2:
optionalDependencies:
'@typescript/typescript-aix-ppc64': 7.0.2
'@typescript/typescript-darwin-arm64': 7.0.2
'@typescript/typescript-darwin-x64': 7.0.2
'@typescript/typescript-freebsd-arm64': 7.0.2
'@typescript/typescript-freebsd-x64': 7.0.2
'@typescript/typescript-linux-arm': 7.0.2
'@typescript/typescript-linux-arm64': 7.0.2
'@typescript/typescript-linux-loong64': 7.0.2
'@typescript/typescript-linux-mips64el': 7.0.2
'@typescript/typescript-linux-ppc64': 7.0.2
'@typescript/typescript-linux-riscv64': 7.0.2
'@typescript/typescript-linux-s390x': 7.0.2
'@typescript/typescript-linux-x64': 7.0.2
'@typescript/typescript-netbsd-arm64': 7.0.2
'@typescript/typescript-netbsd-x64': 7.0.2
'@typescript/typescript-openbsd-arm64': 7.0.2
'@typescript/typescript-openbsd-x64': 7.0.2
'@typescript/typescript-sunos-x64': 7.0.2
'@typescript/typescript-win32-arm64': 7.0.2
'@typescript/typescript-win32-x64': 7.0.2
optional: true
undici-types@8.3.0: {}
undici@8.9.0: {}