Repository navigation
chore(train): vehicle 2f — remaining approved greens (#16738, #16734, #16725, #16719, #16471, #16730, #16454, #16732) #16751
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
Changes from all commits
4f0f758
89efa44
d518e30
16e9c45
e19094e
d6f6571
fbf300b
db3b846
2d5d68f
ec4b0c9
1ddfca1
adffc69
bee8540
6e973dc
51ab542
bccb607
a54a0e2
b993635
2bda795
7bcde41
bd937ad
16535f6
7ea7637
b299fd7
c044b22
51c19d8
aa652fe
bb804ce
02df03b
4ab9fc4
5098779
0dcabd9
97f2a77
619a201
dd0eb44
7c5da70
8bab7cb
bbfbf30
bde3252
990c2aa
d8d0096
b02eefb
e2298fb
9654083
947c9e6
c9e809b
d5f79eb
45d8c1e
3637274
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 |
|---|---|---|
|
|
@@ -97,7 +97,7 @@ jobs: | |
|
|
||
| - name: Upload eval report | ||
| if: always() | ||
| uses: actions/upload-artifact@v7 | ||
| uses: actions/upload-artifact@v7.0.1 | ||
|
Contributor
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. 🔒 Security & Privacy | 🛡️ Analyzed with Security Review | 🟠 Major | ⚡ Quick win Security Misconfiguration Reachability: External Pin every changed The seven changed references use the mutable
🧰 Tools🪛 zizmor (1.29.0)[error] 100-100: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 📍 Affects 3 files
🤖 Prompt for AI Agents |
||
| with: | ||
| name: trajectory-eval-report | ||
| path: | | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ | |
| import uuid | ||
|
|
||
| from fastapi import APIRouter, Depends, HTTPException, status | ||
| from sqlalchemy import select | ||
| from sqlalchemy.ext.asyncio import AsyncSession | ||
|
|
||
| from api.schemas_agent import ( | ||
|
|
@@ -28,6 +29,7 @@ | |
| from autobot_shared.error_boundaries import ErrorCategory, with_error_handling | ||
| from autobot_shared.logging_manager import get_logger | ||
| from autobot_shared.time_utils import utc_timestamp | ||
| from models.collaboration_event import CollaborationEvent | ||
| from models.session_collaboration import PermissionLevel, SessionCollaboration | ||
| from user_management.database import get_async_session | ||
|
|
||
|
|
@@ -43,8 +45,6 @@ | |
|
|
||
| async def _get_session_collab(session_id: str, db: AsyncSession) -> SessionCollaboration | None: | ||
| """Get session collaboration record.""" | ||
| from sqlalchemy import select | ||
|
|
||
| stmt = select(SessionCollaboration).where(SessionCollaboration.session_id == session_id) | ||
| result = await db.execute(stmt) | ||
| return result.scalar_one_or_none() | ||
|
|
@@ -94,8 +94,6 @@ async def _get_or_create_collab(session_id: str, owner_id: uuid.UUID, db: AsyncS | |
|
|
||
| async def _fetch_and_validate_secret(secret_id: uuid.UUID, user_id: uuid.UUID, db: AsyncSession): | ||
| """Helper for share_secret_with_session. Ref: #1088.""" | ||
| from sqlalchemy import select | ||
|
|
||
| from models.secret import Secret | ||
|
|
||
| stmt = select(Secret).where(Secret.id == secret_id) | ||
|
|
@@ -134,6 +132,33 @@ def _resolve_share_recipients( | |
| return recipient_ids | ||
|
|
||
|
|
||
| async def _record_event( | ||
| db: AsyncSession, | ||
| *, | ||
| session_id: str, | ||
| kind: str, | ||
| user_id: uuid.UUID | None, | ||
| username: str | None, | ||
| payload: dict, | ||
| ) -> None: | ||
| """Persist one collaboration event (#16460). Best-effort: a failure here | ||
| must never break the live broadcast or the REST call it rides alongside | ||
| -- see websocket/presence.py's own use of this for the same reasoning.""" | ||
| try: | ||
| db.add( | ||
| CollaborationEvent( | ||
| session_id=session_id, | ||
| kind=kind, | ||
| user_id=user_id, | ||
| username=username, | ||
| payload=payload, | ||
| ) | ||
| ) | ||
| await db.flush() | ||
|
Contributor
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. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Isolate a failed event flush from the share transaction. When Use a nested transaction for the event write, so a failed event insert rolls back only its savepoint. Add a test where Proposed fix try:
- db.add(
- CollaborationEvent(
- session_id=session_id,
- kind=kind,
- user_id=user_id,
- username=username,
- payload=payload,
+ async with db.begin_nested():
+ db.add(
+ CollaborationEvent(
+ session_id=session_id,
+ kind=kind,
+ user_id=user_id,
+ username=username,
+ payload=payload,
+ )
)
- )
- await db.flush()
+ await db.flush()
except Exception as exc: # noqa: BLE001 - persistence is best-effort, never breaks the caller🤖 Prompt for AI Agents |
||
| except Exception as exc: # noqa: BLE001 - persistence is best-effort, never breaks the caller | ||
| logger.warning("collaboration event persistence failed: %s", type(exc).__name__) | ||
|
|
||
|
|
||
| # ==================================================================== | ||
| # API Endpoints | ||
| # ==================================================================== | ||
|
|
@@ -355,6 +380,24 @@ async def share_secret_with_session( | |
| if recipient_id != user_id: # Don't share with self | ||
| secret.share_with(recipient_id) | ||
|
|
||
| # #16460: persisted alongside the share, same transaction -- a client | ||
| # that reconnects later sees this in GET /{session_id}/events, not | ||
| # just whoever was connected to the live broadcast below. | ||
| await _record_event( | ||
| db, | ||
| session_id=session_id, | ||
| kind="secret_shared", | ||
| user_id=user_id, | ||
| username=current_user.get("username", ""), | ||
| payload={ | ||
| "secret_id": str(secret_id), | ||
| "secret_name": secret.name, | ||
| "secret_type": secret.type, | ||
| "shared_by": str(user_id), | ||
| "shared_by_username": current_user.get("username", ""), | ||
| }, | ||
| ) | ||
|
|
||
| await db.commit() | ||
|
|
||
| logger.info(f"User shared secret with {len(recipient_ids)} participants in session {session_id}") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🛡️ Analyzed with Security Review | 🟠 Major | ⚡ Quick win
Security Misconfiguration
Reachability: External
Exploitability: Difficult
CWE: CWE-494 — Download of Code Without Integrity Check
Use an immutable commit pin for every changed
actions/upload-artifactreference.@v7.0.1is still a mutable tag and fails the repository’szizmorpinning policy. Replace it with@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1, as already used in.github/workflows/import-hermeticity-sweep.yml. A retagged action could execute unreviewed code in the runner..github/workflows/ci.yml#L654-L654: replace@v7.0.1with the immutable SHA..github/workflows/co-located-smoke.yml#L236-L236: replace@v7.0.1with the immutable SHA..github/workflows/coverage.yml#L139-L139: replace@v7.0.1with the immutable SHA..github/workflows/docker-smoke-test.yml#L217-L217: replace@v7.0.1with the immutable SHA..github/workflows/frontend-test.yml#L234-L234: replace@v7.0.1with the immutable SHA..github/workflows/frontend-test.yml#L341-L341: replace@v7.0.1with the immutable SHA..github/workflows/hardened-smoke-test.yml#L343-L343: replace@v7.0.1with the immutable SHA..github/workflows/marker-tests.yml#L409-L409: replace@v7.0.1with the immutable SHA..github/workflows/phase_validation.yml#L185-L185: replace@v7.0.1with the immutable SHA..github/workflows/security.yml#L337-L337: replace@v7.0.1with the immutable SHA..github/workflows/security.yml#L461-L461: replace@v7.0.1with the immutable SHA..github/workflows/security.yml#L687-L687: replace@v7.0.1with the immutable SHA..github/workflows/test-durations.yml#L132-L132: replace@v7.0.1with the immutable SHA.🧰 Tools
🪛 zizmor (1.29.0)
[error] 654-654: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
📍 Affects 10 files
.github/workflows/ci.yml#L654-L654(this comment).github/workflows/co-located-smoke.yml#L236-L236.github/workflows/coverage.yml#L139-L139.github/workflows/docker-smoke-test.yml#L217-L217.github/workflows/frontend-test.yml#L234-L234.github/workflows/frontend-test.yml#L341-L341.github/workflows/hardened-smoke-test.yml#L343-L343.github/workflows/marker-tests.yml#L409-L409.github/workflows/phase_validation.yml#L185-L185.github/workflows/security.yml#L337-L337.github/workflows/security.yml#L461-L461.github/workflows/security.yml#L687-L687.github/workflows/test-durations.yml#L132-L132🤖 Prompt for AI Agents