# Comment evaluation corpus -- yaml, needs labels
#
# Real own-line comments with the code that follows. Mark every `verdict:` as:
#
#   slop  - should not exist: restates the code, narrates an edit, labels a
#           section, leaks process, records history, or is a long explanation
#           where a short one would do
#   keep  - deleting it would lose a fact not recoverable from the code
#   skip  - genuinely cannot tell without more context
#
# Leave `?` on anything you do not reach; partial labelling still scores.
#
# Nothing here reveals which rule (if any) fires on a case, or how the case
# was sampled.

### 1  .github/workflows/ci-agent.yml:25
# The agent-service tests are pure (no DB, no network, no Anthropic key):
# they exercise the SDK<->event mapping, env scrubbing, skills resolution,
# tools, and uploads. No Infisical secrets needed.
    - name: Run agent-service tests
    run: uv run --package ionworks_agent_service python -m pytest tests -q
    working-directory: ./agent-service
verdict: ?

### 2  .github/workflows/ci-benchmarks.yml:35
# --package ionworks-ucp scopes the implicit sync to ucp's deps only,
# avoiding a full-workspace install (backend, frontend tooling, etc.).
    run: uv run --package ionworks-ucp python benchmarks/ucp/run_all.py --quick
verdict: keep

### 3  .github/workflows/deploy-production-release.yml:72
# The skills mirror repos are private, so the repo-scoped GITHUB_TOKEN
# cannot read their tags — a `gh api .../git/ref/tags/vX` against them
# 404s and the guard below would false-negative to "missing", trying to
# re-push an existing tag and failing the mirror job (which then skips
# Deploy to Production). Mint the same GitHub App token the mirror-push
# job uses so the existence check can actually see the mirror tags.
    - name: Fetch secrets from Infisical
    uses: Infisical/secrets-action@v1.0.16
    with:
    method: "oidc"
verdict: slop

### 4  .github/workflows/deploy-reusable-agent.yml:57
# porter CLI silently reads PORTER_TOKEN and IONWORKSPIPELINE_LICENSE_KEY
    - name: Deploy stack
    timeout-minutes: 30
    run: exec porter apply -f ./${{ env.PORTER_YAML }}
    env:
verdict: keep

### 5  .github/workflows/deploy-reusable-anyscale.yml:245
# anyscale CLI silently reads ANYSCALE_CLI_TOKEN
    - name: Register image with Anyscale
    id: register
    run: |
    IMAGE_TAG="$REGISTRY/$IMAGE_NAME:${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}"
verdict: keep

### 6  .github/workflows/deploy-reusable-backend.yml:62
# porter CLI silently reads PORTER_TOKEN and IONWORKSPIPELINE_LICENSE_KEY
# --wait makes this step mean "rollout healthy", not merely "accepted".
    - name: Deploy stack
    timeout-minutes: 30
    run: |
    exec porter apply -f ./${{ env.PORTER_YAML }} --wait \
verdict: ?

### 7  .github/workflows/deploy-reusable-db-migrations.yml:51
# Mark remote-only versions reverted before db push: auto-detected branch
# drift (internal only) + the explicit squash list (all envs).
    - name: Repair remote-ahead migration history
    run: |
    remote_only=""
verdict: ?

### 8  .github/workflows/deploy-reusable-frontend.yml:59
# porter CLI silently reads PORTER_TOKEN
    - name: Deploy stack
    timeout-minutes: 20
    run: exec porter apply --wait
    env:
verdict: ?

### 9  .github/workflows/deploy-stage-all.yml:94
# INTEGRATION_TEST_* store names keep the suite's dedicated stage service
# account distinct from the app's own creds; mapped at the pytest step.
    - name: Fetch secrets from Infisical
    uses: Infisical/secrets-action@v1.0.16
    with:
    method: "oidc"
verdict: ?

