-
Notifications
You must be signed in to change notification settings - Fork 6
feat(signing): add opt-in isolated-worktree exact-tree typecheck verification (S3b Part 2b) #503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3f96225
feat(signing): add opt-in isolated-worktree exact-tree typecheck veri…
qnbs feb8504
fix(signing): replace live node_modules reuse with real pnpm material…
qnbs 3f952e5
fix(signing): harden exact-tree install against scripts, corepack, an…
qnbs b09591f
test(signing): add bare-call regressions for the exact-tree lifecycle…
qnbs 41816ad
fix: refuse tracked node_modules and disable hooks in exact-tree veri…
qnbs 7a173fd
fix: match node_modules case-insensitively in tracked-tree refusal
qnbs c19e801
fix: gate compiler trust and pnpm output paths, propagate interruption
qnbs f796bf4
fix: neutralize checkout filters, escaping symlinks, and prune interr…
qnbs b3d8ab5
fix: close compiler-configuration weaponization and replace-ref gaps
qnbs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| import type { DependencyState, TreeEntry } from './dependency-state.d.mts'; | ||
| import type { BoundedResult } from './hooks/shared.d.mts'; | ||
| import type { GitOptions, GitResult } from './signing/signing-core.d.mts'; | ||
|
|
||
| // QNBS-v3: absolute correctness check, not a comparison -- distinct vocabulary from WorkingTreeState. | ||
| export type ExactTreeState = 'PASS' | 'FAIL' | 'NOT_APPLICABLE' | 'UNKNOWN'; | ||
|
|
||
| export interface VerifyExactTreeDependencies { | ||
| runBounded?: ( | ||
| command: string, | ||
| args: string[], | ||
| options?: { | ||
| timeoutMs?: number; | ||
| cwd?: string; | ||
| env?: NodeJS.ProcessEnv; | ||
| input?: string; | ||
| shell?: boolean; | ||
| root?: string; | ||
| detached?: boolean; | ||
| }, | ||
| ) => Promise<BoundedResult>; | ||
| runLocalBinaryDetailed?: ( | ||
| binary: string, | ||
| args: string[], | ||
| options?: { root?: string; cwd?: string; timeoutMs?: number }, | ||
| ) => Promise<BoundedResult>; | ||
| // QNBS-v3: a distinct, pre-existing (#494) synchronous/output-capturing wrapper -- not BoundedResult. | ||
| runGit?: (args: string[], options?: GitOptions) => GitResult; | ||
| mkdtempFn?: () => Promise<string>; | ||
| // QNBS-v3: a separate temp dir authority from mkdtempFn -- distinct lifecycle (hooks dir vs. worktree dir). | ||
| mkdtempHooksFn?: () => Promise<string>; | ||
| rmFn?: (path: string) => Promise<void>; | ||
| installTimeoutMs?: number; | ||
| tsgoArgs?: string[]; | ||
| tsgoTimeoutMs?: number; | ||
| repoRoot?: string; | ||
| // QNBS-v3: reuses dependency-state.mjs's mode-aware git-tree enumeration authority -- not a second parser. | ||
| listTreeEntries?: (sha: string, cwd: string) => TreeEntry[] | null; | ||
| // QNBS-v3: reuses dependency-state.mjs's git-object blob reader for symlink/.gitattributes content. | ||
| readBlobAtRef?: (sha: string, relativePath: string, cwd: string) => Buffer | null; | ||
| // QNBS-v3: checks any scope (local/global/system) for a tracked .gitattributes filter name. | ||
| isFilterConfigured?: (name: string, repoRoot: string) => boolean; | ||
| // QNBS-v3: reuses #502's manifest-compatibility authority to gate which tsgo binary may be trusted. | ||
| computeDependencyState?: (sha: string, root: string) => DependencyState; | ||
| // QNBS-v3: the trusted checkout installDependencies resolves the pinned store-dir from -- never the worktree. | ||
| trustedRepoRoot?: string; | ||
| // QNBS-v3: bypasses the real `pnpm store path` query in tests; undefined means "resolve it for real". | ||
| storeDir?: string | null; | ||
| resolveStoreDir?: (trustedRepoRoot: string | undefined) => Promise<string | null> | string | null; | ||
| } | ||
|
|
||
| export function createIsolatedWorktree( | ||
| sha: string, | ||
| repoRoot: string, | ||
| dependencies?: VerifyExactTreeDependencies, | ||
|
qnbs marked this conversation as resolved.
|
||
| ): Promise<{ ok: boolean; path: string | undefined; interrupted?: boolean }>; | ||
|
|
||
| export function removeIsolatedWorktree( | ||
| worktreePath: string | undefined, | ||
| repoRoot: string, | ||
| dependencies?: VerifyExactTreeDependencies, | ||
| ): Promise<void>; | ||
|
|
||
| export function installDependencies( | ||
| worktreePath: string, | ||
| dependencies?: VerifyExactTreeDependencies, | ||
| ): Promise<boolean>; | ||
|
|
||
| export function verifyExactTreeTypecheck( | ||
| sha: string, | ||
| repoRoot?: string, | ||
| dependencies?: VerifyExactTreeDependencies, | ||
| ): Promise<ExactTreeState>; | ||
|
|
||
| export function verifyExactTreeForShas( | ||
| shas: string[], | ||
| repoRoot?: string, | ||
| dependencies?: VerifyExactTreeDependencies, | ||
| ): Promise<ExactTreeState>; | ||
|
|
||
| export function resolveRef( | ||
| ref: string, | ||
| repoRoot: string, | ||
| dependencies?: VerifyExactTreeDependencies, | ||
| ): string | null; | ||
|
|
||
| export function main(argv?: string[], dependencies?: VerifyExactTreeDependencies): Promise<void>; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.