pi-fovea 0.18.2 → 0.18.3
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/README.md +1 -1
- package/package.json +1 -1
- package/src/core/provenance.ts +7 -1
package/README.md
CHANGED
|
@@ -205,7 +205,7 @@ next user prompt instead; it never restarts an idle agent. The compact update
|
|
|
205
205
|
names changed files, route deltas, and newly relevant files. Shell commands,
|
|
206
206
|
external editors, and agents without Fovea remain `unattributed` rather than
|
|
207
207
|
being guessed, while the path scope still keeps unrelated sibling sandboxes
|
|
208
|
-
quiet. Provenance journals accept either intercepted mutations or explicit trusted SHA-1 transitions, write one bounded replacement per event batch, expire after seven days, and live in
|
|
208
|
+
quiet. Provenance journals accept either intercepted mutations or explicit trusted SHA-1 transitions, preserve supplied commit order, write one bounded replacement per event batch, expire after seven days, and live in
|
|
209
209
|
`$TMPDIR`; repository content remains the drift oracle. Updates list causal
|
|
210
210
|
channels such as calls, imports, shared literals, tests, or co-change history.
|
|
211
211
|
By default Fovea also embeds the refreshed focus context of the top drift target
|
package/package.json
CHANGED
package/src/core/provenance.ts
CHANGED
|
@@ -13,6 +13,7 @@ interface MutationRecord {
|
|
|
13
13
|
afterSha?: string;
|
|
14
14
|
owner: string;
|
|
15
15
|
toolCallId: string;
|
|
16
|
+
commitOrder?: number;
|
|
16
17
|
at: number;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -34,6 +35,7 @@ export interface MutationTransition {
|
|
|
34
35
|
path: string;
|
|
35
36
|
beforeSha?: string | undefined;
|
|
36
37
|
afterSha?: string | undefined;
|
|
38
|
+
commitOrder?: number | undefined;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
type ProvenanceKind = "current-session" | "other-session" | "mixed" | "unattributed";
|
|
@@ -114,6 +116,7 @@ export const recordMutationTransitions = async (
|
|
|
114
116
|
afterSha: transition.afterSha,
|
|
115
117
|
owner,
|
|
116
118
|
toolCallId,
|
|
119
|
+
...(transition.commitOrder === undefined ? {} : { commitOrder: transition.commitOrder }),
|
|
117
120
|
at,
|
|
118
121
|
}];
|
|
119
122
|
});
|
|
@@ -179,7 +182,10 @@ const readRecords = async (root: string, since: number): Promise<MutationRecord[
|
|
|
179
182
|
// A concurrent atomic replacement or malformed journal is unattributed.
|
|
180
183
|
}
|
|
181
184
|
}));
|
|
182
|
-
return records.sort((a, b) => a.at - b.at
|
|
185
|
+
return records.sort((a, b) => a.at - b.at
|
|
186
|
+
|| a.owner.localeCompare(b.owner)
|
|
187
|
+
|| (a.commitOrder ?? Number.MAX_SAFE_INTEGER) - (b.commitOrder ?? Number.MAX_SAFE_INTEGER)
|
|
188
|
+
|| a.toolCallId.localeCompare(b.toolCallId));
|
|
183
189
|
};
|
|
184
190
|
|
|
185
191
|
const kindForOwners = (owners: Set<string>, currentOwner: string): ProvenanceKind => {
|