Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
5193baa
Inital moveover to C#, very incomplete and was mostly handled by AI w…
Azyyyyyy Mar 15, 2026
aa19a46
Last bit to complete an API. To make DB schema the same and allow usi…
Azyyyyyy Mar 16, 2026
4c60c3d
Start on schema alignment
Azyyyyyy Mar 17, 2026
4e19aa2
DB schema re-alisgment (should) be finished now
Azyyyyyy Mar 17, 2026
b6f217e
endpoint & (~runtime) logic aligment
Azyyyyyy Mar 17, 2026
11e9213
More logic gaps
Azyyyyyy Mar 17, 2026
89860e8
last bits (hopefully) required to run the same as exliar version
Azyyyyyy Mar 17, 2026
98bc1d0
Add swagger to Api project
Azyyyyyy Mar 17, 2026
cc495db
Add auth endpoint, we actually get into the client now!
Azyyyyyy Mar 18, 2026
c379de5
Update to .NET 10 and we're now at the point where we can get into th…
Azyyyyyy Mar 19, 2026
8377046
Update readme
Azyyyyyy Mar 19, 2026
2df0e81
* Add event handling
Azyyyyyy Mar 22, 2026
26d7908
Tags are now semi operational!
Azyyyyyy Mar 22, 2026
4cb1493
* Added TODO's for which endpoints have not been tested yet
Azyyyyyy Mar 22, 2026
3a9a5f0
Split websocket logic into some more areas, to make it actually look …
Azyyyyyy Mar 22, 2026
e4da960
* Fix version store failing
Azyyyyyy Mar 23, 2026
a73bf9e
Get basic fronting working, also provides basic history!
Azyyyyyy Mar 23, 2026
95103df
Move event publishing to handlers, to cleanup the event handling even…
Azyyyyyy Mar 24, 2026
ea7638c
Inital websocket logic cleanup
Azyyyyyy Mar 24, 2026
28c70f1
Make all events be handled by their own HandleAsync funcion
Azyyyyyy Mar 24, 2026
6da7aed
* Remove `fronting_changed` from being sent, this is for internal use…
Azyyyyyy Mar 24, 2026
c6a7f2f
* Fix Primary being stuck on client
Azyyyyyy Mar 25, 2026
6aac9ea
* Basic friend request (accept) flow working - events to be published…
Azyyyyyy Mar 25, 2026
46a86ae
* Fix tags causes the client to not load up an alter in friend view
Azyyyyyy Mar 26, 2026
7aac420
Missing fix and start of making cleaner docker container files
Azyyyyyy Mar 30, 2026
ad921a5
* Add cassandra compose setup, allowing arm64 devices to fully run th…
Azyyyyyy Mar 30, 2026
6c9ba43
Add docker file for API
Azyyyyyy Mar 30, 2026
5d41789
Update API backend to new (temp?) name!
Azyyyyyy Mar 31, 2026
81af76b
Add basic ci for api
Azyyyyyy Mar 31, 2026
25f6585
Fix for unit tests
Azyyyyyy Mar 31, 2026
530d7bb
Add missing arg in pipeline
Azyyyyyy Mar 31, 2026
8ebcbeb
Actually fix test step
Azyyyyyy Mar 31, 2026
e6ec5bd
Ensure that github.repository_owner is lowercase
Azyyyyyy Mar 31, 2026
350fc09
Why is lower casing harder then it needs to be?!
Azyyyyyy Mar 31, 2026
ca7d1dc
Add latest tag to docker image
Azyyyyyy Mar 31, 2026
3fbe224
Add cert scripts [skip ci]
Azyyyyyy Mar 31, 2026
b0abcf5
Move to IConfiguration ready for proper config handling
Azyyyyyy Apr 1, 2026
e8d5ce3
Move over to typed settings
Azyyyyyy Apr 1, 2026
9517781
Ensure we are using https if setup and add `api.octocon.app` as an Ex…
Azyyyyyy Apr 2, 2026
1f3fef6
* Ensure msg-db is created with schema
Azyyyyyy Apr 4, 2026
7ca86fa
Fix friend events failing to send to the client correctly
Azyyyyyy Apr 4, 2026
8dcf75f
Fix friends failing to be seen when someone is fronting
Azyyyyyy Apr 4, 2026
b7dba07
* Fix some schema misalignment
Azyyyyyy Apr 5, 2026
b6327c5
* Removed some TODO's
Azyyyyyy Apr 5, 2026
3dfa101
Changes to get Polls working!
Azyyyyyy Apr 7, 2026
6e5f59e
* Add missing node on multi DC setup (gdpr)
Azyyyyyy Apr 7, 2026
8646457
* Add naming to docker compose for sane name in docker desktop
Azyyyyyy Apr 7, 2026
cc0cf8c
* Move postgres DB to it's own compose file (in case we're running wi…
Azyyyyyy Apr 8, 2026
2b291b6
* Fix avatar not being deleted for alters
Azyyyyyy Apr 8, 2026
f3ab7c3
* Fixed auth linking
Azyyyyyy Apr 9, 2026
8429414
Add encryption scripts to help support journal logic
Azyyyyyy Apr 9, 2026
8e2cb34
* Add logic for wipe alters and delete account (Still needs some test…
Azyyyyyy Apr 10, 2026
74c3f14
Move Integration tests to use `WebApplicationFactory`
Azyyyyyy Apr 12, 2026
537c900
Start of integration tests cleanup
Azyyyyyy Apr 13, 2026
87aec8b
Sort current tests into their controllers/endpoints. WebSocket tests …
Azyyyyyy Apr 14, 2026
e93f4d5
* Make frame & and array into a model & actually get (some) websocket…
Azyyyyyy Apr 16, 2026
195bd71
* Fix 401's in tests
Azyyyyyy Apr 18, 2026
acb6ede
(Non-skipped) Unit tests are passing now
Azyyyyyy Apr 18, 2026
88de025
* Make PrincipalId be collected within middleware, enforces it unless…
Azyyyyyy Apr 18, 2026
53f56a2
* Fix endpoint not using alterId
Azyyyyyy Apr 22, 2026
c91d3dc
Fix build errors
Azyyyyyy Apr 22, 2026
94080ba
* Add health checks for all main compose files
Azyyyyyy Apr 22, 2026
3d2d5c9
Fix IP clashing
Azyyyyyy Apr 22, 2026
42519c2
* Use docker actions instead of raw command
Azyyyyyy Apr 27, 2026
760f995
Small fix, used -web as a reference!
Azyyyyyy Apr 27, 2026
cbdcfe7
Remove unrequired step now we're using the docker actions
Azyyyyyy Apr 27, 2026
cd5bca7
Expose Code Coverage results
Azyyyyyy Apr 27, 2026
6ce128e
Use the correct output format
Azyyyyyy Apr 27, 2026
c78668b
third time the charm!
Azyyyyyy Apr 27, 2026
cdab403
* Make `PostgresConnectionFactory` use `PersistenceConfiguration` so …
Azyyyyyy Apr 28, 2026
5403a06
* Using cleanup
Azyyyyyy Apr 28, 2026
de446d9
Move DataAccess into their own projects
Azyyyyyy Apr 28, 2026
3eecd23
Refactor Contracts & Domain so:
Azyyyyyy Apr 28, 2026
adbbd08
[skip ci] Remove Cli project. It was very useful at the beginning but…
Azyyyyyy Apr 28, 2026
7f75a5e
* Finish removing ExpectedVersion
Azyyyyyy May 1, 2026
1140c36
Fix not passing in as correct type!
Azyyyyyy May 1, 2026
a17c3a3
* Make all endpoints return Response model to enforce strong typed re…
Azyyyyyy May 2, 2026
079118f
Make websocket events strong typed
Azyyyyyy May 2, 2026
003b67e
Add SP importing | Need to test poll imports
Azyyyyyy May 2, 2026
aa17f20
* Refactor for some create commands so we can pass in the created/upd…
Azyyyyyy May 7, 2026
3e5e0ee
Fix unit tests
Azyyyyyy May 7, 2026
45b47df
* Add Public Key endpoint
Azyyyyyy May 11, 2026
f5aca6d
* Provide encryptionKey back to SP importing
Azyyyyyy May 12, 2026
98d48f8
* Move salt setup logic to Callback to ensure it's actually setup
Azyyyyyy May 16, 2026
932b927
* Fix salt not being set on user creation
Azyyyyyy May 19, 2026
dac12d3
* Move Import SP back to using recovery code
Azyyyyyy May 19, 2026
0ad2469
- Moved common OAuth logic to OAuthControllerBase
Azyyyyyy Jun 2, 2026
f2ddb58
Ensure that health checks don't go through middleware so they can alw…
Azyyyyyy Jun 2, 2026
3da135d
* Fix space in schema creation
Azyyyyyy Jun 6, 2026
ff025f4
Remove elixir build
Azyyyyyy Jun 6, 2026
4517b12
More ensuring we are as low permissions as required for DB access
Azyyyyyy Jun 6, 2026
8128a64
* Move some files in a more sane place
Azyyyyyy Jun 6, 2026
b47cae3
Fixes for multi-DC environment (To make it so we don't need `tablets …
Azyyyyyy Jun 7, 2026
01b0aa0
denormalize tables for write/read consistency
Azyyyyyy Jun 7, 2026
8dd1650
Fix migration not working on cassandra
Azyyyyyy Jun 7, 2026
e4fac0b
feat: Refactor Scylla & postgres integration to use ISecretsStore for…
Azyyyyyy Jun 7, 2026
8754fe8
* Many fixes with running the server concurrently within integration …
Azyyyyyy Jun 9, 2026
b69c26b
* Refactor WebSocket tests to fail/pass more consistentlt - mostly fi…
Azyyyyyy Jun 10, 2026
db5a52d
Fix ownership issues in Github Runner?
Azyyyyyy Jun 10, 2026
52618eb
Fix actual issues causing Github Actions to fail
Azyyyyyy Jun 12, 2026
c56b1d0
Temp code changes to find failing test run on CI
Azyyyyyy Jun 12, 2026
615fff6
Add more logging
Azyyyyyy Jun 12, 2026
8d97cdc
More debugging
Azyyyyyy Jun 12, 2026
5d8d041
More debugging
Azyyyyyy Jun 12, 2026
835a740
* Fix root ussue for tests failing on just CI
Azyyyyyy Jun 13, 2026
d67c4d7
Rework WebSocket handling to ensure parallel is handed a LOT better
Azyyyyyy Jun 13, 2026
b4ffb59
* Move to new solution format.
Azyyyyyy Jun 17, 2026
ab541c3
* Remove any WithConfiguration's that are not required
Azyyyyyy Jun 17, 2026
1b2500c
* Cleanup from last changes
Azyyyyyy Jun 17, 2026
4b164e8
Handle Multi Syclla node better when doing unit tests
Azyyyyyy Jun 21, 2026
646b9c6
[Skip CI] Bootstrapper - To review output
Azyyyyyy Jun 21, 2026
78099e6
Stagger Multi-DC ScyllaDB Joins - fixes multi-DC connectivity
Azyyyyyy Jun 21, 2026
d4aa0d8
Fix test fails
Azyyyyyy Jun 21, 2026
3e79cb9
Merge branch 'csharp-migration' of https://github.com/Azyyyyyy/octoco…
Azyyyyyy Jun 21, 2026
10c5c19
* Start tracking migrations
Azyyyyyy Jun 21, 2026
d31b138
Fixes for unit tests
Azyyyyyy Jun 21, 2026
d77440e
Fix Bootstrapper integration tests
Azyyyyyy Jun 21, 2026
9c89eaa
- Removed HTTP/HTTPS port exposure from Dockerfile.
Azyyyyyy Jun 21, 2026
aa386b5
Unit test fixes
Azyyyyyy Jun 22, 2026
13a8819
* Add missing (unused) wipe-tags endpoint
Azyyyyyy Jun 22, 2026
a952f48
Add the abilty to have external urls's
Azyyyyyy Jun 22, 2026
021051e
Allow in-memory seeding straight from api
Azyyyyyy Jun 22, 2026
7ba967c
Embed scripts required to make standalone and correct seeding logic
Azyyyyyy Jun 23, 2026
89ed9a4
Make the bootstrapper more TUI styled and expose more config for edit…
Azyyyyyy Jun 23, 2026
b7e70fa
Fix Cassandra mode bootstrapper: embed Dockerfile and build CASSANDRA…
cursoragent Jun 26, 2026
27d2bae
Merge pull request #9 from Azyyyyyy/cursor/fix-cassandra-bootstrapper…
Azyyyyyy Jun 26, 2026
c1b11f9
* Actually build all platforms for both bootstrapper and api
Azyyyyyy Jun 28, 2026
0351e3b
Merge branch 'csharp-migration' of https://github.com/Azyyyyyy/octoco…
Azyyyyyy Jun 28, 2026
a0e8a04
[SKIP CI] Update action branch
Azyyyyyy Jun 28, 2026
e4ca547
* Allow rotating certs
Azyyyyyy Jun 28, 2026
8031ad0
Merge branch 'main' of https://github.com/Azyyyyyy/octocon
Azyyyyyy Jun 28, 2026
9aec4d1
Ensure .well-known does not go through HttpsRedirection
Azyyyyyy Jun 28, 2026
980ace5
Allow HttpHead so we use curl and inspect the ETag header, fixes last…
Azyyyyyy Jun 28, 2026
55018ad
Update bootstrapper so we can provide more then just domains
Azyyyyyy Jun 28, 2026
ef85a1b
Make it so we can grab the IP in interactive mode for the bootstrapper
Azyyyyyy Jun 28, 2026
db9c110
Attempt to fix http -> https for wasm client and add the abilty to ju…
Azyyyyyy Jun 28, 2026
476cfad
* Disable HTTPS port if we're not doing HTTPS (Web)
Azyyyyyy Jun 29, 2026
8932e56
Handle polls importing better
Azyyyyyy Jun 29, 2026
1018235
Try to extract datetimes from SP where possible
Azyyyyyy Jun 29, 2026
73b8bcb
* Fix not using the internal port for websocket
Azyyyyyy Jun 29, 2026
b073309
Allow SSL to not be established only IF we are doing a loopback
Azyyyyyy Jun 29, 2026
eebc487
Many changes to handle avatar storage within a docker container
Azyyyyyy Jun 30, 2026
56536da
Fix tests failing on CI
Azyyyyyy Jun 30, 2026
c9d6128
* Fix import issue from supportMarkdown being null sometimes
Azyyyyyy Jun 30, 2026
6ba44ec
Move imports to a background worker and disable retry's on non-get re…
Azyyyyyy Jun 30, 2026
37f559b
Lower the amount of DinD container at the same time so we don't keep …
Azyyyyyy Jun 30, 2026
b6acf9d
Add the abilty for the bootstrapper to backup the DB and for it to ad…
Azyyyyyy Jun 30, 2026
0c662ec
(Hopefully) fix failing tests
Azyyyyyy Jul 1, 2026
4991bb4
Add support for update-images and restore commands in the bootstrapper
Azyyyyyy Jul 1, 2026
c8cafc8
Fixes for failing tests
Azyyyyyy Jul 1, 2026
9502564
Forgotton code to commit!
Azyyyyyy Jul 1, 2026
475331b
* Add Firebase config provider
Azyyyyyy Jul 4, 2026
a85cf69
Add pull_request trigger to CI/CD workflow
Azyyyyyy Jul 4, 2026
0ef9a28
Merge branch 'main' into firebase-notifications
Azyyyyyy Jul 4, 2026
2fe875b
Merge pull request #10 from Azyyyyyy/firebase-notifications
Azyyyyyy Jul 4, 2026
357ea12
Strong Typing (#11)
Azyyyyyy Jul 16, 2026
a10efa6
Dedup (#12)
Azyyyyyy Jul 21, 2026
f4889a5
Chore/comment sweep and rule (#15)
Azyyyyyy Jul 22, 2026
f04a468
Modular monolith refactor (#16)
Azyyyyyy Jul 23, 2026
efc5723
Phase 7 - rename Interfold.Contracts to Interfold.Shared.Contracts
Azyyyyyy Jul 23, 2026
acda408
Phase 7 - rename Interfold.Domain to Interfold.Shared.Domain
Azyyyyyy Jul 23, 2026
67138f9
Phase 7 - rename Interfold.Api.Shared to Interfold.Shared.Api
Azyyyyyy Jul 23, 2026
1935c8f
Relocate Interfold.Infrastructure from shared/ into infrastructure/
Azyyyyyy Jul 23, 2026
e48f628
Fix FrontNotifierBackgroundService path in Interfold.Infrastructure.c…
Azyyyyyy Jul 23, 2026
7d8ad74
Reorganize root folder taxonomy: split host/ into apis/, hosts/, tool…
Azyyyyyy Jul 23, 2026
66bb6e5
Phase 5: split Interfold.Api.UnitTests into 12 per-feature unit-test …
Azyyyyyy Jul 23, 2026
24b3f8d
Phase 6: split Interfold.IntegrationTests into 14 per-feature integra…
Azyyyyyy Jul 23, 2026
d394ab0
Pipeline changes to spin up int tests per project (Might want to do s…
Azyyyyyy Jul 24, 2026
17d0269
Fix test run issues
Azyyyyyy Jul 24, 2026
a9277c1
Handle tar a bit better
Azyyyyyy Jul 24, 2026
f93a7d2
Update TUnit so int tests summary can be one section
Azyyyyyy Jul 24, 2026
ea427e0
Directly use the built runner. Makes tarballs a lot smaller & fix run…
Azyyyyyy Jul 24, 2026
ee9a60f
Restore nuget packages as still required for DCP...
Azyyyyyy Jul 24, 2026
c80046a
Fix Unit test fail
Azyyyyyy Jul 24, 2026
f5cdfa7
* Only build all boostrappers on push, not PR
Azyyyyyy Jul 24, 2026
d6034c0
Handle when we are only building one platform - bootstrapper
Azyyyyyy Jul 24, 2026
39d2462
Merge pull request #17 from Azyyyyyy/tests-refactor
Azyyyyyy Jul 26, 2026
f88c023
Add exporting endpoint
Azyyyyyy Jul 26, 2026
068d6f4
[SKIP CI]
Azyyyyyy Jul 26, 2026
738e076
Missed file
Azyyyyyy Jul 26, 2026
0297915
Fix InMemory not providing fields for alters
Azyyyyyy Jul 26, 2026
b41d30f
Fix casing
Azyyyyyy Jul 26, 2026
c9b41e5
refactor(shared): relocate feature-specific contracts and domain seam…
Azyyyyyy Jul 27, 2026
614d88c
Fix CI errors
Azyyyyyy Jul 27, 2026
c01c1f5
Move some more logic into their domain
Azyyyyyy Jul 27, 2026
2a769a8
Fix Sp Import tests
Azyyyyyy Jul 27, 2026
cbc36f5
Merge pull request #18 from Azyyyyyy/shared-refactor
Azyyyyyy Jul 27, 2026
33b5f49
Implement dev-mode seed pipeline for Postgres and Scylla in Interfold…
Azyyyyyy Jul 27, 2026
954ee5b
Add centralised auto-managed integration-test DB bench
Azyyyyyy Jul 28, 2026
5f77bda
Merge pull request #19 from Azyyyyyy/tests-local-fixes
Azyyyyyy Aug 16, 2026
00e6103
fix(bootstrapper): source-gen Firebase JSON so trimmed ELF matches tests
Azyyyyyy Aug 16, 2026
cb52915
Merge origin/develop into develop
Azyyyyyy Aug 16, 2026
fb064d4
feat(bootstrapper): add --reconfigure to edit existing bootstrap config
Azyyyyyy Aug 16, 2026
a49c616
Merge pull request #21 from Azyyyyyy/feat/bootstrap-reconfigure
Azyyyyyy Aug 16, 2026
4c832f1
feat(tests): enhance integration tests for update-images with contain…
Azyyyyyy Aug 17, 2026
5211041
fix(bootstrapper): keep update-images digests comparable under vfs DinD
Azyyyyyy Aug 17, 2026
79aa13c
fix(scylla): tolerate null visibility on read and harden parallel tes…
Azyyyyyy Aug 30, 2026
62a78bf
fix(bootstrapper): bind-mount avatar storage from host path
Azyyyyyy Aug 30, 2026
d43a22c
refactor(bootstrapper): use embedded support files without auto-extract
Azyyyyyy Aug 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
216 changes: 0 additions & 216 deletions .credo.exs

This file was deleted.

149 changes: 149 additions & 0 deletions .cursor/rules/comment-style.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
---
description: Enforce short, why-focused code comments across Interfold; forbid plan/step/history narration; allow richer XML doc only on HTTP action methods and wire DTOs.
alwaysApply: true
---

# Comment style

Code comments in this repo exist to explain *why* the code is the way it is,
not *what* it does. Keep them short. If the code cannot self-explain, prefer
refactoring for clarity (rename, extract-method) before adding a comment.

## Principle

- One to three lines. If it needs more, the code probably needs a rename or a
helper, not a longer comment.
- Comment the surprising thing. If a reader could work out the intent from the
parameter names, the method name, and the types, don't restate it.
- Point at deep context rather than inlining it. Prefer
`// see InterfoldAppHost.ConfigureApiSelfHostEnv` over re-narrating the
rationale that already lives at the referenced site.

## Never

- **Plan / step / roadmap narration.** No `// TODO:`, no `// FIXME:`, no
`// HACK:`, no `// Step 1: ...`, no `// PATCH does not currently expose X —
in the future ...`. Deferred work goes in `docs/ROADMAP.md`, not in
comments.
- **Refactor archaeology.** No `// The sync overload this used to sit
alongside was dropped because ...`, no `// Callers no longer thread a
selector.`, no comment that only makes sense to someone who was in the
original PR review.
- **Story-telling / defensive narration.** No `// Without this we would ...`,
no `// scheme doesn't need forwarding because ...`, no "mini-essay against
a question the call site doesn't invite".
- **Redundant XML doc.** A `/// <summary>Returns the current user.</summary>`
above `public User GetCurrentUser()` adds nothing — delete it.
- **Obvious step labels in tests.** No `// Arrange`, `// Act`, `// Assert`,
no `// Setup:`, `// Verify:`, etc. The test's structure is already visible.
- **Commented-out code.** If it might come back, git remembers.

## Do

- Explain a non-obvious constraint in 2–4 dense lines when it's genuinely
hidden (silent widening, `System.Text.Json` ctor-selection rules, framework
foot-guns, database-driver quirks).
- Cross-reference the owning file/symbol when the deep context lives
elsewhere. Example: `// see AlterUrlQualifier.QualifyFriendship for the
origin-rewrite rules`.
- On `catch { }` and `catch (Exception) { }` that intentionally swallow, a
one-line explanation (`// best-effort cleanup, tolerate storage flake`)
is welcome — a silent swallow with no comment reads as a bug.

## Exception — member-level, not file-level

Two surfaces are allowed richer XML doc. The exception is *member-level*: it
does not license an entire file. Even inside the exception, the "Never" list
above still applies.

- **HTTP action methods.** Methods on a `ControllerBase`-derived class
carrying `[HttpGet]`, `[HttpPost]`, `[HttpPut]`, `[HttpPatch]`,
`[HttpDelete]`, or a method-level `[Route]`. XML `<summary>` describing
the endpoint's contract semantics is welcome. Put behavioural nuance in
`<remarks>`. No refactor archaeology.
- **Wire-contract DTOs.** `record` / `class` declarations serialised as
`[FromBody]` requests or as `Response<T>` bodies (types under
`host/Interfold.Api/Models/**` and the actually-serialised types in
`shared/Interfold.Contracts/Models/**` — `AlterReadModel`,
`FriendshipReadModel`, request records, `SocketPayloadContracts`,
`PhxFrame`, etc.). XML `<summary>` on the type and per-property
`<summary>` documenting wire semantics is welcome. No story-telling
about why the type exists.

Everything else — controller base classes, controller-private helpers,
non-wire enums / extensions / converters, internal models — follows the
strict style above.

## Concrete examples from this repo

### Trim over-long XML doc (strict style — not an endpoint / DTO)

**Before** — `host/Interfold.Api/Controllers/Base/InterfoldControllerBase.cs`, `PrincipalId`:

```csharp
/// <summary>
/// The authenticated principal for the current request as a
/// <see cref="ScopedSystemId"/>. The middleware guarantees the value is present and
/// scoped — any endpoint reaching this getter has already passed the JWT-sub
/// validation. <see cref="ScopedSystemId"/> widens implicitly to
/// <see cref="SystemId"/> at every persistence / repository call site, so this
/// getter's byte value flows unchanged to Postgres idempotency and Scylla PKs.
/// </summary>
protected ScopedSystemId PrincipalId
```

**After**:

```csharp
/// <summary>Authenticated principal for the current request; middleware guarantees presence.</summary>
protected ScopedSystemId PrincipalId
```

### Delete plan / refactor-archaeology comments

**Before** — `host/Interfold.Api/Controllers/AltersController.cs`:

```csharp
// PATCH does not currently expose AvatarUrl as a mutable field — avatar updates go
// through the dedicated PUT .../avatar endpoints (multipart for Local, JSON for External)
// so we never observe a half-set (url-without-source) here.
var payload = new UpdateAlterCommand { ... };

//TODO: To ensure route works as expected - check if we delete alter journal entries, unattach from gobal journals when an alter is deleted and delete them from polls
[HttpDelete("{alterId:int}")]
public async Task<Response> Delete(...)
```

**After** — both comments removed. The `//TODO` intent is captured in
`docs/ROADMAP.md`. The `// PATCH does not ...` comment is refactor
archaeology.

### Keep a dense why-comment on a wire DTO

**Keep** — `shared/Interfold.Contracts/Models/Alter.cs`, the block above the
`[JsonConstructor]` overload:

```csharp
// The 14-arg ctor above takes `bool?` for the flag trio so the CQL projections in
// ScyllaAlterRepository can bind `row.GetValue<bool?>(...)` directly. STJ's
// deserialiser refuses that ctor because `bool? untracked` doesn't type-match the
// `bool Untracked` property — this second ctor takes plain `bool`, is marked
// [JsonConstructor], and forwards.
[JsonConstructor]
public AlterReadModel(...)
```

`AlterReadModel` is a wire DTO (returned as `Response<AlterReadModel>` from
`AltersController`), and the comment documents a non-obvious
`System.Text.Json` constraint that the code itself cannot convey. This is
what a "kept" dense comment looks like: 5 lines, no history, no plan, no
apologising.

## Enforcement

- Applies to every `.cs` file in the repo.
- New `//TODO` / `//FIXME` / `//HACK` in a diff is a review block. Move the
intent to `docs/ROADMAP.md` first.
- New `// Arrange / // Act / // Assert` in a test diff is a review block.
- An XML doc block longer than ~10 lines outside the two exception surfaces
is a review block.
Loading