You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This content was written by an AI agent and must be verified by a human developer. After human verification, this alert may be removed.
Summary
crates/graphcal-package/src/lib.rs is 2785 non-test lines (4158 total; the test module starts at line 2785) covering six unrelated responsibilities at different abstraction layers.
Prefer small modules with a single, atomic responsibility over broad domain grab-bags. Two concepts belonging to the same user-facing domain is not enough reason to implement them in the same file; they should also live at the same abstraction layer and have a real implementation dependency.
Items 2 and 5-6 in particular are separate layers: URL syntax has no implementation dependency on lock-graph semantics.
Note on quality
The contents are of high quality and this is a packaging concern, not a correctness one. For the record, the Git URL parser rejects credentials, control characters, backslashes, query/fragment, %2f/%2e path smuggling, option-shaped (--leading) components, and every scheme except https/ssh — and the repository never shells out to git (it uses gix; the only Command::new anywhere in crates/ is the opt-in Lean conformance oracle).
Suggested fix
Split into focused modules, re-exporting from lib.rs so the public API is unchanged:
names.rs — the validated name newtypes
git_url.rs — GitUrl, GitTransport, GitUrlError and the parsers
Pairs naturally with centralizing this crate's url dependency into [workspace.dependencies].
Provenance
Found during a full-workspace code review at 6e462341a (v0.0.1-alpha.27). Baseline at that commit: cargo clippy --workspace --all-targets clean, cargo test --workspace 2926 passed / 0 failed, cargo deny check advisories ok.
Warning
This content was written by an AI agent and must be verified by a human developer. After human verification, this alert may be removed.
Summary
crates/graphcal-package/src/lib.rsis 2785 non-test lines (4158 total; the test module starts at line 2785) covering six unrelated responsibilities at different abstraction layers.What is in the file
PackageName,DependencyName,PackageInstanceId,GitCommitHash,Sha256Digest(lines ~29-378)ssh:/// scp-like, with its own error taxonomy (lines ~59-108, 382-707, ~230 lines of parsing)PackageSourceDirectory,PluginArtifactPath(lines ~109-218, 1356-1429)PluginFuelBudget,PluginFunctionName,PluginFunctionSelector,PluginExecutionPolicy(lines ~732-875)parse_manifest_strand ~10 helpers (lines ~877-1292)Lockfile,ValidatedLockfile, DFS cycle detection, cross-manifest validation (lines ~1293-2784)Why this is a finding
AGENTS.mdasks for the opposite:Items 2 and 5-6 in particular are separate layers: URL syntax has no implementation dependency on lock-graph semantics.
Note on quality
The contents are of high quality and this is a packaging concern, not a correctness one. For the record, the Git URL parser rejects credentials, control characters, backslashes, query/fragment,
%2f/%2epath smuggling, option-shaped (--leading) components, and every scheme excepthttps/ssh— and the repository never shells out togit(it usesgix; the onlyCommand::newanywhere incrates/is the opt-in Lean conformance oracle).Suggested fix
Split into focused modules, re-exporting from
lib.rsso the public API is unchanged:names.rs— the validated name newtypesgit_url.rs—GitUrl,GitTransport,GitUrlErrorand the parserspaths.rs—PackageSourceDirectory,PluginArtifactPathplugin_policy.rs— fuel budget, function name/selector, execution policymanifest.rs—PackageManifestand TOML parsinglockfile.rs—Lockfile, validation, cycle detectionPairs naturally with centralizing this crate's
urldependency into[workspace.dependencies].Provenance
Found during a full-workspace code review at
6e462341a(v0.0.1-alpha.27). Baseline at that commit:cargo clippy --workspace --all-targetsclean,cargo test --workspace2926 passed / 0 failed,cargo deny check advisoriesok.