Skip to content

Commit 4473ceb

Browse files
committed
Add inert workspace HTTP API v2 contract
1 parent d0af080 commit 4473ceb

9 files changed

Lines changed: 2333 additions & 0 deletions
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"api_generation": 2,
3+
"profile_id": "018f4f6e-9f2c-7b1a-8c3d-4e5f60718293",
4+
"profile_revision": 7,
5+
"layout_version": 1,
6+
"layout_digest": "sha256:6d739ad2748910520e4df1d680e9ea78a94230d0751e6346d3f5d3c57b9259b5",
7+
"offer": {
8+
"versions": {
9+
"session": 2,
10+
"replica": 2,
11+
"export_metadata": 2,
12+
"writable_session_store": 1,
13+
"canonical": 1,
14+
"path": 1,
15+
"changeset": 1
16+
},
17+
"session_id": "session-scope-7",
18+
"export_attempt_id": "export-attempt-9",
19+
"source_generations": [
20+
{
21+
"ordinal": 0,
22+
"source_connection_id": "source-drive",
23+
"source_generation_id": "generation-drive-44"
24+
},
25+
{
26+
"ordinal": 1,
27+
"source_connection_id": "source-notion",
28+
"source_generation_id": "generation-notion-109"
29+
}
30+
],
31+
"media_type": "application/x-tar",
32+
"content_encoding": "zstd",
33+
"limits": {
34+
"max_files": 10000,
35+
"max_directories": 10000,
36+
"max_content_bytes": 104857600
37+
},
38+
"control_entry_count": 1,
39+
"file_count": 2,
40+
"directory_count": 2,
41+
"archive_entry_count": 5,
42+
"selected_content_bytes": 17,
43+
"inventory_sha256": "sha256:025cdbae136931542f7fa881da423e8e1f29a6132cf26ae5f4eea53c53a8ef51",
44+
"writable_metadata_sha256": "sha256:a14c564c8d8950755b30115c4e8c684017662c70e7e03ead0d65a5da132474d2",
45+
"sealed_at": "2026-07-23T19:00:01Z",
46+
"expires_at": "2026-07-23T19:10:01Z"
47+
}
48+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"code": "incompatible_capabilities",
3+
"message": "client capabilities cannot safely open this workspace session",
4+
"retriable": false,
5+
"required_api_generation": 2,
6+
"minimum_layout_version": 1,
7+
"required_capabilities": [
8+
{
9+
"name": "workspace_layout",
10+
"version": 1
11+
},
12+
{
13+
"name": "atomic_root_publication",
14+
"version": 1
15+
},
16+
{
17+
"name": "path_ceilings",
18+
"version": 1,
19+
"max_component_utf8_bytes": 255,
20+
"max_component_utf16_units": 255,
21+
"max_path_utf8_bytes": 1024,
22+
"max_path_utf16_units": 1024
23+
},
24+
{
25+
"name": "tar_encodings",
26+
"version": 1,
27+
"encodings": [
28+
"identity",
29+
"zstd"
30+
]
31+
},
32+
{
33+
"name": "freshness_wait",
34+
"version": 1
35+
}
36+
]
37+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"api_generation": 2,
3+
"capabilities": [
4+
{
5+
"name": "workspace_layout",
6+
"version": 1
7+
},
8+
{
9+
"name": "atomic_root_publication",
10+
"version": 1
11+
},
12+
{
13+
"name": "path_ceilings",
14+
"version": 1,
15+
"max_component_utf8_bytes": 255,
16+
"max_component_utf16_units": 255,
17+
"max_path_utf8_bytes": 1024,
18+
"max_path_utf16_units": 1024
19+
},
20+
{
21+
"name": "tar_encodings",
22+
"version": 1,
23+
"encodings": [
24+
"identity",
25+
"zstd"
26+
]
27+
},
28+
{
29+
"name": "freshness_wait",
30+
"version": 1
31+
}
32+
]
33+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"api_generation": 2,
3+
"session_id": "session-scope-7",
4+
"opaque_capability": "opaque-session-capability",
5+
"expires_at": "2026-07-29T01:00:00Z",
6+
"profile_id": "018f4f6e-9f2c-7b1a-8c3d-4e5f60718293",
7+
"profile_revision": 7,
8+
"session_layout": {
9+
"layout_version": 1,
10+
"layout_digest": "sha256:6d739ad2748910520e4df1d680e9ea78a94230d0751e6346d3f5d3c57b9259b5",
11+
"entries": [
12+
{
13+
"scope_ordinal": 0,
14+
"mount_id": "mount-zeta",
15+
"target": "Sales"
16+
},
17+
{
18+
"scope_ordinal": 1,
19+
"mount_id": "mount-alpha",
20+
"target": "Engineering"
21+
},
22+
{
23+
"scope_ordinal": 2,
24+
"mount_id": "mount-zeta",
25+
"target": "Sales"
26+
},
27+
{
28+
"scope_ordinal": 3,
29+
"mount_id": "mount-alpha",
30+
"target": "Engineering"
31+
}
32+
]
33+
}
34+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"api_generation": 2,
3+
"versions": {
4+
"session": 2,
5+
"replica": 2,
6+
"export_metadata": 2,
7+
"writable_session_store": 1,
8+
"canonical": 1,
9+
"path": 1,
10+
"changeset": 1
11+
},
12+
"session_id": "session-scope-7",
13+
"profile_id": "018f4f6e-9f2c-7b1a-8c3d-4e5f60718293",
14+
"profile_revision": 7,
15+
"layout_version": 1,
16+
"layout_digest": "sha256:6d739ad2748910520e4df1d680e9ea78a94230d0751e6346d3f5d3c57b9259b5",
17+
"state": "ready",
18+
"freshness_requirement": {
19+
"max_age_seconds": 300,
20+
"on_stale": "wait_then_fail",
21+
"wait_timeout_seconds": 30
22+
},
23+
"replicas": [
24+
{
25+
"source_connection_id": "source-drive",
26+
"state": "fresh",
27+
"coverage_complete": true,
28+
"provider_observed_through": "drive-repair:43",
29+
"last_successful_sync_at": "2026-07-19T11:58:00Z",
30+
"last_repair_at": "2026-07-19T11:55:00Z",
31+
"pending_events": 0,
32+
"backlog": 0,
33+
"provider_cooldown_until": null
34+
},
35+
{
36+
"source_connection_id": "source-notion",
37+
"state": "fresh",
38+
"coverage_complete": true,
39+
"provider_observed_through": "notion-repair:108",
40+
"last_successful_sync_at": "2026-07-19T11:58:00Z",
41+
"last_repair_at": "2026-07-19T11:55:00Z",
42+
"pending_events": 0,
43+
"backlog": 0,
44+
"provider_cooldown_until": null
45+
}
46+
],
47+
"export_attempt_limits": {
48+
"max_files": 10000,
49+
"max_directories": 10000,
50+
"max_content_bytes": 104857600
51+
},
52+
"error": null,
53+
"updated_at": "2026-07-23T20:00:00Z"
54+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"code": "update_required",
3+
"message": "workspace profile requires workspace layout version 1",
4+
"retriable": false,
5+
"required_api_generation": 2,
6+
"minimum_layout_version": 1,
7+
"required_capabilities": [
8+
{
9+
"name": "workspace_layout",
10+
"version": 1
11+
},
12+
{
13+
"name": "atomic_root_publication",
14+
"version": 1
15+
},
16+
{
17+
"name": "path_ceilings",
18+
"version": 1,
19+
"max_component_utf8_bytes": 255,
20+
"max_component_utf16_units": 255,
21+
"max_path_utf8_bytes": 1024,
22+
"max_path_utf16_units": 1024
23+
},
24+
{
25+
"name": "tar_encodings",
26+
"version": 1,
27+
"encodings": [
28+
"identity",
29+
"zstd"
30+
]
31+
}
32+
]
33+
}

crates/locality-protocol/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//! This crate owns envelopes, not transport or persistence. In particular it
55
//! contains no HTTP client, database repository, cloud SDK, or host path.
66
7+
pub mod workspace_api_v2;
78
pub mod workspace_layout;
89

910
use std::collections::{BTreeMap, BTreeSet};

0 commit comments

Comments
 (0)