Repository navigation
feat(flutter): identify Dart snapshot builds and inspect AOT payloads by pure APK parsing #1582
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
03d2eaf
feat(flutter): identify Dart snapshot builds by pure APK parsing
2945f50
feat(flutter): inspect Dart AOT snapshots through the ELF symbol table
ddf1269
fix(flutter): own snapshots, bound image reads, and preserve cancella…
349b212
docs(flutter): cover the Italian README with the Flutter row
b8cbea9
fix(flutter): make the ABI pattern portable for v-mode validators
e12bfbf
refactor(flutter): reuse shared harnesses and deduplicate the vertical
2207cc6
fix(flutter): address review findings from real-app verification
93db928
fix(flutter): address the Codex review findings
eeb56f9
fix(flutter): address the second Codex review round
87ac338
fix(flutter): address the third Codex review round
24d61ec
fix(flutter): address rounds three and four of the Codex review
802bb9b
fix(flutter): address the fifth Codex review round
9603ecb
fix(flutter): address the sixth Codex review round
ef79672
fix(flutter): address the seventh Codex review round
8d9fd5b
fix(flutter): address the eighth Codex review round
dbdd7fc
fix(flutter): harden streaming, sizes, and cancellation after self-re…
c6e7325
fix(flutter): require structurally parseable ELF headers for complete…
cf18c8c
fix(flutter): validate ELF and snapshot coverage
61394b6
fix(flutter): resolve review findings and CI effect checks
248ce4c
chore(flutter): resolve upstream effects-audit conflict
8b88190
chore: merge main into Flutter analysis branch
morluto 34e764d
fix(flutter): unify artifact ownership and bound ELF evidence
morluto 98707b4
chore: merge latest main into Flutter analysis branch
morluto 9089b98
fix(flutter): preserve ELF provenance and partial coverage
morluto ccfaec0
chore: merge latest main after documentation updates
morluto 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
fix(flutter): address rounds three and four of the Codex review
Round three (one missed finding) plus round four (five findings): - P2: the GNU build-id note descriptor size is decoded from all four bytes of the little-endian field, rejecting nonzero high bytes instead of masking them to 16 bits. - P1: the Flutter MCP handlers route through createContractToolHandler and the session's analysisAdmission, so close_binary and snapshot operations drain in-flight Flutter calls instead of racing them. - P2: the owned-snapshot copy is a streamed, abort-checked write (no copyFile), so cancellation stops the write promptly while the source-identity revalidation (size, mtime, inode) still guards against mid-copy replacement. - P2: identify marks any snapshot_hash_sources value other than exactly two as partial, matching the inspection path's pair requirement. - P2: the verify lane refuses to run without --apk (exit 2) instead of printing a false-green pass, and the engine check requires every libapp-carrying ABI to have a present libflutter with a valid hex build-id rather than filtering missing engines away vacuously.
- Loading branch information
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,46 +1,35 @@ | ||
| import type { EvidenceMcpServer } from "./EvidenceMcpServer.js"; | ||
| import type { EvidenceWriter } from "../application/investigation/InvestigationRecordPort.js"; | ||
| import type { ServerContext } from "@modelcontextprotocol/server"; | ||
| import { FlutterBuildAnalysisService } from "../application/flutter/FlutterBuildAnalysisService.js"; | ||
| import { toolContract } from "../contracts/toolContracts.js"; | ||
| import type { ToolContract } from "../contracts/toolContractTypes.js"; | ||
| import type { FlutterOperation } from "../domain/flutter/flutterBuildAnalysis.js"; | ||
| import type { WithAdmittedAnalysis } from "./analysisAdmission.js"; | ||
| import type { Logger } from "pino"; | ||
| import { logToolExecution } from "./toolLogging.js"; | ||
| import { createContractToolHandler } from "./contractToolHandler.js"; | ||
| import { toolRegistrationOptions } from "./toolRegistrationOptions.js"; | ||
|
|
||
| /** Bind Flutter handlers to their exact named contracts. */ | ||
| /** Bind Flutter handlers to their exact named contracts through admission. */ | ||
| export const registerFlutterTools = ( | ||
| server: EvidenceMcpServer, | ||
| service: FlutterBuildAnalysisService, | ||
| logger: Logger, | ||
| recordEvidence?: EvidenceWriter["recordEvidence"], | ||
| withAdmittedAnalysis?: WithAdmittedAnalysis, | ||
| ): void => { | ||
| const handler = (contract: ToolContract<FlutterOperation>) => { | ||
| const name = contract.name; | ||
| return async (input: unknown, context: ServerContext) => { | ||
| const result = await logToolExecution(logger, name, () => | ||
| service.execute(name, input, { signal: context.mcpReq.signal }), | ||
| ); | ||
| if (!result.ok) return server.delivery.toCallToolResult(result, contract); | ||
| const recorded = recordEvidence?.(result.value); | ||
| return server.delivery.toEvidenceToolResult( | ||
| result.value, | ||
| contract, | ||
| recorded, | ||
| ); | ||
| }; | ||
| }; | ||
| const identifyContract = toolContract("identify_flutter_build"); | ||
| server.registerTool( | ||
| identifyContract.name, | ||
| toolRegistrationOptions(identifyContract), | ||
| handler(identifyContract), | ||
| ); | ||
| const aotContract = toolContract("inspect_dart_aot"); | ||
| server.registerTool( | ||
| aotContract.name, | ||
| toolRegistrationOptions(aotContract), | ||
| handler(aotContract), | ||
| const handler = createContractToolHandler( | ||
| server, | ||
| service, | ||
| logger, | ||
| recordEvidence, | ||
| withAdmittedAnalysis, | ||
| ); | ||
| for (const contract of [ | ||
| toolContract("identify_flutter_build"), | ||
| toolContract("inspect_dart_aot"), | ||
| ] as const) { | ||
| server.registerTool( | ||
| contract.name, | ||
| toolRegistrationOptions(contract), | ||
| handler(contract), | ||
| ); | ||
| } | ||
| }; |
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.