@sentropic/track 0.87.0 → 0.89.0

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.
Files changed (80) hide show
  1. package/dist/cli/index.d.ts.map +1 -1
  2. package/dist/cli/index.js +209 -20
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/events/types.d.ts +1 -1
  5. package/dist/events/types.d.ts.map +1 -1
  6. package/dist/events/types.js +16 -0
  7. package/dist/events/types.js.map +1 -1
  8. package/dist/events/validate.d.ts +10 -0
  9. package/dist/events/validate.d.ts.map +1 -1
  10. package/dist/events/validate.js +81 -0
  11. package/dist/events/validate.js.map +1 -1
  12. package/dist/ingest/contract.d.ts +3 -2
  13. package/dist/ingest/contract.d.ts.map +1 -1
  14. package/dist/ingest/contract.js +33 -1
  15. package/dist/ingest/contract.js.map +1 -1
  16. package/dist/ingest/index.d.ts.map +1 -1
  17. package/dist/ingest/index.js +6 -5
  18. package/dist/ingest/index.js.map +1 -1
  19. package/dist/ingest/ingest.d.ts.map +1 -1
  20. package/dist/ingest/ingest.js +17 -0
  21. package/dist/ingest/ingest.js.map +1 -1
  22. package/dist/ingest/map.d.ts.map +1 -1
  23. package/dist/ingest/map.js +11 -0
  24. package/dist/ingest/map.js.map +1 -1
  25. package/dist/model/index.d.ts +1 -1
  26. package/dist/model/index.d.ts.map +1 -1
  27. package/dist/model/index.js +1 -1
  28. package/dist/model/index.js.map +1 -1
  29. package/dist/model/item.d.ts +65 -0
  30. package/dist/model/item.d.ts.map +1 -1
  31. package/dist/model/item.js +49 -0
  32. package/dist/model/item.js.map +1 -1
  33. package/dist/read/commands.d.ts +24 -18
  34. package/dist/read/commands.d.ts.map +1 -1
  35. package/dist/read/commands.js +167 -26
  36. package/dist/read/commands.js.map +1 -1
  37. package/dist/read/contract.d.ts +32 -3
  38. package/dist/read/contract.d.ts.map +1 -1
  39. package/dist/read/contract.js +42 -2
  40. package/dist/read/contract.js.map +1 -1
  41. package/dist/report/blocker-status.d.ts.map +1 -1
  42. package/dist/report/blocker-status.js +11 -0
  43. package/dist/report/blocker-status.js.map +1 -1
  44. package/dist/report/build.d.ts +6 -0
  45. package/dist/report/build.d.ts.map +1 -1
  46. package/dist/report/build.js +2 -31
  47. package/dist/report/build.js.map +1 -1
  48. package/dist/report/format.d.ts +227 -8
  49. package/dist/report/format.d.ts.map +1 -1
  50. package/dist/report/format.js +946 -106
  51. package/dist/report/format.js.map +1 -1
  52. package/dist/report/index.d.ts +1 -1
  53. package/dist/report/index.d.ts.map +1 -1
  54. package/dist/report/index.js +1 -1
  55. package/dist/report/index.js.map +1 -1
  56. package/dist/report/rollup.d.ts +14 -0
  57. package/dist/report/rollup.d.ts.map +1 -1
  58. package/dist/report/rollup.js +32 -0
  59. package/dist/report/rollup.js.map +1 -1
  60. package/dist/report/snapshot.d.ts +20 -1
  61. package/dist/report/snapshot.d.ts.map +1 -1
  62. package/dist/report/snapshot.js +9 -2
  63. package/dist/report/snapshot.js.map +1 -1
  64. package/dist/state/fold.d.ts.map +1 -1
  65. package/dist/state/fold.js +48 -0
  66. package/dist/state/fold.js.map +1 -1
  67. package/dist/track.d.ts +34 -1
  68. package/dist/track.d.ts.map +1 -1
  69. package/dist/track.js +95 -2
  70. package/dist/track.js.map +1 -1
  71. package/package.json +1 -1
  72. package/skills/track-operation/SKILL.md +16 -4
  73. package/dist/report/html.d.ts +0 -9
  74. package/dist/report/html.d.ts.map +0 -1
  75. package/dist/report/html.js +0 -76
  76. package/dist/report/html.js.map +0 -1
  77. package/dist/report/present.d.ts +0 -28
  78. package/dist/report/present.d.ts.map +0 -1
  79. package/dist/report/present.js +0 -32
  80. package/dist/report/present.js.map +0 -1
