Skip to content

Commit 894d36b

Browse files
ScottArbeitScott Arbeit
andauthored
Fix FS3511 warnings in code and set Warnings-as-Errors (#55)
* bd daemon sync: 2026-01-10 12:58:28 * Repairs for FS3511 warning; full Fantomas reformatting of codebase. --------- Co-authored-by: Scott Arbeit <scottarbeit@github.com>
1 parent c97db8c commit 894d36b

File tree

159 files changed

+9522
-6080
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+9522
-6080
lines changed

.beads/issues.jsonl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
{"id":"Grace-cca","title":"Review: deterministic chaptering + packet assembly","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T01:14:51.2457243-08:00","created_by":"Scott Arbeit","updated_at":"2026-01-06T02:30:30.9647007-08:00","closed_at":"2026-01-06T02:30:30.9647007-08:00","close_reason":"Closed"}
5858
{"id":"Grace-chq","title":"Server: Review endpoints","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T01:14:50.0836908-08:00","created_by":"Scott Arbeit","updated_at":"2026-01-06T01:56:02.1303505-08:00","closed_at":"2026-01-06T01:56:02.1303505-08:00","close_reason":"Closed"}
5959
{"id":"Grace-d6y","title":"Queue: gate framework + attestations","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-06T01:14:52.8430355-08:00","created_by":"Scott Arbeit","updated_at":"2026-01-06T02:46:56.9159633-08:00","closed_at":"2026-01-06T02:46:56.9159633-08:00","close_reason":"Closed"}
60+
{"id":"Grace-dcs","title":"Fix build errors in Grace.CLI and Grace.Server","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-10T12:54:09.3683809-08:00","created_by":"Scott Arbeit","updated_at":"2026-01-10T12:57:33.2944729-08:00","closed_at":"2026-01-10T12:57:33.2944729-08:00","close_reason":"Closed"}
6061
{"id":"Grace-dof","title":"CLI fallback to server OIDC config endpoint","status":"closed","priority":2,"issue_type":"task","created_at":"2026-01-08T01:49:50.4603822-08:00","created_by":"Scott Arbeit","updated_at":"2026-01-08T02:03:33.5007944-08:00","closed_at":"2026-01-08T02:03:33.5007944-08:00","close_reason":"Closed"}
6162
{"id":"Grace-dv3","title":"Show resolved implicit ids in verbose parse output","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-09T00:34:41.3147349-08:00","created_by":"Scott Arbeit","updated_at":"2026-01-09T00:34:41.3147349-08:00"}
6263
{"id":"Grace-e10","title":"P2 Optional: CODEOWNERS + security scans","description":"Add CODEOWNERS and basic security scan config if desired; document required reviewers.","acceptance_criteria":"Guardrails added and documented; minimal overhead.","status":"open","priority":2,"issue_type":"task","created_at":"2026-01-09T12:32:04.8295523-08:00","created_by":"Scott Arbeit","updated_at":"2026-01-09T12:32:04.8295523-08:00"}

src/AGENTS.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,68 @@ Optional: `pwsh ./scripts/install-githooks.ps1` to add a pre-commit
6161
- Format code with `dotnet tool run fantomas --recurse .` (from `./src`) and
6262
include comprehensive, copy/paste-ready snippets when sharing examples.
6363

64+
### Avoid FS3511 in resumable computation expressions
65+
66+
These rules apply to `task { }` and `backgroundTask { }`.
67+
68+
1. **Do not define `let rec` inside `task { }`.**
69+
70+
Bad:
71+
72+
```fsharp
73+
task {
74+
let rec poll () = task { return! poll () }
75+
return! poll ()
76+
}
77+
```
78+
79+
Good:
80+
81+
```fsharp
82+
task {
83+
let mutable done_ = false
84+
while not done_ do
85+
done_ <- true
86+
}
87+
```
88+
89+
2. **Avoid `for ... in ... do` loops inside `task { }`.**
90+
91+
Bad:
92+
93+
```fsharp
94+
task {
95+
for item in items do
96+
useItem item
97+
}
98+
```
99+
100+
Good:
101+
102+
```fsharp
103+
task {
104+
items |> Seq.iter useItem
105+
}
106+
```
107+
108+
3. **Policy: treat FS3511 warnings as regressions (do not suppress).**
109+
110+
Bad:
111+
112+
```xml
113+
<PropertyGroup>
114+
<NoWarn>FS3511</NoWarn>
115+
</PropertyGroup>
116+
```
117+
118+
Good:
119+
120+
```xml
121+
<PropertyGroup>
122+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
123+
</PropertyGroup>
124+
```
125+
64126
## Agent-Friendly Context Practices
65127

66128
- Start with the relevant `AGENTS.md` file(s) to load key patterns,

src/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
66
<EnableNETAnalyzers>true</EnableNETAnalyzers>
77
<AnalysisLevel>latest</AnalysisLevel>
8+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
89
<NoWarn>$(NoWarn);NETSDK1057</NoWarn>
910
<PublishProfile>DefaultContainer</PublishProfile>
1011
<OtherFlags>$(OtherFlags) --test:GraphBasedChecking</OtherFlags>

src/Grace.Actors/AccessControl.Actor.fs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ module AccessControl =
2727
match scope with
2828
| Scope.System -> "system"
2929
| Scope.Owner ownerId -> $"owner:{ownerId}"
30-
| Scope.Organization(ownerId, organizationId) -> $"org:{ownerId}:{organizationId}"
31-
| Scope.Repository(ownerId, organizationId, repositoryId) -> $"repo:{ownerId}:{organizationId}:{repositoryId}"
32-
| Scope.Branch(ownerId, organizationId, repositoryId, branchId) -> $"branch:{ownerId}:{organizationId}:{repositoryId}:{branchId}"
30+
| Scope.Organization (ownerId, organizationId) -> $"org:{ownerId}:{organizationId}"
31+
| Scope.Repository (ownerId, organizationId, repositoryId) -> $"repo:{ownerId}:{organizationId}:{repositoryId}"
32+
| Scope.Branch (ownerId, organizationId, repositoryId, branchId) -> $"branch:{ownerId}:{organizationId}:{repositoryId}:{branchId}"
3333

34-
type AccessControlActor([<PersistentState(StateName.AccessControl, Grace.Shared.Constants.GraceActorStorage)>] state: IPersistentState<AccessControlState>)
35-
=
34+
type AccessControlActor([<PersistentState(StateName.AccessControl, Grace.Shared.Constants.GraceActorStorage)>] state: IPersistentState<AccessControlState>) =
3635
inherit Grain()
3736

3837
let log = loggerFactory.CreateLogger("AccessControl.Actor")
@@ -124,7 +123,7 @@ module AccessControl =
124123
member this.Handle command metadata =
125124
match command with
126125
| AccessControlCommand.GrantRole assignment -> this.GrantRole assignment metadata
127-
| AccessControlCommand.RevokeRole(principal, roleId) -> this.RevokeRole principal roleId metadata
126+
| AccessControlCommand.RevokeRole (principal, roleId) -> this.RevokeRole principal roleId metadata
128127
| AccessControlCommand.ListAssignments principal -> this.ListAssignments principal metadata
129128

130129
member this.GetAssignments principal correlationId =

0 commit comments

Comments
 (0)