-
Notifications
You must be signed in to change notification settings - Fork 3
MCP: preserve EC2 runtime and publisher identity #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
7281489
6933a47
ac0a7dd
72b5f0c
e80c245
60f5dee
3c10131
de490ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -482,9 +482,14 @@ impl TraceStore { | |||||||||||||||||||||||||||||||||||
| if ctx.role.is_empty() { | ||||||||||||||||||||||||||||||||||||
| ctx.role = crate::policy::role(ev).to_string(); | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| if ctx.repo.is_empty() { | ||||||||||||||||||||||||||||||||||||
| ctx.repo = ev.payload["repo"].as_str().unwrap_or("").to_string(); | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| if let Some(cwd) = event_cwd(&ev.payload).filter(|cwd| !cwd.is_empty()) { | ||||||||||||||||||||||||||||||||||||
| if ctx.cwd.is_empty() { | ||||||||||||||||||||||||||||||||||||
| ctx.repo = crate::units::resolve_repo(&cwd, known); | ||||||||||||||||||||||||||||||||||||
| if ctx.repo.is_empty() { | ||||||||||||||||||||||||||||||||||||
| ctx.repo = crate::units::resolve_repo(&cwd, known); | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+485
to
+492
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Only accept repository stamps from the trusted session-start event.
Suggested fix- if ctx.repo.is_empty() {
+ if ev.kind == "session_start" && ctx.repo.is_empty() {
ctx.repo = ev.payload["repo"].as_str().unwrap_or("").to_string();
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||
| ctx.cwd = cwd; | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
@@ -2917,6 +2922,40 @@ mod tests { | |||||||||||||||||||||||||||||||||||
| assert_eq!(hits[0].repo, "repo"); | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| #[test] | ||||||||||||||||||||||||||||||||||||
| fn remote_trace_uses_edge_stamped_repo_without_a_local_checkout() { | ||||||||||||||||||||||||||||||||||||
| let lines = [ | ||||||||||||||||||||||||||||||||||||
| ev( | ||||||||||||||||||||||||||||||||||||
| "start", | ||||||||||||||||||||||||||||||||||||
| "2026-06-01T10:00:00Z", | ||||||||||||||||||||||||||||||||||||
| "codex_cli", | ||||||||||||||||||||||||||||||||||||
| "S", | ||||||||||||||||||||||||||||||||||||
| "session_start", | ||||||||||||||||||||||||||||||||||||
| json!({"cwd":"/mnt/cache/workspaces/sie-harness","repo":"sie-harness"}), | ||||||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||||||
| ev( | ||||||||||||||||||||||||||||||||||||
| "call", | ||||||||||||||||||||||||||||||||||||
| "2026-06-01T10:00:01Z", | ||||||||||||||||||||||||||||||||||||
| "codex_cli", | ||||||||||||||||||||||||||||||||||||
| "S", | ||||||||||||||||||||||||||||||||||||
| "tool_call", | ||||||||||||||||||||||||||||||||||||
| json!({"name":"exec_command","call_id":"c1","arguments":"{\"cmd\":\"pytest\"}"}), | ||||||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||||||
| ev( | ||||||||||||||||||||||||||||||||||||
| "result", | ||||||||||||||||||||||||||||||||||||
| "2026-06-01T10:00:02Z", | ||||||||||||||||||||||||||||||||||||
| "codex_cli", | ||||||||||||||||||||||||||||||||||||
| "S", | ||||||||||||||||||||||||||||||||||||
| "tool_result", | ||||||||||||||||||||||||||||||||||||
| json!({"call_id":"c1","output":"Process exited with code 0"}), | ||||||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||||||
| ]; | ||||||||||||||||||||||||||||||||||||
| let refs: Vec<&str> = lines.iter().map(String::as_str).collect(); | ||||||||||||||||||||||||||||||||||||
| let store = TraceStore::from_lines(&refs); | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| assert_eq!(store.spans[0].repo, "sie-harness"); | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| #[test] | ||||||||||||||||||||||||||||||||||||
| fn published_trace_excludes_pre_boundary_evidence_but_keeps_context() { | ||||||||||||||||||||||||||||||||||||
| let lines = [ | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.