kireji 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/ARCHITECTURE.md +90 -0
- package/docs/ENVIRONMENTS.md +89 -0
- package/docs/FUNDING.yml +5 -0
- package/docs/LICENSE.md +21 -0
- package/docs/README.md +152 -0
- package/docs/VERSIONING.md +87 -0
- package/package.json +69 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +5 -0
- package/test.js +3 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# kireji – Architecture Overview
|
|
2
|
+
|
|
3
|
+
This document provides a technical deep dive into the inner workings of kireji. It supplements the main README with details on the hashing model, URL compression strategy, and state representation.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Minimal Perfect Hashing
|
|
8
|
+
|
|
9
|
+
kireji employs a piecewise-defined, recursive **minimal perfect hash function (MPHF)** to compress part state information into compact, shareable URLs. Each application state is represented as a natural number $`n`$, with the MPHF ensuring a 1:1 mapping between $`n`$ and its respective part state configuration.
|
|
10
|
+
|
|
11
|
+
### 1.1 Bijection Model
|
|
12
|
+
|
|
13
|
+
The core mapping is:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
n <--> Part State
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Each part declares its cardinality $`k`$, which defines the number of possible states it can occupy. The system ensures that every part maps deterministically to a unique number $`0 < n < k`$ within its cardinality range.
|
|
20
|
+
|
|
21
|
+
### 1.2 URL Path Encoding
|
|
22
|
+
|
|
23
|
+
Each full application state is encoded into a URL using variable-length base-64 segments. A typical path looks like:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
https://www.example.com/ghc3w_hi4-5g4w3/
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Each segment represents a portion of the application's state tree. Path segments can store \~1500 bits of entropy each, using the geometric series:
|
|
30
|
+
|
|
31
|
+
$$
|
|
32
|
+
k_{segment} = (64^{251} - 64)/63 ≈ 2^{1500}
|
|
33
|
+
$$
|
|
34
|
+
|
|
35
|
+
This provides extremely dense representation of state without relying on query parameters or local storage, making states sharable and deep-linkable by permanent URLs.
|
|
36
|
+
|
|
37
|
+
## 2. Part Model and State Composition
|
|
38
|
+
|
|
39
|
+
### 2.1 Mix and Match Parts
|
|
40
|
+
|
|
41
|
+
kireji models state as a recursive tree:
|
|
42
|
+
|
|
43
|
+
* `mix.core.parts` performs **multiplicative composition** (Cartesian product of independent subparts)
|
|
44
|
+
* `match.core.parts` performs **additive composition** (exclusive options / partitioning)
|
|
45
|
+
|
|
46
|
+
These two operations enable arbitrarily complex state spaces to be built from small, reusable parts.
|
|
47
|
+
|
|
48
|
+
### 2.2 Stateful Behavior
|
|
49
|
+
|
|
50
|
+
Each part reads and writes its state as an integer. This state is derived from the states of its subparts or from local input, and any mutation automatically updates its hash value.
|
|
51
|
+
|
|
52
|
+
Example mapping:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
https://two-digit.example.com/v123/0t
|
|
56
|
+
-> [domain: two-digit.example.com, version: 123, state: 94]
|
|
57
|
+
-> subpart mapping: [tensPlace.routeID = 9, onesPlace.routeID = 4]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## 3. State Propagation
|
|
61
|
+
|
|
62
|
+
kireji supports rootward and leafward propagation of state changes. Any state mutation in a subpart triggers a full recalculation of parent route identifiers up to the DNS root. This model ensures full consistency across nested part hierarchies.
|
|
63
|
+
|
|
64
|
+
The URL in the address bar always reflects the root part's state and is updated at throttled intervals (to align with browser frame rate limits and avoid DoS mitigation mechanisms).
|
|
65
|
+
|
|
66
|
+
## 4. Prototype Tree and Inheritance
|
|
67
|
+
|
|
68
|
+
Each domain maps to a runtime object (called a part), and subdomains define subparts. These parts follow a prototype-based inheritance model:
|
|
69
|
+
|
|
70
|
+
* Domains can extend other domains
|
|
71
|
+
* Behaviors and cardinalities are inherited or overridden
|
|
72
|
+
* The root prototype is `part.core.parts`
|
|
73
|
+
|
|
74
|
+
This system enables reuse and modularity while preserving static determinism.
|
|
75
|
+
|
|
76
|
+
## 5. Current DNS Integration Status
|
|
77
|
+
|
|
78
|
+
DNS-based behaviors are currently **modeled only**:
|
|
79
|
+
|
|
80
|
+
* TXT record fetching is implemented in a commented-out form
|
|
81
|
+
* No live production use of DNS records occurs yet
|
|
82
|
+
* This modeling forms the basis for future decentralized architecture
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Summary
|
|
87
|
+
|
|
88
|
+
kireji's architecture is defined by its emphasis on stateless, composable, mathematically rigorous component modeling. The hash function acts as the universal interface for state storage, navigation, and sharing, enabling a new paradigm for front-controlled applications without traditional backends.
|
|
89
|
+
|
|
90
|
+
For build engineers, architects, and researchers, kireji offers a reproducible and self-contained environment to explore scalable UI logic, compressed state modeling, and reactive full-stack design.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# kireji – Runtime Environment Model
|
|
2
|
+
|
|
3
|
+
This document provides an overview of the three runtime environments supported by kireji. It outlines how the framework maintains consistency, reactivity, and optimal performance across the entire stack - from build time to client interaction.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview of the Three Environments
|
|
8
|
+
|
|
9
|
+
kireji is designed to operate identically across three distinct environments:
|
|
10
|
+
|
|
11
|
+
1. **`server` (Creates a backend via Node.js)**
|
|
12
|
+
2. **`worker` (Creates a local backend via Service Worker)**
|
|
13
|
+
3. **`client` (Creates the GUI in a browser window)**
|
|
14
|
+
|
|
15
|
+
Each environment has unique responsibilities, but they all operate on the same static payload which bootstraps and renders hash-specific files identically across all three.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 1. `server`
|
|
20
|
+
|
|
21
|
+
### Responsibilities:
|
|
22
|
+
|
|
23
|
+
- **Execute unit tests at build time**
|
|
24
|
+
- **Static analysis of source files**
|
|
25
|
+
- **Hash tree construction and cardinality computation**
|
|
26
|
+
- **Inline and archive versioned part definitions into `/${version}.js`**
|
|
27
|
+
- **Respond to HTTP requests**
|
|
28
|
+
- **Render full HTML snapshots for any valid hash**
|
|
29
|
+
- **Serve the archived script**
|
|
30
|
+
|
|
31
|
+
### Features:
|
|
32
|
+
|
|
33
|
+
- Resolves the entire application structure into a single build artifact
|
|
34
|
+
- Serializes all parts into JavaScript literals
|
|
35
|
+
- Sets default application state to be rendered server-side
|
|
36
|
+
- Enables SEO by server-rendered HTML for any permalink
|
|
37
|
+
- Outputs CSS-inlined, DOM-complete pages for fast first paint
|
|
38
|
+
- Injects minimal bootstrap logic to register the service worker and transfer control to the client
|
|
39
|
+
- Stateless; only computes a single frame of the app based on URL state
|
|
40
|
+
- All logic is deterministic and derived from the hash tree
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 2. `worker`
|
|
45
|
+
|
|
46
|
+
### Responsibilities:
|
|
47
|
+
|
|
48
|
+
- **Controls all client-side network requests after installation**
|
|
49
|
+
- **Hydrates the static DOM rendered by the server**
|
|
50
|
+
|
|
51
|
+
### Features:
|
|
52
|
+
|
|
53
|
+
- Ensures full offline support
|
|
54
|
+
- Because all service workers are static and versioned, the app doesn't use network transactions
|
|
55
|
+
- Manages asset caching and updates using browser-native SW APIs
|
|
56
|
+
- Acts as the bridge between the server-rendered files and the client window
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 3. `client`
|
|
61
|
+
|
|
62
|
+
### Responsibilities:
|
|
63
|
+
|
|
64
|
+
- **Hydrates server renders and handles all DOM updates**
|
|
65
|
+
- **Listens for user interaction events** such as clicks, keypresses, and pointer movements
|
|
66
|
+
- **Reacts performantly to user input** by updating application state with minimal recomputation
|
|
67
|
+
- **Interprets the full application state**
|
|
68
|
+
|
|
69
|
+
### Features:
|
|
70
|
+
|
|
71
|
+
- Presents the final local application
|
|
72
|
+
- Manages user interaction, animations, and local rendering
|
|
73
|
+
- Encodes new state changes back into the URL without needing a backend
|
|
74
|
+
- Offers fast, smooth, and rich/stateful cross-origin navigation
|
|
75
|
+
- Seamless rendering hand-off with no flash-of-unstyled-content (FOUC) on hydration.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Shared Behavior Across Environments
|
|
80
|
+
|
|
81
|
+
- **Immutable State Roots**: All environments operate on the same root hash model
|
|
82
|
+
- **State Derivation**: Given a URL, all environments reconstruct the same system state
|
|
83
|
+
- **Hydration Logic**: Service worker and client window bootstrap from the static state encoded in the URL
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Summary
|
|
88
|
+
|
|
89
|
+
kireji achieves full-stack consistency by applying the same hash-based logic across three distinct environments. Each environment is stateless, reactive, and bound by a shared contract: the application's entire state must be fully described and derived from the URL alone. This approach eliminates backend dependency while enabling rich local state persistence and sharing, SEO, PWA functionality, real-time interaction and LTE version support.
|
package/docs/FUNDING.yml
ADDED
package/docs/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Eric Augustinowicz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# kireji: Entropy-Perfect Multi-Origin Web Applications
|
|
2
|
+
|
|
3
|
+
**kireji** is a web framework that maximally compresses data models using minimal perfect hash functions (MPHFs). It achieves the information-theoretic lower bound, creating the smallest possible collision-free, duplicate-free and gap-free hashes for arbitrary data.
|
|
4
|
+
|
|
5
|
+
Any group of applications powered by kireji can have its entire group state stored in a tight place - like a single URL or even a DNS TXT record. Model data is recovered instantly from a hash and vice-versa. This gives applications deterministic, lossless deep linking, state bookmarking, historical replay and peer-to-peer sharing (via simple URL sharing) without users interacting with a central server.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Entropy-Perfect Encoding
|
|
10
|
+
|
|
11
|
+
Each application state is assigned a unique variable-length base64 hash, derived from a bijective minimal perfect hash function. This makes them as compact and expressive as is mathematically possible.
|
|
12
|
+
|
|
13
|
+
kireji provides a compression solution that is uniquely built for the given data model and can represent every state in that model.
|
|
14
|
+
|
|
15
|
+
All kireji hashes are inherently integers (implemented using the `bigint` primative in JavaScript). Because the hash function has no gaps, no duplicates, and no collisions, it is not possible to achieve a smaller lossless hash of a given data model than this.
|
|
16
|
+
|
|
17
|
+
If there are 10,000,000,000,000,000,000,000,000,000,000,000,000,000,000 possible ways to populate your application's data model, then kireji produces a hash integer that is always between 0 and 9,999,999,999,999,999,999,999,999,999,999,999,999,999,999. kireji can then instantly hash any instance of the data model and instantly recover one from any integer in that range.
|
|
18
|
+
|
|
19
|
+
An example use-case of this is embedding rich state information in places with limited space, such as a URL or DNS TXT record, without the syntactical overhead of query parameters,JSON objects, or delimiters.
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
https://www.ejaugust.com/0.126.3/4lb5kAsH_R0Dv_UHg/
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## MVC + MPHF Architecture
|
|
26
|
+
|
|
27
|
+
kireji can also be used as a compelete front-end framework. Its minimal perfect hash function is highly reactive with a built-in event system. It instantly reflects per-component tweaks to a given model with an extensible model-view-controller (MVC) archetecture.
|
|
28
|
+
|
|
29
|
+
* Each controller is a stateful component (called a <strong>part</strong>) with its own cardinality.
|
|
30
|
+
* Parts assemble like LEGO® bricks, with a root part producing a hash representing its entire hierarchy.
|
|
31
|
+
* JavaScript's prototype chain enables compositional inheritance between parts.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## DNS-Based Namespacing
|
|
36
|
+
|
|
37
|
+
When used as a web application front-end framework, each part in a kireji model can be assigned a name that follows DNS semantics so that a web application's URL (such as [www.ejaugust.com](https://www.ejaugust.com)) can be quickly discerned from a runtime reference to one of its parts, such as:
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
_.app.kireji.www.editor.selected
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The root part is represented by `_` and is the only global object. This prevents poluting the global namespace and allows all parts to make absolute reference to eachother.
|
|
44
|
+
|
|
45
|
+
The framework stores its MVC abstracts and MPHF arithmetic under the domain name `"core.parts"`, allowing them to be reached like so:
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
_.parts.core
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
You can explore this organization in action by going to [www.kireji.app](https://www.kireji.app).
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Live Applications
|
|
56
|
+
|
|
57
|
+
kireji is in alpha. To see the technology in action, check on the kireji.app platform. This is a connected cross-origin app ecosystem that unites eight different web applications into a single state. That way, as users browse between applications, they applications have in-depth knowledge of eachother's state.
|
|
58
|
+
|
|
59
|
+
This is done completely without cookies, javascript storage APIs, user authentication, or uploading state information to a central server. As a consequence, these applications provide a permalink to every possible state they can be in. This enables robust debugging.
|
|
60
|
+
|
|
61
|
+
* [kireji.app](https://www.kireji.app) – an entropy and hash-space explorer for the platform
|
|
62
|
+
* [ejaugust.com](https://www.ejaugust.com) – a notebook-style blog about the platform
|
|
63
|
+
* [desktop.parts](https://www.desktop.parts) – a preview of a GUI-based OS experience
|
|
64
|
+
### Coming Soon
|
|
65
|
+
|
|
66
|
+
The following apps are not built yet, but their domain names and landing pages have been added to the platform:
|
|
67
|
+
* [core.parts](https://www.core.parts) – likely to become a web-based Universal IDE
|
|
68
|
+
* [user.parts](https://www.user.parts) – potential editor for software parts
|
|
69
|
+
* [glowstick.click](https://www.glowstick.click) – purpose TBD
|
|
70
|
+
* [kireji.io](https://www.kireji.io) – the future gamified UIDE
|
|
71
|
+
* [orenjinari.com](https://www.orenjinari.com) – example of an artist's portfolio
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Learn More
|
|
76
|
+
|
|
77
|
+
<!-- Looking ahead? See [FUTURE.md](FUTURE.md) for a deep dive into what's coming next.-->
|
|
78
|
+
Explore the technical background and ideas that shape the kireji platform:
|
|
79
|
+
|
|
80
|
+
* [Entropy-Perfect Encoding](https://www.ejaugust.com/0.126.4/4lb5kAh4PhZXOKxrM/) — on URL space, compression theory, and minimal perfect hash functions
|
|
81
|
+
* [The Charm](https://www.ejaugust.com/0.126.3/4lbxJ29P-vnXOKxrM/) — on measuring entropy and URL information density
|
|
82
|
+
* [Why DNS?](https://www.ejaugust.com/0.126.4/4lbHaxsKnzRXOKxrM/) — part namespacing and platform-wide coordination
|
|
83
|
+
<!--
|
|
84
|
+
* [The Multiverse and the Universal IDE](https://www.ejaugust.com/0.126.4/4lbeO3z_cmrXOKxrM/) — metaphors for self-rewriting environments
|
|
85
|
+
* [The Gamified Universal IDE](https://www.ejaugust.com/0.126.4/4lbofySVBqVXOKxrM/) — an aspirational vision of immersive development tools -->
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## **Technology Stack**
|
|
90
|
+
|
|
91
|
+
* **JavaScript (ECMAScript)**
|
|
92
|
+
* **CSS (Vanilla)**
|
|
93
|
+
* **HTML (W3C Standards)**
|
|
94
|
+
* **Service Workers for offline support**
|
|
95
|
+
* **Serverless-compatible HTML rendering**
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### **Zero Dependencies: A Simpler Equation**
|
|
100
|
+
|
|
101
|
+
kireji is written entirely with vanilla JavaScript, CSS, and HTML. No libraries, frameworks, or third-party packages are imported.
|
|
102
|
+
|
|
103
|
+
This choice was made to preserve full control over the performance of the hash function, align closely with web standards, reduce dependency resolution for applications using kireji, and to offer an opportunity to simplify the equation that defines the system's behavior.
|
|
104
|
+
|
|
105
|
+
By encoding its own components within its data model, kireji and its surrounding data model can be reasoned about end-to-end, as a self-contained and self-descriptive system.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## **Current Status**
|
|
110
|
+
[](https://www.repostatus.org/#alpha)
|
|
111
|
+
[](https://github.com/EJAugust/EJAugust)
|
|
112
|
+
[](https://github.com/EJAugust/EJAugust)
|
|
113
|
+
|
|
114
|
+
The following milestones completed:
|
|
115
|
+
|
|
116
|
+
* Core framework functionality
|
|
117
|
+
* CI/CD pipeline
|
|
118
|
+
* MPFH for stateless deep linking and data compression
|
|
119
|
+
* Reactive front-end framework via MVC + MPFH
|
|
120
|
+
* Domain-named archetecture ready for DNS integration
|
|
121
|
+
* In-platform part inspector
|
|
122
|
+
* Node.js server built-in
|
|
123
|
+
* Local debugging and development at localhost:3000
|
|
124
|
+
* Desktop operating system preview
|
|
125
|
+
* Ready-made stateful components with HTML and CSS, such as
|
|
126
|
+
- Scroller with custom scroll-bar implementation (more customizable than the native scrollbar)
|
|
127
|
+
- Color mode management that automatically computes shades from a given color pallete
|
|
128
|
+
- Additive parts for mutually exclusive variable assignments
|
|
129
|
+
- Multiplicative parts for independant variables
|
|
130
|
+
- Movie clip part for animating data models with a dedicated hash for every frame
|
|
131
|
+
- Notebook - a blog template
|
|
132
|
+
|
|
133
|
+
### **Roadmap**
|
|
134
|
+
|
|
135
|
+
| Phase | Status |
|
|
136
|
+
| ---------------------------------------- | ----------- |
|
|
137
|
+
| **Minimal Perfect Hashing For Any Data** | Completed |
|
|
138
|
+
| **Reacting MVC Framework** | Completed |
|
|
139
|
+
| **CI/CD Pipeline** | Completed |
|
|
140
|
+
| **Model LTS and Versioning Strategy** | Completed |
|
|
141
|
+
| **NPM Packages and Project Generation** | In Progress |
|
|
142
|
+
| **Debug Tools, Docs** | In Progress |
|
|
143
|
+
| **Operating System Concept** | In Progress |
|
|
144
|
+
| **Transfinite State Space** | Planned |
|
|
145
|
+
| **Advanced DNS Integration** | Planned |
|
|
146
|
+
| **Integrated Development Environment** | Planned |
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## **License and Attribution**
|
|
151
|
+
|
|
152
|
+
<sub>© 2013–2025 Eric Augustinowicz and Kristina Soriano. All Rights Reserved.</sub> <sub>This is a personal research project in active development. It's not production-ready. Please do not copy or redistribute this codebase or its methods. All content is considered prior art.</sub>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# kireji – Versioning and Long-Term Stability
|
|
2
|
+
|
|
3
|
+
This document outlines the versioning strategy used by kireji to maintain consistency across application states and ensure long-term permalink stability.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Why Versioning Matters in kireji
|
|
8
|
+
|
|
9
|
+
Unlike traditional applications that store state on the backend, kireji encodes all runtime state directly into the URL. This creates a permalink to any exact state but also a challenge: ensuring old links continue to work as the framework evolves.
|
|
10
|
+
|
|
11
|
+
To solve this, kireji provides a **semantic versioning model** for its core hash function and handles archiving and importing single-file JavaScript files that represent previous versions of the application. These previous versions can be curated by simply removing or adding these JS artifacts into the archive.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Semantic Versioning Scheme
|
|
16
|
+
|
|
17
|
+
The hash function that defines part behavior and layout is versioned using the standard **major.minor.patch** format:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
MAJOR.MINOR.PATCH
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
| Level | When to Increment |
|
|
24
|
+
| ----- | ------------------------------------------------------ |
|
|
25
|
+
| Major | Breaking change to existing state mappings |
|
|
26
|
+
| Minor | New routes added, existing links still work |
|
|
27
|
+
| Patch | Bugfixes, small adjustments, no impact on URL behavior |
|
|
28
|
+
|
|
29
|
+
### Example:
|
|
30
|
+
|
|
31
|
+
* `1.0.0`: First long-term stable version
|
|
32
|
+
* `1.1.0`: Adds new application without changing old routes
|
|
33
|
+
* `2.0.0`: Refactors match/mix behavior in a way that invalidates some previous URLs
|
|
34
|
+
|
|
35
|
+
Until version `1.0.0`, kireji is in **alpha** and the hash tree may change without stability guarantees.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 3. State Stability and Backward Compatibility
|
|
40
|
+
|
|
41
|
+
Each version of the hash tree can be treated as its own schema for URL encoding and decoding. kireji sets aside a small reserved namespace for routing to a specific version of the tree.
|
|
42
|
+
|
|
43
|
+
This allows developers to:
|
|
44
|
+
|
|
45
|
+
* Pin content to a specific version
|
|
46
|
+
* Maintain deep links in notes or docs
|
|
47
|
+
* Add new routes or applications without breaking old ones
|
|
48
|
+
|
|
49
|
+
Hashes can be translated across versions. This is achieved by allowing any previous version of the application to unpack a given hash into a serialized form that later versions can parse.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 4. Archived Versions
|
|
54
|
+
|
|
55
|
+
To preserve past behavior, all previously deployed versions of the hash tree are still available, archived and bundled according to their version number.
|
|
56
|
+
|
|
57
|
+
This ensures that even if the project evolves rapidly, any link shared generated in a previous version of the application can still reconstruct its corresponding UI state.
|
|
58
|
+
|
|
59
|
+
Archived versions include:
|
|
60
|
+
|
|
61
|
+
* A frozen copy of the MPHF tree
|
|
62
|
+
* Static copy of all content
|
|
63
|
+
* Git metadata to link back to that version's commit
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 5. Planned Stability Milestone
|
|
68
|
+
|
|
69
|
+
| Target Version | Purpose |
|
|
70
|
+
| -------------- | ------------------------------------------------ |
|
|
71
|
+
| `1.0.0` | First stable release with backward compatibility |
|
|
72
|
+
| `1.x.x` | Non-breaking extensions |
|
|
73
|
+
| `2.0.0` | First intentional breaking change |
|
|
74
|
+
|
|
75
|
+
Developers working with the alpha version 0.x.x should treat permalinks as non-durable while the deployment strategy matures.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 6. Automatic Versioning
|
|
80
|
+
|
|
81
|
+
kireji includes an **automatic versioning system** built into its local development environment. At build time, if the environment is detected as local, the framework allows the developer to specify change severity (major, minor, or patch) and the system automatically increments and outputs the appropriate next version number in the console at build time. This ensures consistent version tracking and LTE backwards compatibility testing during feature implementation.
|
|
82
|
+
|
|
83
|
+
## Summary
|
|
84
|
+
|
|
85
|
+
kireji treats the application state as a form of typed data and commits to preserving that data over time through semantic versioning. The versioning system ensures that every URL, once published, can remain a valid and functional entry point into the application—without requiring a database or server persistence.
|
|
86
|
+
|
|
87
|
+
As the framework matures, this commitment to permalink durability will allow users and developers to build confidently on top of a stable foundation.
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kireji",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "A web framework for stateful, entropy-perfect, multi-origin web applications. Currently in alpha. Expect breaking changes for version 0. Use with caution!",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "node test"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/kireji-app/kireji.git"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"dns",
|
|
16
|
+
"framework",
|
|
17
|
+
"web",
|
|
18
|
+
"frontend",
|
|
19
|
+
"state-machine",
|
|
20
|
+
"static",
|
|
21
|
+
"operating-system",
|
|
22
|
+
"routing-engine",
|
|
23
|
+
"perfect-hash",
|
|
24
|
+
"compression-algorithm",
|
|
25
|
+
"perfect-hashing",
|
|
26
|
+
"automatic-versioning",
|
|
27
|
+
"permalink-engine",
|
|
28
|
+
"multi-origin",
|
|
29
|
+
"minimal-perfect-hash-function",
|
|
30
|
+
"minimal",
|
|
31
|
+
"perfect",
|
|
32
|
+
"hash",
|
|
33
|
+
"function",
|
|
34
|
+
"state",
|
|
35
|
+
"model",
|
|
36
|
+
"hashing",
|
|
37
|
+
"url",
|
|
38
|
+
"encoding",
|
|
39
|
+
"decoding",
|
|
40
|
+
"tuple",
|
|
41
|
+
"choice",
|
|
42
|
+
"sum-type",
|
|
43
|
+
"product-type",
|
|
44
|
+
"disjoint-union",
|
|
45
|
+
"cartesian-product",
|
|
46
|
+
"structured-data",
|
|
47
|
+
"url-state",
|
|
48
|
+
"algebraic-data-types",
|
|
49
|
+
"radix",
|
|
50
|
+
"bitpacking",
|
|
51
|
+
"bigint"
|
|
52
|
+
],
|
|
53
|
+
"author": "Eric Augustinowicz",
|
|
54
|
+
"license": "MIT",
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://github.com/kireji-app/kireji/issues"
|
|
57
|
+
},
|
|
58
|
+
"homepage": "https://github.com/kireji-app/kireji#readme",
|
|
59
|
+
"types": "./src/index.d.ts",
|
|
60
|
+
"exports": {
|
|
61
|
+
".": {
|
|
62
|
+
"types": "./src/index.d.ts",
|
|
63
|
+
"default": "./src/index.js"
|
|
64
|
+
},
|
|
65
|
+
"./package.json": "./package.json",
|
|
66
|
+
"./LICENSE.md": "./docs/LICENSE.md",
|
|
67
|
+
"./README.md": "./docs/README.md"
|
|
68
|
+
}
|
|
69
|
+
}
|
package/src/index.d.ts
ADDED
package/test.js
ADDED