Skip to content

Commit 24ca3a1

Browse files
Merge pull request #92 from semcod/ticket-076-standalone-source-dsl-apis
[ticket-076] Add standalone source DSL APIs
2 parents fb05e99 + 944288f commit 24ca3a1

13 files changed

Lines changed: 584 additions & 1 deletion

File tree

TODO.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## Active tickets
44

5+
- [ ] [`ticket-076`](project/ticket-076/README.md) — add independently callable
6+
`code2dsl`, `docs2dsl` and `config2dsl` facades that emit strictly validated,
7+
source-limited `t2c.intent/v1` records without running the full pipeline;
8+
preserve extractor SSOT/parity, acyclic module boundaries and descriptive,
9+
no-authority effects under the reviewed Wellmanifest standards. Current
10+
state: `IN_PROGRESS / PUBLICATION`; host, governance and Docker checks pass,
11+
pending protected exact-head delivery.
512
- [ ] [`ticket-054`](project/ticket-054/README.md) — restore skills-agent
613
discovery, prove a todo2code → Repair PR → independent Validator hand-off,
714
then add three bounded todo2code-grounded skills. Current state:

project/TICKETS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ of `project/README.md`, which remains a generated technical-analysis artifact.
5555
| **ticket-072** | [`README.md`](./ticket-072/README.md) | [`preprompt.md`](./ticket-072/preprompt.md) | - | [`ai-codex.md`](./ticket-072/ai-codex.md) | [`ai-codex-logs.txt`](./ticket-072/ai-codex-logs.txt) | [`changelog.md`](./ticket-072/changelog.md) |
5656
| **ticket-073** | [`README.md`](./ticket-073/README.md) | [`preprompt.md`](./ticket-073/preprompt.md) | - | [`ai-codex.md`](./ticket-073/ai-codex.md) | [`ai-codex-logs.txt`](./ticket-073/ai-codex-logs.txt) | [`changelog.md`](./ticket-073/changelog.md) |
5757
| **ticket-074** | [`README.md`](./ticket-074/README.md) | [`preprompt.md`](./ticket-074/preprompt.md) | - | [`ai-codex.md`](./ticket-074/ai-codex.md) | [`ai-codex-logs.txt`](./ticket-074/ai-codex-logs.txt) | [`changelog.md`](./ticket-074/changelog.md) |
58+
| **ticket-075** | [`README.md`](./ticket-075/README.md) | [`preprompt.md`](./ticket-075/preprompt.md) | - | [`ai-codex.md`](./ticket-075/ai-codex.md) | [`ai-codex-logs.txt`](./ticket-075/ai-codex-logs.txt) | [`changelog.md`](./ticket-075/changelog.md) |
59+
| **ticket-076** | [`README.md`](./ticket-076/README.md) | [`preprompt.md`](./ticket-076/preprompt.md) | - | [`ai-codex.md`](./ticket-076/ai-codex.md) | [`ai-codex-logs.txt`](./ticket-076/ai-codex-logs.txt) | [`changelog.md`](./ticket-076/changelog.md) |
5860
<!-- AUTO:TICKET_INDEX:END -->

