Repository navigation
Add M-Team own torrent lists and publish releases on merge (v0.4.0-alpha.1) - #32
Merged
Merged
Conversation
Add a generic account.torrents.read capability with an AccountTorrentLister port and a `site torrents` command that reads one page of the account's seeding, leeching, completed, incomplete, or uploaded list. The M-Team adapter reads the account ID from member/profile and then one page of member/getUserTorrentList on one client. Each row reports bytes actually transferred from exactly one source, named by traffic_scope: the snatch record (account_total) or the running peer (current_session). The peer's addresses, peer ID, and client name are never decoded. A missing list or an unrecognized row fails the whole page. The sitetest suite checks the new port's cancellation and query validation. Docs record why messages (the API refuses an API key) and RSS (rotating signed links) stay unsupported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agents dispatch on kind and treat an unlisted one as unsupported, so the automation contract must name every kind jsonKind returns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The release workflow now runs on every push to main. A plan step skips any commit whose VERSION is already tagged on an earlier commit; a new VERSION must be newer than every v* tag and have a CHANGELOG.md section. The publish step creates the annotated tag, uploads the tested assets to a draft, rechecks the tag, and only then makes the release public, so a failure leaves at most the tag and an unpublished draft. PR CI fails when VERSION has no CHANGELOG.md section. VERSION becomes v0.4.0-alpha.1, the first published release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tonycoder-hub
added a commit
that referenced
this pull request
Oct 23, 2026
Add M-Team own torrent lists and publish releases on merge (v0.4.0-alpha.1)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a generic
account.torrents.readcapability and asite torrentscommand, implemented for M-Team, that reads one page of the account's own seeding, leeching, completed, incomplete, or uploaded list.Port:
site.AccountTorrentListerwithValidateAccountTorrentQuery(runs before any credential is read) andAccountTorrents. TJUPT can implement it later without CLI changes.M-Team:
POST member/profilefor the account ID, thenPOST member/getUserTorrentList({"userid","type","pageNumber","pageSize":50}) on one client, three seconds apart. The account ID is never printed.Traffic scope: each row's traffic comes from exactly one source, named by
traffic_scope:account_total: the snatch record (uploadedReal/downloadedReal), the account's whole history;current_session: the running peer's report.A live check showed the seeding list carries only the peer, while the completed list carries the snatch record. Mixing them in one field would have misled scripts, so the two are never combined in one row. Seed time comes only from the snatch record, in seconds.
Privacy: the peer's IP/IPv6, peer ID, and client name are in the API answer but are never decoded (the fixture marks them
PEER-SECRETand the test asserts they cannot reach JSON).Fail closed: a missing list or any unrecognized row fails the whole page. A repeated torrent is kept once.
Deliberate output changes
account.torrents.read: M-Team now declares 9 capabilities, sosite listandsite capabilities mteam(table and JSON) gain one entry. Goldens are updated.site torrents [--cookie-stdin | --api-key-stdin] [--state …] [--page N] [--output table|json] SITE, with a new usage line in help.site.account.torrent.list.sitetestgains a cancellation check for the new port and anaccount.torrents.read/queryvalidation subtest.No existing command's output, stop reasons, error text, or exit codes change.
Not supported, documented
msg/searchanswers code 401 ("Full authentication is required") to an API key. Only two counter endpoints answer, and their meaning cannot be checked against readable messages.Release process: publish on merge (first release v0.4.0-alpha.1)
The tag-pushed, draft-only release workflow becomes a merge-triggered one. Merging this PR publishes
v0.4.0-alpha.1, the first GitHub Release.Trigger:
releaseruns on every push tomain(and on manual runs onmain). Itsplanstep readsVERSIONat the commit:v*tag and have a non-empty## <VERSION>section inCHANGELOG.md, else the run fails;Publish order (
release.py publish), stopping at the first failure:-version, latest otherwise.A failure leaves at most the tag and an unpublished draft, never a public release with missing assets.
PR CI:
identitynow fails whenVERSIONhas noCHANGELOG.mdsection.Permissions: unchanged:
contents: read, withcontents: writeonly on the final job, usingGITHUB_TOKEN.Files:
VERSION→v0.4.0-alpha.1;CHANGELOG.md;scripts/release.py:check-tag/create-draft→plan/publish;.github/workflows/release.yml;docs/RELEASING.mdrewritten, plus README install (Releases,@v0.4.0-alpha.1), docs index, quickstart, and CONTRIBUTING.Test plan
gofmt,go vet ./...,go test -race ./...,go build -trimpath ./cmd/ptctlpython -m unittest discover -s scripts/tests, 18 tests:planin a real temporary git repo: new, already-tagged, rerun, older, off-main, changed workflows;publishagainst a stateful fake GitHub: tag then draft then upload then publish last, tag reuse, tag on another commit, existing release, partial upload, tag moved during upload.planon this branch in a clone with the real tags (v0.1.0-alpha.1,v0.2.0-alpha.1):release=true,v0.4.0-alpha.1Unit tests: request bodies, every state and page, query validation, fail-closed parsing, traffic-scope precedence, foreign credentials, CLI table/JSON goldens, empty list, public-error redaction
Live (throwaway HOME, saved key via
site login --api-key-stdin), 2026-10-16 and 2026-10-17:sessionrows, later empty;account_totalrows with seed time.Exit 0 every time, and no output held the key or a peer address.
🤖 Generated with Claude Code