### 10  .github/workflows/deploy-stage-all.yml:174
# 'sizing' excluded: a cluster per test, well over an hour. Run deliberately when
# the Anyscale stack changed, via `just env=stage test-standalone-sizing`.
    - name: Run live integration suite against stage
    env:
    IONWORKS_API_KEY: ${{ env.INTEGRATION_TEST_API_KEY }}
    IONWORKS_PROJECT_ID: ${{ env.INTEGRATION_TEST_PROJECT_ID }}
verdict: ?

### 11  .github/workflows/deploy-staging-agent.yml:6
# Shared with the release's stage gate (deploy-stage-all.yml): the suite reaches the
# agent through the backend's /agent/* routing, so a redeploy mid-suite is visible.
    concurrency:
    group: deploy-stage
    cancel-in-progress: false
    queue: max
verdict: keep

### 12  .github/workflows/docs-packages.yml:370
# An unresolvable reference renders as plain text and never warns, so the
# build above cannot catch it. This can.
    - name: Check cross-references resolved
    run: |
    uv run python packages/ionworkspipeline/docs/check_crossrefs.py \
    packages/ionworkspipeline/docs/_build/html
verdict: keep

### 13  .github/workflows/docs-packages.yml:464
# Download each package's artifact into its own subdirectory.
# We use explicit `name`+`path` rather than `pattern` because
# `actions/download-artifact@v8` flattens single-artifact pattern
# downloads directly into `path` without an artifact-named subdir.
    - name: Download ionworks-api docs
    if: >-
    needs.resolve-package.outputs.ionworks-api == 'true'
    uses: actions/download-artifact@v8
verdict: keep

### 14  .pre-commit-config.yaml:17
# Keep uv.lock in sync with pyproject.toml
    - repo: https://github.com/astral-sh/uv-pre-commit
    rev: 0.11.2
    hooks:
    - id: uv-lock
verdict: keep

### 15  .pre-commit-config.yaml:24
# Ruff for all Python code (backend + packages + agent-service)
    - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.15.21
    hooks:
    - id: ruff-check
verdict: keep

### 16  agent-service/k8s/egress-chart/templates/networkpolicy.yaml:11
# There are deliberately NO ipBlock rules here. Every external destination goes
# through the proxy, so the allowlist lives in exactly one place
# (egress-chart/values.yaml → proxy.allowlist) and nothing silently breaks when
# a published IP range moves.
    apiVersion: networking.k8s.io/v1
    kind: NetworkPolicy
    metadata:
    name: {{ $sel.agent }}-egress
verdict: slop

### 17  agent-service/k8s/egress-chart/templates/networkpolicy.yaml:72
# 4. The egress proxy — the pod's ONLY path to anything outside the
# cluster. Requires HTTPS_PROXY/HTTP_PROXY in the agent's env group;
# without it the agent tries to connect directly and every external call
# is denied here. See agent-service/k8s/README.md.
    - to:
    - podSelector:
    matchLabels:
    app: {{ $proxy }}
verdict: slop

### 18  agent-service/k8s/egress-chart/templates/networkpolicy.yaml:112
# DNS: squid resolves the allowlisted hostnames itself. This is what makes
# the name-based allowlist follow CDN address changes for free.
    - to:
    - namespaceSelector: {}
    podSelector:
    matchLabels:
verdict: ?

### 19  agent-service/k8s/egress-chart/values.yaml:1
# Which environment's agent pods this policy protects.
# One of: internal | staging | production
# Selects the agent + backend Porter app-name labels (see templates).
    environment: internal
    namespace: default
verdict: ?

### 20  agent-service/k8s/egress-chart/values.yaml:28
# Linkerd service mesh: these pods run a linkerd-proxy sidecar, and the
# NetworkPolicy applies to it too. The proxy MUST reach the Linkerd control plane
# or the mesh degrades (loses identity/routing/policy). Allow egress to the
# linkerd namespace on the control-plane ports.
    linkerd:
    namespace: linkerd
    ports:
    - 8086  # linkerd-dst (destination)
verdict: ?