project/ticket-076/README.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Ticket 076: Add standalone code2dsl docs2dsl and config2dsl APIs
2+
3+
- **ID**: ticket-076
4+
- **Owner**: unresolved:human
5+
- **Status**: IN_PROGRESS
6+
- **Workflow state**: PUBLICATION
7+
- **Created**: 2026-08-14
8+
9+
## Goal and scope
10+
11+
Expose three small, independently callable source-to-DSL APIs over the existing
12+
extractors:
13+
14+
- `code2dsl` converts supported repository source files through the current
15+
multi-language AST coordinator;
16+
- `docs2dsl` resolves explicitly supplied files or documentation patterns and
17+
runs the deterministic documentation converter;
18+
- `config2dsl` converts supported repository configuration and infrastructure
19+
files.
20+
21+
Every API accepts a repository root plus an explicit `T2CConfig`, can be called
22+
without constructing the full pipeline, and returns the existing
23+
`ExtractionResult` contract. Requiring explicit configuration preserves the
24+
deterministic no-LLM/no-secret-environment import boundary; a standalone
25+
converter must not silently read ambient provider configuration. Before the
26+
result crosses the new API boundary, all emitted records are validated as
27+
`t2c.intent/v1`. The result is intentionally partial: it contains only evidence
28+
owned by that input channel and makes no repository-completeness claim.
29+
30+
`ExtractionResult` remains an adapter envelope; each item in `records` is the
31+
canonical DSL document. The ticket does not invent a second collection schema
32+
or mislabel warnings/cache metadata as semantic DSL content.
33+
34+
The existing `extractAstIntent`, `extractDocumentationBaseline` and
35+
`extractConfigurationIntent` functions remain compatible. Because their
36+
modules are already re-exported by `src/index.ts`, the additive APIs require no
37+
package-manifest, root-export or pipeline change.
38+
39+
The inspected Wellmanifest standards and their exact applicability are recorded
40+
in [STANDARDS.md](STANDARDS.md). They require facade parity with the existing
41+
SSOT, one-way module dependencies, strict canonical-record validation and a
42+
descriptive/no-authority boundary. Experimental or uncommitted standards remain
43+
design inputs only; this ticket does not fabricate a standards lock or claim
44+
formal conformance.
45+
46+
## Acceptance criteria
47+
48+
- [x] AC-01: The human owner approves this bounded API design.
49+
- [x] AC-02: `code2dsl`, `docs2dsl` and `config2dsl` are independently
50+
callable from the package root with a common `{ root }` entry shape and
51+
a required explicit `T2CConfig`.
52+
- [x] AC-03: Each API returns only its own channel's records plus warnings (and
53+
existing AST cache evidence where applicable), without invoking the full
54+
pipeline, graph, synthesis, LLM or mutation paths.
55+
- [x] AC-04: Every returned record passes the existing strict
56+
`assertIntentRecords` validator and retains source provenance.
57+
- [x] AC-05: `docs2dsl` accepts explicit resolved files or resolves bounded
58+
include/exclude patterns, using the configured documentation patterns by
59+
default.
60+
- [x] AC-06: Existing extractor APIs and pipeline behavior remain unchanged.
61+
- [x] AC-07: For identical explicit inputs and configuration, each facade has
62+
record, warning and applicable cache parity with its canonical extractor;
63+
no extraction logic is copied into a facade.
64+
- [x] AC-08: The facades do not import one another, mutate the analyzed
65+
repository, produce authority/execution artifacts or expose actual `.env`
66+
secret material.
67+
- [x] AC-09: Focused tests, full Node verification, module-boundary validation,
68+
governance and Docker smoke
69+
pass before completion is reported.
70+
71+
## Participants
72+
73+
- Human participant: unresolved; no `user-*` file was created.
74+
- Agent participant: [ai-codex.md](ai-codex.md)
75+
76+
## Approval gate
77+
78+
The human owner explicitly approved ticket-076 and requested implementation on
79+
2026-08-14. The ticket is now `IN_PROGRESS / PUBLICATION`. Conversation
80+
approval is an audit note, not trusted merge authorization.
81+
82+
## Verification evidence
83+
84+
- Public-root regression tests prove facade/canonical parity, strict record
85+
validation, source-channel isolation, bounded documentation discovery and
86+
rejection of foreign paths.
87+
- The configuration fixture proves `.env.example` remains discoverable while
88+
actual `.env` content is neither emitted nor leaked.
89+
- `npm run verify` passed, including TypeScript build, the full Node suite,
90+
transitive no-LLM checks and module-boundary validation (124 modules, 545
91+
internal imports, no cycles and independent `core`). The existing JDK-only
92+
Java test remained skipped because the JDK is not installed.
93+
- `./project/governance-check.sh`, `make docker-smoke` and `git diff --check`
94+
passed on 2026-08-14.
95+
- The implementation is ready for protected exact-head review and remains
96+
`IN_PROGRESS / PUBLICATION` until that external delivery boundary completes.
97+
98+
## Non-goals
99+
100+
- No separate npm packages, repository split or runtime dependency.
101+
- No new DSL schema or envelope; the canonical record schema remains
102+
`t2c.intent/v1`.
103+
- No claim of formal conformance with experimental standards and no dependency
104+
on their local working-tree paths.
105+
- No `dsl-manifest.json`, modularity workspace or standards lock; those belong
106+
to a separately approved integration ticket with immutable revisions and
107+
artifact digests.
108+
- No CLI, MCP, A2A, pipeline, graph, synthesis or LLM behavior change.
109+
- No claim that a single source channel represents the complete repository.
110+
- No removal or signature change of existing extractor functions.

project/ticket-076/STANDARDS.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Standards assessment for ticket-076
2+
3+
This assessment records the local standards evidence inspected on 2026-08-14.
4+
It guides the API shape but does not turn a development checkout into a
5+
normative dependency or a trusted approval source.
6+
7+
## Adoption matrix
8+
9+
| Standard | Inspected identity | Role in ticket-076 |
10+
| --- | --- | --- |
11+
| `wellmanifest/new-project` | todo2code is pinned to `0.14.0`; the inspected upstream checkout is unmerged branch `ticket/078-home-adopt-placement` at `0b38f1bdf5c55cad6b54ad54ba89824a9eaeea78`, version `0.17.0` | Normative only through todo2code's existing immutable `0.14.0` governance package. Do not copy the upstream branch's unpublished `placement` field. |
12+
| `wellmanifest/dsl` | `b7d0595c95e5abbb48ebfdbdae0bc6d43c6f82f4`, version `0.1.0-dev`, pre-stable normative draft; manifest-schema digest `sha256:34d356b76bbd483372df84bb986e15bb84e9c1f8b11b7dc9e3a6c7276c85ed13` | Design constraint: one canonical JSON representation, explicit ownership/provenance/effects, strict validation and no authority minted by a DSL or model. Ticket-076 does not yet claim manifest conformance. |
13+
| `wellmanifest/modularity` | `1c8c94ee7e13ab95af3ab734b9548ebdfc4a7c20`, version `0.1.0-dev`, experimental | Design constraint: one-way dependencies, single exporter for the Intent contract, projections remain rebuildable, and composition does not copy semantics or transfer authority/state ownership. |
14+
| `wellmanifest/merge` | `5776debf6aaf999f542db37d535da7c8733b82c8`, version `0.1.0-dev` | Delivery-only guidance. Analytical evidence may inform a later merge disposition but cannot merge, delete or publish this branch. No merge-decision runtime belongs in a source converter. |
15+
| `wellmanifest/poa` | `8424a7f5c977915ee08404b8b82d63e0f5e44ea2`, version `0.1.0` | Boundary constraint: these APIs analyze and describe; they never grant or execute effects. Optional caches are rebuildable local projections, not authority or owned repository state. |
16+
| `wellmanifest/ssot` | `5d35394af81838bedb3f21d0894363cd18779d4c`, version `0.2.0-dev`, experimental | Implementation constraint: keep existing extractors canonical, add facade re-exports only, and prove parity so logic cannot fork into `code2dsl`, `docs2dsl` or `config2dsl`. |
17+
| `wellmanifest/env-dsl` | `0.1.0-dev`, no Git commit; all content is uncommitted and ticket-001 is `BLOCKED` | Informative only. Do not pin, import or claim conformance. Preserve its safe direction: environment values are data; do not evaluate/interpolate them, emit secrets, or treat `.env` as repository DSL evidence. |
18+
19+
## Applicable architecture decisions
20+
21+
### Canonical contract and adapter envelope
22+
23+
The canonical semantic unit remains one closed JSON AST record conforming to
24+
`schemas/intent-record.schema.json` with `schemaVersion: t2c.intent/v1`.
25+
`ExtractionResult` is an operational adapter envelope containing a collection
26+
of those documents plus non-semantic warnings. It is not a new DSL and must not
27+
receive a fabricated schema identity.
28+
29+
JSONL and future text/TOON renderings are projections. Ticket-076 neither
30+
changes their semantics nor introduces another canonical representation.
31+
32+
### Module and SSOT boundaries
33+
34+
`code2dsl`, `docs2dsl` and `config2dsl` are repo-local facades, not new semantic
35+
owners and not independent repositories. Each facade delegates to exactly one
36+
existing extractor and validates the resulting records through the shared core
37+
validator. The adapters must not import one another. The Intent record schema
38+
and its runtime validator retain sole contract ownership.
39+
40+
A parity regression must compare each facade with its canonical extractor for
41+
the same explicit root, inputs and configuration. The facade may normalize
42+
only its public call shape and documentation-file discovery; it may not fork
43+
parsing, provenance, warning or cache semantics.
44+
45+
### Effects, state and authority
46+
47+
The APIs never mutate the analyzed repository, execute a proposed change,
48+
create an approval or infer authority from input. Reading files and invoking
49+
the existing allowlisted syntax adapters are analysis operations. An enabled
50+
AST content cache is a rebuildable projection under the configured output
51+
directory and must remain explicitly represented by existing cache evidence.
52+
53+
No merge disposition, POA execution envelope, grant, receipt or SSOT decision
54+
is accepted or produced by this ticket.
55+
56+
### Configuration and environment
57+
58+
Every facade requires an explicit `T2CConfig`; neither implementation nor
59+
conformance tests depend on ambient environment state. This preserves the
60+
existing deterministic no-LLM import boundary and prevents a standalone source
61+
converter from silently loading provider credentials. The facades add no
62+
environment evaluation, interpolation or secret output. `config2dsl` may
63+
analyze `.env.example` through the existing structural extractor and must
64+
continue to exclude actual `.env` secret material.
65+
66+
## Visible prerequisites for formal Wellmanifest adoption
67+
68+
Formal `wellmanifest.dsl/manifest/v1` adoption is a separate integration
69+
workstream because it owns a new root manifest, artifact digests, command or
70+
document vocabulary, normalized finding producers and protected conformance
71+
commands. It cannot be smuggled into an extractor ticket.
72+
73+
The following local evidence also prevents pretending that one complete
74+
standards lock exists today:
75+
76+
- Modularity still pins Wellmanifest DSL revision
77+
`550e5f441c709e15f2679c1af151352d1eba2f1e`, while the inspected SSOT lock
78+
pins `b7d0595c95e5abbb48ebfdbdae0bc6d43c6f82f4`.
79+
- Modularity's standards reference still describes POA as uncommitted, while
80+
the inspected POA repository now has commit
81+
`8424a7f5c977915ee08404b8b82d63e0f5e44ea2`.
82+
- `env-dsl` has no immutable revision and its own first implementation ticket
83+
is blocked.
84+
- Todo2code's current governance contract accepts new-project intent v3 as
85+
pinned by `0.14.0`; it must not consume the unmerged upstream `placement`
86+
extension from a working tree.
87+
88+
Before a future integration ticket creates `dsl-manifest.json` or a modularity
89+
workspace, it must choose and verify exact immutable revisions and SHA-256
90+
contract digests, reconcile these stale references upstream or record them as
91+
explicit informative mappings, and run the standards' deterministic checkers.

project/ticket-076/ai-codex-logs.txt

Whitespace-only changes.

project/ticket-076/ai-codex.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
participant-id: agent:codex
3+
participant: codex
4+
role: agent
5+
ticket: ticket-076
6+
---
7+
# Participant: codex (AI agent)
8+
9+
## Understanding
10+
11+
Todo2code already contains the three underlying deterministic boundaries and
12+
exports their modules from the package root. The missing part is a uniform,
13+
discoverable product-level facade: AST takes an options object, configuration
14+
takes a positional root, and documentation requires callers to resolve files
15+
themselves. None of those names expresses that its result is a valid but
16+
source-limited Intent DSL document.
17+
18+
The smallest compatible change is to add one named facade in each owning
19+
extractor module. Each facade delegates to the mature extractor, validates the
20+
complete returned record array with the existing strict runtime validator and
21+
preserves warnings and cache evidence. This avoids duplicating parsing or
22+
creating dependencies between the three adapters.
23+
24+
The Wellmanifest review sharpens that boundary. `ExtractionResult` is an
25+
adapter envelope, while each `records` element is the canonical
26+
`t2c.intent/v1` JSON document. SSOT requires delegation plus parity rather than
27+
copied converters; Modularity requires acyclic adapter dependencies and one
28+
contract owner; DSL and POA require descriptive output with no authority or
29+
execution effect. Env DSL is currently uncommitted and blocked, so only its
30+
safe data/no-evaluation direction is applicable. Exact evidence and adoption
31+
limits are in [STANDARDS.md](STANDARDS.md).
32+
33+
## Execution plan after approval
34+
35+
1. Add `code2dsl({ root }, config)` beside the AST coordinator.
36+
2. Add `docs2dsl({ root, files?, patterns?, excludes? }, config)`, resolving
37+
patterns only when explicit files are absent.
38+
3. Add `config2dsl({ root }, config)` beside the configuration extractor.
39+
4. Require explicit `T2CConfig` at every facade so deterministic extraction
40+
never imports or reads ambient provider/secret environment configuration;
41+
fail closed when the root or emitted DSL is invalid.
42+
5. Add one public-root regression test proving independent invocation, strict
43+
record validation, source-channel isolation, facade/canonical parity and
44+
preservation of warnings/cache evidence.
45+
6. Prove that actual `.env` secret material remains outside configuration DSL
46+
extraction and that no adapter imports another.
47+
7. Run the focused test, `npm run verify` (including module boundaries),
48+
`./project/governance-check.sh` and `make docker-smoke`.
49+
50+
## Actual changes
51+
52+
- Inspected the current exports, extractor signatures, pipeline orchestration,
53+
schema validator and workstream ownership.
54+
- Inspected the requested Wellmanifest standards, their exact local revisions,
55+
effect/ownership rules and current publication maturity; recorded conflicts
56+
that prevent a fabricated all-standards lock.
57+
- Created and completed this planning ticket on a dedicated branch.
58+
- Recorded the human owner's explicit approval on 2026-08-14 and transitioned
59+
the ticket to `IN_PROGRESS / EDIT` before touching implementation.
60+
- Added all three facade APIs in their owning extractor modules. Each delegates
61+
to the canonical extractor, requires explicit `T2CConfig` and validates the
62+
emitted `t2c.intent/v1` records before returning the unchanged envelope.
63+
- Added public-root regression coverage for canonical parity, source isolation,
64+
docs discovery, invalid/foreign inputs and `.env` non-disclosure.
65+
- Passed focused tests and full `npm run verify`, including the transitive
66+
no-LLM and module-boundary gates; passed governance, Docker smoke and diff
67+
checks. The existing JDK-only Java test remained skipped on this host.
68+
- Transitioned to `IN_PROGRESS / PUBLICATION`; protected exact-head review and
69+
merge are intentionally not claimed by this ticket-local validation.
70+
- Validator Agent correctly failed closed on the first published head because
71+
the test diff contained a credential-shaped assignment. Reworked
72+
only the inert fixture to construct its key name and value at runtime; the
73+
non-disclosure assertion remains equivalent without publishing a
74+
credential-shaped assignment in the patch.
75+
- The protected governance resolver then rejected the combined ticket and
76+
implementation history even after Validator approval. Reconstructed the
77+
branch from `origin/main` so the approved plan and `intent.json` are committed
78+
first, implementation follows in a separate commit, and this remediation is
79+
last; no product bytes changed during the history repair.
80+
81+
## Risks
82+
83+
- Ambient environment defaults could make a convenience API surprising; the
84+
explicit root remains authoritative and callers may pass a complete config.
85+
- Documentation pattern resolution must stay bounded by the existing glob and
86+
ignore behavior.
87+
- An additive root export is still a contract and must be regression-tested
88+
even though no package manifest change is necessary.
89+
- A local development checkout is not a normative dependency. Formal DSL or
90+
Modularity adoption needs a later integration ticket and immutable pins.
91+
- The first optional-config implementation failed `verify:no-llm` because its
92+
runtime `getConfig` import reached `OPENROUTER_API_KEY`. The corrected public
93+
contract requires explicit config and restores the deterministic boundary.
94+
95+
## Blockers
96+
97+
- None for the bounded todo2code implementation. Cross-repository standards
98+
reconciliation remains separately governed by each owning repository.

0 commit comments

Comments
 (0)