Skip to content

Commit 84c7207

Browse files
nficanocursoragent
andcommitted
docs: fix audit documentation issues (#48-66); format AuditFixesTests
Correct XML comments, guides, OTel/conformance tables, and README for all open docs audit findings. Fix dotnet format whitespace in integration tests. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent c97fa23 commit 84c7207

20 files changed

Lines changed: 40 additions & 40 deletions

CONFORMANCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Status legend: Implemented ✅ · Partial 🚧 · Not implemented ⛔.
6969
| ---- | ----------- | ------ | ----- |
7070
| §10 | `delegate` event kind on parent's `job.event` stream || `JobContext.DelegateAsync` |
7171
| §11 | `trace_id` propagation; OTel span attrs || `TraceAttributes`, `ArcpTracing.WithTracing` |
72-
| §11 (v1.1) | Span attrs `arcp.lease.expires_at`, `arcp.budget.remaining` | | `TraceAttributes` |
72+
| §11 (v1.1) | Span attrs `arcp.lease.expires_at`, `arcp.budget.remaining` | | Not emitted by `ArcpTracing` |
7373
| §12 | 15 canonical error codes with retryable booleans || `ErrorCode.All`, `ErrorCode.IsRetryable` |
7474

7575
## Test cross-reference

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ await using var client = await ArcpClient.ConnectAsync(transport, new ArcpClient
105105

106106
var sessionId = client.SessionId;
107107
var resumeToken = client.ResumeToken;
108-
var effective = client.EffectiveFeatures; // intersection of client/runtime hello.features
108+
var effective = client.EffectiveFeatures; // intersection of hello.features and welcome.features
109109
110110
// ... transport drops; track the last seq your reader observed ...
111111
var lastSeq = client.LastReceivedSeq;

docs/architecture.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
| `Arcp.Runtime` | `ArcpServer`, `JobManager`, `LeaseManager`, `SessionState` — the side that runs them. |
1010
| `Arcp.AspNetCore` | Mounts a runtime on Kestrel via `IEndpointRouteBuilder.MapArcp("/arcp")`. |
1111
| `Arcp.Otel` | Wraps `ITransport` with `ActivitySource`-based OTel instrumentation. |
12-
| `Arcp.Hosting` | Registers a runtime in `IHostedService` for non-ASP.NET workers. |
12+
| `Arcp.Hosting` | Registers `ArcpServer` in DI via `AddArcpRuntime` for non-ASP.NET workers. |
1313
| `Arcp.Cli` | `arcp serve` / `arcp submit` / `arcp version` executable. |
1414
| `Arcp` | Umbrella meta-package — `dotnet add package Arcp` pulls Core + Client + Runtime. |
1515

@@ -37,12 +37,12 @@ Every message is a JSON object envelope:
3737

3838
Unknown top-level fields are preserved verbatim in
3939
`Envelope.Extensions` (`Dictionary<string, JsonElement>`), so
40-
vendor-extension hints round-trip without loss (spec §5.1).
40+
vendor-extension hints round-trip without loss (spec §5).
4141

4242
## Versioning
4343

4444
The SDK follows SemVer strictly. The `arcp` wire version field
45-
(`"1.1"`) is fixed in `Arcp.Core.WireVersion.Current`. Adding a
45+
defaults to `"1.1"` on `Envelope.Arcp` (also exposed as `Arcp.ArcpInfo.ProtocolVersion`). Adding a
4646
public member is a minor bump; changing a signature is a major bump.
4747
One minor deprecation cycle (`[Obsolete]`) before removal. See the
4848
[style guide](./style-guide.md#14-versioning--compatibility).

docs/conformance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Opt out of features on either peer:
6060
```csharp
6161
new ArcpClientOptions
6262
{
63-
Features = new FeatureSet(["heartbeat", "ack"]), // drop the rest
63+
Features = new[] { FeatureFlags.Heartbeat, FeatureFlags.Ack }, // drop the rest
6464
};
6565
```
6666

docs/guides/errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Agents can produce errors by throwing:
9090
```csharp
9191
server.RegisterAgent("strict", async (ctx, ct) =>
9292
{
93-
if (!ctx.Lease.Contains(LeaseNamespaces.FsRead))
93+
if (ctx.Lease.Get(LeaseNamespaces.FsRead).Count == 0)
9494
throw new PermissionDeniedException("fs.read required");
9595

9696
// ...

docs/guides/job-events.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ server.RegisterAgent("researcher", async (ctx, ct) =>
2727
await ctx.StatusAsync("starting", "Fetching data...", ct);
2828

2929
await ctx.ToolCallAsync("fetch", callId: "c1",
30-
args: new { url = "https://api.example.com/data" }, ct);
30+
args: new { url = "https://api.example.com/data" }, cancellationToken: ct);
3131
var data = /* ... */ "";
32-
await ctx.ToolResultAsync("c1", result: data, ct);
32+
await ctx.ToolResultAsync("c1", result: data, cancellationToken: ct);
3333

34-
await ctx.ProgressAsync(current: 1, total: 3, message: "fetched", ct);
34+
await ctx.ProgressAsync(current: 1, total: 3, message: "fetched", cancellationToken: ct);
3535

3636
await ctx.LogAsync("info", "Processing ...", ct);
3737
await ctx.MetricAsync("cost.inference", 0.012, unit: "USD", cancellationToken: ct);
@@ -40,7 +40,7 @@ server.RegisterAgent("researcher", async (ctx, ct) =>
4040
uri: "s3://bucket/report.pdf",
4141
contentType: "application/pdf",
4242
byteSize: 42_000,
43-
ct: ct);
43+
cancellationToken: ct);
4444

4545
return new { status = "done" };
4646
});

docs/guides/leases.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ server.RegisterAgent("file-writer", async (ctx, ct) =>
4747
ctx.Lease,
4848
ctx.LeaseConstraints,
4949
LeaseNamespaces.FsWrite,
50-
path: "/workspace/src/output.cs");
50+
pattern: "/workspace/src/output.cs");
5151
}
5252
catch (PermissionDeniedException ex)
5353
{

docs/guides/observability.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ constants.
4141
| Name | Purpose |
4242
| ----------------- | -------------------------------------------------- |
4343
| `Arcp.Transport` | One span per envelope (send and receive). |
44-
| `Arcp.Runtime` | Runtime-internal spans (dispatch, agent run). |
44+
| `Arcp.Runtime` | Application spans you start manually (e.g. delegation). |
4545
4646
## Span shape
4747
@@ -66,10 +66,6 @@ For each envelope, the wrapper:
6666
| `arcp.job_id` | envelope `job_id` |
6767
| `arcp.trace_id` | envelope `trace_id` |
6868
| `arcp.event_seq` | envelope `event_seq` |
69-
| `arcp.agent` | `payload.agent` (on submit / accept) |
70-
| `arcp.lease.capabilities` | comma-joined lease keys |
71-
| `arcp.lease.expires_at` | ISO 8601 string (v1.1) |
72-
| `arcp.budget.remaining` | JSON-stringified currency map (v1.1) |
7369
7470
## Use with ASP.NET Core
7571

docs/guides/vendor-extensions.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ Write on the send side by populating `Extensions` before calling
3131
`ITransport.SendAsync`:
3232

3333
```csharp
34-
var env = new Envelope { /* ... */ };
35-
env.Extensions["x-vendor.acme.priority"] = JsonSerializer.SerializeToElement("high");
34+
var env = new Envelope
35+
{
36+
/* ... */
37+
Extensions = new Dictionary<string, JsonElement>
38+
{
39+
["x-vendor.acme.priority"] = JsonSerializer.SerializeToElement("high"),
40+
},
41+
};
3642
await transport.SendAsync(env, ct);
3743
```
3844

docs/projects/Arcp.AspNetCore.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@ app.MapArcp(server, o => { o.Path = "/arcp-external"; o.AllowedHosts = new[] {
7777

7878
- [Arcp.Runtime](./Arcp.Runtime.md)`ArcpServer` configuration.
7979
- [Arcp.Otel](./Arcp.Otel.md) — transport instrumentation.
80-
- [Arcp.Hosting](./Arcp.Hosting.md)`IHostedService` / DI integration.
80+
- [Arcp.Hosting](./Arcp.Hosting.md)`AddArcpRuntime` DI registration.
8181
- [Troubleshooting — 403 Forbidden](../troubleshooting.md#websocket-upgrade-returns-403-forbidden) — allowed-host failures.
8282
- [Troubleshooting — HEARTBEAT_LOST](../troubleshooting.md#job-is-cancelled-with-heartbeat_lost) — keepalive collision.

0 commit comments

Comments
 (0)