@@ -12,18 +12,29 @@ dossier and `propose-workpackages` for backlog restructuring.
12
12
  ## Deterministic report/status
13
13
 
14
14
  For a human-facing report or status, run `track report` from the repository root. It is a deterministic
15
- conductor over the folded log, with FAIT / À-FAIRE / DÉCISIONS-ACTIONS for text and Markdown. It never
15
+ conductor over the folded log, with exactly four sections — FAIT / À-FAIRE / DÉCISIONS / RECOMMANDATION
16
+ — for text and Markdown, plus a machine handle-resolution block. It never
16
17
  invokes an adapter, gateway, subprocess, or model.
17
18
 
18
19
  - `track report --format text` is the default conductor.
19
20
  - `track report --format md` is the same deterministic view in Markdown.
20
- - `track report --format html` is the deterministic DS fragment.
21
21
  - `track report --flat` explicitly requests the legacy bucket dump.
22
22
  - `track report --format json` is the flat machine contract; add `--wp` to carry the additive conductor
23
23
  view model. Do not pass `--flat` with JSON.
24
24
  - `track snapshot` or `track report --raw` is a factual diagnostic projection, not a reporting-period
25
25
  cursor or an executable plan.
26
26
 
27
+ There is no HTML surface. `track report --format html` is rejected; the DS fragment is focus's own
28
+ renderer, not the report's.
29
+
30
+ Scope the report to a period rather than asking a reader to filter it:
31
+
32
+ - `track report --period today|week|month|all` selects a named window.
33
+ - `track report --since <YYYY-MM-DD|commit> [--until <YYYY-MM-DD|commit>]` selects an explicit one; each
34
+ bound must be a calendar date or a resolvable commit, never a literal that silently degrades.
35
+ - `--since` and `--period` are mutually exclusive, `--until` requires `--since`, and `--since` must not be
36
+ after `--until` nor after the journal head.
37
+
27
38
  Paste deterministic command output verbatim when that is what was requested. Do not call it
28
39
  AI-prepared, cited AI, or adapter-backed.
29
40
 
@@ -35,8 +46,9 @@ lane/concurrency policy, and model/effort policy. If any required input is absen
35
46
  recommendation can be made; never infer it from an arbitrary event tail or session memory.
36
47
 
37
48
  Do not invent options or recommendations for a legacy decision. A decision without recorded structured
