dsh-file-identity
August 13, 2026 · View on GitHub
DeepSeek Harness 个人适配声明(Personal Adaptation Notice)
本项目是 DeepSeek Harness 的个人适配产物(personal adaptation),并非 DeepSeek Harness 官方文件(not an official DeepSeek Harness file),随附功能、使用说明与个人产物(bundled with features, documentation, and personal artifacts),可与 DeepSeek Harness 搭配使用,也可独立使用。
This project is a personal adaptation for DeepSeek Harness, and is NOT an official DeepSeek Harness file, bundled with features, documentation, and personal artifacts. It can be used alongside DeepSeek Harness or standalone.
作者 / Author: h565656445
合作 / Collaboration: 如有项目可以一起合作,欢迎联系。微信:wohaishihenshuaide。If you have projects, let's collaborate. WeChat: wohaishihenshuaide.
用途 / What this is for
文件身份模块:用哈希指纹与内容寻址给文件建立稳定身份,用于证据与快照核验。
File identity module: stable file identities via hash fingerprints and content addressing.
Hermes File Identity / Hermes 文件身份
基于 Win32 句柄的文件身份原语:HermesFileIdentity.psm1 通过 GetFinalPathNameByHandleW 解析句柄最终路径,在遍历父路径时拒绝重解析点(junction/symlink)逃逸,供安全读取、绑定校验与稳定文件访问使用。
Win32-handle-based file identity primitives: HermesFileIdentity.psm1 resolves the final path of an open handle via GetFinalPathNameByHandleW and refuses reparse-point (junction/symlink) escape while walking parent paths, for safe reads, binding checks, and stable file access.
Features / 功能
- 原生身份:kernel32
GetFinalPathNameByHandleW解析最终路径 / Native final-path resolution via GetFinalPathNameByHandleW - 反逃逸:遍历父路径时拒绝 ReparsePoint / Refuses reparse-point traversal
- 设备路径转换:
ConvertFrom-HermesDevicePath规范化设备路径 / Device-path normalization - 句柄绑定校验:
Assert-HermesFileHandlePath断言句柄与期望路径一致 / Handle-to-path binding assertion
What's inside / 目录结构
dsh-file-identity/
├── README.md
├── LICENSE
├── src/HermesFileIdentity.psm1
└── .dsh/
Quick start / 快速开始
Import-Module .\src\HermesFileIdentity.psm1 -Force
$expected = (Resolve-Path '.\data.json').Path
$stream = [IO.File]::Open('.\data.json', [IO.FileMode]::Open, [IO.FileAccess]::Read, [IO.FileShare]::Read)
Assert-HermesFileHandlePath -Handle $stream.SafeFileHandle -ExpectedPath $expected -Label 'data'
$stream.Dispose()
DeepSeek Harness 衍生 / DSH Derivative
本项目附带 DeepSeek Harness 衍生包,位于 .dsh/ 目录:
preset.yml— Agent 预设元数据agent.cordis.yml— Cordis 组装(基于 standard 预设,persona 已定制)skills/dsh-file-identity/SKILL.md— 项目专属技能(skill)
安装与接入方式见 .dsh/README.md(双语)。
License / 许可证
相关项目 / Related Projects
这是 DeepSeek Harness 个人适配系列(共 31 个仓库)的完整导航。 / This is the complete navigation for the DeepSeek Harness personal-adaptation series (31 repos).
Agent OS 内核 / Kernel
dsh-agent-os-runtime · dsh-agent-os-planning · dsh-agent-os-scheduler · dsh-agent-os-worker-protocol · dsh-agent-os-observability · dsh-agent-os-specs
Harness 基础设施 / Infrastructure
dsh-harness-core · dsh-graph-entry · dsh-async-job · dsh-file-identity(本仓库 / this repo) · dsh-json-projection · dsh-manual-approval · dsh-observation-writer · dsh-provider-control · dsh-schema-negotiator · dsh-upgrade-governance
规格与文档 / Specs & Docs
dsh-harness-specs · dsh-novel-specs · dsh-architecture-guide · dsh-powershell-patterns · dsh-json-schema-driven-dev · dsh-llm-agent-harness-guide
适配器 / Adapters
dsh-short-story-engine · dsh-tutorial-video-state-machine · dsh-governance-kernel · dsh-sports-pipeline · dsh-motion-grammar
DSH 总集成 / Integration
dsh-integration · dsh-presets-pack · dsh-skills-pack · dsh-starter-kit