Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .pa/task_arch10c.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# ARCH-10c — Ziel-Routen nach hq_routes

Status: entwurf

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Aktiviere die bereits umgesetzte Paket-Spec

entwurf bedeutet laut scripts/lib/active-specs.mjs:3-6, dass die Datei noch kein ausführbarer Auftrag ist; entsprechend lässt npm run specs ARCH-10c aus, obwohl derselbe Commit das M-Paket bereits umsetzt und die serielle Nahtstelle api.rs ändert. Dadurch bleibt diese Lane während der laufenden Arbeit in STAND.md unbelegt und ein weiterer Agent könnte parallel dieselbe Nahtstelle bearbeiten. Setze die Spec bis zum Merge auf aktiv und trage sie unter „Aktive Specs“ ein; nach dem Merge kann sie auf historisch gesetzt werden.

AGENTS.md reference: AGENTS.md:L31-L32

Useful? React with 👍 / 👎.


Paketgröße: M, höchstens 300 Diff-Zeilen
Dateien: `src-tauri/src/api.rs`, `src-tauri/src/api/hq_routes.rs`, dieser Auftrag

Verschiebt unverändert die drei Arme `GET /api/hq/v1/goals`,
`POST /api/hq/v1/goals` und `POST /api/hq/v1/goals/:goalId/tasks` aus
`api.rs` in `hq_routes::handle()`. Besitztest in `hq_routes::route` nennt
genau diese Methoden und Pfadsegmente, kein Präfix- oder Methoden-Platzhalter.

Keine neue Funktion, kein Bugfix, keine Änderung an Backend, Store, Schema,
Auth oder Konfiguration. Bestehende Ziel-API-Tests in `api.rs` decken
Verhalten und Reihenfolge ab (No-Test, rein mechanisch).
78 changes: 0 additions & 78 deletions src-tauri/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1386,84 +1386,6 @@ fn route(inner: &Inner, request: &Request, proof: VerdictProof) -> Response {
}

