Skip to content

Exercise public endpoint identities with bounded fuzzing and mutation - #1195

Merged
zlareb1 merged 9 commits into
mainfrom
test/embedding-identity-boundaries
Nov 24, 2026
Merged

zlareb1 merged 9 commits into
mainfrom
test/embedding-identity-boundaries

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry

Not required.

Why

Public endpoint identities must remove URL credentials while retaining the fields
that distinguish embedding spaces. Exercise that existing standard-library boundary
with a maintained byte-input target, checked-in synthetic replay seeds, independent
contract cases and a narrow mutation pilot.

The byte oracle accepts explicit URL validation errors for malformed inputs and
checks accepted results for absent userinfo/fragments, allowed query names,
idempotence and unchanged non-URL fields. Every input also exercises an accepted
structured URL, with literal expectations independent of the implementation. Credential
rotation must keep the public identity; a space-selecting change must distinguish it.

Scope and risk

The production module remains unchanged. This adds one fuzz target, eight small seeds,
eight deterministic case functions, the bounded runner configuration and report controls.
Both test directories receive an explicit workflow home in the existing inventory.
It is not a general secret scrubber, network allowlist or API-authentication proof.
No Loom service, database, provider or third-party target is used.

The hosted fuzzing executor and build image use verified content digests. The
hash-locked engine matches the image's Python ABI; a newer engine requiring another
ABI is not substituted blindly. One worker runs for thirty seconds on a relevant PR
and three minutes on main, schedule or manual runs, with a 4096-byte input limit,
five-second case limit and bounded memory. Build and total job limits remain explicit.
The runner's native findings and replay records remain in the job log. Its supported
standalone platform and no-filestore implementation make no artifact, build, corpus
or cloud upload; each run begins with the checked-in synthetic seeds. Stateless
batch mode does not claim a differential comparison against another build.

The mutation pilot stages byte-identical copies of one module and its tests, selects
only public-identity mutants and uses two workers with a two-minute process budget.
It requires tested mutants and a killed control rather than reporting empty success.
Its private process group is terminated on completion or error. The summary reports
survivors without treating them as vulnerabilities or silently accepting equivalents;
each actual survivor needs a missing-assertion or equivalence disposition. Two
observed test gaps receive literal multi-separator and uppercase-path cases. Two
output-equivalent split-bound changes retain raw survivor status and individual
reasons, pinned to the exact module, tool version and diff hash. Changed evidence
receives no equivalence classification and remains visible work.

PR jobs are read only. Trusted main and scheduled runs automatically create or update
static maintenance tasks for broken probes or mutation results needing review.
The publisher executes no project code, publishes no raw source or crash input,
preserves human bodies and closed decisions, and fails explicit API/history budgets.
Real security findings follow SECURITY.md's private route. No email or disclosure
commitment is introduced.

Compatibility, rollout and rollback

  • Wire, runtime, schema, settings, product dependencies and operator steps: none.
  • Standard public runners, OSS engines and included GitHub reporting only; no paid
    account, provider, runner, storage repository or extra credential is required.
  • First merged trusted publication must establish the actual token grant. Local
    fake APIs and source checks do not prove a live issue write.
  • Rollback: revert the probes, workflow, build and test-only dependency locks.
    Existing maintenance tasks remain subject to ordinary maintainer decisions.

Tests

  • Eight seeds replay and eight case functions pass, including 256 one-byte inputs.
  • Six deliberate in-memory changes to the actual target are detected: retained
    userinfo, unknown query names, retained fragments, lost query-name normalization,
    choosing the first userinfo separator and stripping a meaningful path suffix.
    The production source stays unchanged.
  • Ten controls execute the actual trusted publisher against an in-memory API.
  • Four controls require exact source, tool and diff evidence for a reviewed
    equivalent; changed evidence and unknown names remain unreviewed.
  • An isolated copy of the native sparse input set runs all twenty-two cases; removing
    its workflow input reproduces the missing-input failure. Two controls also call
    the pinned mutation tool's source-copy helpers: the staged directory copy passes,
    while copying a file before its parent exists reproduces the staging error.
    These controls generate no mutants and start no mutation workers.
  • Selected Python, shell, workflow, YAML/Markdown and public prose gates run before push.
  • Native coverage-guided fuzzing, mutation results, fresh review and full repository
    CI remain required in GitHub. No local fuzzing engine, mutation run, database,
    server, provider, container, broad scan or full suite is started.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated: Codex wrote the probes and workflow; a fresh independent agent reviews each pushed head.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Existing code, callers and open pull requests were checked before adding the target.
  • Synthetic inputs and reports contain no real credentials or deployment data.
  • Product behavior and existing CI assertions remain unchanged.
  • Native hosted results, survivor dispositions, fresh review and full CI remain required.

