hindsight-pg0-configurable 0.1.0__tar.gz

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.
Files changed (21) hide show
  1. hindsight_pg0_configurable-0.1.0/.gitignore +7 -0
  2. hindsight_pg0_configurable-0.1.0/LICENSE +21 -0
  3. hindsight_pg0_configurable-0.1.0/PKG-INFO +174 -0
  4. hindsight_pg0_configurable-0.1.0/README.md +147 -0
  5. hindsight_pg0_configurable-0.1.0/THIRD_PARTY_NOTICES.md +24 -0
  6. hindsight_pg0_configurable-0.1.0/licenses/PostgreSQL.txt +23 -0
  7. hindsight_pg0_configurable-0.1.0/licenses/Theseus.txt +7 -0
  8. hindsight_pg0_configurable-0.1.0/licenses/pgvector.txt +20 -0
  9. hindsight_pg0_configurable-0.1.0/pyproject.toml +52 -0
  10. hindsight_pg0_configurable-0.1.0/scripts/fetch_bundles.py +45 -0
  11. hindsight_pg0_configurable-0.1.0/src/hindsight_pg0_configurable/__init__.py +3 -0
  12. hindsight_pg0_configurable-0.1.0/src/hindsight_pg0_configurable/__main__.py +4 -0
  13. hindsight_pg0_configurable-0.1.0/src/hindsight_pg0_configurable/bundle.py +132 -0
  14. hindsight_pg0_configurable-0.1.0/src/hindsight_pg0_configurable/cli.py +121 -0
  15. hindsight_pg0_configurable-0.1.0/src/hindsight_pg0_configurable/config.py +90 -0
  16. hindsight_pg0_configurable-0.1.0/src/hindsight_pg0_configurable/data/bundles.json +19 -0
  17. hindsight_pg0_configurable-0.1.0/src/hindsight_pg0_configurable/data/pgvector-x86_64-pc-windows-msvc-pg18.tar.gz +0 -0
  18. hindsight_pg0_configurable-0.1.0/src/hindsight_pg0_configurable/data/postgresql-18.1.0-x86_64-pc-windows-msvc.zip +4 -0
  19. hindsight_pg0_configurable-0.1.0/src/hindsight_pg0_configurable/postgres.py +294 -0
  20. hindsight_pg0_configurable-0.1.0/tests/test_launcher.py +282 -0
  21. hindsight_pg0_configurable-0.1.0/tests/test_native_integration.py +43 -0