### 21  agent-service/k8s/egress-chart/values.yaml:52
# Squid is not a Porter app — it is deployed by this chart, alongside the
# policy, by the same cluster-admin apply. Keep >1 replica: it is on the
# request-critical path (auth introspection goes through it), so a single
# replica makes a squid restart a full agent outage.
    replicas: 2
verdict: slop

### 22  agent-service/k8s/egress-chart/values.yaml:90
# Sentry ingest (org subdomain + region subdomain both live under here).
    - .ingest.sentry.io
    - .ingest.us.sentry.io
verdict: ?

### 23  agent-service/k8s/egress-chart/values.yaml:111
# (http://ionworks-backend-<env>-backend-web-service.default.svc.cluster.local:8000,
    apiHost: ""
verdict: ?

### 24  agent-service/porter.production.yaml:34
# pod runs prompt-injectable code with bypassPermissions AND holds the caller's
# JWT, and the egress control that confines exfiltration
# (agent-service/k8s/egress-chart) is applied OUT OF BAND — Porter does not
# manage it — so it may not be live yet. Scaling out multiplies the number of
# pods holding caller JWTs with an open network path before that control
# exists. Do NOT raise `instances` or re-enable autoscaling until the chart is
# applied AND verified in the cluster: the smoke test in
# agent-service/k8s/README.md must show a pod reaching an arbitrary external
# host (example.com) is DENIED (403 from the proxy) while api.anthropic.com and
# Supabase still work. Only then restore scale-out with the conversation-sticky
# consistent-hash ingress above.
    instances: 1
    cpuCores: 2
    ramMegabytes: 4096
verdict: slop

### 25  agent-service/porter.production.yaml:74
# Secret-light env group: ANTHROPIC_API_KEY, SUPABASE_URL/ANON_KEY,
# INTERNAL_API_BASE_URL (the API tier's internal URL), CORS/Sentry, LOGFIRE_TOKEN
# (+ LOGFIRE_LOG_TURNS to enable the per-turn latency spans), and the optional
# AGENT_MODEL (unset = the in-code default; set it to change the agent's model
# without a code deploy). It must NOT contain SUPABASE_SERVICE_KEY, Stripe, the
# pipeline license, or Anyscale tokens.
    envGroups:
    - agent-prod
    deploymentStrategy: {}
verdict: slop

### 26  k8s/env-override.yaml:12
# backend
    SUPABASE_ANON_KEY: "<redacted:153>"
    SUPABASE_SERVICE_KEY: "<redacted:164>"
    DEBUG: "true"
    "SUPABASE_JWT_SECRET": "super-secret-jwt-token-with-at-least-32-characters-long"
verdict: ?

### 27  k8s/env.yaml:10
# Agent chat-turn endpoints (/agent/stream|stop|upload) run on the separate
# agent-service (run-agent.sh, port 8001). In prod the API edge routes these
# paths there, so agentUrl is unset; locally there is no shared ingress, so
# point the frontend at agent-service directly. Session/message persistence
# stays on VITE_BACKEND_API_URL.
    VITE_AGENT_API_URL: "http://localhost:8001"
    VITE_PUBLIC_POSTHOG_KEY: ""
    VITE_PUBLIC_POSTHOG_HOST: "https://us.i.posthog.com"
    VITE_SENTRY_DSN: ""
verdict: slop

### 28  porter.internal.yaml:12
# Block the unauthenticated Prometheus /metrics endpoint at the public edge.
# In-cluster/Porter scraping hits the pod directly and is unaffected; only
# external requests via internal-api.ionworks.com get a 403. (Oneleet: public
# metrics exposure.) `= /metrics` is an exact match so real API routes are untouched.
    ingressAnnotations:
    nginx.ingress.kubernetes.io/server-snippet: "location = /metrics { deny all; return 403; }"
    autoscaling:
    enabled: true
verdict: slop

### 29  porter.internal.yaml:36
# Reachable on the internal mesh so the agent-service can call back to the API
# (its ionworks SDK targets INTERNAL_API_BASE_URL = this backend's mesh URL).
    serviceMeshEnabled: true
