feat: authors() - the write history as attribution reads it - #49
Merged
Conversation
One read-only verb on VaultStore: who has written in this vault, how often, and when last. Conformance-first, both stores.
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.
Adds ONE read-only verb to
VaultStore:authors(): Promise<AuthorStat[]>- who has written in this vault, how often, and when last. It is the read side of the attributionwrite/editalready record, and it is what an account-level memory overview needs to answer "which AIs write here".Why this shape, and not a commit log
The alternative was
log(opts?: { limit? }) -> CommitInfo[]with the host aggregating.authors()won on four counts:limitmakeswritesa count over a truncated window, which is a lie on a busy vault. There is no window here.describe()'s.The spawn budget is the same either way: one
git log.The contract (pinned by the conformance kit)
delete, and a commit that arrived out of band (a push from a person) carry no client and appear in no row.writesdesc, thenauthor.idasc - a total order that never reads a clock, so two stores holding the same history agree. Both stores date to the second, so a clock-ordered contract would be untestable across them.lastAtis a strict ISO 8601 instant.writes/lastAtcover the history the store retains (git: every commit; in-memory: what the instance has seen -capabilities().versionedsays which).How the bare store answers it
gitAuthorOfalready stamps the connected client as the git author (<id>@clients.agentage.io) and leaves the committer to the system.clientAuthorOfis the exact inverse, and both directions now sit incommit.ts, so there is no second bookkeeping:authors()is onegit log --reversepass, and a restored clone answers exactly like the store that wrote it (tested). A pushed commit carries a human's identity and belongs to no client (tested).--reverseis not cosmetic: both stores feed the shared tally chronologically, which is what makes the same-second tie rule ("latest wins") mean the same thing for a live tally and for a log.Cost
One
git logper version, cached in the slot beside the vault card, so a page of memory cards pays for it once.authors()git logpass per version, then cached like the cardVerified
npm run verifygreen: type-check, lint, format, 301 tests, coverage 97.5 / 88.4 / 98.4 / 99.1 (floors 70), build, dist smoke (extended to exercise the new verb throughdist/).New perf row on the commit-count axis, where this verb actually lives - it is indifferent to note count. The churn fixture now attributes two of every three commits to a client, so the pass has something to aggregate:
Notes for review
authors()is onVaultReader, so it is a required method - same shape of change asreadManyin 1.1.0, and a minor bump for the same reason.container.openexactly as it does fordescribe().