Checkpoint source 7 workflows and in-progress diagram authoring redesign
Rust checks / check (ubuntu-latest) (push) Canceled after 0s
Rust checks / check (windows-latest) (push) Canceled after 0s
Rust checks / check (ubuntu-latest) (push) Canceled after 0s
Rust checks / check (windows-latest) (push) Canceled after 0s
Preserve current core, source, REST, desktop, recovery, documentation and validation work, including AGENTS.md and the development summary. This is a work-in-progress checkpoint: the new compact palette has outstanding compilation errors and native acceptance; earlier passing gates retain their documented scope.
This commit is contained in:
@@ -18,6 +18,8 @@ mod port_anchors;
|
||||
mod semantic_transitions;
|
||||
#[path = "http/source6_views.rs"]
|
||||
mod source6_views;
|
||||
#[path = "http/source7_contracts.rs"]
|
||||
mod source7_contracts;
|
||||
#[path = "http/source_projects.rs"]
|
||||
mod source_projects;
|
||||
|
||||
@@ -567,89 +569,6 @@ async fn oversized_source_and_json_are_rejected_without_stalling_the_catalog() {
|
||||
server.stop().await;
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn accepted_slow_source_does_not_lock_catalog_and_loses_to_a_newer_http_revision() {
|
||||
let directory = tempfile::tempdir().unwrap();
|
||||
let server = TestServer::start(directory.path(), None).await;
|
||||
let (id, etag) = server.create().await;
|
||||
let mut source = String::from(
|
||||
"arcadia 2; project prepared \"Slow proposed head\" { oa_activity a0 \"Root\" {}\n",
|
||||
);
|
||||
// This is within all admission budgets. A nested engineering graph forces
|
||||
// real validation work after the source route's initial revision snapshot.
|
||||
// Keep this concurrency fixture below the service's 30-second deadline:
|
||||
// 2,000 nested activities returned a legitimate 504 on the two-core runner.
|
||||
// The overlap assertion below prevents shrinking it into a sequential test.
|
||||
for i in 1..1_000 {
|
||||
source.push_str(&format!(
|
||||
"oa_activity a{i} \"Activity {i}\" {{ parent @a{}; }}\n",
|
||||
i - 1
|
||||
));
|
||||
}
|
||||
source.push('}');
|
||||
let client = server.client.clone();
|
||||
let url = server.url(&format!("/projects/{id}/source"));
|
||||
let stale_etag = etag.clone();
|
||||
let proposed = tokio::spawn(async move {
|
||||
client
|
||||
.put(url)
|
||||
.header("if-match", stale_etag)
|
||||
.header("content-type", "text/plain")
|
||||
.body(source)
|
||||
.send()
|
||||
.await
|
||||
.unwrap()
|
||||
});
|
||||
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
|
||||
assert!(
|
||||
!proposed.is_finished(),
|
||||
"fixture must overlap actual candidate preparation"
|
||||
);
|
||||
let catalog = tokio::time::timeout(
|
||||
std::time::Duration::from_secs(2),
|
||||
server.client.get(server.url("/projects")).send(),
|
||||
)
|
||||
.await
|
||||
.expect("catalog locked during valid candidate preparation")
|
||||
.unwrap();
|
||||
assert_eq!(catalog.status(), StatusCode::OK);
|
||||
let winner = tokio::time::timeout(
|
||||
std::time::Duration::from_secs(2),
|
||||
server
|
||||
.client
|
||||
.patch(server.url(&format!("/projects/{id}")))
|
||||
.header("if-match", &etag)
|
||||
.json(&json!({"name":"Concurrent accepted review"}))
|
||||
.send(),
|
||||
)
|
||||
.await
|
||||
.expect("unrelated preparation held the commit lock")
|
||||
.unwrap();
|
||||
assert_eq!(winner.status(), StatusCode::OK);
|
||||
// The two-second read/PATCH bounds above test responsiveness and lock
|
||||
// ownership. Finishing the deliberately expensive admitted candidate is
|
||||
// a separate watchdog, not a latency promise under parallel CPU contention.
|
||||
let loser = tokio::time::timeout(std::time::Duration::from_secs(45), proposed)
|
||||
.await
|
||||
.expect("admitted candidate did not complete within the test watchdog")
|
||||
.unwrap();
|
||||
assert_eq!(loser.status(), StatusCode::PRECONDITION_FAILED);
|
||||
let failure: Value = loser.json().await.unwrap();
|
||||
assert_eq!(failure["code"], "revision_conflict");
|
||||
assert_eq!(failure["current_revision"], 2);
|
||||
let committed = server.get(id).await;
|
||||
assert_eq!(committed.revision, 2);
|
||||
assert_eq!(committed.model.name, "Concurrent accepted review");
|
||||
assert!(committed.model.elements.is_empty());
|
||||
let installed: StoredProject = serde_json::from_slice(
|
||||
&std::fs::read(directory.path().join(format!("{id}.json"))).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(installed.model, committed.model);
|
||||
assert_eq!(installed.revision, 2);
|
||||
server.stop().await;
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn mission_and_contextual_chain_records_round_trip_and_edit_through_http() {
|
||||
let directory = tempfile::tempdir().unwrap();
|
||||
@@ -2019,7 +1938,7 @@ async fn current_migration_reports_and_invalid_typed_transaction_preserve_http_s
|
||||
.text()
|
||||
.await
|
||||
.unwrap();
|
||||
assert!(source.starts_with("arcadia 6;"));
|
||||
assert!(source.starts_with("arcadia 7;"));
|
||||
assert_eq!(oa_core::language::parse(&source).unwrap(), stored.model);
|
||||
let no_op = server
|
||||
.client
|
||||
|
||||
Reference in New Issue
Block a user