-
Notifications
You must be signed in to change notification settings - Fork 0
feat: harden filesystem edits and release controls #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: npm | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| day: monday | ||
| open-pull-requests-limit: 5 | ||
| - package-ecosystem: github-actions | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| day: monday | ||
| open-pull-requests-limit: 5 |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| name: CodeQL | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| schedule: | ||
| - cron: "23 4 * * 1" | ||
|
|
||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: CodeQL / JavaScript-TypeScript | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: github/codeql-action/init@v3 | ||
| with: | ||
| languages: javascript-typescript | ||
| - uses: github/codeql-action/autobuild@v3 | ||
| - uses: github/codeql-action/analyze@v3 |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| dist/test/ | ||
| test/ | ||
| .env | ||
| .env.* | ||
| auth.json | ||
| credentials* |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2026 T50 Systems | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Security policy | ||
|
|
||
| ## Supported versions | ||
|
|
||
| | Version | Supported | | ||
| |---|---| | ||
| | 0.1.x | Yes | | ||
| | Earlier or unreleased snapshots | No | | ||
|
|
||
| Security fixes are released as new immutable patch versions. Support may move to the newest minor release after an announcement in the changelog and GitHub release notes. | ||
|
|
||
| ## Private reporting | ||
|
|
||
| Use [GitHub private vulnerability reporting](https://github.com/T50-Systems/pi-anchor-edit-core/security/advisories/new). Do not open a public issue for a suspected vulnerability. If GitHub does not present a private report form, contact a T50 Systems maintainer privately through the organization’s established contact channel and include only enough metadata to arrange a secure transfer; do not fall back to a public issue. | ||
|
|
||
| Never include credentials, access tokens, secrets, customer data, private source files, complete edited file contents, or stale-anchor diagnostic excerpts in a public issue, discussion, pull request, benchmark, or log. A safe initial report states the affected version, operating system, Node version, error prefix, and a minimal synthetic reproduction. Maintainers will request sensitive evidence through the private advisory. | ||
|
|
||
| We aim to acknowledge a private report within 3 business days, provide an initial severity/triage decision within 7 business days, and send status updates at least every 14 days until remediation or closure. Coordinated disclosure timing is agreed with the reporter after a fix and supported release are ready. | ||
|
|
||
| ## Trust boundary | ||
|
|
||
| `pi-anchor-edit-core` reads and mutates caller-selected local paths. The caller is responsible for authorization, path selection, backups, and preventing untrusted users from choosing sensitive targets. The filesystem adapter rejects symbolic links, special files, directories, images, binary/null-byte content, and invalid UTF-8 rewrites; it does not create a sandbox or establish that a path is safe to edit. | ||
|
|
||
| Anchor diagnostics can quote nearby file content in `>>> LINE#HASH:content` retry lines. Treat all diagnostics as potentially sensitive. Redact or replace them with synthetic examples before sharing, and never send raw diagnostics to telemetry by default. | ||
|
|
||
| See [`docs/OPERATIONS.md`](docs/OPERATIONS.md) for safe recovery actions and [`docs/RELEASING.md`](docs/RELEASING.md) for immutable release recovery. | ||
|
|
||
| ## Dependency and scanning maintenance | ||
|
|
||
| Dependabot checks npm and GitHub Actions dependencies weekly. CodeQL scans pushes, pull requests, and a weekly schedule. The maintainer responsible for the next release reviews high-severity `npm audit`, Dependabot, and code-scanning findings at least weekly and before every release. Security-related dependency updates use the normal reviewed pull-request and required-check path; emergency fixes do not bypass validation. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| export type LoadedFile = { | ||
| kind: 'directory'; | ||
| } | { | ||
| kind: 'symlink'; | ||
| } | { | ||
| kind: 'image'; | ||
| mimeType: string; | ||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| import type { EditParams, PiClient, ReadParams } from './types.js'; | ||
| export declare class FilesystemPiClient implements PiClient { | ||
| protected replaceTemporaryFile(temporaryPath: string, destinationPath: string): Promise<void>; | ||
| private atomicWrite; | ||
| read({ path, offset, limit }: ReadParams): Promise<string>; | ||
| edit({ path, edits }: EditParams): Promise<string>; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In
.github/workflows/release.yml, this job is triggered by any pushedv*tag and reachesgh release createwithout verifying thatGITHUB_SHAis an ancestor oforigin/main. If someone with tag-push rights tags an unmerged branch or local commit whose package version matches the tag, the workflow will still publish a GitHub release, bypassing the documented reviewed-main release path; add an explicit fetch/merge-base --is-ancestorcheck before creating the release.Useful? React with 👍 / 👎.