Skip to content

docs: worklog v1 requirements, design, ADRs, and 33-issue implementation plan - #1

Open
Saber5656 wants to merge 3 commits into
mainfrom
docs/v1-design
Open

docs: worklog v1 requirements, design, ADRs, and 33-issue implementation plan#1
Saber5656 wants to merge 3 commits into
mainfrom
docs/v1-design

Conversation

@Saber5656

Copy link
Copy Markdown
Owner

Summary

Documentation-only PR establishing the v1 requirements, architecture, security model, and implementation plan for worklog — a local-only, read-only CLI that generates daily reports and standup summaries from zsh history, git commits, and AI agent session logs (Claude Code / Codex), with an optional loopback-only local LLM narrative.

No product code is included; docs/ is the canonical source of truth, and GitHub Issues #1#33 (created after this PR) are derived from docs/issues/*.md.

Contents

Path Purpose
docs/DESIGN.md Full v1 design: invariants I1–I5, architecture, CLI/config/data contracts, per-source parsing specs, redaction ruleset, loopback-enforced LLM client, security model (trust boundaries + threat table), testing strategy, known unknowns
docs/decisions/ADR-001..005 Go + minimal deps; zero-external-network boundary; read-only/stateless sources; redaction default-on; licensing & distribution
docs/ISSUE_PLAN.md 33-issue plan: execution order, dependency table, 7 waves, DESIGN coverage table, whole-product validation strategy, v2 deferrals
docs/issues/01..33 Granular English issue drafts (one module/boundary each), written to be mechanically executable by a lower-capability implementation agent
docs/research/*.md Verified local formats: zsh history (incl. metafication), Claude Code session JSONL, Codex rollout JSONL, local LLM endpoint compatibility

Requirements baseline (user-approved 2026-07-10)

  • Sources v1: zsh history + git + Claude Code + Codex CLI
  • Local LLM narrative in v1 via OpenAI-compatible loopback-only endpoint (opt-in, deterministic fallback)
  • Output: stdout default, safe file output optional; reports in ja/en
  • Redaction ON by default, applied before rendering and before the LLM
  • Hard invariants: no external network I/O; sources strictly read-only; writes confined; stateless runs
  • Go, stdlib-first (single dependency: BurntSushi/toml)

Review evidence

All documents were reviewed by Codex (codex exec, read-only sandbox): 6 batches covering the design set and every issue file individually, plus a post-fix verification pass. 2 BLOCKER and ~30 MAJOR findings were found and fixed in 655d79c and ab3629d (see commit messages for the itemized list). Final verification: 14/14 items OK.

Open questions for the repository owner

  1. License (blocking issue 01's LICENSE file): MIT (proposed, ADR-005) or Apache-2.0? The repo is already public with no LICENSE, i.e. currently all-rights-reserved.
  2. Commit author email: commits currently use the same personal email as the pre-existing public history; consider switching to the GitHub noreply address going forward (optional).

Notes

  • Do not merge without human review (merge ≠ release).
  • Implementation starts at wave 0 (issue 01) once this PR is merged and the license is confirmed.

🤖 Generated with Claude Code

Saber5656 and others added 3 commits July 10, 2026 08:47
Requirements baseline approved by user on 2026-07-10:
local-only daily/standup report generator (zsh + git + Claude Code +
Codex sessions), loopback-only local LLM narrative, redaction default-on,
Go implementation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Key fixes:
- llm.enabled defaults to false (opt-in per approved requirement wording);
  zero-config runs now always validate
- unified non-loopback warning taxonomy on llm_blocked_nonloopback
- added zsh_lines_skipped / git_root_missing / codex_file_skipped to the
  canonical DESIGN §13 warning list (issues now reference, not amend)
- dependency table corrections (03<-04, 18/24<-17, 27<-22, 30<-26..29,
  31<-30+32, 33<-30+31) and wave-0 execution order note
- providers emit raw cwd; normalization owned by aggregation (research
  docs aligned with DESIGN §6.2); agent-session counts are in-range only
- sanitize: escape functions documented non-idempotent, single-application
- redaction corpus moved to JSON (multiline PEM + exact-want assertions);
  RedactEvent covers Project and returns (Event, int)
- render: project headings and LLM narrative escaped via EscapeText with
  adversarial goldens; standup buckets carry explicit clamp ranges
- LLM prompt marker integrity via encoding/json HTML escaping (no-op
  replace bug removed); Client.Model() accessor for attribution
- output writer exit-code mapping aligned with DESIGN §13; created-parent
  re-verification; git Runner dir contract + stderr caps
- release workflow: glob tag trigger + validated workflow_dispatch dry run
- invariant suite pins XDG_*/TMPDIR into the watched tree; hard deps on
  all commands
