@betanyc/nyc-charter-laws-rules 0.1.3 → 0.2.0
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/README.md +40 -3
- package/data/index/json/admin_code.json +352 -16
- package/data/index/json/rules.json +104 -6
- package/data/index/json/versions.json +6 -6
- package/data/index/markdown/admin_code.md +401 -17
- package/data/index/markdown/rules.md +119 -7
- package/dist/index.js +3 -190
- package/dist/index.js.map +1 -1
- package/dist/tools.d.ts +118 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +210 -0
- package/dist/tools.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -144,6 +144,7 @@ npm test
|
|
|
144
144
|
| `test/content-leak.test.js` | Regression tests for the content-leak fix (PR-A0): undecoded ` ` nbsp entities, `[ALP S-xxx]` editorial markers, and leading-digit run-ons (`1Each`). Includes scope guards confirming the subdivision-letter nit (`(6)the`) is left untouched. |
|
|
145
145
|
| `test/corpus-invariants.test.js` | Invariant assertions over the committed `data/index/json/*.json` (all 22,079 sections across charter, admin\_code, and rules). Asserts: no run-together text, no leaked XML tags, no undecoded entities, no double spaces, no leading/trailing whitespace, and structural integrity against `versions.json` counts. Collects all violations before asserting, with corpus/id/citation/snippet in the failure message. |
|
|
146
146
|
| `test/mcp-tools.test.js` | In-process tests for the MCP handler functions (`searchCorpus`, `getSection`, `listTitles`, `getTitle`, `getVersions`) imported from `dist/corpus.js`. Grounded in real index data: verifies § 292 text content (the issue-#3 corrected phrase), negative lookups, version presence, and title listing. |
|
|
147
|
+
| `test/strict-schema.test.js` | Strict tool schemas (issue #19). Asserts every tool in `TOOLS` (from `dist/tools.js`) advertises `additionalProperties: false`, and that `callTool()` rejects an undeclared parameter with an error naming both the offending key and that tool's accepted keys — rather than silently dropping it and returning unfiltered results. Includes regression guards that valid calls, with and without optional params, still succeed. |
|
|
147
148
|
| `test/build-smoke.test.js` | Build pipeline smoke test (Layer 5a). Feeds tiny hand-authored AML-shaped XML fixtures to the pure builder `buildSectionsFromXml` in `scripts/lib/build-corpus.js` — no multi-MB ZIPs. Asserts correct section shape, citation derivation (`Section 292.` → `§ 292`), clean text (no tags/entities/edge whitespace), document-order LINK extraction, and that non-qualifying records (wrong style-name, too-short heading) are filtered out. |
|
|
148
149
|
|
|
149
150
|
### Differential test (Layer 4 — occasional cadence)
|
|
@@ -410,13 +411,13 @@ The complete, dated record of **every index rebuild** lives in **[CHANGELOG.md](
|
|
|
410
411
|
The block below is stamped automatically with the most recent rebuild every time `npm run update-changelog` runs — see [CHANGELOG.md](CHANGELOG.md) for the full history.
|
|
411
412
|
|
|
412
413
|
<!-- LATEST_INDEX_UPDATE:START -->
|
|
413
|
-
**Last index update:** 2026-07-
|
|
414
|
+
**Last index update:** 2026-07-16 — ⬆️ Updated
|
|
414
415
|
|
|
415
416
|
| Corpus | Current through | Sections |
|
|
416
417
|
|---|---|---|
|
|
417
418
|
| NYC Charter | Current through Local Law 2026/112, enacted June 19, 2026, | 854 |
|
|
418
|
-
| NYC Administrative Code | Current through Local Law 2026/
|
|
419
|
-
| Rules of the City of New York | Current through rules effective July
|
|
419
|
+
| NYC Administrative Code | Current through Local Law 2026/116, enacted July 11, 2026, | 12,635 |
|
|
420
|
+
| Rules of the City of New York | Current through rules effective July 14, 2026. | 8,685 |
|
|
420
421
|
<!-- LATEST_INDEX_UPDATE:END -->
|
|
421
422
|
|
|
422
423
|
### Release history
|
|
@@ -427,6 +428,42 @@ Package version history (distinct from the per-rebuild record in CHANGELOG.md):
|
|
|
427
428
|
- **0.1.1:** Initial published release with full JSON and Markdown indexes committed to repo.
|
|
428
429
|
- **0.1.0:** Initial release.
|
|
429
430
|
|
|
431
|
+
## About BetaNYC
|
|
432
|
+
|
|
433
|
+
This project is built and maintained by [BetaNYC](https://beta.nyc), New York's
|
|
434
|
+
civic technology and open-data community. We work to improve lives in New York
|
|
435
|
+
through civic design, technology, data, and public-interest technology.
|
|
436
|
+
|
|
437
|
+
**Come do civic tech with us.** We run public events, meetups, and hands-on
|
|
438
|
+
data classes throughout the year — including [NYC School of Data](https://www.schoolofdata.nyc/)
|
|
439
|
+
and [CityCamp NYC](https://citycamp.nyc), and we host frequent civic-tech gatherings. See what's coming up on our
|
|
440
|
+
[events calendar](https://www.beta.nyc/events/).
|
|
441
|
+
|
|
442
|
+
**Sustain this work.** These MCP servers are free and open source. To help keep this work going and find BetaNYC's
|
|
443
|
+
tools, please consider [donating and becoming a Beta
|
|
444
|
+
Builder](https://beta.nyc/donate).
|
|
445
|
+
|
|
446
|
+
## Building on this? Tell us!
|
|
447
|
+
|
|
448
|
+
If you build something with this project, we'd love to hear about it. We can help other New Yorkers find it. BetaNYC publishes a weekly newsletter,
|
|
449
|
+
*This Week in NYC's Civic Technology and Open Data*.
|
|
450
|
+
|
|
451
|
+
- **[Subscribe to the newsletter](https://beta.nyc/newsletter)** to keep up with
|
|
452
|
+
NYC civic tech, open data, and public-interest technology.
|
|
453
|
+
- **Built something, or found a story worth sharing?** [Submit a link for the
|
|
454
|
+
newsletter](https://www.beta.nyc/newsletter-inbox/) and we'll consider it for
|
|
455
|
+
an upcoming issue.
|
|
456
|
+
|
|
457
|
+
## Related BetaNYC MCP servers
|
|
458
|
+
|
|
459
|
+
BetaNYC maintains a suite of open-source MCP servers for NYC and NYS civic data.
|
|
460
|
+
See the full directory, with install details for each, at
|
|
461
|
+
**[beta.nyc/ai-tools](https://beta.nyc/ai-tools)**.
|
|
462
|
+
|
|
463
|
+
This server pairs directly with:
|
|
464
|
+
|
|
465
|
+
- **[nyc-council-mcp](https://github.com/BetaNYC/nyc-council-mcp)**: see the Council legislation, sponsors, votes, and hearings that create and amend the Code.
|
|
466
|
+
|
|
430
467
|
---
|
|
431
468
|
|
|
432
469
|
## Contributing
|