@ascenda-one/history-import 0.1.17 → 0.1.19
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.
- package/dist/activeSplit.js +30 -0
- package/dist/activeSplit.js.map +1 -1
- package/dist/activeTimeFigures.js +84 -0
- package/dist/activeTimeFigures.js.map +1 -0
- package/dist/cli.js +468 -214
- package/dist/cli.js.map +1 -1
- package/dist/crossStoreElapsed.js +178 -0
- package/dist/crossStoreElapsed.js.map +1 -0
- package/dist/extractors/claudeCode.js +2 -2
- package/dist/extractors/claudeCode.js.map +1 -1
- package/dist/extractors/codex.js +2 -2
- package/dist/extractors/codex.js.map +1 -1
- package/dist/handoffActiveTime.js +142 -0
- package/dist/handoffActiveTime.js.map +1 -0
- package/dist/localHandoff.js +83 -32
- package/dist/localHandoff.js.map +1 -1
- package/package.json +1 -1
package/dist/activeSplit.js
CHANGED
|
@@ -62,6 +62,36 @@ import { autonomyBand } from "@ascenda-one/tool-kit";
|
|
|
62
62
|
export function snakeCasePermissionMode(mode) {
|
|
63
63
|
return mode.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase();
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* The gap that ends a stretch of work, in milliseconds — one definition for
|
|
67
|
+
* every store this package reads.
|
|
68
|
+
*
|
|
69
|
+
* **Defined here, still injected.** The extractors used to hold a literal
|
|
70
|
+
* each, which is how a package with one documented rule came to have two
|
|
71
|
+
* copies of the number it rests on. They now import this and pass it in, so
|
|
72
|
+
* the call-site contract `SplitOptions` describes is unchanged and there is
|
|
73
|
+
* one value to change rather than two to keep in step.
|
|
74
|
+
*
|
|
75
|
+
* **5 minutes, and the reason is the hands-on half.** Hands-on is the interval
|
|
76
|
+
* immediately preceding a human prompt, and that prompt is the entire evidence
|
|
77
|
+
* a person was present — so the threshold sets how much absence one prompt is
|
|
78
|
+
* allowed to vouch for. At five minutes the interval reads as someone reading
|
|
79
|
+
* output and typing. Widening it to thirty admits "left, came back half an
|
|
80
|
+
* hour later, and typed" and counts the absence as time at a keyboard, which
|
|
81
|
+
* is a claim this module's own definition cannot support. Measured on a real
|
|
82
|
+
* 697-session store, thirty minutes inflates hands-on 3.5x and supervising
|
|
83
|
+
* 1.4x — the asymmetry is the tell, because the two halves rest on different
|
|
84
|
+
* evidence and only one of them is bounded by a prompt.
|
|
85
|
+
*
|
|
86
|
+
* **The backend gap-splits at thirty, on purpose, and that is not a bug to
|
|
87
|
+
* reconcile.** It measures block length and coverage rather than hands-on, and
|
|
88
|
+
* a longer bridge is a feature there. The two rails therefore measure
|
|
89
|
+
* different quantities with the same-shaped constant, and the decision
|
|
90
|
+
* (ascendaone-com/ai-engineer-tools#81) was to keep both and make every
|
|
91
|
+
* surface say which rule produced its figure rather than unify a spelling.
|
|
92
|
+
* `HandoffFile.activeGapMinutes` is this package's half of that.
|
|
93
|
+
*/
|
|
94
|
+
export const DEFAULT_ACTIVE_GAP_MS = 5 * 60_000;
|
|
65
95
|
/**
|
|
66
96
|
* The active spans of a timeline, in order.
|
|
67
97
|
*
|
package/dist/activeSplit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activeSplit.js","sourceRoot":"","sources":["../src/activeSplit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,OAAO,EAAE,YAAY,EAAqB,MAAM,uBAAuB,CAAC;AAExE;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAY;IAClD,OAAO,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;AACnE,CAAC;
|
|
1
|
+
{"version":3,"file":"activeSplit.js","sourceRoot":"","sources":["../src/activeSplit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,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ff reports.
|
|
4
|
+
*
|
|
5
|
+
* **Keyed on `Interface.field`, never on the field name alone**, because in this
|
|
6
|
+
* file a bare name is genuinely ambiguous: `handsOnMinutes` is summed across
|
|
7
|
+
* sessions on {@link HandoffProjectDigest} and unioned on
|
|
8
|
+
* {@link ProjectElapsedActive}, one nesting level apart under one spelling. Both
|
|
9
|
+
* are deliberate — the sums are kept because agent-hours is a real quantity and
|
|
10
|
+
* because removing them would silently change every existing reader — and until
|
|
11
|
+
* this table nothing mechanical told them apart. That is the asc-core-be#194
|
|
12
|
+
* shape: two figures sharing a name with nothing on either distinguishing them.
|
|
13
|
+
*
|
|
14
|
+
* The vocabulary itself is vendored in
|
|
15
|
+
* `packages/tool-contract/contracts/active-time-quantities.v1.json`, so a name
|
|
16
|
+
* used here that the backend does not own fails a build rather than a dashboard.
|
|
17
|
+
*
|
|
18
|
+
* **The assignments are not vendored — three repos keep three of these by hand,
|
|
19
|
+
* and changing one means reading the other two.** See asc-core-be
|
|
20
|
+
* `docs/ACTIVE_TIME.md`, "The vocabulary is shared; the assignments are three
|
|
21
|
+
* hand-kept registries", for the sibling paths and the one-line test.
|
|
22
|
+
*/
|
|
23
|
+
export const ACTIVE_TIME_FIGURES = {
|
|
24
|
+
// One session cannot overlap itself, so its figures are already elapsed.
|
|
25
|
+
// `activeMinutes` is gap-split minutes at the 5-minute rule; hands-on and
|
|
26
|
+
// supervising are its two halves and must never be rendered as one.
|
|
27
|
+
"HandoffSession.activeMinutes": "coverage",
|
|
28
|
+
"HandoffSession.handsOnMinutes": "hands_on",
|
|
29
|
+
"HandoffSession.agentSupervisingMinutes": "supervising",
|
|
30
|
+
"CodexHandoffSession.activeMinutes": "coverage",
|
|
31
|
+
"CodexHandoffSession.handsOnMinutes": "hands_on",
|
|
32
|
+
"CodexHandoffSession.agentSupervisingMinutes": "supervising",
|
|
33
|
+
// Summed over sessions, from the sessions' own minute figures. On the
|
|
34
|
+
// reference machine these came to 4.2x the wall clock of the period they
|
|
35
|
+
// described, which is why they are agent-hours and not time.
|
|
36
|
+
"HandoffProjectDigest.handsOnMinutes": "hands_on_agent_hours",
|
|
37
|
+
"HandoffProjectDigest.agentSupervisingMinutes": "supervising_agent_hours",
|
|
38
|
+
// The same time unioned instead of added up. This is the figure to render as
|
|
39
|
+
// time, and the reason the pair above needed a different name rather than a
|
|
40
|
+
// warning comment.
|
|
41
|
+
"ProjectElapsedActive.handsOnMinutes": "hands_on",
|
|
42
|
+
"ProjectElapsedActive.agentSupervisingMinutes": "supervising",
|
|
43
|
+
// Per local day, both readings side by side so a window can state its own
|
|
44
|
+
// concurrency instead of borrowing a corpus-wide ratio.
|
|
45
|
+
"ProjectElapsedDay.handsOnMinutes": "hands_on",
|
|
46
|
+
"ProjectElapsedDay.agentSupervisingMinutes": "supervising",
|
|
47
|
+
"ProjectElapsedDay.summedHandsOnMinutes": "hands_on_agent_hours",
|
|
48
|
+
"ProjectElapsedDay.summedAgentSupervisingMinutes": "supervising_agent_hours",
|
|
49
|
+
// One local day of one session — the day's share of that session's own split.
|
|
50
|
+
// A session cannot overlap itself, so these are elapsed. They sat in
|
|
51
|
+
// daySlice.ts unlabelled while the scan read only localHandoff.ts; the app
|
|
52
|
+
// workspace registers a class of the same name with the same three
|
|
53
|
+
// quantities, so the two rails already agreed and one could not see its own
|
|
54
|
+
// copy.
|
|
55
|
+
"SessionDaySlice.activeMinutes": "coverage",
|
|
56
|
+
"SessionDaySlice.handsOnMinutes": "hands_on",
|
|
57
|
+
"SessionDaySlice.agentSupervisingMinutes": "supervising"
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Fields whose names are figure-shaped but which are not figures, with reasons.
|
|
61
|
+
*
|
|
62
|
+
* `activeGapMinutes` is the label saying how the figures were cut — the second
|
|
63
|
+
* third of the `{quantity, gapMinutes, basis}` triple, not a quantity of its
|
|
64
|
+
* own. Registering it would claim the gap is a measurement of something.
|
|
65
|
+
*/
|
|
66
|
+
export const NOT_ACTIVE_TIME_FIGURES = {
|
|
67
|
+
"HandoffFile.activeGapMinutes": "the gap rule these figures were cut by, not a figure",
|
|
68
|
+
"CodexHandoffFile.activeGapMinutes": "the gap rule these figures were cut by, not a figure",
|
|
69
|
+
"CrossStoreElapsedFile.activeGapMinutes": "the gap rule these figures were cut by, not a figure"
|
|
70
|
+
};
|
|
71
|
+
/** The quantity a figure reports, or undefined when it is not registered. */
|
|
72
|
+
export function quantityOf(iface, field) {
|
|
73
|
+
return ACTIVE_TIME_FIGURES[`${iface}.${field}`];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Whether a figure may be rendered as elapsed time — "where your week went".
|
|
77
|
+
*
|
|
78
|
+
* A summed figure quoted as elapsed time is the specific defect the
|
|
79
|
+
* elapsed/summed split exists to prevent.
|
|
80
|
+
*/
|
|
81
|
+
export function isElapsed(quantity) {
|
|
82
|
+
return ASCENDA_ELAPSED_QUANTITIES[quantity];
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=activeTimeFigures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activeTimeFigures.js","sourceRoot":"","sources":["../src/activeTimeFigures.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAE3B,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAwD;IACtF,yEAAyE;IACzE,0EAA0E;IAC1E,oEAAoE;IACpE,8BAA8B,EAAE,UAAU;IAC1C,+BAA+B,EAAE,UAAU;IAC3C,wCAAwC,EAAE,aAAa;IAEvD,mCAAmC,EAAE,UAAU;IAC/C,oCAAoC,EAAE,UAAU;IAChD,6CAA6C,EAAE,aAAa;IAE5D,sEAAsE;IACtE,yEAAyE;IACzE,6DAA6D;IAC7D,qCAAqC,EAAE,sBAAsB;IAC7D,8CAA8C,EAAE,yBAAyB;IAEzE,6EAA6E;IAC7E,4EAA4E;IAC5E,mBAAmB;IACnB,qCAAqC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