archive: lead with methods for tar and extract (slice of #146) #177
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Goal
std/archiveis used as methods:entries.tarred(),bytes.untarred(),entries.extract(into:, stripComponents:).Part of #146 (methods are the preferred API style; owner direction 2026-10-06, first applied in #96 as
Digest.equalsConstantTimewithconstantTimeEqualkept as a thin wrapper). This slice follows exactly that pattern.Functions in scope
tarredandextract(receiverList<TarEntry>),untarred(receiverBytes) instd/archive.Source (pinned record)
usethe method like any member. If anextendwithout a trait on a type of another package turns out not to work instd/, stop and re-plan instead of working around it.Acceptance criteria
std/archiveprovidesList<TarEntry>.tarred(),Bytes.untarred()andList<TarEntry>.extract(into:, stripComponents: = 0)with the current result typesstd/archivetar, extract and real-archive test files): method result equals free function result on the existing vectors, including the error cases (bad header, path escape inextract)deprecatedhere (the deprecation path is an open owner decision on #146).docs/standard-library/leads with the method in every example; the wrapper is listed as the older spelling. Examples are checked withtrb check;skills/is regenerated.compiler/srcandtools/keep calling the wrapper).Seed
No. Ordinary TorbScript in
std/only: no syntax change, no new native, no driver flag, no std name the compiler looks up by string. If that turns out wrong, stop and re-plan (two commits, seed refresh).Size
One PR, one Conventional Commit (
refactor(<module>): ...orfeat(<module>): ...), tests and docs in the same commit.Dependencies
Tracking epic: #146. No other dependency; independent of the other module slices.
[loop:torbscript] scope update from the owner decision on #146 (torben, 2026-10-08): the free functions covered by this slice are removed in the same PR that adds the methods, not kept as wrappers and not marked
deprecated. Migrate every caller in the repo (std, tests, examples, docs) to the method in the same PR. No lint migration rule needed.[loop:torbscript] claim implement by session:loop-torbscript-20261008 until 2026-10-08T15:30:00Z
[loop:torbscript] implement: PR #185 is open (
Closes #177, branchloop/177-archive-methods,5053c8c8).List<TarEntry>.tarred(),Bytes.untarred()andList<TarEntry>.extract(into:, stripComponents:)replace the free functions with no wrappers or deprecation; std, compiler, tests, docs andskills/are migrated. The methods are declared where callers import them (#182). CI on5053c8c8: tier A, bootstrap, same-C, playground, release-sync, pdisc, commit messages and the VS Code extension are green. Two earlier red runs were my own parse and doc-example slips (assert [..]and a?.untarred()chain in theextractdoc example), both fixed. Gates/pack/archives are still queued as aggregate statuses. Worker tokens: not tracked exactly, roughly 0.5M. next: review