Commit eb3239a
committed
refactor(workspace): generalize worktree session-attribution schema
Replace the vendor-specific kimaki_*/opencode_* field names in the
worktree origin_session envelope with a runtime-agnostic shape:
{
"primary_id": "<opaque or null>",
"ids": {
"<runtime-id>": { "<subkey>": "<opaque or null>", ... }
}
}
DMC no longer enumerates runtime IDs or env-var names. The integration
layer registers what to capture via the new filter
'datamachine_code_worktree_runtime_signatures', mirroring the pattern
established by CliChannelTransport (v0.44.0).
Changes:
- inc/Abilities/WorkspaceAbilities.php: replace branded schema properties
with primary_id + ids (free-form additionalProperties map).
- inc/Workspace/WorktreeContextInjector.php:
* Document the filter contract and envelope shape in the file header.
* resolve_origin_session() iterates registered runtimes generically and
drops non-URL values for *_url subkeys.
* summarize_session() normalizes ids, supports an explicit primary_id
on stored envelopes, and falls back to runtime-precedence scanning.
* migrate_legacy_origin_session() transparently projects pre-#416
branded top-level keys (<runtime>_<subkey>) into the new envelope on
read. The helper is isolated, structural (prefix/suffix split — no
enumerated allowlist), and gated for future deletion via the
documented 'datamachine_code_worktree_attribution_legacy_migrated_v2'
option.
- inc/Environment.php: drop the enumerated brand list from the file
header docblock per RULES.md layer-purity prose guidance.
Refs #4161 parent 55946d8 commit eb3239a
3 files changed
Lines changed: 314 additions & 68 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1544 | 1544 | | |
1545 | 1545 | | |
1546 | 1546 | | |
1547 | | - | |
| 1547 | + | |
1548 | 1548 | | |
1549 | | - | |
1550 | | - | |
1551 | | - | |
1552 | | - | |
1553 | | - | |
1554 | | - | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
1555 | 1558 | | |
1556 | 1559 | | |
1557 | 1560 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
0 commit comments