# Stateboard Product Definition

[中文](product-definition.zh.md)

## One Line

Turn AI work context into a project-status board that can refresh every day.

Tagline:

```text
Turn AI work context into a living project board.
```

## Problem

People move projects across Codex, ChatGPT, local repositories, design tools, Notion, calendars, and todo apps. Real progress is scattered across conversations, files, automation output, test results, and memory.

A normal todo tool can store "what to do", but it cannot automatically judge:

- which projects are genuinely active
- which items are only historical context
- whether current progress has evidence
- whether the next step is code, verification, a decision, release, or waiting for input
- how priority should change

Stateboard turns that scattered state into a maintainable project board and syncs it to the systems users already use.

## Core Flow

```text
context intake
-> evidence coverage + cursor
-> evidence decision
-> project state judgment
-> task granularity control
-> destination mapping
-> idempotent sync
-> verification + run health
```

## V1 Shape

V1 does not start with a complex framework or standalone service. It keeps two entry points:

1. **Prompt entry**: zero-install, copyable into Codex / ChatGPT / other AI tools for manual runs or automation setup.
2. **Skill entry**: installable and versionable, better for long-term reuse across sessions and stronger guardrails.

Both entry points must follow the same Stateboard rules:

- Establish the truth layer before judging project state and priority.
- For repository sources with a valid cursor, compare committed changes from that cursor to current `HEAD`, plus current worktree changes.
- Use `BASELINE` only for a confirmed first run. A missing, unreadable, scope-mismatched, or incomparable expected cursor is `INDETERMINATE` until the user accepts a replacement baseline.
- Use `BASELINE`, `CHANGED`, `NO_NEW`, or `INDETERMINATE`; unavailable required evidence is never `NO_NEW`.
- Discover target-system capability before assuming a connector exists.
- Use an immutable project key and private destination-ID mapping. Search before writing, update one unambiguous match, and reconcile unknown results before retrying.
- Control task granularity; do not split historical memory into many low-value tasks.
- Confirm frequency and exact time before creating recurring automation.
- Output a short run report after every run.
- Keep evidence coverage, destination delivery, and automation run health separate.
- Follow the user's request language unless bilingual output is explicitly requested.

Current skill shape:

```text
stateboard-codex
  -> read project truth layer
  -> produce ProjectState
  -> map to destination project-status tasks
  -> verify write and idempotent update
```

The prompt template lives at `prompts/stateboard-sync-prompt.md`. `prompts/stateboard-automation-prompt.md` is an advanced template for agents after the user has confirmed automation timing.

`packages/core/` and `packages/adapters/` are placeholders for later extraction. Do not design complex interfaces before real usage proves the shape.

## Why Not Just A Prompt

A single prompt already proved that organizing Codex / ChatGPT context and syncing it to Dida/TickTick is feasible. Stateboard keeps the prompt form because it is the lowest-friction entry point and works well for user-configured automation.

`stateboard-codex` is valuable because it turns one successful prompt into a reproducible, constrained, versioned workflow. The skill preserves behaviors that are easy to lose when a prompt is copied or modified:

- evidence-first project-state judgment
- connector discovery before writes
- search-and-update before create
- task granularity control
- automation time confirmation
- short verification report
- runtime language discipline

If the user only needs a temporary sync, a strong prompt is enough. The V1 goal is to make the same project-state rules available through both a low-friction prompt and a maintainable skill.

## MVP

Phase 1 focuses on one reliable loop:

1. Extract project state from Codex / ChatGPT related context.
2. Produce positioning, current progress, priority, next steps, blockers, and evidence.
3. Default to one task per project, with 3-5 next-action checklist items.
4. Sync to Dida/TickTick MCP and verify search/update without duplicates.
5. Add daily or weekly refresh later, only after asking the user for frequency and exact time.

The first proof of work is a reproducible dry-run, followed by an optional live sync into a user-approved test destination.

The 1.0 reliability baseline also requires regression coverage for code-only progress, clean repositories with new commits, CI/release-only evidence, noise-only changes, incomplete sources, missed-run risk, and idempotent retries.

## Non-Goals

- Not a generic one-off reminder bot.
- Not a tool that turns every chat message into a task.
- Not an automation that assumes a default run time.
- Not a webhook notification wrapper pretending to be a full task system.
- Not a place to store or sync secrets, tokens, license keys, or personal credentials.

## Key Objects

```text
ProjectState
  project_key
  name
  positioning
  status
  priority
  next_actions
  blockers
  evidence
  source_scope
  updated_at

EvidenceSample
  layer
  coverage             # checked | unavailable | not-applicable
  change               # changed | no-change | unknown
  method
  window
  redacted_samples

EvidenceCursor        # local runtime only
  source_scope_hash
  cursor_state         # never-established | valid | missing | incomparable
  last_success_at
  git_head_or_manifest
  last_applied_state_hash

EvidenceSnapshot      # immutable record of one captured fingerprint and bounded samples
  source_fingerprint
  observed_at
  post_write_fingerprint
  rescan_required

DestinationSnapshot  # local runtime only
  connector_version
  semantic_hash
  verified_at

EvidenceDecision
  BASELINE | CHANGED | NO_NEW | INDETERMINATE

RunHealth
  primary_status        # healthy | late-or-missed-risk | source-partial | delivery-failed | verification-pending | unknown
  actual_run_at
  delivery_verified_at
  run_completed_at
  last_success_at
  expected_run_at
  next_expected_run_at
  missed_run_risk
  source_status
  delivery_status
  verification_status
  duration

TaskSink
  create_project
  find_existing_task
  create_task
  update_task
  verify_task

CalendarSink
  create_review_event
  update_review_event

NotificationSink
  send_digest
```

`ProgressSignal` is a classification used during judgment, not a required standalone V1 package. `PrivacyBoundary` separates public artifacts, user-authorized destination content, and local-only runtime state.

For `EvidenceSample`, coverage describes access to the current source, while change describes the result of a comparison. Readable current evidence without a valid comparison is `checked` + `unknown`; access failure is `unavailable` + `unknown`; an out-of-scope layer is `not-applicable` + `unknown`. Private runtime-state filenames and raw fields remain local.

`BASELINE` requires explicit private-state confirmation that no cursor ever existed; a missing field is not confirmation. `NO_NEW` retains the existing project state and durable task. Run Health reports one primary Stateboard condition: delivery failure, pending destination verification, schedule risk, partial source, healthy completion, or unknown.

When several Run Health conditions apply, primary-status priority is `delivery-failed` > `verification-pending` > `late-or-missed-risk` > `source-partial` > `healthy` > `unknown`.

Stateboard delivery, scheduler/automation health, and output self-verification are operational evidence. They belong in Run Health or Sync Result, not in project EvidenceSample layers or ProgressSignal.

The EvidenceSnapshot record used for synthesis is immutable for that write attempt, but it is not an immutable copy of the source filesystem. It contains the captured fingerprint and bounded representative samples. A source cursor advances only when destination read-back succeeds and the post-write fingerprint still equals the captured fingerprint. Destination ETag drift is metadata only; semantic fields require a private semantic hash and reconciliation. Private state is committed atomically after these checks.

One changed artifact maps to one ProgressSignal layer: docs to Documentation; test/workflow/deployment configuration to Engineering; execution/review results to Verification; deployment/release results to Release.

## Default Granularity

Default mode is balanced project tasks:

- One real project maps to one parent task.
- The task body records positioning, progress, priority, risks, and evidence.
- The checklist keeps 3-5 next actions.
- Low-activity projects go to the parking lot instead of becoming separate task clusters.