@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Nov 23, 2026 10:10am UTC

Request Review

@zlareb1
zlareb1 force-pushed the test/embedding-identity-boundaries branch 7 times, most recently from 732a7ad to 4127e42 Compare November 23, 2026 09:48
Exercise the public URL identity boundary with replay seeds, independent oracles and a narrow mutation target. Keep trusted maintenance reporting separate from read-only probes.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Include the workflow read by the report controls in the explicit native input set.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Create the destination parents through the existing directory-copy helper before collecting the tests.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Keep raw mutation outcomes and require exact source, tool and diff evidence for reviewed output equivalence.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
@zlareb1
zlareb1 force-pushed the test/embedding-identity-boundaries branch from 4127e42 to a868639 Compare November 23, 2026 10:08
@zlareb1
zlareb1 merged commit 1522e00 into main Nov 24, 2026
100 of 101 checks passed
zlareb1 added a commit that referenced this pull request Nov 24, 2026
* Python SDK snapshot includes the grep body switch

The public SDK method accepts include_body. Regenerate the snapshot so the contract test records that parameter.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Coding MCP loads source tools upfront (#1297)

* Coding MCP loads source tools upfront

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Document deferred general search for coding clients

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Read indexed source ranges in one request (#1295)

* Read indexed source ranges in one request

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Verify exact source across incremental index revisions

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Read exact ranges from verified indexed Git blobs

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep indexed range reads inside exact source coverage

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Track the indexed file metadata query shape

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Ruby SDK: cursor pagination over the rows and results page shapes (#1296)

client.paginate walks a cursor-paginated op and returns a lazy Enumerator
of its rows, as paginate does in the TypeScript SDK. Part of #55.

* Shorten the coding MCP primer and keep grep fallback guidance visible (#1299)

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Route named definitions to symbol lookup before literal search (#1300)

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Suggest nearby declarations after a file-scoped symbol miss (#1301)

* Suggest nearby declarations after a file-scoped symbol miss

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Keep qualified declarations distinct in symbol suggestions

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Coding MCP shows how to batch follow-up source reads (#1303)

* Coding MCP shows how to batch follow-up source reads

Keep path scoping and regex invocation in the compact grep listing. The coding primer names indexed tests as source and distinguishes reading them from running tests.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Name the client that provides ToolSearch

The coding primer is shared across clients. Check the advertised symbol tool on initialize rather than requiring a literal wildcard.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Bulk-error fan-out test controls the coalescing clock (#1235)

### Changelog category (leave one):

- CI Fix or Improvement (changelog entry is not required)

### Changelog entry

Not required.

### Why

The bulk-error fan-out test assumes five calls enter the same coalescing window. An elapsed window turns later calls into individual requests, so the test can miss the bulk request whose error it intends to check.

Use the existing manual clock while queuing the calls, then flush the pending batch explicitly. The original assertion still requires the first two individual calls to succeed and all three batched calls to receive the error.

### Scope and risk

One test function changes. Every assertion and all other test functions remain unchanged. The SDK implementation and its coalescing window are unchanged. The explicit flush exercises bulk error delivery without waiting for a real timer.

### Compatibility, rollout and rollback

- Wire: no changes.
- Operator steps: none.
- Rollback: revert the test change; no stored state remains.

### Tests

- A focused synthetic-transport probe executes the actual test function against the SDK. Before the change, the ordinary-clock control passes and the elapsed-window control fails its assertion. After the change, both pass.
- A negative control suppresses the synthetic bulk error; the unchanged assertion still fails.
- The probe blocks network connections and records zero attempts. It does not collect the full test module or establish the cause of any earlier CI failure.
- AST comparison confirms that every assertion and the rest of the module are unchanged.
- `ruff check tests/unit/test_sdk_set_coalescer.py`, `ruff format --check tests/unit/test_sdk_set_coalescer.py` and `git diff --check` pass.
- Full ordinary unit and integration qualification remains required in CI. The targeted pytest command is `python -m pytest tests/unit/test_sdk_set_coalescer.py -k test_a_failed_bulk_fails_every_set_it_carried`.

### AI assistance in the code (leave one; writing this description with AI is fine):

- AI-generated (an agent wrote most of the diff): Codex wrote the change and checked the controlled failure, negative control, unchanged assertions and focused gates.

- [x] I can explain every line of this diff and how it interacts with the rest of Loom.

### Checklist

- [x] Local formatting, lint and focused controls pass. No production types change; full unit and applicable integration results remain CI gates.
- [x] No generated files, migrations, plugin files, frontend files or documentation change.
- [x] No wire changes or operator steps.
- [x] Repository text contains no deployment details.
- [x] Commits are signed off.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Add consistency checks for the course retrieval labels (#1294)

Signed-off-by: ravi payghan <payghanravi362@gmail.com>

* Annotate failed test modules without captured values (#1218)

### Changelog category

- CI Fix or Improvement

### Why

A failed unit job needs a module location that can be inspected without retrieving captured test values. The existing controller plugin emits one error annotation per failed module, capped at 50 modules per session.

Only a validated repository-relative Python path, an optional declared line and a fixed message enter the annotation. Paths reject traversal and control characters; property delimiters are escaped. Test names, parameters, tracebacks and captured output are not inspected. An annotation write failure preserves the test result.

### Scope and risk

The report observer runs in the controller when GITHUB_ACTIONS is true. Existing collection, selection, assertions, timeout, worker diagnostics and exit status remain unchanged. Invalid paths are omitted. The declared line identifies the test definition, not necessarily the failing statement. Collection errors and worker crashes without a test report do not produce these annotations.

### Compatibility, rollout and rollback

- Wire: none.
- Operator steps: none; the unit jobs already load the controller plugin.
- Rollback: revert the observer and its helper. No stored data or generated files change.

### Tests

- Eleven focused controls cover path rejection, command-property escaping, absent or invalid lines, value exclusion, deduplication, the session budget, output failures and interrupt propagation.
- An isolated synthetic pytest probe runs with zero and two workers, with annotation output enabled and disabled. All four cases retain exit status 1; enabled cases emit exactly one fixed-message location without the synthetic assertion value.
- Static AST comparison confirms every existing controller method is unchanged after removing the new import, session set and report hook.
- Selected source format, lint, prose and diff checks pass. Full unmodified unit and integration checks run in CI.

### AI assistance in the code

- AI-generated: Codex wrote the diff and checked the controls, synthetic pytest behavior and source preservation described above.

- [x] I can explain every line of this diff and how it interacts with the rest of Loom.

### Checklist

- [x] Local format, lint and focused tests pass. Full unit and integration results remain CI gates; runtime type-check targets are unchanged.
- [x] No generated files, migrations, plugin package files or frontend files change.
- [x] No operator or wire changes.
- [x] Repository text contains no deployment details.
- [x] Commits are signed off.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Reject GitHub token shapes in the offline content guard (#1207)

### Changelog category (leave one):

- CI Fix or Improvement (changelog entry is not required)

### Changelog entry

Not required.

### Why

The content guard misses known GitHub personal-access and installation-token shapes. Extend its existing offline patterns so these values are reported before a contribution lands.

### Scope and risk

Two recognition rules cover classic and fine-grained personal-access shapes and opaque installation-token bodies, including their longer dotted format. The current masked terminal display, placeholder checks, file selection and refusal behavior remain. In Actions, a finding also emits a location and static rule annotation with no matched-value fragments or source context. Command properties escape percent signs, carriage returns, newlines, colons and commas. No validity request is made. Coverage is limited to these prefixes and known personal-access shapes; future formats need qualification.

A redaction-test parameter used a constructed full token-shaped literal. It now generates a fresh zero-filled synthetic value at runtime and retains every existing redaction assertion. This changes the fixture representation without adding a detector exception.

The focused cases use generated, unissued values in temporary files. No real credential, repository history or service is scanned locally. A credential-shaped example can be rejected intentionally; use a descriptive placeholder rather than a full token-shaped literal.

### Compatibility, rollout and rollback

The guard's arguments and existing rules remain. A contribution containing these additional credential shapes now fails the content check. Wire models, stored data, SDK behavior, settings and operator steps: none. Reverting removes these two recognition rules and their focused regression tests.

### Tests

Nine recognition tests exercise the actual file-scanning helper without enumerating repository files. Six fail before the rules are added; all nine pass afterward. Cases cover personal-access formats, legacy and long dotted installation formats, exact capture, near-miss boundaries, placeholders, credentials in a URL, existing provider/password behavior and masked output.

Three additional annotation controls check actual finding locations, command-injection escaping and absence of matched-value fragments. These controls call the formatter directly and do not enumerate repository files. The annotation output does not repair or waive a finding.

A focused AST check verifies that only the redaction parameter expression changes and all assertions remain. The actual scanner rejects the runtime-generated value in a temporary file and reports no finding in the three changed source files; this is a selected-source check, not a repository audit.

Selected Python lint, formatting and public-prose checks run locally under the normal supervisor. Full required CI and a fresh independent review remain required before merge. No live verification, provider or benchmark runs.

### AI assistance in the code (leave one):

- AI-generated: Codex wrote the patterns and tests; the source and generated fixtures are checked directly.

- [x] I can explain every line of this diff and how it interacts with the rest of Loom.

### Checklist

- [x] Existing helpers and open work were checked.
- [x] Focused regressions use only unissued temporary values.
- [ ] Full CI and fresh independent review pass before merge.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Exercise public endpoint identities with bounded fuzzing and mutation (#1195)

### Changelog category (leave one):

- CI Fix or Improvement (changelog entry is not required)

### Changelog entry

Not required.

### Why

Public endpoint identities must remove URL credentials while retaining the fields
that distinguish embedding spaces. Exercise that existing standard-library boundary
with a maintained byte-input target, checked-in synthetic replay seeds, independent
contract cases and a narrow mutation pilot.

The byte oracle accepts explicit URL validation errors for malformed inputs and
checks accepted results for absent userinfo/fragments, allowed query names,
idempotence and unchanged non-URL fields. Every input also exercises an accepted
structured URL, with literal expectations independent of the implementation. Credential
rotation must keep the public identity; a space-selecting change must distinguish it.

### Scope and risk

The production module remains unchanged. This adds one fuzz target, eight small seeds,
eight deterministic case functions, the bounded runner configuration and report controls.
Both test directories receive an explicit workflow home in the existing inventory.
It is not a general secret scrubber, network allowlist or API-authentication proof.
No Loom service, database, provider or third-party target is used.

The hosted fuzzing executor and build image use verified content digests. The
hash-locked engine matches the image's Python ABI; a newer engine requiring another
ABI is not substituted blindly. One worker runs for thirty seconds on a relevant PR
and three minutes on main, schedule or manual runs, with a 4096-byte input limit,
five-second case limit and bounded memory. Build and total job limits remain explicit.
The runner's native findings and replay records remain in the job log. Its supported
standalone platform and no-filestore implementation make no artifact, build, corpus
or cloud upload; each run begins with the checked-in synthetic seeds. Stateless
batch mode does not claim a differential comparison against another build.

The mutation pilot stages byte-identical copies of one module and its tests, selects
only public-identity mutants and uses two workers with a two-minute process budget.
It requires tested mutants and a killed control rather than reporting empty success.
Its private process group is terminated on completion or error. The summary reports
survivors without treating them as vulnerabilities or silently accepting equivalents;
each actual survivor needs a missing-assertion or equivalence disposition. Two
observed test gaps receive literal multi-separator and uppercase-path cases. Two
output-equivalent split-bound changes retain raw survivor status and individual
reasons, pinned to the exact module, tool version and diff hash. Changed evidence
receives no equivalence classification and remains visible work.

PR jobs are read only. Trusted main and scheduled runs automatically create or update
static maintenance tasks for broken probes or mutation results needing review.
The publisher executes no project code, publishes no raw source or crash input,
preserves human bodies and closed decisions, and fails explicit API/history budgets.
Real security findings follow SECURITY.md's private route. No email or disclosure
commitment is introduced.

### Compatibility, rollout and rollback

- Wire, runtime, schema, settings, product dependencies and operator steps: none.
- Standard public runners, OSS engines and included GitHub reporting only; no paid
  account, provider, runner, storage repository or extra credential is required.
- First merged trusted publication must establish the actual token grant. Local
  fake APIs and source checks do not prove a live issue write.
- Rollback: revert the probes, workflow, build and test-only dependency locks.
  Existing maintenance tasks remain subject to ordinary maintainer decisions.

### Tests

- Eight seeds replay and eight case functions pass, including 256 one-byte inputs.
- Six deliberate in-memory changes to the actual target are detected: retained
  userinfo, unknown query names, retained fragments, lost query-name normalization,
  choosing the first userinfo separator and stripping a meaningful path suffix.
  The production source stays unchanged.
- Ten controls execute the actual trusted publisher against an in-memory API.
- Four controls require exact source, tool and diff evidence for a reviewed
  equivalent; changed evidence and unknown names remain unreviewed.
- An isolated copy of the native sparse input set runs all twenty-two cases; removing
  its workflow input reproduces the missing-input failure. Two controls also call
  the pinned mutation tool's source-copy helpers: the staged directory copy passes,
  while copying a file before its parent exists reproduces the staging error.
  These controls generate no mutants and start no mutation workers.
- Selected Python, shell, workflow, YAML/Markdown and public prose gates run before push.
- Native coverage-guided fuzzing, mutation results, fresh review and full repository
  CI remain required in GitHub. No local fuzzing engine, mutation run, database,
  server, provider, container, broad scan or full suite is started.

### AI assistance in the code (leave one; writing this description with AI is fine):

- AI-generated: Codex wrote the probes and workflow; a fresh independent agent reviews each pushed head.

- [x] I can explain every line of this diff and how it interacts with the rest of Loom.

### Checklist

- [x] Existing code, callers and open pull requests were checked before adding the target.
- [x] Synthetic inputs and reports contain no real credentials or deployment data.
- [x] Product behavior and existing CI assertions remain unchanged.
- [x] Native hosted results, survivor dispositions, fresh review and full CI remain required.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Analyze every source SDK language with CodeQL (#1201)

### Changelog category (leave one):

- CI Fix or Improvement (changelog entry is not required)

### Changelog entry

Not required.

### Why

The Go, Java, C#, Ruby and Rust SDKs need static security analysis alongside their
native build and package checks. Extend the existing workflow with those five
languages and require actual client source in each extracted database.

### Scope and risk

Each added job checks out only its SDK, hashes a bounded set of tracked production
source and requires the client entrypoint. It downloads the exact per-language
CodeQL 2.27.4 bundle from the official release and verifies its published SHA256
before initialization. Download size, time, source bytes, archive entries, analysis
memory, threads and job duration are bounded. No local analysis engine is run.

Go uses a pinned compiler and an explicit traced SDK build. Java, C#, Rust and Ruby
use their supported no-build mode. Java uses its declared JDK and refuses a future
Kotlin source addition until a built extraction path is supplied. No-build analysis
can be less precise for inferred dependencies or generated-at-build code; it is not
a replacement for the separate native build/test/package gates.

After analysis, each job inspects only its expected SDK entries in the produced
source archive. It requires nonzero matching bytes and the client, rejecting a
README, another project or changed bytes as evidence. The summary states the actual
matching file count. This establishes source presence, not complete query coverage
or a security-clean result. Existing Python, TypeScript/JavaScript and workflow
analyzers keep their configuration.

Repository contents remain read only. Analysis retains the existing narrowly scoped
code-scanning upload permission. A separate trusted main/weekly metadata job has
issues-write permission only for a failed SDK-analysis task or changed status. It
executes no checkout code, publishes no raw security finding, preserves human bodies
and closed decisions while a task retains its original title or body marker. Removing
both identifiers makes it unrecognizable to later runs. No unchanged-status comment
is added. Findings remain in code scanning and follow SECURITY.md's private route
when sensitive.

### Compatibility, rollout and rollback

- Product behavior, wire models, schema, settings and operator steps: none.
- Standard public runners and public-repository code scanning use the existing free
  entitlement; no larger runner, paid account, secret or new application grant is used.
- No workflow artifact upload or dependency-cache save is introduced.
- The first trusted merged publication must establish the actual issue-write grant.
- Rollback: revert the additional SDK jobs, metadata publisher and focused controls.

### Tests

- Nine focused controls execute the actual trusted publisher against a synthetic API:
  deduplication, recovery, human edits, closed decisions, budgets and refusal handling.
- Four controls execute the actual archive checker against synthetic archives. Exact
  client bytes pass; README-only, changed bytes and another project's client fail.
- Selected-file Python, workflow, Markdown and public prose checks run before push.
- All five native extractors must actually analyze SDK source, report nonzero matching
  client bytes and complete their uploads. Fresh review and full unmodified repository
  CI remain required on this head.
- No local compiler, CodeQL engine, service, database, provider or full suite runs.

### AI assistance in the code (leave one; writing this description with AI is fine):

- AI-generated: Codex wrote the workflow extension and controls; a fresh independent agent reviews each pushed head.

- [x] I can explain every line of this diff and how it interacts with the rest of Loom.

### Checklist

- [x] Existing coverage, source SDK paths, official build-mode support and open work were checked.
- [x] Official action and per-language bundle pins are recorded.
- [x] Source-presence evidence and analysis limitations are explicit.
- [x] Actual native extraction, full hosted CI and fresh review remain required.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Publish workflow audit maintenance issues and security alerts (#1163)

### Changelog category (leave one):

- CI Fix or Improvement (changelog entry is not required)

### Changelog entry

Not required.

### Why

Workflow audit findings should be visible in pull requests and automatically become
maintainable GitHub work. The hosted audit records findings in the job summary and an escaped log report.

The checksum-verified scanner runs in offline network mode with the auditor persona,
strict collection and no config or ignore overrides. Offline describes scanner context
lookups, not where the workflow runs. It does not prove remote action identity or every
repository setting. Findings are report only; scanner, collection and reporting errors fail.

### Scope and risk

Pull-request runs have contents read access and execute no project code. Trusted main
pushes and a weekly schedule automatically create or update maintenance issues from a
fresh trusted checkout and scan at the current default-branch head. The issue
job has contents read and issues write access; it consumes no fork artifact or report.

Public issues use only low or informational observations from anonymous-definition,
superfluous-actions and undocumented-permissions. These are maintenance tasks, not
vulnerability claims. Other rules and higher severities remain in the complete report
and go to the existing code scanning view through a separate trusted SARIF job. That
job has contents read and security-events write access, without issue write access.
Security-sensitive reports follow SECURITY.md; no raw source, secret, exploit payload,
email, bounty or legal commitment is added to a public issue.

The reporter fetches issue state in bounded pages and requests fewer rows if a page exceeds its byte limit. It defers a task when the last automated status falls outside the comment window. If an edit erases the only saved status, a later audit can record verified absence. Status follows creation time and the full numeric comment identifier. Each task keeps its full rule-and-path fingerprint in the title and body. A changed observation count or determination adds a status comment. The reporter preserves titles, bodies and closed decisions.

Trusted runs serialize without canceling an active publisher. The client permits ten
writes and forty API calls. The client stops starting requests after three minutes;
socket operations have ten-second timeouts and each job has a five-minute limit.
Responses are bounded. Deferred work is counted and reconsidered on the next trusted
run. API refusals and incomplete pagination fail the run. Scan inputs and output summaries have byte limits.

### Compatibility, rollout and rollback

- Wire, runtime, schema, generated clients and operator steps: none.
- Standard public runners and public-repository code scanning use included GitHub services.
  No paid runner, provider, app, account, cache or general artifact service is required.
- Trusted publication becomes active from main. Its first merged run must establish the
  actual job-token grants, issue result and code scanning ingestion; local controls do not.
- Rollback: revert the workflow, publisher, controls and documentation. Existing issues
  and security alerts remain subject to ordinary maintainer decisions.

### Tests

- Twenty-nine focused controls exercise the actual publisher with an in-memory API:
  stable grouping, no raw-source publication, no per-run or line-shift spam, changed and
  reappearing states, human edits, closed decisions, sensitive/unknown rule exclusion,
  ambiguous identities, API refusals, bounded deferral and trusted permissions/events.
  Literal GraphQL actors cover existing-task reuse, current bot status, human-author
  preservation and one update across repeated reappearance snapshots.
- A native positive fixture produces four real findings and two eligible maintenance
  task groups. The actual publisher creates two tasks in the fake API and makes no
  duplicate issue or comment on a second run. Native SARIF contains the same four findings.
- Fifteen native scanner/report controls retain complete output, HTML escaping, workflow
  command isolation, strict malformed/no-input errors and input/output budget failures.
- Selected Python/YAML/Markdown lint, formatting, workflow expressions, shell diagnostics
  and public prose checks run before push. The new workflow is audited as a selected file.
- Full repository suites remain required in hosted CI. No local server, database,
  provider call, repository-wide workflow scan or full suite runs.

### AI assistance in the code (leave one; writing this description with AI is fine):

- AI-generated: Codex wrote the workflow, publisher, controls and documentation; a fresh independent agent reviews each pushed head.

- [x] I can explain every line of this diff and how it interacts with the rest of Loom.

### Checklist

- [x] Pull requests retain read-only tokens; trusted publication uses separate narrow grants.
- [x] Reports preserve all findings and distinguish maintenance tasks from sensitive reports.
- [x] Automatic issues deduplicate state and preserve human bodies and closed decisions.
- [x] Required full hosted CI, fresh review and native post-merge verification remain mandatory.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Encode ignored names safely with generated HTTP contract checks (#1198)

### Changelog category (leave one):

- Bug Fix

### Changelog entry

Unknown argument names are percent-encoded in the HTTP diagnostic header, so
Unicode and separator characters preserve a valid response. JSON argument feedback
keeps the original names.

### Why

An unknown Unicode JSON key was copied directly into a Latin-1 response header.
The actual header codec rejects that value, turning a successful operation into an
error. Encode each diagnostic name as one percent-encoded UTF-8 component; ordinary
field names keep their spelling and JSON feedback keeps the original names.

A bounded schema-generated pilot exercises wire payload combinations while
keeping explicit authorization assertions. Generate positive request bodies from the
actual blacklist-list OpenAPI schema and send them through the real HTTP router,
signed synthetic tokens, authorization gates and handler.

### Scope and risk

The pilot selects one read-only operation. Three generated properties validate its
successful response schema, require cross-org or cross-namespace refusal, and require
missing or invalid tokens to fail before a backing-store read. Six fixed cases verify
invalid body types and limit bounds. Each generated request resets its observations.

The existing unit-test fixtures isolate external stores and side effects. Only the
blacklist store read and absence of supplementary grants are scripted by this module;
the token verifier, transport authorization and handler remain real. This is transport
qualification with synthetic stores, not a database-isolation or whole-API proof.
A generation-only copy selects declared request fields and intersects string
lengths with a thirty-two-character cap. The served OpenAPI document and response
schemas remain unchanged. This prevents unconstrained recursive extra-property
generation from exhausting the generator health check. The fixed Unicode case
retains the unknown-name boundary. Generated positive bodies are assigned known
synthetic identities before requests.
The pilot does not claim general negative-schema generation or undocumented-error
response-schema validation.

Schemathesis 4.33.4 is installed only with an explicit contract-test extra. Its
resolved packages remain in the existing lock; runtime and ordinary unit installations
do not request that extra. The test inventory explicitly owns the new directory.

Three properties use a deterministic twenty-four-example generation budget each,
no persistent example database and a reproduction blob on failure. Shrinking shares
the two-minute subprocess limit. The whole job has a ten-minute limit and must report
all ten tests without skips or failures. Failure annotations include only an allowlisted
source path, optional declared line and a static phase. The bounded report verifier
prints aggregate counts or a static missing/invalid-report status at its producer
source call line. Only the direct producer line number is read; no frame locals or
traceback are inspected. Neither diagnostic
reads node IDs, case parameters, captured output or failure text. The original test
assertions, generation limits, expected ten cases and subprocess deadline remain.
No server, database, network target or provider is started, and no artifact is uploaded.

PR runs are read only. A separate trusted main/weekly metadata job creates one bounded
maintenance task for a broken pilot or appends a changed status. Human bodies and
closed decisions remain intact while a task retains its original title or body marker.
Removing both identifiers makes it unrecognizable to later runs. No unchanged-status
comment is added. Its static text contains no request bodies or credentials. Sensitive findings use SECURITY.md.

### Compatibility, rollout and rollback

- No operation, input/output model, authentication, schema or setting changes.
- Diagnostic header names use percent encoding; split at commas and decode each
  component when original names are needed. JSON feedback remains unchanged.
- Operator steps and generated SDK-shape changes: none.
- A test-only optional extra and its resolved lock entries are added.
- OSS tooling and standard public runners require no paid account, larger runner,
  provider credential or new service grant.
- The first merged trusted run must establish the actual issue-write permission.
- Rollback: revert the header correction and docs, regressions, pilot, optional test extra,
  inventory prefix and workflow.

### Tests

- The actual header helper and actual header codec reproduce the Unicode failure.
  A focused unit regression has six literal cases; five fail before the correction,
  and all six pass after it. Reproduce with
  `python -m unittest tests.unit.test_argument_header_encoding`.
- A fixed native HTTP case requires a successful Unicode-key response, its encoded
  header and exact original JSON feedback. It remains required on this head.
- Nine focused standard-library controls execute the actual trusted publisher against
  an in-memory API, covering deduplication, changed status, human bodies, closed
  decisions, history limits, duplicate identities and refusal without retry.
- Eight diagnostic controls and the nine publisher controls pass with synthetic
  inputs. Missing, malformed and oversized reports, invalid counts, all wrong execution
  counts, annotation limits and inaccessible failure payloads are checked.
- Four tiny synthetic pytest processes verify call, setup, collection and success
  phases, actual exit codes and annotations without copied failure text. These do not
  execute the HTTP schema engine or establish the earlier native failure's cause.
- A focused source-location control rejects the unlocated error annotations and
  accepts only exact producer call lines after the change.
- Lock resolution and selected-file Python, TOML, workflow, Markdown and public prose
  gates run before push. Resolution changed only the explicit test dependency closure.
- Generated HTTP cases, the actual signed-token authorization assertions, fresh review
  and full unmodified repository CI require hosted execution on this head.
- No schema engine, broad suite, service, container, database or provider runs locally.

### AI assistance in the code (leave one; writing this description with AI is fine):

- AI-generated: Codex wrote the pilot and controls; a fresh independent agent reviews each pushed head.

- [x] I can explain every line of this diff and how it interacts with the rest of Loom.

### Checklist

- [x] Existing transport tests, schema APIs and open work were checked before implementation.
- [x] Authentication, authorization and handler contracts remain intact.
- [x] Synthetic stores and limited operation coverage are explicit.
- [x] Native hosted results, full repository CI and fresh review remain required.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Check source SDK packages and known Go vulnerabilities (#1180)

### Changelog category (leave one):

- CI Fix or Improvement (changelog entry is not required)

### Changelog entry

Not required.

### Why

The source SDKs need native build and test coverage before scanner results can say
anything useful about their quality. Add the missing Go, Java core, .NET and Ruby
jobs alongside the existing Python, TypeScript and Rust gates.

Go builds, vets and runs the HTTP tests with the race detector. It also runs pinned
Go vulnerability analysis for the selected Linux toolchain, after a known vulnerable
call and its fixed version prove that the actual analyzer detects the control.
The control modules are temporary and their code is never executed. Reflection,
other build tags and other Go versions remain outside this scan. Java verifies the
core package and instantiates a client from its jar and resolved runtime dependencies
in an independent consumer. The .NET job tests, packs and installs the resulting
package into a separate console project. Ruby tests, builds its gem and loads the
installed client outside the checkout. Every suite must execute tests; missing,
zero-test or all-skipped reports fail. Counts appear in the job summary.

### Scope and risk

One workflow, its publisher controls and the existing testing guide change. SDK source,
wire behavior, SDK dependencies, package targets, release jobs and existing gates do not.
Java adapter modules remain outside the core job. This establishes neither every
minimum-version claim nor publication to a registry.

Use pinned setup actions on standard public runners. The unchanged .NET target is
built with the supported LTS SDK in an isolated installation, verifies the actual SDK
and runtime, and runs with explicit major-version roll-forward;
this qualifies the selected runtime rather than the older target runtime. No SDK
minimum version is changed as part of a CI addition. Tests use their existing handler
fakes and owned loopback servers, without a Loom server, database or provider call.

Pull-request tokens are read only. On main pushes and a weekly schedule, a separate
trusted job automatically records a failing SDK as an actionable issue and appends a
status comment when it recovers or fails again. Repeated unchanged states do not add
comments. It executes no checkout code, includes no raw failure text, preserves human
bodies and closed decisions, and points sensitive findings to SECURITY.md. The fixed
host/repository client permits forty calls, ten issue pages and fewer than a hundred
comments per task, with bounded requests and a five-minute job. At most four writes
occur per run. Incomplete history and API refusals fail without retries or alternate
credentials. The first merged trusted run must establish its actual token grant.

The selected-file workflow audit reports one low-severity ad-hoc-package observation
for installing the gem built in the same disposable job with `gem install --local`.
The step installs no registry package or project runtime dependency. The observation
is retained without a suppression or claim of a clean security audit.

### Compatibility, rollout and rollback

- Wire, schema, settings, generated files and operator steps: none.
- Standard public runners are included free; no paid runner, app, account, cache,
  artifact upload, provider credential or paid service is introduced.
- Rollback: revert the workflow, controls and guide changes. Existing failure issues
  remain subject to ordinary maintainer decisions.

### Tests

- Nine controls execute the actual embedded publisher against an in-memory API:
  repeated failures, recovery and reappearance, human edits, closed decisions,
  canceled/skipped jobs, exhausted history, duplicate identity and API refusal.
- Two partial-report pipeline controls preserve a failing test producer through `tee`.
- Eight synthetic controls execute the four actual reporting parsers and verify
  that nonzero reports pass while zero-test reports fail. They run no native SDK.
- Selected Python lint/format, workflow expression and shell checks, YAML/Markdown
  formatting and public prose checks run before push.
- Native build, race, package-consumer, vulnerability analyzer controls and full
  repository suites run in hosted CI.
  No local toolchain, broad scan, server, database or provider is started.

### AI assistance in the code (leave one; writing this description with AI is fine):

- AI-generated: Codex wrote the workflow and controls; a fresh independent agent reviews each pushed head.

- [x] I can explain every line of this diff and how it interacts with the rest of Loom.

### Checklist

- [x] Existing SDK helpers and all open PR metadata were checked before adding missing jobs.
- [x] Existing Python, TypeScript and Rust jobs remain intact.
- [x] Focused validation uses synthetic data without a runtime or provider.
- [x] Full hosted CI, fresh review and actual native results remain required before merge.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

* Symbol lookups can include indexed test examples (#1312)

* Symbol lookups can include indexed test examples

Select test call sites before limiting the edge read so a definition and revision-matched test source can be returned in one request.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Test examples use the shared test-path rules

Use the test gate pattern for filtering call sites and regenerate the Ruby operation table.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Classify code.read as an indexed source read

The operation reads verified repository blobs within the authorized namespace. Classify it with the other source reads so user-scoped tokens can call it and the registry isolation checks pass.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

* Record code.read in the Python SDK snapshot

The generated operation client already exposes the source read. Record its method so the snapshot matches the public SDK.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

---------

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: ravi payghan <payghanravi362@gmail.com>
Co-authored-by: Rahul <132360698+rahulsjha@users.noreply.github.com>
Co-authored-by: ravi payghan <payghanravi362@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant