cclaw-cli 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -714,6 +714,72 @@ const DOMAIN_LABELS = {
714
714
  "data-pipeline": "Data pipeline / ETL"
715
715
  };
716
716
  const STAGE_DOMAIN_SAMPLES = {
717
+ brainstorm: [
718
+ {
719
+ domain: "web",
720
+ label: "Direction",
721
+ body: "Problem: admin dashboard orders table requires manual refresh to see new orders. Success: admins see new rows within 2s of server-side status change, no full navigation. Anti-success: WebSocket rewrite of the whole table stack when only one view needs live updates."
722
+ },
723
+ {
724
+ domain: "cli",
725
+ label: "Direction",
726
+ body: "Problem: `cclaw archive` silently deletes 30+ day runs with no preview. Success: a `--dry-run` flag prints would-be-archived run IDs to stdout and exits 0; current behavior is unchanged without the flag. Anti-success: adding an interactive confirmation prompt that breaks CI scripts."
727
+ },
728
+ {
729
+ domain: "library",
730
+ label: "Direction",
731
+ body: "Problem: consumers cannot validate hook JSON without importing internal modules. Success: `validateHookDocument(obj)` exported from the package root with typed result `{ ok, errors? }`. Anti-success: exposing the full Zod schema and forcing consumers to depend on Zod."
732
+ },
733
+ {
734
+ domain: "data-pipeline",
735
+ label: "Direction",
736
+ body: "Problem: reruns of the orders job create duplicate `fact_orders` rows. Success: running the job twice on the same input leaves row count unchanged and `dbt test --select fact_orders` green. Anti-success: introducing a nightly dedup job that hides the underlying non-idempotency."
737
+ }
738
+ ],
739
+ scope: [
740
+ {
741
+ domain: "web",
742
+ label: "Scope line",
743
+ body: "In: live-update `/dashboard/orders` table via SSE; out: notification drawer, mobile PWA, dashboards other than `orders`. Discretion: choice of SSE vs long-polling for legacy Safari. NOT in scope: rewriting the auth layer or the existing REST endpoints."
744
+ },
745
+ {
746
+ domain: "cli",
747
+ label: "Scope line",
748
+ body: "In: add `--dry-run` to `cclaw archive`; out: redesigning archive formats, adding retention flags, or changing the default. Discretion: exact wording of stdout lines. NOT in scope: touching `init` / `sync` / `doctor` subcommands."
749
+ },
750
+ {
751
+ domain: "library",
752
+ label: "Scope line",
753
+ body: "In: expose `validateHookDocument` + types from package root; out: rewriting hook schema, adding new hook kinds, dropping old ones. Discretion: whether to re-export `HookDocument` as type-only. NOT in scope: migrating consumers."
754
+ },
755
+ {
756
+ domain: "data-pipeline",
757
+ label: "Scope line",
758
+ body: "In: dedup step between `raw.orders` and `fact_orders` keyed on `(order_id, event_ts)`; out: redesigning ingestion, adding new partitions, or touching downstream marts. Discretion: `row_number()` vs `qualify`-style dedup. NOT in scope: backfilling historical partitions."
759
+ }
760
+ ],
761
+ design: [
762
+ {
763
+ domain: "web",
764
+ label: "Architecture note",
765
+ body: "Data flow: server-side order update → publish to `orders-updates` channel → SSE endpoint `/api/orders/stream` → `useOrderFeed` hook merges into React state → row rerenders. Failure mode: SSE connection drop → exponential-backoff reconnect + on-reconnect REST snapshot fallback. Trade-off accepted: no client→server channel (SSE one-way); existing REST mutations cover it."
766
+ },
767
+ {
768
+ domain: "cli",
769
+ label: "Architecture note",
770
+ body: "Flag is parsed by the existing Zod CLI parser; `--dry-run` short-circuits before any filesystem mutation, shares formatter `src/cli/format.ts` with `status`. Failure mode: formatter output differs between `status` and `archive --dry-run` → centralize format. Trade-off: we print run IDs unsorted to keep the code path identical to the real archive path."
771
+ },
772
+ {
773
+ domain: "library",
774
+ label: "Architecture note",
775
+ body: "Re-export `validateHookDocument` from package root; rename internal `__validate` to match the exported name so callsites and the export converge. Failure mode: consumers importing from `/dist/internal` break on the rename → add a deprecation re-export shim for one minor. Trade-off: slightly wider public surface today buys us a smaller public surface tomorrow."
776
+ },
777
+ {
778
+ domain: "data-pipeline",
779
+ label: "Architecture note",
780
+ body: "Insert `int_orders_deduped` CTE between staging and fact, keyed on `(order_id, event_ts)` with `row_number() = 1` per key; `fact_orders` reads from the deduped model only. Failure mode: late-arriving events with an earlier `event_ts` would flap the chosen row → tiebreak on `ingest_ts DESC`. Trade-off: the job now does one extra pass; measured +8% runtime, within budget."
781
+ }
782
+ ],
717
783
  spec: [
718
784
  {
719
785
  domain: "web",
@@ -780,6 +846,28 @@ const STAGE_DOMAIN_SAMPLES = {
780
846
  body: "RED: `dbt test --select fact_orders` → `unique test on (order_id, event_ts)` fails on re-run. GREEN: added `row_number()` dedup in the staging model. REFACTOR: extracted the dedup CTE into `int_orders_deduped` for reuse by `fact_returns`."
781
847
  }
782
848
  ],
849
+ review: [
850
+ {
851
+ domain: "web",
852
+ label: "Finding",
853
+ body: "R-W-1 (Critical, correctness): `useOrderFeed` does not unsubscribe from the SSE channel on unmount — two mounts on the same page double-count rows. Evidence: `tests/unit/order-feed-hook.test.ts > unmount` fails. Fix owner: frontend; blocks ship."
854
+ },
855
+ {
856
+ domain: "cli",
857
+ label: "Finding",
858
+ body: "R-C-2 (Suggestion, UX): `cclaw archive --dry-run` prints run IDs without a trailing newline, breaking downstream `xargs` pipelines. Evidence: `echo '' | xargs -I{} printf '%s\\n' {}` contrast. Fix owner: CLI; non-blocking."
859
+ },
860
+ {
861
+ domain: "library",
862
+ label: "Finding",
863
+ body: "R-L-1 (Important, surface-area): the new `validateHookDocument` export is documented in README but missing from `src/index.ts` — `import { validateHookDocument } from 'cclaw'` fails despite the docs. Evidence: `pnpm build && node -e \"require('./dist').validateHookDocument\"` prints `undefined`. Fix owner: library; blocks ship."
864
+ },
865
+ {
866
+ domain: "data-pipeline",
867
+ label: "Finding",
868
+ body: "R-D-1 (Critical, correctness): dedup CTE orders by `event_ts ASC` instead of `event_ts DESC` — on duplicate events we keep the older row. Evidence: `dbt test --select fact_orders` green but fixture `tests/fixtures/orders-dupes.csv` shows wrong survivor. Fix owner: analytics-eng; blocks ship."
869
+ }
870
+ ],
783
871
  ship: [
784
872
  {
785
873
  domain: "web",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cclaw-cli",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Installer-first flow toolkit for coding agents",
5
5
  "type": "module",
6
6
  "bin": {