Complete LexShield OSS v0.1 — full feature build - #5
Merged
Conversation
Remove Cloud/SaaS from MVP scope, replace M6 with docs/polish, simplify GTM to OSS launch, and add an explicit build-readiness go. Co-authored-by: Moses Man <mosesman831@users.noreply.github.com>
Add SPEC §9 feature freeze: exact engine/SDK/CLI/API behaviors, three demos, expression/redaction contracts, full policy pack YAML, 24-intent catalog, and Appendix D acceptance checklist. Co-authored-by: Moses Man <mosesman831@users.noreply.github.com>
Add JSON schemas, policy packs from SPEC Appendix A, golden fixtures, examples, docs skeletons, CI workflow example, and contrib placeholder. Co-authored-by: Moses Man <mosesman831@users.noreply.github.com>
Add packages/engine-ts with ESM build (tsup), vitest, zod schemas for Policy/ToolCallRequest/Verdict/Trace, YAML policy loader stubs, policy engine and classifier pipeline stubs, SPEC §9.6 redaction, Shield SDK surface, and basic tests. Co-authored-by: Moses Man <mosesman831@users.noreply.github.com>
Parallel scaffold of the full monorepo per SPEC v0.1: - Root: MIT LICENSE, uv workspace, pnpm workspaces, README - packages/engine-py: Pydantic models, policy/classifier/server stubs, redaction - packages/cli: Typer CLI (init, check, run, evaluate, traces, challenge, packs) - packages/engine-ts: @latticeag/lexshield with zod types and Shield stubs - schemas/, packs/, fixtures/golden/, examples/, docs/, CI example All Python (10) and TypeScript (10) tests pass; `uv run lexshield version` works. Co-authored-by: Moses Man <mosesman831@users.noreply.github.com>
Add expression parser/evaluator, full policy engine matching (tags, expressions, priority/tie-break, unclassified fallback), deterministic classifier parity with rules.yaml loading, golden and policy-engine tests. Co-authored-by: Moses Man <mosesman831@users.noreply.github.com>
OSS-first implementation kickoff: - SPEC v0.5: add §9B detailed implementation spec (module map, algorithms, golden matrix, CLI/API contracts, dev workflow) - Python: real PolicyEngine, rule matching, safe expressions, compiled policies - 10 golden fixtures + pytest harness (deterministic-only) - CLI check/evaluate wired to Shield; trace writes on evaluate - TypeScript golden confidence aligned with Python (0.5 unclassified) - change-window pack priority fix for allow-infra-with-ticket Tests: 35 Python + 26 TypeScript (10 golden scenarios parity) Co-authored-by: Moses Man <mosesman831@users.noreply.github.com>
- init: copy pack rules.yaml (follow symlinks), embed challenge-delete in baseline - check: strict fails on warnings, taxonomy intent ref warnings - evaluate: stdin ToolCallRequest, --caller JSON, --environment/--env, --tags - traces: resolve path from config or --trace-file, pretty-print list/show - challenge: wire ChallengeStore with config path resolution, print id/status - main: add completion stub - tests: evaluate, challenge, packs apply, and smoke flows Co-authored-by: Moses Man <mosesman831@users.noreply.github.com>
Implement challenge creation on CHALLENGE verdicts in Shield.evaluate using matched rule challenge config. Add NDJSON trace format with redacted arguments and classifications, update_outcome patching, and StdoutTraceSink. guard_sync uses asyncio.run with optional await_challenge polling. from_config loads all sinks, challenge store path, proxy upstreams, and fail_on_classifier_error. Add execute_upstream for httpx forwarding when ALLOW. Move challenge ID creation from PolicyEngine to Shield. Add test_shield.py covering guard, guard_sync, challenge creation, and record_outcome. Co-authored-by: Moses Man <mosesman831@users.noreply.github.com>
Implement taxonomy severity map, LLM classifier stub, classifier pipeline with severity merge and caching, full Shield SDK (session context, guardSync, trace sink, challenge store), LocalApiClient, and expanded test coverage. All 25 golden fixtures pass. Co-authored-by: Moses Man <mosesman831@users.noreply.github.com>
- Add runnable Python/TS examples with bundled policy configs - Fill docs (policy, intents, SDKs, security, CLI) with real content - Update README with verified deterministic quickstart - Replace example workflow with ci.yml (pytest, pnpm test/golden, pack check) - Add lexshield-check-packs CLI entry point for validating all packs Co-authored-by: Moses Man <mosesman831@users.noreply.github.com>
Parallel implementation of remaining v0.1 OSS features: - LLM classifier (OpenAI-compatible, mocked tests) + severity merge pipeline - Shield: challenges, guard_sync, record_outcome, execute_upstream, trace redaction - FastAPI: execute/proxy, auth token, policy reload, trace/challenge APIs - CLI: init packs+rules, evaluate stdin, traces, challenge, run with config - 25 golden fixtures (Py/TS parity) - TypeScript: full Shield, pipeline, LLM, challenges, traces, LocalApiClient - Examples, filled docs, CI workflow (pytest + vitest + pack check) Tests: 98 Python, 47 TypeScript (25 golden scenarios) Co-authored-by: Moses Man <mosesman831@users.noreply.github.com>
mosesman831
marked this pull request as ready for review
July 11, 2026 13:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full OSS v0.1 build — all features from SPEC §9 implemented (no SaaS).
Engine (Python)
@guard/guard_sync, challenges, traces (redacted NDJSON + stdout),execute_upstreamCLI
init,check,run,evaluate,traces,challenge,packs,version,completionTypeScript (
@latticeag/lexshield)LocalApiClientContent
.github/workflows/ci.ymlTests
Explicitly out (per SPEC)