Skip to content

feat: pilot Ozark internal stdlib — runtime deps through osl-* forks#106

Merged
bjcorder merged 3 commits into
mainfrom
feat/ozark-stdlib-pilot
May 22, 2026
Merged

feat: pilot Ozark internal stdlib — runtime deps through osl-* forks#106
bjcorder merged 3 commits into
mainfrom
feat/ozark-stdlib-pilot

Conversation

@bjcorder

Copy link
Copy Markdown
Owner

Summary

First pilot of the Ozark internal-stdlib strategy: this PR switches deterministic-deps' four runtime dependencies from upstream npm registry installs to git-URL installs pinned to commit SHAs of Ozark-Security-Labs/osl-* forks, and adds the agent-enforcement policy that keeps it that way.

Forks consumed

Package Pinned SHA
osl-actions-core 23007f60ab3ee61aefe66202f4790b0c9e6552e4
osl-glob 3d32991b7f0fcdff9c394e3025b40a6a5e253b44
osl-js-yaml 721957e87b8fd2716d29c30a859ac816b2768f0f
osl-minimatch 4a0ff5b8e7ab0a3d12c5ef09660994125f759e3b

Policy

  • AGENTS.md gains a new ## Dependency policy section: coding agents must NOT modify any manifest or lockfile to add a runtime dep; instead they file .ozark/fork-proposals/<dep>.md and stop, leaving the maintainer to run the fork-and-trim workflow.
  • CLAUDE.md mirrors the rule in its top-of-file non-negotiables and the ## Tech & runtime constraints section.
  • Scope for this pilot is runtime deps only. devDependencies (typescript, jest, eslint, ncc, etc.) remain upstream and are a Phase 2 follow-up.

Cross-repo wiring

  • Ozark-Security-Labs/.github (new public profile repo) holds the canonical docs/ozark-stdlib.md, docs/fork-and-trim-workflow.md, and proposal template.
  • New workflow .github/workflows/fork-proposal-issue.yml mirrors each proposal into a Fork request: osl-<dep> issue in the central repo. Requires the OZARK_CROSS_REPO_TOKEN secret to be configured (fine-scoped PAT or GitHub App token with issues: write on Ozark-Security-Labs/.github); deferred per pilot scope, but the workflow is harmless until that secret exists.

Verification

  • npm run all: lint + 157 tests + tsc + ncc bundle — all green.
  • npm run format clean. git diff --check clean.
  • Dogfood node dist/index.js: 0 findings.
  • Patch round-trip exercised in commit 502e811 — pushed a benign CHANGELOG entry to osl-glob, bumped SHA here, rebuilt; no test or scan deltas.

Known follow-ups (out of pilot scope)

  • Configure OZARK_CROSS_REPO_TOKEN repo secret.
  • Phase 2: extend policy to devDependencies (forking typescript, eslint, jest, ncc, etc.).
  • Pre-existing ReDoS findings in src/rules/index.ts (~9 new RegExp() call sites) flagged by Semgrep — unrelated to this pilot; addressed in a separate workstream.
  • Optional CI lint that fails on non-osl-* git URLs in package.json (mechanical guard for the negative test).

Test plan

  • CI runs and stays green on this branch.
  • Spot-check Ozark-Security-Labs/.github/docs/ozark-stdlib.md — the four pinned SHAs in the index match the four entries in package.json on this branch.
  • Open a scratch PR adding a fake .ozark/fork-proposals/lodash.md (without touching package.json) once OZARK_CROSS_REPO_TOKEN is set, and confirm an issue is filed in Ozark-Security-Labs/.github.

bjcorder added 3 commits May 22, 2026 10:00
Coding agents working in this repo can no longer silently add runtime
dependencies. Per the new AGENTS.md ## Dependency policy section, any
proposed external library requires writing
.ozark/fork-proposals/<dep>.md and stopping — the maintainer then runs
the fork-and-trim workflow before any consumer change lands.

- AGENTS.md: new ## Dependency policy section, sits after ## Supply
  Chain Policy. Spells out the osl-* fork rule, the no-touch-manifest
  rule, and the proposal-file workflow. Scopes the rule to runtime deps
  for the pilot; devDependencies and toolchain remain upstream pending
  Phase 2.
- CLAUDE.md: dep policy added to the top non-negotiables list and a
  one-line pointer added to ## Tech & runtime constraints.
- .ozark/fork-proposals/_TEMPLATE.md: the canonical fork-proposal
  template, mirroring the version in Ozark-Security-Labs/.github.
- .github/workflows/fork-proposal-issue.yml: mirrors every new proposal
  file into an issue in Ozark-Security-Labs/.github so the maintainer
  sees all pending fork requests in one place. Uses
  OZARK_CROSS_REPO_TOKEN (PAT or GH App token, not the default
  GITHUB_TOKEN) for cross-repo issue creation. Workflow validates
  proposal filenames to defeat shell-metacharacter injection and uses
  env-var interpolation for all event payload values.

Full org-wide runbook + index of forks live in
Ozark-Security-Labs/.github (docs/ozark-stdlib.md and
docs/fork-and-trim-workflow.md).
Pilot bring-up of the Ozark internal standard library: the four runtime
dependencies of deterministic-deps now resolve from osl-prefixed forks
in Ozark-Security-Labs, pinned by full commit SHA via npm git URLs.

Forks consumed (each tagged upstream/<sha> at its fork point and
trimmed/renamed per the fork-and-trim workflow):

- osl-actions-core @ 23007f60... (upstream actions/toolkit packages/core
  pruned to root, lib/ built ahead-of-time and committed)
- osl-glob         @ df4a3af8... (upstream isaacs/node-glob)
- osl-js-yaml      @ 721957e8... (upstream nodeca/js-yaml)
- osl-minimatch    @ 4a0ff5b8... (upstream isaacs/minimatch)

Changes:

- package.json: dependencies entries switched from registry installs to
  github:Ozark-Security-Labs/osl-*#<sha> git URLs. Names use the osl-*
  prefix matching each fork's package.json name field.
- package-lock.json: regenerated. npm warns about skipped integrity
  checks for git deps — expected, the pinned SHA is the integrity check.
- src/{main,scanner,config,remote,rules/index}.ts: six import sites
  updated from upstream names to osl-* names.
- src/types/osl-js-yaml.d.ts: type shim re-declaring @types/js-yaml's
  module declarations under the osl-js-yaml name so TypeScript still
  resolves types for `import yaml from 'osl-js-yaml'`.
- __tests__/{action-metadata,config,fixtures}.test.ts: same import
  rename in test files.
- dist/: re-bundled via ncc; dogfood scan against the rebuilt action
  returns 0 findings (the new git URLs are SHA-pinned and pass the
  Node rule).

Verification (all green): npm run lint, npm test (7 suites, 157 tests),
npm run build (tsc --noEmit), npm run bundle (ncc), npm run format,
git diff --check, node dist/index.js dogfood (0 findings).
Pilot verification step 2: bumped osl-glob's pinned SHA from
df4a3af → 3d32991 (a benign CHANGELOG-OZARK.md append on the fork
side), reinstalled, reran `npm run all` (lint + test + build + bundle),
and confirmed the dogfood scan still reports 0 findings. The round-trip
loop from fork-patch → SHA-bump → consumer-rebuild works.
@bjcorder
bjcorder marked this pull request as ready for review May 22, 2026 15:19
@bjcorder
bjcorder merged commit 590b60e into main May 22, 2026
14 checks passed
@bjcorder
bjcorder deleted the feat/ozark-stdlib-pilot branch May 22, 2026 15:19
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