- ADR-005/DESIGN §16 updated to the already-public repo reality

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- issue 25: llm-on fixture explicitly sets llm.enabled/model
- issues 18/24: dependency sections aligned with ISSUE_PLAN (add 17)
- ISSUE_PLAN / issues 01,30,33: align remaining go-public wording with the
  already-public repository reality

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Saber5656, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 16 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8e6b056a-4138-4e44-8d31-a12f2d76f933

📥 Commits

Reviewing files that changed from the base of the PR and between 38391e3 and ab3629d.

📒 Files selected for processing (44)
  • docs/DESIGN.md
  • docs/ISSUE_PLAN.md
  • docs/decisions/ADR-001-go-and-dependency-policy.md
  • docs/decisions/ADR-002-network-boundary.md
  • docs/decisions/ADR-003-read-only-sources-and-stateless-runs.md
  • docs/decisions/ADR-004-redaction-default-on.md
  • docs/decisions/ADR-005-licensing-and-distribution.md
  • docs/issues/01-repo-scaffolding.md
  • docs/issues/02-ci-workflow.md
  • docs/issues/03-model-package.md
  • docs/issues/04-timeutil-package.md
  • docs/issues/05-config-package.md
  • docs/issues/06-sanitize-package.md
  • docs/issues/07-cli-skeleton.md
  • docs/issues/08-source-provider-collector.md
  • docs/issues/09-zsh-history-parser.md
  • docs/issues/10-zsh-provider.md
  • docs/issues/11-git-repo-discovery.md
  • docs/issues/12-git-commit-extraction.md
  • docs/issues/13-jsonl-scanner-util.md
  • docs/issues/14-claude-code-provider.md
  • docs/issues/15-codex-provider.md
  • docs/issues/16-redaction-engine.md
  • docs/issues/17-redaction-ruleset.md
  • docs/issues/18-aggregation.md
  • docs/issues/19-standup-derivation.md
  • docs/issues/20-render-daily.md
  • docs/issues/21-render-standup.md
  • docs/issues/22-output-writer.md
  • docs/issues/23-llm-client.md
  • docs/issues/24-llm-narrative.md
  • docs/issues/25-cmd-daily.md
  • docs/issues/26-cmd-standup.md
  • docs/issues/27-cmd-init.md
  • docs/issues/28-cmd-doctor.md
  • docs/issues/29-cmd-sources.md
  • docs/issues/30-network-invariant-enforcement.md
  • docs/issues/31-readme-and-user-docs.md
  • docs/issues/32-release-workflow.md
  • docs/issues/33-security-docs.md
  • docs/research/claude-code-session-format.md
  • docs/research/codex-session-format.md
  • docs/research/local-llm-endpoints.md
  • docs/research/zsh-history-format.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/v1-design

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This was referenced Jul 10, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab3629d8d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +40 to +41
- Tidy check: `go mod tidy && git diff --exit-code go.mod go.sum` (tolerate
absent `go.sum` while there are no deps).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fix tidy check for missing go.sum

In the issue-01 skeleton there is intentionally no go.sum, but this command is specified without the -- path separator. I checked Git's behavior on a repo with only go.mod: git diff --exit-code go.mod go.sum exits 128 with go.sum: no such path in the working tree, so issue 02's own acceptance criterion (green against the issue-01 tree) will fail until a dependency creates go.sum. Use git diff --exit-code -- go.mod go.sum or gate the missing path.

Useful? React with 👍 / 👎.

Comment on lines +60 to +61
4. No LLM involvement, no redaction needed (counts only — but note:
originator strings print raw → pass through `sanitize.Line(…, 60)`).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Redact originators before printing sources output

When a Codex session_meta.originator contains a token-like string, worklog sources would print it to stdout after only sanitize.Line. That is still source log content and bypasses invariant I4/ADR-004's redaction-before-user-visible-output rule; sources should run the same redactor (or aggregate path) before printing originator names.

Useful? React with 👍 / 👎.

Comment on lines +42 to +46
- Provider error → converted to a warning
(`Code = string(id)+"_failed"` unless the provider already returned
typed warnings; the error message becomes the warning message);
partial events returned alongside an error are kept.
- Panic in a provider is recovered → warning (`<id>_panic`), run

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep collector warnings in the canonical taxonomy

This creates public warning codes like zsh_failed and zsh_panic that are not in DESIGN §13 or the constants required by issue 03. In any provider-error/panic path the report footer/README will expose undocumented codes, contradicting the stable warning taxonomy; use an existing canonical code or add the new codes to the taxonomy/model issue.