match (method, path.as_slice()) {
("GET", ["api", "hq", "v1", "goals"]) => {
let project_id = match project_id {
Some(value) if !value.is_empty() => value,
_ => return Response::error(400, "projectId is required"),
};
match backend.list_continuous_goals(project_id) {
Ok(goals) => Response::ok(json!({ "goals": goals })),
Err(err) => continuous_error(err),
}
}
("POST", ["api", "hq", "v1", "goals"]) => {
let body = match parse_body(&request.body) {
Ok(body) => body,
Err(err) => return Response::error(400, err),
};
if let Err(err) = only_keys(
&body,
&[
"projectId",
"objective",
"acceptanceCriteria",
"sourceGoalId",
"admit",
],
) {
return Response::error(400, err);
}
let project_id = match required_str(&body, "projectId") {
Ok(value) => value,
Err(err) => return Response::error(400, err),
};
let objective = match required_str(&body, "objective") {
Ok(value) => value,
Err(err) => return Response::error(400, err),
};
let admit = match optional_bool(&body, "admit") {
Ok(value) => value.unwrap_or(false),
Err(err) => return Response::error(400, err),
};
match backend.create_continuous_goal(
&project_id,
&objective,
optional_str(&body, "acceptanceCriteria"),
optional_str(&body, "sourceGoalId"),
admit,
) {
Ok(goal) => Response::ok(json!({ "goal": goal })),
Err(err) => continuous_error(err),
}
}
("POST", ["api", "hq", "v1", "goals", goal_id, "tasks"]) => {
let body = match parse_body(&request.body) {
Ok(body) => body,
Err(err) => return Response::error(400, err),
};
let objective = match required_str(&body, "objective") {
Ok(value) => value,
Err(err) => return Response::error(400, err),
};
let owned_paths = match string_array(&body, "ownedPaths") {
Ok(value) => value,
Err(err) => return Response::error(400, err),
};
let dependencies = match string_array(&body, "dependencies") {
Ok(value) => value,
Err(err) => return Response::error(400, err),
};
match backend.create_continuous_task(
goal_id,
&objective,
optional_str(&body, "profileId"),
owned_paths,
dependencies,
) {
Ok(task) => Response::ok(json!({ "task": task })),
Err(err) => continuous_error(err),
}
}
("GET", ["api", "hq", "v1", "tasks", task_id, "assignment"]) => {
match backend.continuous_task_assignment(task_id) {
Ok(assignment) => Response::ok(
Expand Down
80 changes: 80 additions & 0 deletions src-tauri/src/api/hq_routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ pub(super) fn route(
| ("GET", ["api", "hq", "v1", "runtime" | "plan" | "runs"])
| ("GET", ["api", "hq", "v1", "context" | "changes"])
| ("POST", ["api", "hq", "v1", "plan", "import"])
| ("GET" | "POST", ["api", "hq", "v1", "goals"])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stelle den erforderlichen No-Test-Trailer wieder her

Der Commit ändert Rust-Quellcode, enthält aber keine eigenständige Zeile No-Test: ...; die Formulierung **Test policy:** No-Test im Bericht wird vom Gate nicht als Trailer erkannt. Für genau diesen Base-/Head-Vergleich endet BASE_SHA=277a79d... HEAD_SHA=0a14433... bash scripts/ci/red-first.sh --plan deshalb mit Exit 1 und „ändert Quellcode ohne Test-First:/Regression-For:/No-Test:“, sodass dieser Kandidat die Merge-Gates nicht bestehen kann.

AGENTS.md reference: AGENTS.md:L155-L158

Useful? React with 👍 / 👎.

| ("POST", ["api", "hq", "v1", "goals", _, "tasks"])
);
owned.then(|| handle(inner, request, method, path, project_id))
}
Expand Down Expand Up @@ -173,6 +175,84 @@ fn handle(
}
continuous_response(backend.development_records(project_id))
}
("GET", ["api", "hq", "v1", "goals"]) => {
let project_id = match project_id {
Some(value) if !value.is_empty() => value,
_ => return Response::error(400, "projectId is required"),
};
match backend.list_continuous_goals(project_id) {
Ok(goals) => Response::ok(json!({ "goals": goals })),
Err(err) => continuous_error(err),
}
}
("POST", ["api", "hq", "v1", "goals"]) => {
let body = match parse_body(&request.body) {
Ok(body) => body,
Err(err) => return Response::error(400, err),
};
if let Err(err) = only_keys(
&body,
&[
"projectId",
"objective",
"acceptanceCriteria",
"sourceGoalId",
"admit",
],
) {
return Response::error(400, err);
}
let project_id = match required_str(&body, "projectId") {
Ok(value) => value,
Err(err) => return Response::error(400, err),
};
let objective = match required_str(&body, "objective") {
Ok(value) => value,
Err(err) => return Response::error(400, err),
};
let admit = match optional_bool(&body, "admit") {
Ok(value) => value.unwrap_or(false),
Err(err) => return Response::error(400, err),
};
match backend.create_continuous_goal(
&project_id,
&objective,
optional_str(&body, "acceptanceCriteria"),
optional_str(&body, "sourceGoalId"),
admit,
) {
Ok(goal) => Response::ok(json!({ "goal": goal })),
Err(err) => continuous_error(err),
}
}
("POST", ["api", "hq", "v1", "goals", goal_id, "tasks"]) => {
let body = match parse_body(&request.body) {
Ok(body) => body,
Err(err) => return Response::error(400, err),
};
let objective = match required_str(&body, "objective") {
Ok(value) => value,
Err(err) => return Response::error(400, err),
};
let owned_paths = match string_array(&body, "ownedPaths") {
Ok(value) => value,
Err(err) => return Response::error(400, err),
};
let dependencies = match string_array(&body, "dependencies") {
Ok(value) => value,
Err(err) => return Response::error(400, err),
};
match backend.create_continuous_task(
goal_id,
&objective,
optional_str(&body, "profileId"),
owned_paths,
dependencies,
) {
Ok(task) => Response::ok(json!({ "task": task })),
Err(err) => continuous_error(err),
}
}
_ => unreachable!("route() only hands over owned arms"),
}
}
Loading