Pen v0.2 - #5
Open
krijnrijshouwer wants to merge 24 commits into
Open
Conversation
' to '@input' - Updated package names in various files to replace '@pen' with '@input', ensuring consistency across the codebase. - Modified the .npmrc file to include an authentication token and set the registry for package management. - Adjusted the playwright configuration to reflect the new package naming convention. - Enhanced the .gitignore file to include the .npmrc file for better version control. - Updated README and documentation to guide users on the new package names and installation instructions. - Changed access settings in package metadata to 'restricted' for better control over package visibility.
- Introduced a comprehensive roadmap document outlining improvements for the Pen library to support local-first applications, synchronized AI workflows, and cross-client collaboration. - Defined product boundaries, goals, and wave orders for implementing CRDT state vectors, structured mutation origins, and headless editor capabilities. - Emphasized the importance of generic primitives for collaboration and AI-assisted editing while maintaining a headless, open-source architecture. - Established clear non-goals to avoid product-specific semantics, ensuring focus on core functionalities and extensibility.
- Added '@input/pen-document-ops' to pnpm-lock.yaml for better workspace management. - Removed deprecated warning for the 'without' option in createEditor, simplifying the editor initialization process. - Updated editor extension resolution logic to streamline the installation of user extensions. - Refactored AI extension interfaces to enhance functionality and maintainability, including new methods for handling document changes and inline history shortcuts. - Improved test structure by consolidating common editor creation logic and enhancing selected text deletion tests for better clarity and coverage.
…repo Introduces AGENTS.md as the repo-wide contract for coding agents (architecture layering, specs-as-contract, mutation-path and headless invariants, commands, testing posture, git conventions), plus the pen-deslop and ligne-blanche skills, an investigate workflow, and a spec-reviewer subagent that maps a diff to the spec rule IDs it must honor. Co-authored-by: Cursor <cursoragent@cursor.com>
…ation orders Specifies the next iteration of Pen: change summaries with position mapping, a single selection authority, typed facets replacing string slots, a command registry, the eight-phase commit pipeline, scheduled DOM read/write phases, and bidi support. Adds the independent audit record (F1-F21, including render-time XSS through stored link marks and surrogate-pair splitting on delete) with the security, accessibility, and API/packaging specs that remediate it, and twelve wave work orders carrying entry gates, deletion lists, and runnable exit gates so every normative rule ID is claimed by a wave. Co-authored-by: Cursor <cursoragent@cursor.com>
…riants Stands up the lint infrastructure Wave H step H.1 owes the rest of the v2 train: a permissive flat config at the root, a private @input/pen-eslint-plugin the later waves mount their custom rules on, and a lint script per package. The first rule enforces SEC2 by banning markup sinks; the dynamic-code ban (SEC8) uses core rules. CI picks both up through the existing pnpm lint step. Baseline is 0 errors and 6,649 warnings, concentrated in the mechanically split AI extension parts, so the gate blocks regressions while Wave H burns the debt down. Fixes three innerHTML teardowns in the Vue tests and a redundant escape in defaultSkills rather than exempting them. Co-authored-by: Cursor <cursoragent@cursor.com>
Amends the wave order to match what shipping the lint host proved: no no-op rule stubs (a rule that reports nothing is fake protection), no-html-injection-sinks and the dynamic-code ban land in H.1 rather than Wave S, and root lint is one eslint pass instead of turbo run lint to avoid double-linting. Adds finding F22: the host surfaced streaming accumulators in the AI extension that are initialized, passed to a consumer, and never written, plus a warn-once flag duplicated across two core files and wired to nothing. Both were invisible to tsc because they sit under @ts-nocheck, which is the receipt F3 argued for, so prefer-const stays a warning rather than autofixing dead logic into place. Co-authored-by: Cursor <cursoragent@cursor.com>
A model streaming "para one\n\npara two\n\npara three" produced five blocks: the blank lines each became an empty paragraph, so accepting a multi-paragraph suggestion inserted visible blank blocks between the paragraphs. The prose path used the shared line splitter, which preserves interior empty lines by contract because pen-ai's replacement ranges need the 1:1 line mapping. Splits prose on paragraphs in the autocomplete caller instead, leaving that contract intact. Leading and trailing newline runs still produce empty blocks, which is where the caret lands after acceptance. Resolves the contradiction between extension.part5 and the structuredCandidate unit test, red since d240d77. Co-authored-by: Cursor <cursoragent@cursor.com>
The test asserted that some element still carries affected-range styling while the inserted suggestion does not. shouldShowSelectionContext suppresses the selection context highlight entirely once final-text suggestions exist, so the guard could never hold and the suite has been red since d240d77. The narrower guarantee it was protecting is already covered by reviewPresentation. Records finding F23: diagnosing this surfaced ai/src/decorations/affectedRange.ts as dead code superseded by review/contextDecorations.ts, still imported by sixteen split files. Wave H step H.2 deletes it. Co-authored-by: Cursor <cursoragent@cursor.com>
…ionality - Revised AGENTS.md to clarify the role of extensions and removed the mention of the database extension. - Enhanced CONTRIBUTING.md with a new section on the Contributor License Agreement and clarified changeset requirements. - Updated eslint.config.mjs to enforce new rules and added comments for better understanding of security contexts. - Modified package.json to include new scripts for release checks and size limits, ensuring better package management. - Adjusted Playwright configuration to support multiple web servers for testing. - Cleaned up pnpm-lock.yaml by removing unused dependencies and ensuring consistency across package versions. - Added new examples to README.md to guide users on using React and Vue apps. - Expanded SECURITY.md to include supported versions and reporting guidelines for vulnerabilities. - Removed deprecated test files and updated core package files to reflect recent changes in database handling and editor functionality. These changes aim to enhance the developer experience and maintain the integrity of the codebase.
…tion. Clipboard JSON, HTML sanitizer, facet-aware URL sinks, and phase-2 proto-key rejection now match SEC1–SEC9, with the hostile corpus and local exit-gate proof recorded. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…log. Co-authored-by: Cursor <cursoragent@cursor.com>
…dd localization gates. Co-authored-by: Cursor <cursoragent@cursor.com>
- Updated CONTRIBUTING.md to clarify API report requirements and changeset processes. - Added new ESLint rules for security contexts in eslint.config.mjs, focusing on unescaped markup concatenation and aria-hidden visibility. - Modified CI workflows to include checks for API reports, types-package purity, and internal stripping. - Adjusted pnpm-lock.yaml and package.json to standardize workspace dependency specifications. - Introduced new scripts for release checks and improved type safety in TypeScript configurations. These changes aim to improve developer experience, maintain code quality, and ensure compliance with security standards.
- Changed the licensing description in AGENTS.md and CONTRIBUTING.md to reflect the transition to the MIT License. - Updated LICENSE.md to include the full MIT License text. - Revised README.md to clarify the licensing terms and usage instructions for the SDK. - Adjusted SUPPORT.md to align with the new licensing structure. - Enhanced examples in the documentation to improve user guidance. These changes aim to provide clearer licensing information and improve the overall documentation for better user understanding.
…ithout enforcing timings. Co-authored-by: Cursor <cursoragent@cursor.com>
…ation - Adjusted size limits for various packages in `.size-limit.baseline.json` to reflect recent changes and improvements. - Updated `CONTRIBUTING.md` to clarify the status of examples as pnpm workspace members and revised licensing information. - Enhanced `eslint.config.mjs` with new rules for managing v1 extension fields and improved error handling. - Modified `package.json` to correct script paths and added new scripts for better package management. - Updated README files in examples to include necessary peer dependencies and clarify installation instructions. These changes aim to improve package management, documentation clarity, and code quality across the project.
…ols' in transports and enhance documentation for inline node segments and search functionality. - Added '@input/pen-ai-tools' as a workspace dependency in both 'packages/transports/direct' and 'packages/transports/sse'. - Improved documentation to clarify the round-tripping of inline node segments through the shared content pipeline and JSON/XML exporters, as well as search capabilities for table cells.
…oling
Checkpoint of the parallel wave lanes, taken on the first state where all
four gates pass together: build 40/40, typecheck 38/38, test 78/78, lint
clean.
Notable fixes made while verifying, each a regression left by a lane that
had already moved on:
- schema/handles.ts: the sentinel consolidation replaced an early return
that guarded both textContent paths with a call that guarded only the
unresolved one, so textContent({ resolved: true }) began returning the
\u200B sentinel through a host-visible read API.
- core originShape contract test imported DocumentMigration from
pen-types, where it does not exist; it lives in core's migrations/types.
- awarenessValidator: the control-character strip is deliberate defense
and now carries a reasoned no-control-regex disable rather than a
masked lint error.
- bench envelope/compare: attach the caught error as cause.
Also corrects three defective verification clauses in the wave files. Every
shell command embedded in spec-v2/waves was extracted and run as a set for
the first time; three could not do the job their prose claimed, and the
technique is recorded in spec-v2/waves/README.md.
Co-authored-by: Cursor <cursoragent@cursor.com>
…rt correctly
Six parallel lanes landed against bb354ea; all four gates stay green
(build 40/40, typecheck 38/38, test 78/78, lint clean) and the standalone
gate scripts now pass as well.
Lane results:
- Conformance: the typing budget no longer exits 0 when the last-run file
is missing, which was the worst case because a missing file looked
exactly like success. Numbers stay record-only with a loud banner rather
than being raised to hide the Wave 7 target.
- Docs coverage: the gate stopped skipping @input/pen-dom's ./field-editor/*
subpath, which was the one surface the API triage tells extension authors
to import from. Ratchet re-recorded once, 1796 -> 2008; the rise is the
wider denominator, not a documentation regression.
- Size: five packages re-recorded with wave-attributed causes, three
deferred while their lanes were mid-edit and re-recorded here once a
rebuild reproduced the byte count twice.
- Above-floor allowlist: a site may now be a path or { path, reason }, and
stale sites fail by name.
- Inline atom delete: both behaviours pinned in tests and deliberately left
divergent. Every binding one-shot deletes today while the spec ports a
select-first affordance, so converging is a product decision, not a fix.
- Focus sink: all three attribute writes exempted from Wave 3 scheduling,
each for a different reason; the adoption inventory is now the adopt and
exempt markers together, not adopt alone.
- Wave 03/05: the gate cycle is closed by moving the absolute clause to the
wave that deletes the two files it depends on.
Gate repairs found while integrating:
- gate-mutation's above-floor proof asserted a "bare path" message that the
schema change deleted. It still exited non-zero, for an unrelated reason,
so it read as healthy while proving nothing. Replaced with proofs of the
properties actually enforced, plus a positive control, and record() can
now express "can it pass" as well as "can it fail".
- gated-scope and the Wave D and Wave E notes claimed a ratchet, a skipped
glob surface and empty allowlist sites that are all now out of date.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
…and correct three selection-spec claims that could not hold Wave 05 step 5.2: the empty-block sentinel is now declared once, in @input/pen-types utils/logicalText.ts, down from ten declarations under four names across eight files. INLINE_ATOM_CARET_BOUNDARY_TEXT survives as a documented alias because it means a different thing with the same character. Non-test sites fall from 28 to 8; the rest belong to core and step 5.3. Bench: a Pen-removed null implementation is now timed alongside every bench, and attributeBenchResult refuses a wall-clock without one, so the harness floor cannot be forgotten rather than merely remembered. The concurrent-peers bench asserts peer B observed the timed insert after the clock, not only during setup. Durability: the DUR4 parity test compared createHeadlessEditor with createEditor, which are the same factory in Node. Replaced with a no-DOM assertion that can fail; real parity stays in the Playwright scenario and the exit gate stays open. Selection spec corrections, each measured rather than inferred: section 4.3 claimed all six v1 heuristics have v2 successors, and resolveProgrammaticInputRange has none because it resolves an input range rather than classifying a selectionchange. selectionBridge.ts has five production importers outside pen-dom through the published field-editor subpath, so deleting it is an API migration. no-selection-timers exists and scopes to filenames containing "selection", so it sees two of the nine remaining rAFs. Also: sixteen entry gates ticked against commands actually run, seven migration-guide sections written as first-publish rather than upgrade guidance, and Wave 07's browser-fuzz clause relocated to the wave that builds the browser fuzzer. Co-authored-by: Cursor <cursoragent@cursor.com>
…onformance helpers Co-authored-by: Cursor <cursoragent@cursor.com>
…layground errors Co-authored-by: Cursor <cursoragent@cursor.com>
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.
No description provided.