feat(package): resolve git: sources #330
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/322-git-sources"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task
Loop stage IMPLEMENT for #322: resolve
git:sources in the package manager (split from #27), following the designdecided in the refinement comment of the issue.
What and why
compiler/src/package/git.trb, new): asource "...", git: "<url>", revision: "<rev>"line is fetchedwith the
gitexecutable (TORB_GITnames another one) viaProcess.runBlocking, in a scratch directory under thecache that is removed afterwards:
init,fetch --depth 1 -- <repo> <rev>, and where that fails (a short commit id)a fetch of every branch and tag and
rev-parse --verify -q <rev>^{commit}; thenrev-parse FETCH_HEAD^{commit}andcheckout -q --detach. The package files are checked like an archive's (file limit,pathProblem, UTF-8), hashedwith
treeHashand installed content-addressed. The fetchedproject.trbmust name thesourcepackage.lock.trb):package "<name>", git: "<url>"[, ref: "<rev>"], revision: "<commit>", hash: "sha256:...";ref:only where the revision is not a full commit id (refOf,isCommitId). An older lock has no such row andreads unchanged.
add,remove,vendorandupdate <names>keep the locked commit of every othergit:package whose
sourceline still names the same URL and revision; plainupdatemoves them all. A locked tree inthe cache runs no
git, and--offlinenever does.git:tree at the locked commit and refuses a tree of another hash.workspace.trb): agit:row whose URL or revision is not thesourceline's, or whose repository nosourceline names, is a lock problem withrun torb update; a missing tree saysrun torb install.vendorleavesgit:packages in place,publishrefuses a package with agit:dependency,auditskips them.project, PROJECT.md sections 7 and 11 "As built",RELEASE.md;
skills/regenerated.Deviations from the refinement comment
GIT_TERMINAL_PROMPT=0:std/processhas no environment option, so it cannot be set.gitonly promptswhere it has a terminal; in CI and other non-interactive runs a private repository fails instead of hanging.
packageFiles: the.trbfiles plusREADME.md/LICENSE*/COPYING*besideproject.trb), not the whole checkout: other files of a repository (binary assets, CI config) neither break the UTF-8install nor change the hash, and the tree hash equals that of an archive of the same files.
--offlinenever runsgit, not even for afile:URL.Test
torb check compiler(nightly 2026-10-11): 388 files, no problems;torb format --checkon every touched.trb.compiler/tests/packages.test.trb: lock rows,refOf/isCommitId, the build/lock mismatches, and a new group"Sources from git" against throwaway repositories made with
git(tag, branch, full and short commit; a keptcommit after its branch moved; a hash mismatch; warm cache and
--offlinerun no git; missing program, revision,-revision, empty revision; symlink). The group skips where nogitis installed.tools/packages.sh: newtests/packages/git-appfixture; the script makes the repository withgitat a fixedauthor and date (stable commit id), then lock, run,
lock --check, a revision mismatch, a missing revision, a namemismatch,
install --offlinerefused andinstallat the locked commit. No network.Closes #322
git:sources #322Review of
3c9cdfd(CI green on this head).Checklist: tests ok (lock rows,
refOf/isCommitId, build/lock mismatches, "Sources from git" group with local repositories,tools/packages.shfixture, no network) · correctness ok (revision is passed after--, a leading-is refused, scratch directory always removed, locked commit wins over a moved tag, hash mismatch names both hashes, symlinks refused) · scope = #322 and its refinement, deviations are stated with reasons · security ok (no secrets, no new permissions,--offlinenever runsgit) · data ok (old locks read unchanged) · docs ok (tooling docs, PROJECT.md, RELEASE.md,skills/regenerated) · no boundary change.Findings
[blocker]Not mergeable.mainmoved toe1d13b0after this branch forked (merge basef8f41d4) and now containsfeat(package): resolve and lock two majors of one package(plus runtime/conformance commits). That commit touches the same files as this PR:compiler/src/cli/packages.trb,package/lock.trb,package/publish.trb,project/workspace.trb,compiler/tests/packages.test.trb,docs/design/PROJECT.md,docs/design/RELEASE.md. The API reportsmergeable: false, so the PR cannot be merged as is. Because the resolver and lock code changed underneath (resolved,lockedVersions, lock rows), the green CI on this head does not show that the merged result builds and passes. Please rebase onto currentmain(linear history), resolve the conflicts, regenerateskills/if the docs changed, and let CI run on the new head.Non-blocking
[suggestion]The refined acceptance criteria in #322 listdocs/how-to/add-a-dependency.md; it is not touched here and does not mentiongit:. Add a shortgit:example when you rebase, or open a follow-up issue.The code itself looks fine; once it is rebased and CI is green again I expect to approve.
3c9cdfd01be65af84525Rebased onto current
main(e1d13b0) as 3 commits plus one new, linear history; new heade65af84. Conflicts were incli/packages.trb(lockedVersions/resolvednow take the per-majorList<Version>preference from #323 together with thecommitsargument),tests/packages.test.trb(header comment) anddocs/design/RELEASE.md(both built-dates kept). Also added agit:step todocs/how-to/add-a-dependency.md(and itsskills/copy), as suggested.pdiscstamp/index/check ok. CI on the new head will run now; re-requesting review.Re-review of
e65af84(earlier finding: not mergeable; the three rebased commits are otherwise unchanged in substance and the code looked fine in round 1).Findings
[blocker]Not mergeable again.mainmoved frome1d13b0to8e03e22(feat(package): record the variables a manifest read in the lock, its docs and an env-fixture fix). It touches files this PR also changes:compiler/src/cli/packages.trb,package/lock.trb,compiler/tests/packages.test.trb,tests/packages/transcript.expected,tools/packages.sh,docs/design/PROJECT.md,docs/tooling/project-lock-trb.md(+ itsskills/copy). The API reportsmergeable: false. The lock row format is the shared point: the new "variables a manifest read" rows and thegit:rows must be written and read together. Please rebase onto currentmain(linear history), resolve the conflicts, regenerateskills/, runpdisc, and let CI run on the new head.[blocker]CI is red on this head:ci / tier A (linux-x64)(failing after 4m21s),ci / gates, andpdisc / pdisc. I cannot read the job logs with my token, so I do not know the cause; tier A may be a real failure from the merge of thecommits/per-major changes or from thetranscript.expected/tools/packages.shadditions, and pdisc may be a stale stamp or INDEX. Please check both after the rebase; if they stay red on the new head, name the cause in the PR.No further code findings so far; I will re-check only the conflict resolution and whatever the CI failures turn out to be. Once rebased and CI is green I expect to approve.
e65af84525b964420e7aRebased again onto current
main(8e03e22), linear history, new headb964420. Conflicts:compiler/tests/packages.test.trb(imports:refOf, isCommitIdandReadVariableboth kept),tools/packages.shandtests/packages/transcript.expected(thesources/env-1.0.0steps and thegit-appsteps both kept, env first). CI red cause one65af84:pdisc / pdiscwas a.pdisc-sidecar.yamlentry fordocs/how-to/add-a-dependency.md, which is out of pdisc scope (has its own frontmatter); removed,pdisc.py checkis ok locally. Thegatesandtier Afailures were on the stale rebase; I cannot read those logs either, so I will check them on the new head and name the cause here if they stay red.b964420e7ad679af0effRe-review of
d679af0(earlier blockers: not mergeable, red CI).Checks
mergeable: true, linear history on currentmain.git:rows and the manifest-variable rows (imports, transcript andtools/packages.shsteps kept together); the out-of-scope pdisc sidecar entry is removed.git:example indocs/how-to/add-a-dependency.md): done, with itsskills/copy.Round 1 findings on the code stand resolved: scope = #322, tests cover the resolver, lock rows, mismatches and the offline paths without network, revision is passed after
--, scratch dir always removed, symlinks refused, no secrets or new permissions, old locks read unchanged, docs updated.Approving and merging by rebase.
git:sources #322