@@ -0,0 +1,7 @@
1
+ .venv/
2
+ .pytest_cache/
3
+ .ruff_cache/
4
+ __pycache__/
5
+ dist/
6
+ src/hindsight_pg0_configurable/data/*.zip
7
+ src/hindsight_pg0_configurable/data/*.tar.gz
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dark Light
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.
@@ -0,0 +1,174 @@
1
+ Metadata-Version: 2.5
2
+ Name: hindsight-pg0-configurable
3
+ Version: 0.1.0
4
+ Summary: Configurable native PostgreSQL and pgvector launcher for Hindsight on Windows
5
+ Author: Dark Light
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ License-File: THIRD_PARTY_NOTICES.md
9
+ License-File: licenses/PostgreSQL.txt
10
+ License-File: licenses/Theseus.txt
11
+ License-File: licenses/pgvector.txt
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Operating System :: Microsoft :: Windows
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Database :: Database Engines/Servers
19
+ Requires-Python: >=3.11
20
+ Requires-Dist: filelock<4,>=3.20.1
21
+ Requires-Dist: python-dotenv<2,>=1.2.1
22
+ Provides-Extra: full
23
+ Requires-Dist: hindsight-api<2,>=1.0.0; extra == 'full'
24
+ Provides-Extra: slim
25
+ Requires-Dist: hindsight-api-slim<2,>=1.0.0; extra == 'slim'
26
+ Description-Content-Type: text/markdown
27
+
28
+ # hindsight-pg0-configurable
29
+
30
+ Run Hindsight with PostgreSQL and pgvector in an explicitly configured native
31
+ installation directory. Database data, credentials, locks and logs live in a
32
+ separate writable state directory. Intended for native Windows x86-64 setups
33
+ where application-control policy prohibits executing PostgreSQL from a user
34
+ profile. No Docker, service registration, symbolic links or runtime downloads.
35
+
36
+ **Initial alpha release. The Python launcher and Windows archive layout are
37
+ checked on macOS; execution of these binaries under Windows and any corporate
38
+ policy is not yet validated.** This package does not grant execution rights.
39
+ The selected executable directory and its EXE/DLL files must be permitted by IT.
40
+
41
+ This is an independent launcher, not an official Hindsight or pg0 release. It
42
+ does not replace the `pg0` Python module or satisfy a dependency named
43
+ `pg0-embedded`. It uses Hindsight's supported `HINDSIGHT_API_DATABASE_URL`
44
+ setting, so an installed original pg0 package can coexist without being used
45
+ by this launcher. Launch through this package, rather than `hindsight-api`.
46
+
47
+ ## Install through PyPI or your Artifactory PyPI proxy
48
+
49
+ Use Python 3.11 or newer and the same Python environment for all commands:
50
+
51
+ ```powershell
52
+ python -m pip install "hindsight-pg0-configurable[full]==0.1.0"
53
+ ```
54
+
55
+ For a slim Hindsight installation, use `[slim]` instead of `[full]`; configure
56
+ your embedding and reranking providers as required by Hindsight. If Hindsight
57
+ is already installed in this environment, the base package is sufficient:
58
+
59
+ ```powershell
60
+ python -m pip install hindsight-pg0-configurable==0.1.0
61
+ ```
62
+
63
+ The optional extras accept Hindsight 1.x. Actual availability of Hindsight's
64
+ transitive dependencies depends on your Artifactory mirror and Python version.
65
+ The launcher does not configure or download LLMs or embedding models.
66
+
67
+ ## Prepare PostgreSQL once
68
+
69
+ Replace the example executable path with the directory approved by your IT.
70
+ The installation root will contain `bin`, `lib`, and `share`. Preparation needs
71
+ write access to the destination's parent directory; a destination may be absent
72
+ or empty. A populated directory is never overwritten. An IT operator may
73
+ prepare the directory and subsequently grant normal users read/execute access.
74
+
75
+ ```powershell
76
+ $env:HINDSIGHT_PG_INSTALLATION_DIR = 'C:\Program Files\Firma\Hindsight\PostgreSQL-18.1'
77
+ python -m hindsight_pg0_configurable prepare
78
+ ```
79
+
80
+ The wheel and source distribution already contain PostgreSQL 18.1.0 and
81
+ pgvector 0.8.5 Windows archives, the same versions used by pg0-embedded 0.15.2.
82
+ Preparation checks their pinned SHA-256 digests and copies real files into the
83
+ requested location. It does not execute the archives' contents. Runtime startup
84
+ only reads this native installation and does not unpack or update it.
85
+
86
+ Alternatively provision a compatible PostgreSQL installation with pgvector
87
+ through IT and point the launcher at its installation root; `prepare` is then
88
+ unnecessary. `prepare` bundles Windows x86-64 only. An explicitly supplied
89
+ native installation also permits development checks on other operating systems.
90
+
91
+ ## Configure and run Hindsight
92
+
93
+ Set these variables in every new terminal or persist them in your approved
94
+ launcher configuration. No registry changes are made by this package.
95
+
96
+ ```powershell
97
+ $env:HINDSIGHT_PG_INSTALLATION_DIR = 'C:\Program Files\Firma\Hindsight\PostgreSQL-18.1'
98
+ $env:HINDSIGHT_PG_STATE_DIR = "$env:LOCALAPPDATA\Firma\HindsightPg0"
99
+
100
+ # Add your normal HINDSIGHT_API_LLM_* / embeddings / reranker configuration.
101
+ python -m hindsight_pg0_configurable run
102
+ ```
103
+
104
+ Pass ordinary Hindsight foreground options after `--`, for example:
105
+
106
+ ```powershell
107
+ python -m hindsight_pg0_configurable run -- --host 127.0.0.1 --port 8888
108
+ ```
109
+
110
+ The launcher initializes a dedicated cluster on first start, binds PostgreSQL
111
+ to `127.0.0.1:55439`, creates the database and enables pgvector, and supplies
112
+ Hindsight's database URL. SCRAM authentication uses a generated password.
113
+ Hindsight still requires your normal provider settings. The original
114
+ `hindsight-api` command does not automatically adopt this configuration.
115
+
116
+ Provider settings in a discovered `.env` are loaded first. The launcher then
117
+ sets its own database URL and disables further dotenv reloads for the process
118
+ and its workers. Existing read-replica and migration URL overrides are cleared
119
+ for this dedicated local cluster. A stale `.env` therefore cannot switch it
120
+ back to the original embedded pg0 or another database.
121
+
122
+ The cluster started by `run` stops when foreground Hindsight exits normally.
123
+ A cluster already running before `run` is borrowed and remains running.
124
+ `--daemon` is unsupported. An abrupt process kill can leave PostgreSQL running;
125
+ use `status` and `stop` to manage this dedicated instance.
126
+
127
+ ```powershell
128
+ python -m hindsight_pg0_configurable status
129
+ python -m hindsight_pg0_configurable start
130
+ python -m hindsight_pg0_configurable stop
131
+ ```
132
+
133
+ | Variable | Default / meaning |
134
+ | --- | --- |
135
+ | `HINDSIGHT_PG_INSTALLATION_DIR` | Required absolute native installation root |
136
+ | `HINDSIGHT_PG_STATE_DIR` | `%LOCALAPPDATA%\HindsightPg0` on Windows |
137
+ | `HINDSIGHT_PG_NAME` | `hindsight`; dedicated instance subdirectory |
138
+ | `HINDSIGHT_PG_PORT` | `55439`; explicit port, no automatic switching |
139
+ | `HINDSIGHT_PG_USERNAME` | `hindsight`; initial cluster owner |
140
+ | `HINDSIGHT_PG_DATABASE` | `hindsight` |
141
+ | `HINDSIGHT_PG_PASSWORD` | Optional initial password; otherwise generated |
142
+
143
+ The state directory stores the password in `<name>\manager.json` and must
144
+ remain private to the user. POSIX state files use mode 0600; Windows uses the
145
+ directory's inherited ACLs. Public status output excludes passwords and URLs.
146
+ This package never deletes clusters or imports existing pg0 data. A nonempty
147
+ unmanaged data directory is refused. Existing instance settings must remain
148
+ unchanged across restarts; choose another instance name for a separate setup.
149
+
150
+ For a new PostgreSQL or pgvector release, prepare a new installation directory
151
+ and plan any required database migration separately. Upgrading this Python
152
+ package alone does not modify installed native files or existing databases.
153
+
154
+ ## Build and release
155
+
156
+ ```sh
157
+ python scripts/fetch_bundles.py
158
+ uv sync --group dev
159
+ uv run pytest
160
+ uv run ruff check .
161
+ uv run ruff format --check .
162
+ uv build
163
+ uv run twine check dist/*
164
+ ```
165
+
166
+ `scripts/fetch_bundles.py` downloads only the pinned upstream release archives,
167
+ verifies their hashes and adds them to the distribution data directory. The
168
+ archives are not versioned in Git. Both wheel and sdist must contain them;
169
+ inspect built distributions before publication. Publishing uses a PyPI API token
170
+ from the environment, never from this repository.
171
+
172
+ Sources: [Hindsight configuration](https://hindsight.vectorize.io/developer/configuration),
173
+ [pg0 0.15.2 versions](https://github.com/vectorize-io/pg0/blob/v0.15.2/versions.env),
174
+ [PostgreSQL pg_ctl](https://www.postgresql.org/docs/current/app-pg-ctl.html).
@@ -0,0 +1,147 @@
1
+ # hindsight-pg0-configurable
2
+
3
+ Run Hindsight with PostgreSQL and pgvector in an explicitly configured native
4
+ installation directory. Database data, credentials, locks and logs live in a
5
+ separate writable state directory. Intended for native Windows x86-64 setups
6
+ where application-control policy prohibits executing PostgreSQL from a user
7
+ profile. No Docker, service registration, symbolic links or runtime downloads.
8
+
9
+ **Initial alpha release. The Python launcher and Windows archive layout are
10
+ checked on macOS; execution of these binaries under Windows and any corporate
11
+ policy is not yet validated.** This package does not grant execution rights.
12
+ The selected executable directory and its EXE/DLL files must be permitted by IT.
13
+
14
+ This is an independent launcher, not an official Hindsight or pg0 release. It
15
+ does not replace the `pg0` Python module or satisfy a dependency named
16
+ `pg0-embedded`. It uses Hindsight's supported `HINDSIGHT_API_DATABASE_URL`
17
+ setting, so an installed original pg0 package can coexist without being used
18
+ by this launcher. Launch through this package, rather than `hindsight-api`.
19
+
20
+ ## Install through PyPI or your Artifactory PyPI proxy
21
+
22
+ Use Python 3.11 or newer and the same Python environment for all commands:
23
+
24
+ ```powershell
25
+ python -m pip install "hindsight-pg0-configurable[full]==0.1.0"
26
+ ```
27
+
28
+ For a slim Hindsight installation, use `[slim]` instead of `[full]`; configure
29
+ your embedding and reranking providers as required by Hindsight. If Hindsight
30
+ is already installed in this environment, the base package is sufficient:
31
+
32
+ ```powershell
33
+ python -m pip install hindsight-pg0-configurable==0.1.0
34
+ ```
35
+
36
+ The optional extras accept Hindsight 1.x. Actual availability of Hindsight's
37
+ transitive dependencies depends on your Artifactory mirror and Python version.
38
+ The launcher does not configure or download LLMs or embedding models.
39
+
40
+ ## Prepare PostgreSQL once
41
+
42
+ Replace the example executable path with the directory approved by your IT.
43
+ The installation root will contain `bin`, `lib`, and `share`. Preparation needs
44
+ write access to the destination's parent directory; a destination may be absent
45
+ or empty. A populated directory is never overwritten. An IT operator may
46
+ prepare the directory and subsequently grant normal users read/execute access.
47
+
48
+ ```powershell
49
+ $env:HINDSIGHT_PG_INSTALLATION_DIR = 'C:\Program Files\Firma\Hindsight\PostgreSQL-18.1'
50
+ python -m hindsight_pg0_configurable prepare
51
+ ```
52
+
53
+ The wheel and source distribution already contain PostgreSQL 18.1.0 and
54
+ pgvector 0.8.5 Windows archives, the same versions used by pg0-embedded 0.15.2.
55
+ Preparation checks their pinned SHA-256 digests and copies real files into the
56
+ requested location. It does not execute the archives' contents. Runtime startup
57
+ only reads this native installation and does not unpack or update it.
58
+
59
+ Alternatively provision a compatible PostgreSQL installation with pgvector
60
+ through IT and point the launcher at its installation root; `prepare` is then
61
+ unnecessary. `prepare` bundles Windows x86-64 only. An explicitly supplied
62
+ native installation also permits development checks on other operating systems.
63
+
64
+ ## Configure and run Hindsight
65
+
66
+ Set these variables in every new terminal or persist them in your approved
67
+ launcher configuration. No registry changes are made by this package.
68
+
69
+ ```powershell
70
+ $env:HINDSIGHT_PG_INSTALLATION_DIR = 'C:\Program Files\Firma\Hindsight\PostgreSQL-18.1'
71
+ $env:HINDSIGHT_PG_STATE_DIR = "$env:LOCALAPPDATA\Firma\HindsightPg0"
72
+
73
+ # Add your normal HINDSIGHT_API_LLM_* / embeddings / reranker configuration.
74
+ python -m hindsight_pg0_configurable run
75
+ ```
76
+
77
+ Pass ordinary Hindsight foreground options after `--`, for example:
78
+
79
+ ```powershell
80
+ python -m hindsight_pg0_configurable run -- --host 127.0.0.1 --port 8888
81
+ ```
82
+
83
+ The launcher initializes a dedicated cluster on first start, binds PostgreSQL
84
+ to `127.0.0.1:55439`, creates the database and enables pgvector, and supplies
85
+ Hindsight's database URL. SCRAM authentication uses a generated password.
86
+ Hindsight still requires your normal provider settings. The original
87
+ `hindsight-api` command does not automatically adopt this configuration.
88
+
89
+ Provider settings in a discovered `.env` are loaded first. The launcher then
90
+ sets its own database URL and disables further dotenv reloads for the process
91
+ and its workers. Existing read-replica and migration URL overrides are cleared
92
+ for this dedicated local cluster. A stale `.env` therefore cannot switch it
93
+ back to the original embedded pg0 or another database.
94
+
95
+ The cluster started by `run` stops when foreground Hindsight exits normally.
96
+ A cluster already running before `run` is borrowed and remains running.
97
+ `--daemon` is unsupported. An abrupt process kill can leave PostgreSQL running;
98
+ use `status` and `stop` to manage this dedicated instance.
99
+
100
+ ```powershell
101
+ python -m hindsight_pg0_configurable status
102
+ python -m hindsight_pg0_configurable start
103
+ python -m hindsight_pg0_configurable stop
104
+ ```
105
+
106
+ | Variable | Default / meaning |
107
+ | --- | --- |
108
+ | `HINDSIGHT_PG_INSTALLATION_DIR` | Required absolute native installation root |
109
+ | `HINDSIGHT_PG_STATE_DIR` | `%LOCALAPPDATA%\HindsightPg0` on Windows |
110
+ | `HINDSIGHT_PG_NAME` | `hindsight`; dedicated instance subdirectory |
111
+ | `HINDSIGHT_PG_PORT` | `55439`; explicit port, no automatic switching |
112
+ | `HINDSIGHT_PG_USERNAME` | `hindsight`; initial cluster owner |
113
+ | `HINDSIGHT_PG_DATABASE` | `hindsight` |
114
+ | `HINDSIGHT_PG_PASSWORD` | Optional initial password; otherwise generated |
115
+
116
+ The state directory stores the password in `<name>\manager.json` and must
117
+ remain private to the user. POSIX state files use mode 0600; Windows uses the
118
+ directory's inherited ACLs. Public status output excludes passwords and URLs.
119
+ This package never deletes clusters or imports existing pg0 data. A nonempty
120
+ unmanaged data directory is refused. Existing instance settings must remain
121
+ unchanged across restarts; choose another instance name for a separate setup.
122
+
123
+ For a new PostgreSQL or pgvector release, prepare a new installation directory
124
+ and plan any required database migration separately. Upgrading this Python
125
+ package alone does not modify installed native files or existing databases.
126
+
127
+ ## Build and release
128
+
129
+ ```sh
130
+ python scripts/fetch_bundles.py
131
+ uv sync --group dev
132
+ uv run pytest
133
+ uv run ruff check .
134
+ uv run ruff format --check .
135
+ uv build
136
+ uv run twine check dist/*
137
+ ```
138
+
139
+ `scripts/fetch_bundles.py` downloads only the pinned upstream release archives,
140
+ verifies their hashes and adds them to the distribution data directory. The
141
+ archives are not versioned in Git. Both wheel and sdist must contain them;
142
+ inspect built distributions before publication. Publishing uses a PyPI API token
143
+ from the environment, never from this repository.
144
+
145
+ Sources: [Hindsight configuration](https://hindsight.vectorize.io/developer/configuration),
146
+ [pg0 0.15.2 versions](https://github.com/vectorize-io/pg0/blob/v0.15.2/versions.env),
147
+ [PostgreSQL pg_ctl](https://www.postgresql.org/docs/current/app-pg-ctl.html).
@@ -0,0 +1,24 @@
1
+ # Third-party notices
2
+
3
+ The Python launcher is original code under the MIT license in LICENSE.
4
+ This project is independent of Vectorize, Hindsight, and pg0. It does not
5
+ bundle their Python application code. Optional Hindsight extras install the
6
+ upstream distributions separately.
7
+
8
+ The distribution includes unmodified native archives selected from the same
9
+ release sources as pg0-embedded 0.15.2. Their URLs and SHA-256 digests are in
10
+ `hindsight_pg0_configurable/data/bundles.json`.
11
+
12
+ - PostgreSQL 18.1.0 Windows x86-64: theseus-rs/postgresql-binaries release
13
+ 18.1.0, PostgreSQL license. The archive's own LICENSE is preserved. See also
14
+ `licenses/PostgreSQL.txt` and `licenses/Theseus.txt`.
15
+ - pgvector 0.8.5 for PostgreSQL 18 Windows x86-64: nicoloboschi/pgvector_compiled
16
+ release v0.18.320, PostgreSQL license; source: pgvector/pgvector v0.8.5.
17
+ See `licenses/pgvector.txt`.
18
+
19
+ The PostgreSQL archive also includes third-party native runtime libraries and
20
+ tools. Its contents are preserved unchanged; the upstream source, build scripts
21
+ and dependencies are available from https://github.com/theseus-rs/postgresql-binaries.
22
+ This package's MIT license applies to the launcher only and does not relicense
23
+ the native components. No corporate files, credentials, policy settings, or
24
+ private model data are included in the release.
@@ -0,0 +1,23 @@
1
+ PostgreSQL Database Management System
2
+ (also known as Postgres, formerly known as Postgres95)
3
+
4
+ Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
5
+
6
+ Portions Copyright (c) 1994, The Regents of the University of California
7
+
8
+ Permission to use, copy, modify, and distribute this software and its
9
+ documentation for any purpose, without fee, and without a written agreement
10
+ is hereby granted, provided that the above copyright notice and this
11
+ paragraph and the following two paragraphs appear in all copies.
12
+
13
+ IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
14
+ DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
15
+ LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
16
+ DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
17
+ POSSIBILITY OF SUCH DAMAGE.
18
+
19
+ THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
20
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
+ AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
22
+ ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
23
+ PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2024, Theseus
2
+
3
+ Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
4
+
5
+ IN NO EVENT SHALL Theseus BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF Theseus HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6
+
7
+ Theseus SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN “AS IS” BASIS, AND Theseus HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
@@ -0,0 +1,20 @@
1
+ Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
2
+
3
+ Portions Copyright (c) 1994, The Regents of the University of California
4
+
5
+ Permission to use, copy, modify, and distribute this software and its
6
+ documentation for any purpose, without fee, and without a written agreement
7
+ is hereby granted, provided that the above copyright notice and this
8
+ paragraph and the following two paragraphs appear in all copies.
9
+
10
+ IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
11
+ DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
12
+ LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
13
+ DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
14
+ POSSIBILITY OF SUCH DAMAGE.
15
+
16
+ THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
17
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
18
+ AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
19
+ ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
20
+ PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
@@ -0,0 +1,52 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.27"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "hindsight-pg0-configurable"
7
+ version = "0.1.0"
8
+ description = "Configurable native PostgreSQL and pgvector launcher for Hindsight on Windows"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "MIT"
12
+ license-files = ["LICENSE", "THIRD_PARTY_NOTICES.md", "licenses/*"]
13
+ authors = [{name = "Dark Light"}]
14
+ dependencies = ["filelock>=3.20.1,<4", "python-dotenv>=1.2.1,<2"]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Environment :: Console",
18
+ "Operating System :: Microsoft :: Windows",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Topic :: Database :: Database Engines/Servers",
23
+ ]
24
+
25
+ [project.optional-dependencies]
26
+ slim = ["hindsight-api-slim>=1.0.0,<2"]
27
+ full = ["hindsight-api>=1.0.0,<2"]
28
+
29
+ [project.scripts]
30
+ hindsight-pg0 = "hindsight_pg0_configurable.cli:main"
31
+
32
+ [dependency-groups]
33
+ dev = ["pytest>=8", "ruff>=0.8", "build>=1.2", "twine>=6"]
34
+
35
+ [tool.hatch.build.targets.wheel]
36
+ packages = ["src/hindsight_pg0_configurable"]
37
+ artifacts = ["src/hindsight_pg0_configurable/data/*"]
38
+
39
+ [tool.hatch.build.targets.sdist]
40
+ include = ["src", "tests", "scripts", "licenses", "pyproject.toml", "README.md", "LICENSE", "THIRD_PARTY_NOTICES.md"]
41
+ artifacts = ["src/hindsight_pg0_configurable/data/*"]
42
+
43
+ [tool.pytest.ini_options]
44
+ pythonpath = ["src"]
45
+ testpaths = ["tests"]
46
+
47
+ [tool.ruff]
48
+ line-length = 100
49
+ target-version = "py311"
50
+
51
+ [tool.ruff.lint]
52
+ select = ["E", "F", "I"]
@@ -0,0 +1,45 @@
1
+ """Fetch pinned native inputs for a reproducible offline-capable distribution."""
2
+
3
+ import hashlib
4
+ import json
5
+ import shutil
6
+ import tempfile
7
+ import urllib.request
8
+ from pathlib import Path
9
+
10
+ DATA = Path(__file__).resolve().parents[1] / "src" / "hindsight_pg0_configurable" / "data"
11
+
12
+
13
+ def main() -> None:
14
+ manifest = json.loads((DATA / "bundles.json").read_text())
15
+ for item in manifest["archives"]:
16
+ dest = DATA / item["filename"]
17
+ if dest.exists():
18
+ with dest.open("rb") as handle:
19
+ if hashlib.file_digest(handle, "sha256").hexdigest() == item["sha256"]:
20
+ print("Verified:", dest.name)
21
+ continue
22
+ raise RuntimeError(f"Existing archive hash mismatch: {dest}")
23
+ fd, name = tempfile.mkstemp(dir=DATA, suffix=".download")
24
+ import os
25
+
26
+ os.close(fd)
27
+ stage = Path(name)
28
+ try:
29
+ request = urllib.request.Request(
30
+ item["url"], headers={"User-Agent": "hindsight-pg0-build"}
31
+ )
32
+ with urllib.request.urlopen(request, timeout=120) as response, stage.open("wb") as out:
33
+ shutil.copyfileobj(response, out)
34
+ with stage.open("rb") as handle:
35
+ actual = hashlib.file_digest(handle, "sha256").hexdigest()
36
+ if actual != item["sha256"]:
37
+ raise RuntimeError(f"Download hash mismatch: {dest.name}")
38
+ stage.rename(dest)
39
+ print("Downloaded and verified:", dest.name)
40
+ finally:
41
+ stage.unlink(missing_ok=True)
42
+
43
+
44
+ if __name__ == "__main__":
45
+ main()
@@ -0,0 +1,3 @@
1
+ """Native PostgreSQL with explicit installation and state directories."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,4 @@
1
+ from .cli import main
2
+
3
+ if __name__ == "__main__":
4
+ raise SystemExit(main())