verdict: keep

### 30  porter.internal.yaml:39
# Edge-route the agent chat-turn path to the internal agent-service app.
# rewrite-off keeps the full /agent/... path (the agent-service mounts there).
# Everything else — including /agent/sessions persistence — stays on this backend.
# The three turn-execution paths (/agent/stream, /agent/stop, /agent/upload)
# run on the agent-service. Session/message persistence (/agent/sessions...)
# stays on this backend, which is the only tier with a DB client.
    pathRouting:
    - path: /
    port: 8000
    - path: /agent/stream
verdict: slop

### 31  porter.internal.yaml:68
# On SIGTERM the worker stops claiming and lets the in-flight task finish
# (see src/tasks/worker.py). Give it enough grace to run first-element
# dispatch and mark_done, so a deploy/scale-down doesn't kill mid-run and
# force a stale-lock replay 300s later.
    terminationGracePeriodSeconds: 120
    build:
    context: .
    method: docker
verdict: slop

### 32  porter.production.yaml:12
# Block the unauthenticated Prometheus /metrics endpoint at the public edge.
# In-cluster/Porter scraping hits the pod directly and is unaffected; only
# external requests via api.ionworks.com get a 403. (Oneleet: public metrics
# exposure.) `= /metrics` is an exact match so real API routes are untouched.
    ingressAnnotations:
    nginx.ingress.kubernetes.io/server-snippet: "location = /metrics { deny all; return 403; }"
    autoscaling:
    enabled: true
verdict: slop

### 33  porter.production.yaml:39
# Edge-route the agent chat-turn paths to the internal agent-service app.
# rewrite-off keeps the full /agent/... path (the agent-service mounts there),
# which matters twice over now: the three turn-execution routes carry the
# conversation id as their final path segment
# (/agent/{stream,stop,upload}/{conversation_id}), and the agent-service's
# ingress consistent-hashes on that URI to pin a conversation to one replica.
# Stripping or rewriting the path would break that pinning. These are prefix
# matches, so the id suffix routes here as-is.
# Everything else — including /agent/sessions persistence — stays on this
# backend, which is the only tier with a write-capable DB client.
    pathRouting:
    - path: /
    port: 8000
    - path: /agent/stream
verdict: slop

### 34  porter.production.yaml:86
# Explicit resources: without these the predeploy job inherits a small default,
# and a backfill that reads a page of protocol rows (several JSONB columns each)
# is enough to OOM it — which fails the deploy before traffic switches, with the
# Python traceback lost because Porter does not retain the job's stderr.
    cpuCores: 1
    ramMegabytes: 4096
verdict: slop

### 35  porter.stage.yaml:73
# See porter.production.yaml — the default is too small for backfills that read
# rows with large JSONB columns.
    cpuCores: 1
    ramMegabytes: 4096
verdict: ?

### 36  scripts/seed/fixtures/optimizations.yaml:3
# Each entry references:
# - parameterized_model: key from parameterized_models.yaml
# - experiment: key from constants.yaml protocols (discharge, cccv_charge)
    max_discharge_energy:
    name: "[seed] Opt: Max Discharge Energy"
    parameterized_model: chen2020_spme
    experiment: discharge
verdict: ?

### 37  scripts/seed/fixtures/pipelines.yaml:3
# Entry element values use parameter_source markers resolved by the loader.
# Data references use data_path markers resolved to file:{abs_path} URIs.
    full_pipeline:
    name: "[seed] Full Pipeline (SPMe)"
    parameter_source: chen2020_file
    elements:
verdict: ?

### 38  scripts/seed/fixtures/pipelines.yaml:50
# Pipeline using db:<id> data reference (measurement_id injected at runtime)
    db_ref_pipeline:
    name: "[seed] Pipeline with db: refs"
    parameter_source: chen2020_file
    requires_measurement_id: true
verdict: ?
