MCPcopy Index your code
hub / github.com/openai/plugins / set_capability_preflight

Function set_capability_preflight

plugins/codex-security/scripts/workbench_db.py:1329–1355  ·  view source on GitHub ↗
(
    connection: sqlite3.Connection, args: argparse.Namespace
)

Source from the content-addressed store, hash-verified

1327
1328
1329def set_capability_preflight(
1330 connection: sqlite3.Connection, args: argparse.Namespace
1331) -> dict[str, Any]:
1332 workspace = require_workspace(connection, args.workspace_id)
1333 if workspace["active_scan_id"]:
1334 raise SystemExit("Cannot update capability preflight after a scan has started.")
1335 checked_target_path = str(require_target(args.checked_target_path))
1336 preflight_json = capability_preflight_json(
1337 capability_preflight_input(
1338 args.capability_preflight_json, args.capability_preflight_json_file
1339 ),
1340 checked_target_path=checked_target_path,
1341 checked_mode=args.checked_mode,
1342 )
1343 timestamp = now()
1344 with connection:
1345 updated = connection.execute(
1346 """
1347 UPDATE workspaces
1348 SET capability_preflight_json = ?, updated_at = ?
1349 WHERE id = ? AND active_scan_id IS NULL
1350 """,
1351 (preflight_json, timestamp, workspace["id"]),
1352 )
1353 if updated.rowcount != 1:
1354 raise SystemExit("Cannot update capability preflight after a scan has started.")
1355 return workspace_state(connection, workspace["id"])
1356
1357
1358def begin_diff_resolution(

Callers 1

mainFunction · 0.85

Calls 6

require_workspaceFunction · 0.85
require_targetFunction · 0.85
nowFunction · 0.85
workspace_stateFunction · 0.85

Tested by

no test coverage detected