38
- options and recommendation must be rendered in **À INSTRUIRE**, not under **DÉCISIONS**. An owner-ratified
39
- revision supplies the actual existing `Option { id, title, summary }` objects and recommendation; an owner
49
+ options and recommendation keeps its row in **DÉCISIONS** but reads structurer`: it reserves no
50
+ D-number, carries no option letters, and is never offered in the reply line. An owner-ratified revision
51
+ supplies the actual existing `Option { id, title, summary }` objects and recommendation; an owner
40
52
  selection is persisted with `track decision select <decisionId> <optionId>`.
41
53
 
42
54
  ## Contract
@@ -1,9 +0,0 @@
1
- import { type ReportView } from './format.js';
2
- import type { DecisionRow, ReportRow } from './build.js';
3
- import type { WpNode } from './rollup.js';
4
- import { type DsFragmentHooks, type DsFragmentPresenter } from './present.js';
5
- /** Render a `ReportView` to a sanitized, DS-styled `<article>` fragment (the shared presenter, §C). */
6
- export declare const renderReportHtml: DsFragmentPresenter<ReportView>;
7
- /** Build the conductor view from the forest and render its DS fragment (the CLI `--format html` path). */
8
- export declare function formatWpConductorHtml(tree: readonly WpNode[], decisions?: readonly DecisionRow[], hooks?: DsFragmentHooks, outsideRollup?: readonly ReportRow[], totalScope?: string): string;
9
- //# sourceMappingURL=html.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/report/html.ts"],"names":[],"mappings":"AAOA,OAAO,EAAyC,KAAK,UAAU,EAAwB,MAAM,aAAa,CAAA;AAC1G,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAA8B,KAAK,eAAe,EAAE,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAgEzG,uGAAuG;AACvG,eAAO,MAAM,gBAAgB,EAAE,mBAAmB,CAAC,UAAU,CAU5D,CAAA;AAED,0GAA0G;AAC1G,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,SAAS,GAAE,SAAS,WAAW,EAAO,EACtC,KAAK,GAAE,eAAgC,EACvC,aAAa,GAAE,SAAS,SAAS,EAAO,EACxC,UAAU,SAAW,GACpB,MAAM,CAER"}
@@ -1,76 +0,0 @@
1
- // report-revamp §C — the DS-compatible HTML FRAGMENT renderer for the conductor report. Implements the
2
- // shared `DsFragmentPresenter` contract (present.ts) — the SAME presenter path as focus's `renderHtml`, not
3
- // a second engine: a self-contained `<article>` with namespaced classes + `data-*` variants, every
4
- // interpolation escaped (§A4), the whole fragment run through the host `sanitizeHtml` hook. It consumes the
5
- // SAME `ReportView` the JSON path exposes (tables + directives + keystone), so the HTML and the table render
6
- // share one derived model. The design system supplies the CSS/tokens and embeds the fragment.
7
- import { buildWpConductorView, directivePhrase } from './format.js';
8
- import { escapeHtml, IDENTITY_HOOKS } from './present.js';
9
- /** One conductor table → a `<section>` with a `<table class="report-table">`; cells escaped (§A4). */
10
- function renderTable(t) {
11
- const head = t.columns.map((c) => `<th>${escapeHtml(c.label)}</th>`).join('');
12
- const body = t.rows
13
- .map((row) => `<tr>${t.columns.map((c) => `<td>${escapeHtml(row[c.id] ?? '')}</td>`).join('')}</tr>`)
14
- .join('');
15
- return (`<section class="report-section" data-section="${escapeHtml(t.id)}">` +
16
- `<h2>${escapeHtml(t.title)}</h2>` +
17
- `<table class="report-table"><thead><tr>${head}</tr></thead><tbody>${body}</tbody></table>` +
18
- `</section>`);
19
- }
20
- /**
21
- * The machine-attributed directive list — the DS-consumable variant surface (mirrors focus's
22
- * `data-annotation`/`data-modality` convention): each `<li>` carries `data-mode`, `data-advice-kind`,
23
- * `data-rank`, `data-step`, and (when present) `data-gate`/`data-blocked-by`/`data-fan-in`, so the design
24
- * system styles chips WITHOUT parsing the phrase. The rendered phrase reuses `directivePhrase` (same bytes
25
- * as the table). Every interpolated title/ref is escaped.
26
- */
27
- function renderDirectives(dirs) {
28
- if (dirs.length === 0)
29
- return '';
30
- const items = dirs
31
- .map((d) => {
32
- const g = d.gate;
33
- const attrs = [
34
- `data-mode="${escapeHtml(d.mode)}"`,
35
- `data-advice-kind="${escapeHtml(d.adviceKind)}"`,
36
- `data-rank="${escapeHtml(d.rank)}"`,
37
- `data-step="${escapeHtml(d.step.code)}"`,
38
- ...(g?.code !== undefined ? [`data-gate="${escapeHtml(g.code)}"`] : []),
39
- ...(g?.blockedBy !== undefined ? [`data-blocked-by="${escapeHtml(g.blockedBy)}"`] : []),
40
- ...(d.facts.fanIn !== undefined ? [`data-fan-in="${escapeHtml(String(d.facts.fanIn))}"`] : []),
41
- ].join(' ');
42
- const subject = escapeHtml(d.target.title ?? d.target.id);
43
- const blocker = g?.blockedByTitle !== undefined
44
- ? ` <span class="report-directive-blocker">bloqué par « ${escapeHtml(g.blockedByTitle)} »</span>`
45
- : '';
46
- return (`<li class="report-directive" ${attrs}>` +
47
- `<strong class="report-directive-subject">${subject}</strong> — ` +
48
- `<span class="report-directive-phrase">${escapeHtml(directivePhrase(d))}</span>${blocker}</li>`);
49
- })
50
- .join('');
51
- return `<section class="report-section" data-section="directives"><h2>Directives</h2><ul class="report-directives">${items}</ul></section>`;
52
- }
53
- function renderHeader(view) {
54
- const k = view.keystone;
55
- const keystone = k !== undefined
56
- ? ` · <span class="report-keystone" data-keystone-id="${escapeHtml(k.id)}" data-blocks="${escapeHtml(String(k.blocks))}">goulot: ${escapeHtml(k.title)} (bloque ${escapeHtml(String(k.blocks))})</span>`
57
- : '';
58
- return (`<header class="report-header"><h1>Report — conducteur</h1>` +
59
- `<p class="report-meta">vue: <code>${escapeHtml(view.kind)}</code> · locale: ${escapeHtml(view.locale)}${keystone}</p></header>`);
60
- }
61
- /** Render a `ReportView` to a sanitized, DS-styled `<article>` fragment (the shared presenter, §C). */
62
- export const renderReportHtml = (view, hooks = IDENTITY_HOOKS) => {
63
- const html = `<article class="report-document" data-kind="${escapeHtml(view.kind)}" data-locale="${escapeHtml(view.locale)}">` +
64
- renderHeader(view) +
65
- view.tables.map(renderTable).join('') +
66
- renderDirectives(view.directives) +
67
- `<section class="report-section" data-section="recommandation"><h2>Recommandation</h2>` +
68
- `<p class="report-recommendation">${escapeHtml(view.generalRecommendation)}</p></section>` +
69
- `</article>`;
70
- return hooks.sanitizeHtml(html);
71
- };
72
- /** Build the conductor view from the forest and render its DS fragment (the CLI `--format html` path). */
73
- export function formatWpConductorHtml(tree, decisions = [], hooks = IDENTITY_HOOKS, outsideRollup = [], totalScope = 'global') {
74
- return renderReportHtml(buildWpConductorView(tree, decisions, outsideRollup, totalSc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AC,YAAY,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC,CAAA;AAED,0GAA0G;AAC1G,MAAM,UAAU,qBAAqB,CACnC,IAAuB,EACvB,YAAoC,EAAE,EACtC,QAAyB,cAAc,EACvC,gBAAsC,EAAE,EACxC,UAAU,GAAG,QAAQ;IAErB,OAAO,gBAAgB,CAAC,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,CAAC,EAAE,KAAK,CAAC,CAAA;AAClG,CAAC"}
@@ -1,28 +0,0 @@
1
- /** Convert markdown source to an HTML string. Host-supplied (e.g. `marked`) — only prose models need it. */
2
- export type RenderMarkdown = (markdown: string) => string;
3
- /** Sanitize an HTML string before emission. Host-supplied (e.g. DOMPurify / sanitize-html). */
4
- export type SanitizeHtml = (html: string) => string;
5
- /**
6
- * Hooks a DS fragment renderer needs from the host. A SUPERSET of focus's `HtmlRenderHooks`:
7
- * `sanitizeHtml` is always required (the fragment is run through it before emission); `renderMarkdown` is
8
- * OPTIONAL and only consulted by prose-bearing models (the dossier), so the report renderer never needs it.
9
- */
10
- export interface DsFragmentHooks {
11
- readonly sanitizeHtml: SanitizeHtml;
12
- readonly renderMarkdown?: RenderMarkdown;
13
- }
14
- /** The shared presenter signature: a model → a sanitized, DS-styled `<article>` fragment string. */
15
- export type DsFragmentPresenter<Model> = (model: Model, hooks: DsFragmentHooks) => string;
16
- /**
17
- * Minimal HTML text escaping for attribute/text content the renderer itself emits (§A4 — every interpolated
18
- * user title/ref MUST pass through this before landing in the fragment, so a forged title cannot inject
19
- * markup). Byte-for-byte the same escape focus's renderer uses, so the two fragments are consistent.
20
- */
21
- export declare const escapeHtml: (value: string) => string;
22
- /**
23
- * The trusted-local-CLI hooks (identity sanitize): track's `--format html` is a local surface, not untrusted
24
- * network output — the renderer already escapes every interpolation, so identity sanitize is safe here. An
25
- * L4/web host (the Svelte app) supplies a REAL DOMPurify/sanitize-html hook instead.
26
- */
27
- export declare const IDENTITY_HOOKS: DsFragmentHooks;
28
- //# sourceMappingURL=present.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"present.d.ts","sourceRoot":"","sources":["../../src/report/present.ts"],"names":[],"mappings":"AAeA,4GAA4G;AAC5G,MAAM,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;AAEzD,+FAA+F;AAC/F,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;AAEnD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAA;IACnC,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAA;CACzC;AAED,oGAAoG;AACpG,MAAM,MAAM,mBAAmB,CAAC,KAAK,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,KAAK,MAAM,CAAA;AAEzF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,MAMhB,CAAA;AAE3B;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,eAA4D,CAAA"}
@@ -1,32 +0,0 @@
1
- // report-revamp §C — the SHARED design-system fragment contract (the "embeddable-view contract" of
2
- // M5-decision-presentation-DESIGN §3.3). The report and the focus dossier are the SAME presenter: both emit
3
- // a self-contained, DS-styled `<article>` FRAGMENT (structure + namespaced classes + `data-*` variants, NO
4
- // inline styling, NO tokens embedded), with markdown/sanitization INJECTED by the host. The design system
5
- // supplies the CSS (`--st-*` tokens) and wrapping; a fragment is embeddable in the Svelte app OR any host.
6
- //
7
- // This module defines the contract ONCE. Two implementations conform to it:
8
- // • focus — `@sentropic/focus` `renderHtml(DecisionDossierDocument, HtmlRenderHooks)` (the dossier side),
9
- // already vendored in `../focus-vendor/render/html.js`;
10
- // • report — `renderReportHtml(ReportView, DsFragmentHooks)` (this repo, `./html.ts`).
11
- // Both take `(model, hooks) => sanitizedFragment` and share the SAME hooks shape (a superset of focus's
12
- // `HtmlRenderHooks`: `renderMarkdown` is OPTIONAL because a report carries no prose). The full Svelte app
13
- // (design-system-svelte, focus L-D) consumes this contract — it is the cross-repo DS piece, out of scope
14
- // here; this repo ships the DS-compatible FRAGMENT that app embeds.
15
- /**
16
- * Minimal HTML text escaping for attribute/text content the renderer itself emits (§A4 — every interpolated
17
- * user title/ref MUST pass through this before landing in the fragment, so a forged title cannot inject
18
- * markup). Byte-for-byte the same escape focus's renderer uses, so the two fragments are consistent.
19
- */
20
- export const escapeHtml = (value) => value
21
- .replace(/&/g, '&amp;')
22
- .replace(/</g, '&lt;')
23
- .replace(/>/g, '&gt;')
24
- .replace(/"/g, '&quot;')
25
- .replace(/'/g, '&#39;');
26
- /**
27
- * The trusted-local-CLI hooks (identity sanitize): track's `--format html` is a local surface, not untrusted
28
- * network output — the renderer already escapes every interpolation, so identity sanitize is safe here. An
29
- * L4/web host (the Svelte app) supplies a REAL DOMPurify/sanitize-html hook instead.
30
- */
31
- export const IDENTITY_HOOKS = { sanitizeHtml: (h) => h };
32
- //# sourceMappingURL=present.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"present.js","sourceRoot":"","sources":["../../src/report/present.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,4GAA4G;AAC5G,2GAA2G;AAC3G,0GAA0G;AAC1G,2GAA2G;AAC3G,EAAE;AACF,4EAA4E;AAC5E,6GAA6G;AAC7G,qEAAqE;AACrE,yFAAyF;AACzF,wGAAwG;AACxG,0GAA0G;AAC1G,yGAAyG;AACzG,oEAAoE;AAqBpE;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAa,EAAU,EAAE,CAClD,KAAK;KACF,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;KACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;KACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;KACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;KACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;AAE3B;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAoB,EAAE,YAAY,EAAE,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,EAAE,CAAA"}