Skip to content

armgit / ECC

Public Imported from GitHub
0

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

16.4 KB
Raw Blame
{
  "name": "notebook-edits",
  "description": "Jupyter notebook edits: a cold edit, its retry, a credited test notebook, a comment-only cell, and sensitive notebooks in the parent and a subagent.",
  "files": {
    "notebooks/forecast.ipynb": "{\n \"cells\": [\n  {\n   \"cell_type\": \"code\",\n   \"id\": \"c1\",\n   \"metadata\": {},\n   \"source\": [\n    \"import pandas as pd\\nsales = pd.read_csv('data/sales.csv')\\n\"\n   ],\n   \"outputs\": [],\n   \"execution_count\": null\n  }\n ],\n \"metadata\": {},\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n",
    "notebooks/cleanup.ipynb": "{\n \"cells\": [\n  {\n   \"cell_type\": \"code\",\n   \"id\": \"c1\",\n   \"metadata\": {},\n   \"source\": [\n    \"# drop empty rows\\nrows = [r for r in rows if r]\\n\"\n   ],\n   \"outputs\": [],\n   \"execution_count\": null\n  }\n ],\n \"metadata\": {},\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n",
    "tests/notebooks/check_model.ipynb": "{\n \"cells\": [\n  {\n   \"cell_type\": \"code\",\n   \"id\": \"c1\",\n   \"metadata\": {},\n   \"source\": [\n    \"assert model.score(X, y) > 0.8\\n\"\n   ],\n   \"outputs\": [],\n   \"execution_count\": null\n  }\n ],\n \"metadata\": {},\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n",
    "src/auth/session_audit.ipynb": "{\n \"cells\": [\n  {\n   \"cell_type\": \"code\",\n   \"id\": \"c1\",\n   \"metadata\": {},\n   \"source\": [\n    \"sessions = load_sessions()\\n\"\n   ],\n   \"outputs\": [],\n   \"execution_count\": null\n  }\n ],\n \"metadata\": {},\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n",
    "src/payments/ledger.ipynb": "{\n \"cells\": [\n  {\n   \"cell_type\": \"code\",\n   \"id\": \"c1\",\n   \"metadata\": {},\n   \"source\": [\n    \"ledger = load_ledger()\\n\"\n   ],\n   \"outputs\": [],\n   \"execution_count\": null\n  }\n ],\n \"metadata\": {},\n \"nbformat\": 4,\n \"nbformat_minor\": 5\n}\n",
    "data/sales.csv": "month,total\n2026-01,10\n"
  },
  "steps": [
    {
      "id": "cold-forecast",
      "note": "First NotebookEdit with no investigation; the change profile is unknown, so the full code questions are asked.",
      "transcript": [
        {
          "type": "user",
          "uuid": "notebook-edits-001",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "promptId": "prompt-notebook-1",
          "message": {
            "role": "user",
            "content": "Group the forecast by quarter instead of by month."
          }
        },
        {
          "type": "assistant",
          "uuid": "notebook-edits-002",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "message": {
            "id": "msg_notebookedits_01",
            "type": "message",
            "role": "assistant",
            "model": "claude-sonnet-4-5",
            "content": [
              {
                "type": "tool_use",
                "id": "toolu_notebookedits_001",
                "name": "NotebookEdit",
                "input": {
                  "notebook_path": "{{root}}/notebooks/forecast.ipynb",
                  "cell_id": "c1",
                  "new_source": "sales = pd.read_csv('data/sales.csv')\nsales.groupby('quarter').sum()\n"
                }
              }
            ]
          }
        }
      ],
      "payload": {
        "session_id": "sess-notebook",
        "transcript_path": "{{transcript}}",
        "cwd": "{{root}}",
        "permission_mode": "default",
        "hook_event_name": "PreToolUse",
        "tool_name": "NotebookEdit",
        "tool_input": {
          "notebook_path": "{{root}}/notebooks/forecast.ipynb",
          "cell_id": "c1",
          "new_source": "sales = pd.read_csv('data/sales.csv')\nsales.groupby('quarter').sum()\n"
        },
        "tool_use_id": "toolu_notebookedits_001"
      },
      "expect": "deny",
      "mustDeny": false,
      "redundant": false,
      "relevantQuestions": [
        "importers",
        "public-api",
        "data-schema",
        "external-contract",
        "quote-instruction"
      ]
    },
    {
      "id": "retry-forecast",
      "note": "Retry after the facts are presented.",
      "transcript": [
        {
          "type": "user",
          "uuid": "notebook-edits-003",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "promptId": "prompt-notebook-1",
          "message": {
            "role": "user",
            "content": [
              {
                "type": "tool_result",
                "tool_use_id": "toolu_notebookedits_001",
                "content": "denied"
              }
            ]
          }
        },
        {
          "type": "assistant",
          "uuid": "notebook-edits-004",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "message": {
            "id": "msg_notebookedits_02",
            "type": "message",
            "role": "assistant",
            "model": "claude-sonnet-4-5",
            "content": [
              {
                "type": "tool_use",
                "id": "toolu_notebookedits_002",
                "name": "NotebookEdit",
                "input": {
                  "notebook_path": "{{root}}/notebooks/forecast.ipynb",
                  "cell_id": "c1",
                  "new_source": "sales.groupby('quarter').sum()\n"
                }
              }
            ]
          }
        }
      ],
      "payload": {
        "session_id": "sess-notebook",
        "transcript_path": "{{transcript}}",
        "cwd": "{{root}}",
        "permission_mode": "default",
        "hook_event_name": "PreToolUse",
        "tool_name": "NotebookEdit",
        "tool_input": {
          "notebook_path": "{{root}}/notebooks/forecast.ipynb",
          "cell_id": "c1",
          "new_source": "sales.groupby('quarter').sum()\n"
        },
        "tool_use_id": "toolu_notebookedits_002"
      },
      "expect": "allow",
      "mustDeny": false,
      "redundant": false
    },
    {
      "id": "credited-test-notebook",
      "note": "A scoped Grep that names the notebook earlier in the turn credits the first touch.",
      "transcript": [
        {
          "type": "user",
          "uuid": "notebook-edits-005",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "promptId": "prompt-notebook-1",
          "message": {
            "role": "user",
            "content": [
              {
                "type": "tool_result",
                "tool_use_id": "toolu_notebookedits_002",
                "content": "ok"
              }
            ]
          }
        },
        {
          "type": "user",
          "uuid": "notebook-edits-006",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "promptId": "prompt-notebook-2",
          "message": {
            "role": "user",
            "content": "Tighten the model check threshold to 0.85."
          }
        },
        {
          "type": "assistant",
          "uuid": "notebook-edits-007",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "message": {
            "id": "msg_notebookedits_03",
            "type": "message",
            "role": "assistant",
            "model": "claude-sonnet-4-5",
            "content": [
              {
                "type": "tool_use",
                "id": "toolu_notebookedits_003",
                "name": "Grep",
                "input": {
                  "pattern": "check_model",
                  "path": "{{root}}/tests",
                  "output_mode": "files_with_matches"
                }
              }
            ]
          }
        },
        {
          "type": "user",
          "uuid": "notebook-edits-008",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "promptId": "prompt-notebook-2",
          "message": {
            "role": "user",
            "content": [
              {
                "type": "tool_result",
                "tool_use_id": "toolu_notebookedits_003",
                "content": "tests/notebooks/check_model.ipynb"
              }
            ]
          }
        },
        {
          "type": "assistant",
          "uuid": "notebook-edits-009",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "message": {
            "id": "msg_notebookedits_04",
            "type": "message",
            "role": "assistant",
            "model": "claude-sonnet-4-5",
            "content": [
              {
                "type": "tool_use",
                "id": "toolu_notebookedits_004",
                "name": "NotebookEdit",
                "input": {
                  "notebook_path": "{{root}}/tests/notebooks/check_model.ipynb",
                  "cell_id": "c1",
                  "new_source": "assert model.score(X, y) > 0.85\n"
                }
              }
            ]
          }
        }
      ],
      "payload": {
        "session_id": "sess-notebook",
        "transcript_path": "{{transcript}}",
        "cwd": "{{root}}",
        "permission_mode": "default",
        "hook_event_name": "PreToolUse",
        "tool_name": "NotebookEdit",
        "tool_input": {
          "notebook_path": "{{root}}/tests/notebooks/check_model.ipynb",
          "cell_id": "c1",
          "new_source": "assert model.score(X, y) > 0.85\n"
        },
        "tool_use_id": "toolu_notebookedits_004"
      },
      "expect": "allow",
      "mustDeny": false,
      "redundant": true
    },
    {
      "id": "comment-only-cleanup",
      "note": "A comment-only cell source is not a trivial pass for a notebook.",
      "transcript": [
        {
          "type": "user",
          "uuid": "notebook-edits-010",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "promptId": "prompt-notebook-2",
          "message": {
            "role": "user",
            "content": [
              {
                "type": "tool_result",
                "tool_use_id": "toolu_notebookedits_004",
                "content": "ok"
              }
            ]
          }
        },
        {
          "type": "assistant",
          "uuid": "notebook-edits-011",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "message": {
            "id": "msg_notebookedits_05",
            "type": "message",
            "role": "assistant",
            "model": "claude-sonnet-4-5",
            "content": [
              {
                "type": "tool_use",
                "id": "toolu_notebookedits_005",
                "name": "NotebookEdit",
                "input": {
                  "notebook_path": "{{root}}/notebooks/cleanup.ipynb",
                  "cell_id": "c1",
                  "new_source": "# drop empty and blank rows\nrows = [r for r in rows if r]\n"
                }
              }
            ]
          }
        }
      ],
      "payload": {
        "session_id": "sess-notebook",
        "transcript_path": "{{transcript}}",
        "cwd": "{{root}}",
        "permission_mode": "default",
        "hook_event_name": "PreToolUse",
        "tool_name": "NotebookEdit",
        "tool_input": {
          "notebook_path": "{{root}}/notebooks/cleanup.ipynb",
          "cell_id": "c1",
          "new_source": "# drop empty and blank rows\nrows = [r for r in rows if r]\n"
        },
        "tool_use_id": "toolu_notebookedits_005"
      },
      "expect": "deny",
      "mustDeny": false,
      "redundant": false,
      "relevantQuestions": [
        "importers",
        "public-api",
        "data-schema",
        "external-contract",
        "quote-instruction"
      ]
    },
    {
      "id": "sensitive-notebook-after-search",
      "note": "A notebook under auth/ is sensitive: the crediting search does not count.",
      "transcript": [
        {
          "type": "user",
          "uuid": "notebook-edits-012",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "promptId": "prompt-notebook-2",
          "message": {
            "role": "user",
            "content": [
              {
                "type": "tool_result",
                "tool_use_id": "toolu_notebookedits_005",
                "content": "denied"
              }
            ]
          }
        },
        {
          "type": "user",
          "uuid": "notebook-edits-013",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "promptId": "prompt-notebook-3",
          "message": {
            "role": "user",
            "content": "Add a column for the session origin to the audit notebook."
          }
        },
        {
          "type": "assistant",
          "uuid": "notebook-edits-014",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "message": {
            "id": "msg_notebookedits_06",
            "type": "message",
            "role": "assistant",
            "model": "claude-sonnet-4-5",
            "content": [
              {
                "type": "tool_use",
                "id": "toolu_notebookedits_006",
                "name": "Grep",
                "input": {
                  "pattern": "session_audit",
                  "path": "{{root}}/src"
                }
              }
            ]
          }
        },
        {
          "type": "user",
          "uuid": "notebook-edits-015",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "promptId": "prompt-notebook-3",
          "message": {
            "role": "user",
            "content": [
              {
                "type": "tool_result",
                "tool_use_id": "toolu_notebookedits_006",
                "content": "src/auth/session_audit.ipynb"
              }
            ]
          }
        },
        {
          "type": "assistant",
          "uuid": "notebook-edits-016",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "message": {
            "id": "msg_notebookedits_07",
            "type": "message",
            "role": "assistant",
            "model": "claude-sonnet-4-5",
            "content": [
              {
                "type": "tool_use",
                "id": "toolu_notebookedits_007",
                "name": "NotebookEdit",
                "input": {
                  "notebook_path": "{{root}}/src/auth/session_audit.ipynb",
                  "cell_id": "c1",
                  "new_source": "sessions = load_sessions(columns=['origin'])\n"
                }
              }
            ]
          }
        }
      ],
      "payload": {
        "session_id": "sess-notebook",
        "transcript_path": "{{transcript}}",
        "cwd": "{{root}}",
        "permission_mode": "default",
        "hook_event_name": "PreToolUse",
        "tool_name": "NotebookEdit",
        "tool_input": {
          "notebook_path": "{{root}}/src/auth/session_audit.ipynb",
          "cell_id": "c1",
          "new_source": "sessions = load_sessions(columns=['origin'])\n"
        },
        "tool_use_id": "toolu_notebookedits_007"
      },
      "expect": "deny",
      "mustDeny": true,
      "redundant": false,
      "relevantQuestions": [
        "importers",
        "public-api",
        "data-schema",
        "external-contract",
        "quote-instruction"
      ]
    },
    {
      "id": "subagent-sensitive-notebook",
      "note": "A subagent touching a sensitive notebook is gated like the parent.",
      "transcript": [
        {
          "type": "user",
          "uuid": "notebook-edits-017",
          "sessionId": "sess-notebook",
          "isSidechain": false,
          "promptId": "prompt-notebook-3",
          "message": {
            "role": "user",
            "content": [
              {
                "type": "tool_result",
                "tool_use_id": "toolu_notebookedits_007",
                "content": "denied"
              }
            ]
          }
        }
      ],
      "payload": {
        "session_id": "sess-notebook",
        "transcript_path": "{{transcript}}",
        "cwd": "{{root}}",
        "permission_mode": "default",
        "hook_event_name": "PreToolUse",
        "tool_name": "NotebookEdit",
        "tool_input": {
          "notebook_path": "{{root}}/src/payments/ledger.ipynb",
          "cell_id": "c1",
          "new_source": "ledger = load_ledger(currency='EUR')\n"
        },
        "tool_use_id": "toolu_notebookedits_008",
        "agent_id": "agent-ledger",
        "agent_type": "general-purpose"
      },
      "expect": "deny",
      "mustDeny": true,
      "redundant": false,
      "relevantQuestions": [
        "importers",
        "public-api",
        "data-schema",
        "external-contract",
        "quote-instruction"
      ]
    }
  ]
}