Repository navigation
Draft timesheets: owner and agent hours, commits and PRs per project and client - #7
Merged
Merged
Conversation
…sage
The usage verb now also reports subagent and workflow agent transcripts
(<session>:<agent> ids), the entrypoint of each transcript, the repository
(work project) of each line's cwd, prompts the owner did not type ("o": "n")
and sidechain lines ("sc": 1). The hub parses and caches the new fields
(cache version 2). usage_report ignores agent transcripts, so its numbers do
not change; the timesheet uses them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
A timesheet section maps project folders to exactly one client each. Owner time (interactive sessions from the owner's prompt on, voice calls) and agent time (headless runs, subagents, chains without an owner prompt) are computed per project and day in the owner's time zone, with unions, an optional split of simultaneous owner time and optional rounding. Commits and pull requests come from gh and local clones (subjects and titles only). Drafts, adjustments and approvals live under stateDir/timesheets, mode 0600; an approval freezes the period. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
Every tool call of the owner is recorded with its times and the project folder it targeted (no text). timesheet_summary drafts and reads back a period; timesheet_approve reads back the draft and timesheet_approve_confirm approves it in a later turn, bound to that draft and the OAuth client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
…wner time Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
…gateway note) SWITCHBOARD.md gets the Timesheet section, the timesheet config, the dispatcher 0.10.0 usage additions, the tools and the milestone entry; DESIGN.md records the decisions (separate owner and agent time, split of simultaneous owner time, repository attribution, nothing sent, the voice approval exception); REFERENCE.md the config keys, CLI and tools; both example configs get a timesheet section with placeholders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
…t log hardening On a tie between copies an owner-driven transcript keeps them, so an ask fork of the owner's session does not turn its history into agent time. An adjustment naming a project a new draft no longer has no longer breaks the view. git log runs without signature checks (no gpg.program from a repository's config). A failed background draft is logged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
Union of both sides: dispatcher verbs version, list, capture, send, usage, keys, resize, attachments, attachment, health; dispatcher and connector stay 0.10.0 (deploy copies identical); config carries timesheet and incidents; the MCP tool list has the timesheet and incident tools, then the attachment tools, all guarded for the incident log and wrapped by the voice activity log; tool list snapshot regenerated (23 tools); docs keep both sets of rows and sections; guides state the dispatcher's new size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
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.
Draft timesheets for the owner: per client, per project and per day, owner hours, agent hours, commits and pull requests, as Markdown, CSV and JSON under
stateDir/timesheets/. Always a draft until the owner approves it; nothing is sent anywhere (no email, no upload), approved timesheets are only exported to files.Contract:
docs/SWITCHBOARD.md"Timesheet"; decisions indocs/DESIGN.md"Timesheet"; config and CLI indocs/REFERENCE.md.Time rules
<session>:<agent>) and headless runs (entrypointsdk-*: the hub'srun_tasktasks, ask and relay forks,claude -pscripts). Everything else is an owner-driven (interactive) session.usage.idleGapMinutesapart. Every part lasts at least one minute.origin.kind) is owner time from the event just before that first prompt (the answer being read) to the chain's end, including the work it triggers. Plus every Switchboard tool call (start, end, project it targeted), chained the same way; calls without a project go to(voice)and count only where no project has owner time..gitabove that line'scwd, dispatcher 0.10.0). Folders are mapped to configured projects (keys, aliases, globs) before any union. Unmapped folders are listed under "unassigned" with their hours, never guessed or dropped.timesheet.timeZone, DST aware, weeks Monday to Sunday): owner time is the union of owner parts and voice chains, agent time the union of agent parts, across sessions and machines.ownerOverlap: split(default) divides simultaneous owner time in several projects equally, so owner hours never exceed wall-clock hours;fullcounts it in each. Agent time is never split. Copies (forks, resumes) count once; on a tie the owner-driven transcript keeps them.roundingMinutes, default off): per project and day, owner and agent separately.Commits and pull requests
Per configured project:
reposthroughgh(default-branch commits byauthorEmails, cut to the first message line by--jqon GitHub's side; PRs bygithubLoginsopened or merged in the period),paths(local clones insideprojectRoots) throughgit log --allwith hooks, fsmonitor and signature checks off. Only hashes, times, subjects, titles, numbers and URLs. Failures become notes.Approval
hours,moveto a configured project,note) are records on top of the computed numbers, never rewrites.voice-coding-mcp timesheet approve [period] [--expect ID]ortimesheet_approve+timesheet_approve_confirm(later turn, same OAuth client,minConfirmSeconds..confirmSeconds, single use, bound to the SHA-256 of the exact view read back) write<period>.approved.jsononce (O_EXCL) with a SHA-256; the period then takes no new draft or adjustment;exportrefuses drafts and changed files. Recorded in DESIGN.md as an exception to "nothing is approved by voice" (timesheet.voiceApproval: falseturns it off).stateDir/timesheets/voice.jsonlholds tool name, times and project folder only.Dispatcher 0.10.0
The existing
usageverb gains optional fields (agent transcripts,epentrypoint,wp/pwork projects,"o": "n"origins,"sc": 1sidechains); the hub cache is version 2.usage_reportignores agent transcripts, so its numbers do not change. Connector bumped in step. Rebase note: the version lines (VERSION,test_dispatcher_keys.py,test_cli_remote.py) will conflict with #5 (0.7.0) and the clear-input (0.8.0) and incident (0.9.0) PRs; keep 0.10.0.Tests
uv sync --locked,uv run ruff check,uv run ruff format --check,uv run mypy --strict src tests,uv run pytest: all pass (1910 passed, 9 skipped: live tmux and shellcheck tests that need tools not installed here; ruff, format and mypy clean).New:
tests/usage/test_dispatcher_agents.py,tests/timesheet/(compute: owner vs agent vs sidechain, idle gaps, lead-in, unions, split/full, voice, renames, forks, midnight and week boundaries in Europe/Zurich, rounding; work: fake gh/git runners; service/store: end to end on hub transcripts withtests/fixtures/fake_gh.py, unassigned and ambiguous folders, adjustments, approval freeze, tamper check, file modes, privacy, config validation; tool/CLI: approval in a later turn, client binding, changed draft, expiry, voice approval off, the CLI flow), plustest_mcp.py(tool calls recorded without text) and the tool list snapshot. A read-only probe on a real Claude Code home (12 days, 828 transcripts) took 12 s and produced plausible per-project owner and agent hours.Deploy and config
voice-coding-mcp remote-dispatcher > ~/.local/bin/switchboard-remote), and connector 0.10.0 on agent machines (voice-coding-mcp remote-connector), then restart the connectors. Check withvoice-coding-mcp remote-check.timesheetsection to the deployed config (example inconfig.example.json):timeZone,clients(id to display name),projects(folder name to exactly one client, withaliasesfor worktrees and clones on other machines,reposasowner/name, optionalpathsinsideprojectRoots),authorEmails(your commit emails),githubLogins(your GitHub login). Personal addresses only in the deployed config.ghon the hub: checkgh auth statusas the hub user; if the hub's identity cannot read a client's repository, runvoice-coding-mcp timesheet draftwhereghis logged in with the hub's config and state dir.voice-coding-mcp timesheet draft,show,adjust ... --note,approve --expect <id>,export --format csv --out ...; or by voice "what is on last week's timesheet?".Not verified yet on the real setup (listed in DESIGN.md "To verify"):
origin.kindvalues across Claude Code versions, the entrypoint of Remote Control sessions the hub starts, agent transcript paths in newer versions,gh pr list --searchwith times on the installedgh.🤖 Generated with Claude Code
https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh