feat(api): consolidate project-history stored-request GET and CLI - #456
Conversation
GAP-003A unique slice: GET /v1/project-histories/{key}/request returns the
accepted LineageWeave create request on AnalysisRunLiveService. Metric-free;
inference_status remains temporal_association_only. Naruon refused. Does not
re-open cancel lineages. ADR 0087.
GAP-003A unique slice: tepp-project-history-request get mints lineageweave_project_history_stored_request_exchange onto spawned tepp-loopback TCP. Empty stdin admitted. Naruon refused. Does not re-open cancel lineages. ADR 0088.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| if idempotency_key.contains('/') || idempotency_key.contains('\0') { | ||
| return Err(ApiError::InvalidWirePayload); |
There was a problem hiding this comment.
🟡 Slash keys block stored retrieval
lineageweave_project_history_stored_request_exchange rejects slash-containing keys that project creation accepts. Their stored requests become unretrievable.
Prompt for agents
ProjectHistoryRequest validation accepts slash characters in idempotency_key, and the existing GET-by-id contract percent-encodes and round-trips them. The new stored-request builder, CLI validation, and stored-request path decoder reject the same keys after creation. Make the stored-request GET use percent-encoding consistently with project_history_retrieval_http so every valid POST idempotency key can retrieve its stored request. Update the HTTP and CLI tests to cover an accepted key containing a slash.
Was this helpful? React with 👍 or 👎 to provide feedback.
| let stdout = render_project_history_stored_request_cli_stdout(&invocation, &response)?; | ||
| println!("{stdout}"); | ||
| if (200..300).contains(&response.status_code) { | ||
| Ok(()) | ||
| } else { | ||
| Err(ApiError::InvalidWirePayload) |
There was a problem hiding this comment.
🟡 Failures print request-shaped output
For any non-2xx response, run prints the error envelope to stdout. Pipelines can consume error JSON as a stored request.
| let stdout = render_project_history_stored_request_cli_stdout(&invocation, &response)?; | |
| println!("{stdout}"); | |
| if (200..300).contains(&response.status_code) { | |
| Ok(()) | |
| } else { | |
| Err(ApiError::InvalidWirePayload) | |
| let stdout = render_project_history_stored_request_cli_stdout(&invocation, &response)?; | |
| if (200..300).contains(&response.status_code) { | |
| println!("{stdout}"); | |
| Ok(()) | |
| } else { | |
| eprintln!("{stdout}"); | |
| Err(ApiError::InvalidWirePayload) |
Was this helpful? React with 👍 or 👎 to provide feedback.
| let bytes = read_bounded(&mut stream, MAXIMUM_HTTP_RESPONSE_BYTES)?; | ||
| parse_http_response(&bytes) |
There was a problem hiding this comment.
| let tenant_workspace_id = header_value(headers, PROJECT_HISTORY_RETRIEVAL_TENANT_HEADER)?; | ||
| crate::project_history::validate_project_history_registry_identity(tenant_workspace_id)?; | ||
| let idempotency_key = project_history_stored_request_path_id(path)?; | ||
| let replay_key = | ||
| consumer_tenant_idempotency_key(consumer, tenant_workspace_id, &idempotency_key); | ||
| let (stored_request, projection) = self | ||
| .accepted_project_histories | ||
| .get(&replay_key) | ||
| .ok_or(ApiError::InvalidWirePayload)?; |
Preserve #420 query CLI source, fail-closed transport/refusal behavior, contract tests, changelog fragment, and doctoring in the consolidated Analysis Run project-history adapter vehicle. Keep stored-request GET/CLI behavior intact. No new bounded context or architecture authority is created.
seonghobae
left a comment
There was a problem hiding this comment.
Exact-head COMMENT on f02436236a73824c87c6043fc5d1e0b08cb0d448 (not the stale ade6e27d SHA; not APPROVE; author COMMENT is not an independent approval under ruleset 18156473). Predecessor Checks/reviews do not transfer. Do not un-draft. Do not reopen closed #420 (folded here). Do not ship project-history by-idempotency lookup (duplicates GET-by-id; #429 CLOSED).
Fail-closed read at this SHA:
- LineageWeave-facing stored-request GET
GET /v1/project-histories/{idempotency_key}/requestrequirestenant_workspace_idthroughvalidate_project_history_registry_identitybefore compose (project_history_stored_request_http.rs). Naruon is refused.NaruonLiveServicestays POST-only. - Query-CLI stdout remains metric-free with
inference_status=temporal_association_only; scientific-acceptance, public binds, hostile origins, and naruon use fail closed per the PR body. - Fold of #420 query CLI is one Analysis Run adapter vehicle, not a new bounded context. ADR 0087/0088 are implementation lineage, not separate architecture authority.
Keep tenant-scoped stored-request; do not add an unscoped stored-request-by-client-key disclosure. Unique tepp-project-history-request remains occupied here. mergeable_state=unstable — not merge-ready.
Consolidated landing vehicle
This PR is the surviving LineageWeave-facing Analysis Run / project-history application-adapter vehicle. It now folds predecessor #455 and the unique project-history query-CLI behavior from #420 into one source lineage instead of leaving one-operation micro-PRs as independent product candidates.
Preserved source/test evidence
tepp-project-history-request get.5e327b8c6238aa1f3777bac4390be32d58adcfaccopies feat(api): query cutoff-safe project history via loopback CLI #420'stepp-project-history querybinary, its project-history query CLI adapter, integration contract tests, changelog fragment, and research doctoring into this branch while retaining the existing collection/retrieval/stored-request surfaces.idempotency_keyandtenant_workspace_idthrough the shared fail-closed registry-identity invariant, so feat(api): query cutoff-safe project history via loopback CLI #420's CR/LF/control-character protection is preserved without reintroducing a duplicate validation helper.inference_status=temporal_association_only;tepp.scientific_acceptance.v1, causal scoring, credential-shaped flags, public binds, hostile origins, unbounded framing and naruon use fail closed.DDD / WIP disposition
This is one Analysis Run adapter landing vehicle, not a new bounded context. After exact-head source verification demonstrates the #420 behavior is present here, #420 may close as
superseded_by_fold; its discussion remains historical evidence. Further project-history HTTP/CLI one-operation slices should fold here or into a deliberate successor rather than creating independent landing authority.Merge bar
Every source mutation invalidates predecessor workflow evidence. Merge only after fresh exact-current-head Rust/documentation/security/SAST gates, resolved blocking conversations, and the qualifying independent approval required by the live organization ruleset. No self-approval, predecessor-head evidence transfer, force push or protection bypass.