feat: an accounting view of accepted tasks by machine and by workload #782
No Reviewers
Labels
Clear labels
accessibility
all-platforms
area:agents
area:ai
area:chain
area:ci
area:client
area:daemon
area:p2p
area:project
area:protocol
area:runtime
area:storage
bug
chore
community
dependencies
discussion
discussion/Announcements
discussion/General
discussion/Ideas
discussion/Q&A
discussion/Show and tell
discussion/answered
documentation
duplicate
enhancement
good first issue
help wanted
i18n
infra
invalid
needs:decision
needs:hardware
paired
question
research
security
status:in-review
test
testing
tracking
wontfix
Barrier affecting people with disabilities
Run every platform's packaging and checks on this pull request, not only the three main ones
MCP server, skill, and thinking on the pool
Planner and model providers
Blockchain, SISY, verification
Continuous integration and build workflows
Desktop and web clients
sisyphusd coordinator, worker, scheduler
libp2p hosts, relays, discovery, connections between nodes
Project planning, roadmap, and governance
Protobuf schemas and RPC contracts
Workload execution and environments
Content-addressed storage, IPFS, Kubo, Cluster, S3, names, pinning
Something isn't working
Repository health, templates, Discussions, contributor experience
Updates to actions, Go modules or npm packages
Migrated from GitHub Discussions
GitHub Discussions category: Announcements
GitHub Discussions category: General
GitHub Discussions category: Ideas
GitHub Discussions category: Q&A
GitHub Discussions category: Show and tell
Q&A discussion with an accepted answer
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
Translations and right-to-left layouts
Build, CI, releases
This doesn't seem right
Waits on a decision from both owners
Waits on a machine we do not have yet
Built together by both maintainers, with co-authored commits
Further information is requested
Needs investigation or a design decision
Sealing, keys, access control, tokens, the security model
Built and in an open pull request; closes when it merges
Tests, test harnesses and the rehearsal
Roadmap and meta issues
This will not be worked on
type
Feature
A request, idea, or new functionality (GitHub issue type)
type
Task
A specific piece of work (GitHub issue type)
Milestone
No items
No Milestone
Beyond V0: open network and chain
Projects
Clear projects
No projects
Sisyphus roadmap
Done
No Assignees
rvnminers-A-and-N
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Sisyphus/Sisyphus#782
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of #21.
What
An accounting view beyond job record v1: totals by machine and by workload over a span of time, as a pool API call and a CLI command with CSV export. It follows the boundary agreed on #21 and in #476: the accepted task is the unit, together with the coordinator-observed basis it was accepted on. It has no weights, prices or measured durations, and the v1 record is unchanged. This answers excho0's v1-vs-v2 question on #21 in favour of a read-only projection: no v2 section and no parameter hash.
agreementaudituncheckedcaughtcaught)Per machine: jobs, attempts, failed attempts, accepted tasks by basis, caught, outvoted.
Per workload: jobs (succeeded/failed/cancelled), tasks, attempts, failed attempts, accepted tasks by basis (each counted once), machines, and wall seconds (submit to end on the coordinator's clock, labelled as not compute time).
How
packages/accounting(new, no I/O):Events(job)gives a finished job's accepted-task events.Summarize(Input{Jobs, Range, Composite})gives the totals. A job made of jobs counts as a job, and its steps count for themselves, so the coordinator is never credited as a machine.NodeService.GetAccounting(from, to)(proto/sisyphus/v1/node.proto). It has the client role. A client admitted to the pool gets only the jobs it submitted, as withGetJob/own. The node's own key gets every job. A range whose end is not after its start isINVALID_ARGUMENT.sisyphusd accounting [--last 24h|7d|30d|<duration>] [--from DATE|RFC3339] [--to …] [--by machine|workload] [--csv]. One column table drives both the printed table and the CSV.accounting.MachineandMachineTotals(the proto comment says so). They come in throughaccounting.InputbesideJobs, so no caller changes, and each needs one entry inmachineColumnsto show up in both the table and the CSV. No mining code is included.--keep-jobs, 30 days by default). The README says so.The desktop page is the next PR. It needs a local-API (
node/v1) call and a page inapps/sisyphus, anddocs/desktop-backend.mdnow notes it as still to come.Tests
packages/accounting: each basis and who gets credited, ranges (from inclusive, to exclusive, unbounded), per-machine and per-workload totals across succeeded, failed and cancelled jobs, restored attempts with no worker, renamed machines, composite jobs, and a clock that went backwards. Coverage is 100%.apps/sisyphusd: a real pool test covering primes jobs, a graph and two clients (the node sees all, each client sees only its own, empty range refused); a real node with the CLI table,--csvand--csv --by workload, and--tobefore the job; a fake node that checks the exactfrom/tosent for--last,--fromand--to, and every error path including a failing writer.go test -race -count=5onpackages/accounting,packages/jobrecord,apps/sisyphusd/{access,api,coordinator}and the new main-package tests; the fullapps/sisyphusdpackage once with-race. All pass.gofmt -l apps packages skillsis empty, andgo vet ./...and staticcheck 2026.2.2 are clean.make cover(it needs Kubo, Cluster and Docker). I checked the changed lines with-coverprofile/-coverpkginstead, and every new statement is covered.packages/accountingis added toCOVEREDin the Makefile.Docs
apps/sisyphusd/README.md: a new Accounting section (bases, columns, what is and is not counted, client scoping, #776), the usage line and a layout row.docs/research/token-economics.md: how the view puts the accepted-task design into practice.docs/desktop-backend.mdanddocs/security-model.md: the API and the client-scoping rule.