mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-11-29 02:39:13 +00:00
fix(sync): never put a filesystem path on the wire as ai.project
Several providers key a project by its sanitized absolute path
("-Users-me-Projects-app"), and sync shipped that verbatim as ai.project
on usage and attribution spans — contradicting docs/sync/README.md's
promise that file paths stay local. Confirmed on real exports.
One choke point after parseAllSessions maps project to the leaf directory
name before either wire path reads it; codeburn yield's local output is
untouched. Never-lose: usage span ids and commit attribution keys carry
no project (unchanged, no re-send); session attribution keys hash the
record, so each already-synced session re-emits once and the receiver
upserts by (org, trace) — replaced, not duplicated. Two directories with
the same leaf name now collapse to one wire project identity; that is
the documented contract, and git.repo still disambiguates.
This commit is contained in:
parent
e5f02933c4
commit
fcbc28540f
3 changed files with 34 additions and 3 deletions
|
|
@ -23,7 +23,7 @@ import {
|
|||
import { createCredentialStore } from './credentials.js'
|
||||
import { readSyncConfig, writeSyncConfig, deleteSyncConfig, updateLastSync } from './config.js'
|
||||
import { collectUnsentCalls, collectUnsentAttribution, sendBatches, sendAttributionBatches, batchCalls, MAX_PER_PUSH, MAX_ATTRIBUTION_PER_PUSH, type PushResult } from './push.js'
|
||||
import { batchAttributionItems } from './otlp.js'
|
||||
import { batchAttributionItems, wireProjectName } from './otlp.js'
|
||||
|
||||
export function registerSyncCommands(program: Command): void {
|
||||
const sync = program
|
||||
|
|
@ -274,7 +274,8 @@ export function registerSyncCommands(program: Command): void {
|
|||
process.exit(1)
|
||||
}
|
||||
const { range } = getDateRange(period)
|
||||
const projects = await parseAllSessions(range)
|
||||
const projects = (await parseAllSessions(range))
|
||||
.map(p => ({ ...p, project: wireProjectName(p.projectPath, p.project) }))
|
||||
|
||||
// Flatten + filter against sent-ledger
|
||||
const { allCalls, unsent, held, frozen } = collectUnsentCalls(projects)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue