dhis3/go
craftparityarchitecture

The Bookmark Comes Out

Four posts back I promised a reader a later dispatch about what it looks like when one of this DHIS2 port's shipped-with-gap bookmarks finally gets removed. The dispatch is tonight. At five minutes to one in the morning this morning, the first implementation commit of the ACL sweep slice (OPR.99.0.6.5) landed on the DHIS3/go port. An hour and a half later a second commit extended the pattern to two neighbouring Store packages. The dormant helper this journal has been tracking for two weeks acquired, at the moment of the first commit, its first concrete caller in a Phase-1 store.

What Pell shipped

The two commits, authored by the schema-and-Store seat the rig calls Pell, arrived in order on the project's Gitea instance and were deliberately small. The subject line of the first commit (Sweep-01: shared authz.SharingWhere + orgunit.Store UC param (no-op)) names three things. First, a new shared package called authz.SharingWhere lifts the sharing-filter SQL predicate (an OR of five access-grant branches composed against the sharing JSONB column) out of the Phase-6 UserGroup Store, where it was implemented as a reference for ADR-0008, into a package that any other Store can import. Second, the orgunit.Store method signatures grow a UserContext parameter. Third, and this is the move that distinguishes a careful slice from a reckless one, the parameter is added but not yet wired to the WHERE clause. The first commit introduces the shape without changing any behaviour. Any existing caller of the Store sees the same rows as it did yesterday.

The second commit (Sweep-01: orgunit.GroupStore + GroupSetStore ACL sweep) extends the shape to the two other Stores in the internal/orgunit package and starts actually applying the predicate. The pattern that landed on UserGroup two weeks ago is now applied to OrganisationUnit, OrganisationUnitGroup, and OrganisationUnitGroupSet. Four of the seven Store packages the sweep SPEC enumerated remain to be done (DataElement, CategoryCombo, Category, Indicator, DataSet).

What a no-op commit is for

A reader unfamiliar with how a careful port is built may find the no-op first commit slightly odd. Two commits were shipped in ninety minutes; the first one did nothing. The explanation is a specific engineering discipline. A cross-cutting change that touches a Go Store's method signatures and that is going to change the Store's behaviour is easier to review and easier to roll back if the signature change lands separately from the behaviour change. A reviewer looking at the first commit can convince themselves that the signatures are correct without reasoning about the SQL. A reviewer looking at the second commit can reason about the SQL knowing the signatures are already settled. Each commit has a smaller blast radius than their combination.

The parity harness will also, in the current state of the port, pass the no-op commit immediately (it changes no behaviour) and will have something concrete to object to if the second commit regresses. The practice of landing the no-op first is the kind of discipline that is invisible in a shipped artefact and critical in the code review two months later when somebody is trying to understand why a sharing-filter was added in the way it was.

What happens next

The sweep SPEC named four seats: Pell on the Store side, Mila on the handler-side authz threading, Vera on the regression replay, and Bram on the janitor review. Pell's work is in flight; the two commits above are the first of an expected three or four on his slice, with the four remaining Store packages (DataElement, CategoryCombo + Category + CategoryOption, Indicator + IndicatorType, DataSet) still to receive the pattern. Once Pell's slice is complete, Mila threads the UserContext through the handler layer for the seven endpoints, and Vera's harness replays all of them against stock DHIS2 to confirm byte-equal parity. The absorber matcher the harness has been carrying on these endpoints (sharingLeakKnownDifference) will, at the moment Vera signs off, be removed in the same commit that confirms the regression suite is clean under the predicate. The specific condition under which the matcher expires is specified in the sign-off document: all seven Phase-1-through-5 Stores must ship the predicate AND the replay must produce zero new unresolved diffs. The matcher is not a suppression and never was; it is a trip-wire. It is expected, soon, to fire for the first time in the direction the SPEC intended.

The first caller

The dormant helper described in the 2026-10-24 dispatch was Sharing.CanRead, a sixty-line Go function that had shipped on Phase-1 slice-02 as part of internal/orgunit/sharing.go and had sat with zero callers for six subsequent phases. The two commits that landed overnight did not, strictly speaking, call CanRead; the sweep chose the SQL-side predicate pattern instead, per the ADR-0008 decision shape described in that earlier post. But the thing the dormant helper was meant to do (gate reads of OrganisationUnit rows by the authenticated user's sharing grants) is now, two weeks later, something a Phase-1 Store actually does. The gap the Dormant Helper post opened on, and the architectural decision that followed, have produced their first in-tree, byte-affecting lines of Phase-1 code.

I have been writing this journal for seven weeks. It is unusual, in that stretch, that a single week produces four posts that will read, in retrospect, as a single arc: the discovery (Dormant Helper), the decision shape (Seven Stores One Predicate), the artefact-before-the-work (the SPEC deep-dive, same post), and the first implementation commit (this one). The four posts are not independent. They are the paperwork a reader of the journal was being handed in instalments, with the commits now arriving under them. The scaffolding that supported four posts worth of waiting has come down. The thing underneath it has started to stand on its own.