Skip to content

Commit f58948e

Browse files
Consume Harmony via NuGet instead of submodule (#2354)
* Remove backend/harmony git submodule. * Consume Harmony via NuGet with optional local source mode. * remove commitId from IChange ts interface * Add migration adding new Commits index --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d41dacd commit f58948e

35 files changed

Lines changed: 1010 additions & 139 deletions

.claude/agents/harmony-sentinel.md

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,61 @@
11
---
22
name: harmony-sentinel
3-
description: Review changes to the backend/harmony submodule — submodule-pointer bumps or in-place edits. Thin shim that cites harmony's own AGENTS.md as the authoritative source; the substrate-author standards (change-application semantics, snapshot equivalence, commit ordering, backward compatibility) live in the harmony repo where they belong.
3+
description: Review Harmony package version bumps and MSBuild reference changes in LexBox. Thin shim that cites the harmony repo's AGENTS.md as the authoritative source for substrate-author standards (change-application semantics, snapshot equivalence, commit ordering, backward compatibility).
44
tools: Bash, Read, Grep, Glob
55
model: opus
66
---
77

8-
You review changes to the Harmony CRDT library — the substrate every
9-
FwLite component depends on. Stakes are higher than any other domain:
10-
a bug here ripples to all consumers.
8+
You review changes to how LexBox depends on the Harmony CRDT library — the
9+
substrate every FwLite component depends on. Stakes are higher than any other
10+
domain: a bug here ripples to all consumers.
1111

12-
You are a **thin shim**. The standards live in
13-
`backend/harmony/AGENTS.md` (canonical) — read that file before
14-
reviewing and walk its standards against the diff.
12+
You are a **thin shim**. The standards live in the
13+
[sillsdev/harmony](https://github.com/sillsdev/harmony) repo's `AGENTS.md`
14+
(canonical) — read that file before reviewing and walk its standards against
15+
the release notes / changelog for the version being adopted.
1516

1617
## How the diff arrives
1718

18-
**Submodule pointer bump** — lexbox PR moves the submodule SHA forward.
19+
**Package version bump** — lexbox PR updates `SIL.Harmony*` versions in
20+
`backend/Directory.Packages.props` (and possibly `backend/Harmony*.props`).
1921

2022
```bash
21-
git diff origin/develop...HEAD -- backend/harmony | grep '^[-+]Subproject'
22-
cd backend/harmony && git log OLD..NEW --oneline
23-
cd backend/harmony && git diff OLD..NEW
23+
git diff origin/develop...HEAD -- backend/Directory.Packages.props backend/Harmony*.props
2424
```
2525

26-
**In-place edits** — lexbox PR contains uncommitted work inside
27-
`backend/harmony/`. Diff those files directly.
26+
Cross-check the new version against the harmony repo release tag / commit range
27+
on GitHub. If the PR body links a harmony release, verify the pinned versions
28+
match.
2829

29-
## If harmony isn't initialized
30+
**Local source mode changes** — edits to `backend/Harmony.props` or
31+
`backend/Harmony.*.References.props` that affect `UseHarmonySource` /
32+
`HarmonySourcePath` behavior.
3033

31-
The `.claude/hooks/session-start.sh` SessionStart hook initializes the
32-
submodule on session start. If for some reason it's empty:
34+
## If you cannot read the harmony release
3335

34-
> ⚠️ important — Can't review harmony content; submodule not fetched.
35-
> Recommend running `git submodule update --init --recursive backend/harmony`,
36-
> or opening a PR in `sillsdev/harmony` directly.
36+
> ⚠️ important — Can't review substrate changes without the harmony release
37+
> diff. Open the tagged commit on GitHub (`sillsdev/harmony`) for the pinned
38+
> version, or ask the author to link the release notes.
3739
3840
Don't fabricate findings against unread code.
3941

40-
## If harmony has no AGENTS.md yet
41-
42-
The thin-shim design assumes `backend/harmony/AGENTS.md` exists. If
43-
absent at this submodule SHA:
44-
45-
> ⚠️ important — `backend/harmony/AGENTS.md` not present at this SHA.
46-
> Falling back to a reduced check: serialization-shape changes
47-
> (`[JsonConstructor]`, property renames in `Change<T>` subclasses),
48-
> public API of `IChangeContext` / `DataModel.QueryLatest<T>`,
49-
> projected-table generators. Recommend bumping the submodule to a SHA
50-
> that includes
51-
> AGENTS.md so the full review can run.
52-
5342
## Standard review
5443

55-
1. **Read `backend/harmony/AGENTS.md` in full.** It owns the
44+
1. **Read harmony's `AGENTS.md` at the release tag** (on GitHub). It owns the
5645
substrate-author standards (change-application semantics, snapshot
5746
equivalence, commit ordering, backward compatibility of serialized
5847
formats, performance, test coverage expectations).
59-
2. **Walk those standards against the diff window**
60-
(`git log OLD..NEW` commits for a pointer bump, or in-place edits).
61-
3. **Frame data-loss / consumer-break findings bluntly.** Cite specific
62-
commits within the harmony range. Reference harmony files by path.
48+
2. **Walk those standards against the harmony changelog** between the old and
49+
new pinned versions.
50+
3. **Flag LexBox consumer breaks** — serialization shape changes, public API
51+
changes to `DataModel`, `IChangeContext`, projected-table behavior.
52+
4. **Frame data-loss / consumer-break findings bluntly.** Cite harmony files
53+
by path in the upstream repo.
6354

6455
## Out of scope
6556

6657
- LexBox / FwLite *usage* of harmony — `fwlite-sentinel`'s job.
67-
- Submodule pointer mechanics (gitlink correctness, .gitmodules) —
68-
flag only if the pointer change looks accidental (e.g. moves
69-
backward without justification).
58+
- Whether to use NuGet vs source mode — a developer workflow choice.
7059

7160
## Voice
7261

.claude/hooks/session-start.sh

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,6 @@
11
#!/bin/bash
22
# SessionStart hook for claude/amazing-franklin-BXNI5 and beyond.
33
#
4-
# Ensures `backend/harmony/` (the CRDT substrate submodule) is checked out so
5-
# that subagents — particularly `harmony-sentinel` — can read its content.
6-
# Without this, plain `git clone` leaves the submodule as a bare gitlink
7-
# pointer and any agent that tries to read inside it gets an empty directory.
8-
#
9-
# Idempotent: `git submodule update --init --recursive` is a no-op when the
10-
# submodule is already at the pinned SHA.
11-
#
12-
# Non-fatal on network failure: a transient github.com outage shouldn't block
13-
# the whole session. We log and continue.
14-
15-
set -uo pipefail
16-
17-
# Only act in the remote (Claude Code on the web) environment. Local devs
18-
# manage their own submodules.
19-
if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then
20-
exit 0
21-
fi
22-
23-
cd "${CLAUDE_PROJECT_DIR:-$(pwd)}"
24-
25-
echo "[session-start] initializing backend/harmony submodule…"
26-
if git submodule update --init --recursive backend/harmony 2>&1; then
27-
echo "[session-start] harmony submodule ready at $(cd backend/harmony && git rev-parse --short HEAD 2>/dev/null || echo 'unknown')"
28-
else
29-
rc=$?
30-
echo "[session-start] WARN: submodule init failed (exit $rc); harmony-sentinel reviews will report 'submodule not fetched' until resolved." >&2
31-
fi
4+
# Harmony is consumed via NuGet; no submodule initialization required.
325

33-
# Always exit 0 so a failed submodule init doesn't block the session.
346
exit 0

.claude/skills/_shared/apply-rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ otherwise. One decision at a time.
6565

6666
- Commit, push, open a PR.
6767
- Run integration tests (root `AGENTS.md`).
68-
- Touch `backend/harmony` submodule contents.
68+
- Bump `SIL.Harmony*` package versions without `harmony-sentinel` review.
6969
- Modify `.git/`, `deployment/` PVCs, or any infrastructure state.
7070

7171
## Re-validate after fixes (loop, hard cap 2)

.claude/skills/_shared/dispatch-matrix.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Dispatch via `Agent` with `subagent_type=<name>` (the value in the
2222

2323
| Touched | Agent |
2424
|---|---|
25-
| `backend/harmony/**` (submodule pointer bump or in-place edits) | `harmony-sentinel` |
25+
| `backend/Directory.Packages.props` or `backend/Harmony*.props` (SIL.Harmony* version or reference changes) | `harmony-sentinel` |
2626
| `backend/FwLite/**` | `fwlite-sentinel` |
2727
| `backend/FwHeadless/**` | `fwheadless-sentinel` |
2828
| `backend/LexBoxApi/GraphQL/**` or any `.cs` with `[GraphQLType]` / `[QueryType]` / `[MutationType]` / `[ObjectType]` | `graphql` (additive — `dotnet-stylist` still runs on these too) |

.github/workflows/codeql.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ jobs:
4444
steps:
4545
- name: Checkout repository
4646
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
47-
with:
48-
submodules: true
4947

5048

5149
# Initializes the CodeQL tools for scanning.

.github/workflows/fw-lite.yaml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ on:
44
push:
55
paths:
66
- 'backend/FwLite/**'
7-
- 'backend/harmony/**'
7+
- 'backend/Directory.Packages.props'
8+
- 'backend/Harmony*.props'
89
- 'frontend/viewer/**'
910
- '.github/workflows/fw-lite.yaml'
1011
- 'FwLiteOnly.slnf'
@@ -14,7 +15,8 @@ on:
1415
pull_request:
1516
paths:
1617
- 'backend/FwLite/**'
17-
- 'backend/harmony/**'
18+
- 'backend/Directory.Packages.props'
19+
- 'backend/Harmony*.props'
1820
- 'frontend/viewer/**'
1921
- '.github/workflows/fw-lite.yaml'
2022
- 'FwLiteOnly.slnf'
@@ -35,8 +37,6 @@ jobs:
3537
steps:
3638
- name: Checkout
3739
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
38-
with:
39-
submodules: true
4040
- uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
4141
with:
4242
dotnet-version: '10.x'
@@ -171,8 +171,6 @@ jobs:
171171
steps:
172172
- name: Checkout
173173
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
174-
with:
175-
submodules: true
176174
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
177175
with:
178176
name: fw-lite-viewer-js
@@ -208,8 +206,6 @@ jobs:
208206
steps:
209207
- name: Checkout
210208
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
211-
with:
212-
submodules: true
213209
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
214210
with:
215211
name: fw-lite-viewer-js
@@ -254,8 +250,6 @@ jobs:
254250
steps:
255251
- name: Checkout
256252
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
257-
with:
258-
submodules: true
259253
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
260254
with:
261255
name: fw-lite-viewer-js
@@ -308,8 +302,6 @@ jobs:
308302
steps:
309303
- name: Checkout
310304
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
311-
with:
312-
submodules: true
313305
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
314306
with:
315307
name: fw-lite-viewer-js

.github/workflows/integration-test-gha.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
23-
with:
24-
submodules: true
2523
- uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
2624
with:
2725
dotnet-version: '10.x'

.github/workflows/integration-test.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ jobs:
6969
runs-on: ${{ inputs.runs-on }}
7070
steps:
7171
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
72-
with:
73-
submodules: true
7472
- uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
7573
with:
7674
dotnet-version: '10.x'

.github/workflows/lexbox-api.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ jobs:
4545

4646
steps:
4747
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
48-
with:
49-
submodules: true
5048
- uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
5149
with:
5250
dotnet-version: '10.x'

.github/workflows/lexbox-fw-headless.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ jobs:
4545

4646
steps:
4747
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
48-
with:
49-
submodules: true
5048
- uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
5149
with:
5250
dotnet-version: '10.x'

0 commit comments

Comments
 (0)