Useful? React with 👍 / 👎.

Comment on lines +50 to +52
- Negatives (must NOT mask, ≥ 20 lines): 12/40-char git hashes; commit
subject `fix: rotate token handling`; `TOKEN_COUNT=5` (name not in the
secret-name list — verify the pattern's name list is anchored);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Align TOKEN_COUNT corpus with the env rule

The issue also requires implementing DESIGN §8 exactly, whose env-assignment pattern matches any variable name containing TOKEN. Under that regex, TOKEN_COUNT=5 is a match, so this mandatory negative corpus case cannot pass unless the design pattern is changed in the same docs set; either update DESIGN §8 to the anchored name rule or remove this negative.

Useful? React with 👍 / 👎.

Comment on lines +51 to +52
--pretty=format:%H%x1f%an%x1f%ae%x1f%aI%x1f%s%x1e
--shortstat

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Move git record separator after shortstat output

With Git 2.43, running this exact git log format emits the --shortstat line after the %x1e record separator, so splitting records on 0x1e leaves the first record without stats and prefixes the next record with the previous stats. The parser contract below expects the shortstat bytes inside the same record, so commits with file changes will be parsed incorrectly unless the separator is emitted after the shortstat or the parser associates post-separator stats with the previous commit.

Useful? React with 👍 / 👎.

Comment on lines +40 to +42
- `Makefile` — targets: `build` (`go build -trimpath -o bin/worklog
./cmd/worklog`), `test` (`go test -race ./...`), `lint`
(`gofmt -l . && go vet ./...`; golangci-lint added by issue 02), `clean`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make lint fail when gofmt lists files

gofmt -h describes -l as listing files whose formatting differs, and an unformatted file still makes gofmt -l exit 0, so this lint target will pass with badly formatted Go code. Wrap it in a non-empty-output check (or use a shell test around gofmt -l) before go vet so local lint matches the intended formatting gate.

Useful? React with 👍 / 👎.

Comment on lines +70 to +71
- Empty → `Run(ctx, "", "config", "--get", "user.email")` once (the
`dir==""` global form);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the global git config for author fallback

This invocation is described as the global form, but git config -h shows --global is the option that selects the global config file; without it, running worklog from inside any Git repository can read that repository's local user.email instead. In that context the default author filter will silently select the wrong identity, so use git config --global --get user.email or otherwise avoid local config lookup.

Useful? React with 👍 / 👎.

Comment on lines +53 to +57
3. Project normalization (DESIGN §6.2): for `agent-session` events whose
raw Project (cwd) equals or is a subpath of `<root>/<repo>` for any
configured git root (or matches an explicit repo path), the project key
is `<repo>` (first path element under the root). A cwd equal to a root
itself → key = base name of cwd. Otherwise: cleaned absolute path with

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize nested repo sessions to the repo basename

For users with nested repos like ~/dev/org/foo, this rule maps an agent session under foo to project org, while git commit extraction maps the same repository to foo. That splits one project across two report sections and contradicts DESIGN §6.2's basename-based attribution; match discovered/explicit repos or use the deepest repo directory basename instead of the first path element under the root.

Useful? React with 👍 / 👎.

Comment on lines +40 to +41
- `cli-secret-flag` must handle `--token=x`, `--token x`, `-p=x` forms
listed in the pattern.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make the short -p secret flag rule implementable

The required -p=x case cannot be satisfied while also implementing DESIGN §8's cli-secret-flag pattern exactly, because --?(password|passwd|token|...) matches one- or two-dash long names, not the single-letter -p. Either add -p to the design pattern in the same docs change or drop this acceptance requirement; otherwise the corpus forces a rule that the normative table disallows.

Useful? React with 👍 / 👎.

Comment on lines +35 to +39
- `zsh` (when enabled): file exists+readable (missing → WARN, fix:
check path/HISTFILE); parse first 2000 entries: ExtendedCount==0 →
WARN with the exact fix
`echo 'setopt EXTENDED_HISTORY INC_APPEND_HISTORY' >> ~/.zshrc`
(new entries only — note that old entries stay undated); else PASS

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Check recent zsh entries when diagnosing timestamps

Because existing simple-format entries stay undated after a user enables EXTENDED_HISTORY, parsing only the first 2000 entries can keep warning ExtendedCount==0 on long histories even when all new entries are timestamped. Doctor should sample the tail or scan until it has seen recent entries, otherwise users who already applied the fix get a persistent false warning.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant