Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ title-recordings/
.jedit-text.edict-lawpack-build.lock
.obsidian/
.claude/
src/generated/jedit/structural-history-replace-text-range.wesley.generated.ts
64 changes: 26 additions & 38 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,42 +33,26 @@ These are hard repo rules, not suggestions:
## Structure

- `ARCHITECTURE.md` is the canonical repo architecture doctrine.
- `docs/BEARING.md` records the current execution gravity.
- `docs/jim-component-ownership.md` owns the Jim/Jedit/Edict/Echo target
ownership and causal model.
- `README.md` (*Current posture*) records current truth, the roadmap toward the
`Jim.edict` goalpost, and the hard gates; *Where Jim is going* records the
product direction.
- `docs/method/process.md` is the canonical cycle workflow.
- `docs/method/durable-decisions.md` owns the durable decision policy and the
canonical-owner register.
- `docs/method/documentation-lifecycle.md` owns when documentation is kept,
rewritten, or deleted.
- `docs/method/roadmap-planning.md` defines release-gate, roadmap, slice, and
proof policy for multi-cycle planning.
- `docs/method/ci.md` describes what CI runs for a change.
- `docs/design/TEMPLATE.md` is the required template for full cycle designs.
- `docs/design/0034-design-cycle-template-and-lifecycle.md` records the policy
decision that made executable design docs official.
- `docs/design/0024-jedit-powered-by-echo-release-gate.md` is the completed
baseline plan for the first thirty slices proving jedit has an installed
package/evidence path while Echo remains generic.
- `docs/design/0025-echo-application-hosting-pattern.md` is the completed
post-release-pressure ten-slice plan for proving the reusable Echo
application-hosting pattern before applying it to Graft, Think, or other apps.
- `docs/design/0026-echo-hosting-hardening-first-twenty.md` is the completed
hardening plan for slices 41-60. Keep track of our progress in that plan doc
by checking off slices just before you make the commit for that slice.
- `docs/design/0027-echo-hosted-production-cutover.md` is the active production
cutover plan for slices 61-80. Keep track of progress in that plan doc by
checking off slices just before you make the commit for that slice.
- `docs/BEARING.md` is the active plan for the powered-by-Echo completion
budget after slice 80. Keep track of progress there by checking off slices
just before you make the commit for that slice.
- `docs/design/0032-jedit-echo-reading-cache-and-fallback-boundaries.md`
records the local package for slices 101-110.
- `docs/design/0033-echo-authoritative-recovery-gate-b.md` records the current
local companion plan for consuming Echo recovery truth through jedit-owned
ports. Keep track of progress there and in `docs/BEARING.md` by checking off
slices just before you make the commit for that slice.
- `scripts/quality-gate.mjs` is the current enforceable quality ratchet.
- `quality-baseline.json` is temporary debt tracking, not permission to add more debt.
Keep it empty when the ratchet is clean.
Lower an entry when the debt shrinks, and remove it when the debt is gone.

Keep track of our progress in the plan doc by checking off slices just before
you make the commit for that slice.
When a cycle has a plan doc with a slice checklist, check off each slice just
before you make the commit for that slice.

## Durable Decision Discipline

Expand All @@ -82,9 +66,9 @@ Chat transcripts, Think memories, pull-request prose, and review threads may
motivate a decision; none of them is its repository home.

Treat missing or stale canonical decision documentation as incomplete
engineering work, not optional polish. Historical design documents remain
evidence of their cycle; when durable current architecture changes, update the
current owning doctrine rather than relying on an old retrospective.
engineering work, not optional polish. When durable current architecture
changes, update the current owning doctrine. Obsolete documents are deleted, not
kept as history; follow `docs/method/documentation-lifecycle.md`.

## Design Cycle Workflow

Expand All @@ -99,21 +83,25 @@ current owning doctrine rather than relying on an old retrospective.
software surface: package API, runtime behavior, rendered output, scripted app
flow, command behavior, schema validation, lower-mode output, or CI/tooling
behavior.
- Design-doc assertions are allowed only as evidence-ledger checks. They cannot
be the only acceptance test for product, runtime, UI, or tooling work.
- Tests never read documentation. No spec, test, or gate may read a document's
content or assert its wording, so a docs change never changes a check's
result; see
[documentation-lifecycle.md](docs/method/documentation-lifecycle.md).
- Fill in the design doc retrospective before marking the PR ready.
- Create GitHub issues for deferred work instead of hiding follow-on debt in
prose.

## Current Reality

The repo is still converging toward the full architecture doctrine, but the
enforceable quality ratchet is currently clean.
The repo is still converging toward the full architecture doctrine.

- `scripts/quality-gate.mjs` currently enforces no `any`, no `unknown`, and no
TypeScript file over 500 lines.
- `quality-baseline.json` should stay empty unless temporary ratcheted debt is
deliberately introduced and documented.
- `scripts/quality-gate.mjs` enforces the rules it prints (`npm run quality`),
including no `any`, no `unknown`, no enums, no type assertions, function,
parameter, import, complexity, and line-length limits, and a 500-line file
limit that also covers specs and tests.
- `quality-baseline.json` records the remaining ratcheted debt: line counts for
a few oversized spec and test files. A change may lower an entry, never raise
one.

## Delivery Workflow

Expand Down
23 changes: 14 additions & 9 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ The broader project doctrine is written down in
Ports describe typed runtime contracts. They do not decode raw payloads.

- `src/adapters`
Concrete implementations for filesystem, MCP, Bijou integration, persistence, and process boundaries.
Raw strings, JSON, bytes, terminal events, and MCP payloads are decoded here and re-encoded here.
Concrete implementations for the filesystem, the native Echo host process, Graft, Bijou integration, and other process boundaries.
Raw strings, JSON, bytes, terminal events, and host payloads are decoded here and re-encoded here.

- `src/ui`
Presentation and input mapping.
Expand Down Expand Up @@ -232,17 +232,21 @@ Why the boundary exists:
- Graft's `StructuredBuffer` surface is an immutable parsed snapshot over
`path + content`, which is excellent for language intelligence but not a
substitute for an editor runtime.
- `jedit` still needs a lawful text-edit kernel with explicit tick-grounded
history, stable anchors, and eventually a persistent piece-rope worldline.
- Editor truth needs a lawful text-edit kernel with tick-grounded history and
stable anchors. The persistent rope is `jedit.text` law hosted in Echo's
graph (see `docs/design/0159-edict-rope-representation.md`), not a Graft
concern.
- Structural projections and causal text truth are related, but they are not
the same layer.

The intended stack is:

- `jedit` core owns editing interaction and buffer lifecycle over causal text
frontiers
- `Jim.edict` owns editing interaction and buffer lifecycle over causal text
frontiers; today TypeScript and the native host hold this as compatibility
authority
- Graft provides structural intelligence and parser-backed projections
- Echo / `echo-text` owns the native causal text substrate
- Echo owns generic admission, scheduling, graph state, receipts, and
recovery; it hosts the rope as application law, not as a built-in text engine
- Echo persistence owns durable causal history
- filesystem remains a working projection boundary
- Git remains an ecosystem projection and compatibility export
Expand All @@ -251,8 +255,9 @@ The intended stack is:
implementation may use Echo internally, but `jedit` should not have to route
canonical editor truth through Graft to reach its own causal substrate.

The transport used to reach Graft is not architectural truth. The current MCP
path is an implementation detail, not a long-term ownership claim.
The transport used to reach Graft is not architectural truth. The current
direct Graft API session (`src/adapters/graft-api-session.ts`) is an
implementation detail, not a long-term ownership claim.

## Testing Rule

Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@

## Unreleased

- Folded `VISION.md` and `docs/BEARING.md` into `README.md`. *Current posture*
now holds current truth, the authority and artifact boundaries, the roadmap
toward `Jim.edict`, and the hard gates; *Where Jim is going* holds the product
promise, boundary doctrine, product goalposts, and non-goals. The README's
Vim-parody introduction is unchanged. Every reference now points at the
README sections.

- Removed obsolete documentation: completed or abandoned design cycles whose
rules now live in code, specs, or canonical owners; documents for retired
interfaces (the TypeScript text runtime, optic session, WASM transport, and
structural-history generation); dated audit snapshots; the invalidated
`v0.1.0` release material; the method backlog, retrospective, and graveyard
directories; and five closed Edict probes. Still-binding rules moved into
their owners, live ideas became GitHub issues, and links were repaired.
`docs/method/documentation-lifecycle.md` now owns the rule that Git history
is the archive, `docs/method/ci.md` documents CI planning, and `AGENTS.md`,
`ARCHITECTURE.md`, `README.md`, `VISION.md`, `CODE_STANDARDS.md`, BEARING,
the ownership map, and the Echo guides were corrected where they had drifted.
Tests no longer read documentation at all: the specs that asserted Markdown
wording (`audit-docs`, `design-cycle-policy`, `guide-path-references`,
`echo-application-hosting-guide`, `rope-fact-inspector-design`, the Vim
command-line teardown check, and the design-doc ledger half of
`replace-range-law-cycle`) and the quality gate's `identity-doctrine-links`
rule were removed, along with the now-empty `docs-release` CI shard, so a
docs-only change runs build and quality but no test shard. Behavioural checks
were kept, including the lawpack digest sidecars and the cutover guard.

- CI now runs ShellCheck (`scripts/ci/shellcheck.sh`, in the `quality` job) over
every tracked shell script and over the pre-commit and pre-push launchers that
`scripts/install-hooks.sh` generates, installed into a throwaway repository.
Expand Down
46 changes: 12 additions & 34 deletions CODE_STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ For cross-realm values, normalize through adapters/boundaries and construct vali

---

## Strict Code Limits (Enforced)
## Strict Code Limits

`scripts/quality-gate.mjs` enforces these:

- **File size**: ≤ **500 lines**
- **Source line length**: ≤ **160 characters**
Expand All @@ -89,9 +91,12 @@ For cross-realm values, normalize through adapters/boundaries and construct vali
nesting level)
- **Cyclomatic complexity**: ≤ **8**
- **Parameters**: ≤ **5** (use a named options class/object otherwise)
- Max 12 imports per file

Review enforces these:

- **Class size**: ≤ **400 lines**, ≤ **15 public methods**
- One primary domain concept per file
- Max 12 imports per file

---

Expand Down Expand Up @@ -137,38 +142,11 @@ must be named before comparison.

---

## Sample ESLint Rules

```json
{
"rules": {
"max-lines": ["error", 500],
"max-len": ["error", { "code": 160 }],
"max-lines-per-function": ["error", { "max": 35, "skipBlankLines": true, "skipComments": true }],
"max-depth": ["error", 4],
"max-params": ["error", 5],
"complexity": ["error", 8],
"max-statements": ["error", 25],

"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-restricted-types": [
"error",
{
"types": {
"unknown": "Use a concrete type instead of unknown"
}
}
],
"@typescript-eslint/no-unsafe-assignment": "error",
"@typescript-eslint/no-unsafe-member-access": "error",
"@typescript-eslint/no-unsafe-return": "error",
"@typescript-eslint/no-unsafe-call": "error",
"@typescript-eslint/only-throw-error": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/no-floating-promises": "error"
}
}
```
## Enforcement

The repository does not use ESLint. `scripts/quality-gate.mjs` implements the
enforced limits, the banned-language list, and the magic-literal ratchet above; run `npm run quality` to see the full
rule list and any ratcheted debt in `quality-baseline.json`.

---

Expand Down
14 changes: 12 additions & 2 deletions GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ workspace launches that trusted Rust host as a child process. Set
host is missing or exits, text operations fail closed. Jim does not fall back to
a local text runtime.

### Startup flags

`jedit --version` (or `-V`) prints `jedit <version>`, where the version is
`package.json`'s, and exits. `jedit --help` (or `-h`) prints that line, the
usage `jedit [--version|-V] [--help|-h]`, and the two options, and exits. Both
return before the workspace module is loaded, so they never start the terminal
UI or the native Echo host. A flag counts only as the sole argument; any other
arguments start the editor. `src/adapters/jedit-startup-cli.ts` implements this
and `spec/jedit-startup-cli.spec.mjs` pins it.

Build the app:

```sh
Expand Down Expand Up @@ -71,8 +81,8 @@ Jim command
```

The implemented surface is intentionally narrow: create/open a buffer,
single-range replace/insert/delete, and bounded text-window observation. Other
operations return typed obstructions. Edict will replace the transitional Rust
single-range replace/insert/delete, checkpoint declaration, and bounded
text-window observation. Other operations return typed obstructions. Edict will replace the transitional Rust
operation law and invocation seam operation by operation; do not widen this
compatibility path merely to regain feature parity.

Expand Down
Loading
Loading