Compare commits
815 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 831665c913 | |||
| ab0aa9cfad | |||
| 313423a19c | |||
| 99437a24eb | |||
| ff77f7b0b0 | |||
| 450d73f2c9 | |||
| 080b2c1944 | |||
| 719fe8d49e | |||
| d39f03fd10 | |||
| f4a8488167 | |||
| f7a7afe12f | |||
| 6fb15b0094 | |||
| 39d9184c14 | |||
| 0e63c3d11a | |||
| 5d07476e2c | |||
| e4659f2dfd | |||
| 2e14dcef51 | |||
| d2f8b21c97 | |||
| 106036cf5b | |||
| 3d09745a79 | |||
| a623ecb518 | |||
| 93876ff2cf | |||
| e824e133d7 | |||
| 134513e3b9 | |||
| abc25dfc38 | |||
| 9ae5443073 | |||
| 19b720742e | |||
| 0965b7c7ac | |||
| 6c8301c78e | |||
| 886ee12311 | |||
| 3e0f455b6d | |||
| d3b4f25f71 | |||
| 17f930b8d5 | |||
| af0baa03b5 | |||
| 21d4eebb5e | |||
| adf4dc87e0 | |||
| 87a749d26d | |||
| d6df530312 | |||
| 845738a665 | |||
| 3c5533d310 | |||
| a053ffab79 | |||
| 042431e246 | |||
| a172eebeba | |||
| e5d91cb19b | |||
| 56483f9064 | |||
| e7fada4372 | |||
| ad8a5df97b | |||
| 4f50a57a38 | |||
| ebdf8b522f | |||
| 7ad8deb381 | |||
| 62778f5c5b | |||
| 6e74b436f6 | |||
| 9367c7b713 | |||
| 93c8695250 | |||
| eb146d3298 | |||
| cf8fd71a83 | |||
| 07fac1b968 | |||
| b82ab47c6c | |||
| 663e02e21e | |||
| 76f99184ac | |||
| 7a25a50056 | |||
| a057ce3397 | |||
| 56fadeb27d | |||
| 59e324a8aa | |||
| c1f43de5f9 | |||
| 11de2262a0 | |||
| c0c8a95f7c | |||
| 6c869495cf | |||
| 89a587311c | |||
| 6ae2fc852e | |||
| 914d98dd25 | |||
| 0ec57fe2f4 | |||
| 9e2fc7313e | |||
| 3b16bf2790 | |||
| 35ddc5ed96 | |||
| 62ec37d9e2 | |||
| f902e50def | |||
| 9b59fa16b2 | |||
| 1a66db4708 | |||
| 0288111c72 | |||
| 89c8e5de3c | |||
| 4d7fc57a5e | |||
| 75eddf8adc | |||
| f59a53e31b | |||
| d311579dc0 | |||
| d70bf98871 | |||
| 59813b72fa | |||
| 6f5464615e | |||
| d0c879ad09 | |||
| da4de023ad | |||
| eb100e54f2 | |||
| 9e3fc25fdd | |||
| 038105ece9 | |||
| 8e4627e262 | |||
| a92a117ad9 | |||
| 074fe64e12 | |||
| 3d24fc4130 | |||
| 473f39bd90 | |||
| b5ea9b4786 | |||
| aa0379294f | |||
| 096a2f6745 | |||
| 4b75e283db | |||
| bfd6369bc1 | |||
| 5b8cc0c45c | |||
| 9e07e9e5db | |||
| d8bc99b17e | |||
| 935b513255 | |||
| 2763890ffc | |||
| 02683f6d96 | |||
| 191bd4342b | |||
| 1b7742cd38 | |||
| bd8e8a0627 | |||
| 28e54fb657 | |||
| bca7cd7c3a | |||
| 8f7d2ab181 | |||
| 7a9bbbde9f | |||
| f0e45b6035 | |||
| f02e7ec8de | |||
| 3c00167912 | |||
| 89ea4ff155 | |||
| 723b788161 | |||
| 8aa552070d | |||
| 7320fd7957 | |||
| c11b4ac309 | |||
| f292edfe5c | |||
| b2877c1ea0 | |||
| 727ed783d1 | |||
| 6ea1b42d2a | |||
| 2b4123f48f | |||
| 5ca879e7e2 | |||
| 61e2a85842 | |||
| 1f494c285a | |||
| d4e5cfe41b | |||
| 07e6faed5a | |||
| 826369c81a | |||
| fec29b541f | |||
| afd04e49d7 | |||
| 719a6839d1 | |||
| e9d74a7de0 | |||
| e9a81509b0 | |||
| c00c8169e2 | |||
| 03c16df524 | |||
| 5196c67570 | |||
| 2ca09e2a00 | |||
| 95e297e917 | |||
| 39ad49e09d | |||
| 3b6449113e | |||
| 13b28eeea8 | |||
| 7906b2915e | |||
| 1f5c0c435e | |||
| 4d81a37638 | |||
| 949e1ab189 | |||
| b45e934feb | |||
| 807fbbeda3 | |||
| 3795d86587 | |||
| dbfcfa3f75 | |||
| bc4878f2d7 | |||
| b6492ab4e8 | |||
| 7ad6b718a0 | |||
| 4ee706bfb6 | |||
| d3d7728f1f | |||
| 2ec43305da | |||
| 706c1bb7ad | |||
| b5b4672920 | |||
| 52a5d483e3 | |||
| 3118bc35ba | |||
| e19ba81406 | |||
| 3094ad892f | |||
| c07d4f24a2 | |||
| 16c3d7d643 | |||
| a5d541529d | |||
| 7eed744ad1 | |||
| 815d727361 | |||
| a3ce64f841 | |||
| 4e3ac343b4 | |||
| f05e711328 | |||
| 4e94b2157b | |||
| 5c4ca20b11 | |||
| c70de21a7b | |||
| d5e6d44fa7 | |||
| d1bf1fbfff | |||
| f923d75562 | |||
| 816453b444 | |||
| 8bc3ae56cb | |||
| c53c764c4d | |||
| f2829f31e8 | |||
| b472ccfbbe | |||
| 2043cdf25f | |||
| 8dc1724846 | |||
| c88182811c | |||
| cd12eb2f4c | |||
| 9c61299e86 | |||
| d1d505c9a2 | |||
| 0676d7e40c | |||
| 1d09762e31 | |||
| b65f653380 | |||
| 782bcceb1c | |||
| 806526de68 | |||
| 65b774b568 | |||
| 55a4c49a31 | |||
| 89f5a6a0ad | |||
| aa0c1f1c03 | |||
| eb5e912fa3 | |||
| 447888e062 | |||
| d4036eea47 | |||
| 54ba768a28 | |||
| 4f27331636 | |||
| 0de73ba25f | |||
| 8b9c0e664b | |||
| cfcb55e28c | |||
| 410a4109ad | |||
| d178e2c437 | |||
| b9b154e59e | |||
| 2db2554d1e | |||
| 5bafae048e | |||
| 16e28b25a2 | |||
| 5da7db2b27 | |||
| 0ce7568103 | |||
| 28d149f7ed | |||
| 1bb1daa1f2 | |||
| caddd668ca | |||
| 1cc37ef980 | |||
| 5d44b41e74 | |||
| 66b7674e43 | |||
| a6c1bceb26 | |||
| 6e6d64c289 | |||
| bf86acd0a4 | |||
| 4f68fb27d9 | |||
| 9400eb20da | |||
| 6fe5afcca4 | |||
| 95aac6367f | |||
| f2cc45ea26 | |||
| fa22c89622 | |||
| 9029dc4d7d | |||
| 3b1718c44f | |||
| c9828b220e | |||
| 0a43b67847 | |||
| 72eb597a72 | |||
| f930ebf337 | |||
| e9d57fb7aa | |||
| d48215678a | |||
| 150a59a928 | |||
| 0cee77887d | |||
| 2c9668683a | |||
| 3e7200ef28 | |||
| f1fb77baa0 | |||
| de325006de | |||
| b790cc73ca | |||
| fcd7cffd18 | |||
| a9705a6b56 | |||
| bb84094385 | |||
| b9d56b8923 | |||
| e586e8c733 | |||
| 1d1dfdf1ed | |||
| 9fa179736b | |||
| e7b266f908 | |||
| b266031d56 | |||
| c893e1086a | |||
| 3185795b4b | |||
| c2c3232d8f | |||
| b031d35af7 | |||
| ef4335cda3 | |||
| 8e5511b112 | |||
| 7ab594bc8b | |||
| 5776733ebd | |||
| aef88a9602 | |||
| 0d0596b204 | |||
| abaa3c78df | |||
| 7f7033779c | |||
| bb15edc057 | |||
| f04b6097b8 | |||
| c5970ff834 | |||
| 6026933b24 | |||
| 43a7d398b6 | |||
| 716869d553 | |||
| 457b5a3976 | |||
| 6175945230 | |||
| a4491a8517 | |||
| af3f49b644 | |||
| 14f33dde04 | |||
| 9fb0c6a994 | |||
| b63bef2d43 | |||
| 1d5dc370e8 | |||
| c6214f6259 | |||
| 04483a68e8 | |||
| b1ef8e20b6 | |||
| 1701f0461f | |||
| b47cb35966 | |||
| 39b4bddbc9 | |||
| 7e45ffca43 | |||
| 672b7f0ebd | |||
| f44078724a | |||
| af6cf8b6f1 | |||
| 7e65c29a61 | |||
| 846f8470dc | |||
| 32ff928786 | |||
| 25c59ff62f | |||
| 38866110a7 | |||
| 65d24fb88f | |||
| 8be65fd3a1 | |||
| 0117f3f35d | |||
| 0e9cbc9c2a | |||
| faa8cb5822 | |||
| 7db626781e | |||
| c523def852 | |||
| c7a5ff316d | |||
| a6c6f1e4ab | |||
| 85df36a770 | |||
| 6b7a0847d4 | |||
| e44247b5b1 | |||
| 97cced5d88 | |||
| 0238f82847 | |||
| ed29bdc473 | |||
| c3c6849bed | |||
| 1e67c429b7 | |||
| b537cb38ae | |||
| 065a615e5f | |||
| 6900cad104 | |||
| c3e6245416 | |||
| 16a4f7ee12 | |||
| a3c58141a0 | |||
| 86692d58f9 | |||
| bcbfc0fa4a | |||
| e476c08ea4 | |||
| 8824ce330f | |||
| 87142508e3 | |||
| 7cc877ea7f | |||
| 7ee362f1c3 | |||
| 084e6d178b | |||
| 86ec48d2e4 | |||
| 3868822277 | |||
| d83c5f0062 | |||
| 981eb6be8f | |||
| 6b027873a5 | |||
| d00cc8037d | |||
| b4b618a913 | |||
| 8ba001750e | |||
| fa9ed78a6d | |||
| 4dae8e0d36 | |||
| 35eaefd05d | |||
| f85f93bdfb | |||
| 0e34ea1d48 | |||
| 97a93d3393 | |||
| 435ec79185 | |||
| 33d2ebf44c | |||
| e93fb8d5ab | |||
| 69dc5cc8ec | |||
| 5d62f9a88b | |||
| ba9079ee74 | |||
| 583c5bdf1b | |||
| bccf03a99f | |||
| 39a958675d | |||
| 413b0d7134 | |||
| ff4bdaa483 | |||
| ebcc5b32a0 | |||
| ce661252d0 | |||
| ed7e722077 | |||
| bcfca7a044 | |||
| 05f5607968 | |||
| 1657c9f65d | |||
| c3023cb609 | |||
| 6593ccbeaf | |||
| 341fe93e3b | |||
| 65d0e518e5 | |||
| 4a0e3c83db | |||
| f5451a0cf5 | |||
| 381668568f | |||
| 8afb49c018 | |||
| 535f47ef20 | |||
| dcb9bae215 | |||
| f1f71d8cdf | |||
| 39af6ef941 | |||
| e1c934a492 | |||
| dd760d84e0 | |||
| 6db49b3949 | |||
| f1672f6f95 | |||
| 428f435734 | |||
| c4abdc19df | |||
| 08327c2e63 | |||
| 2850498043 | |||
| fe9817f354 | |||
| 40cbf42438 | |||
| 44a318694b | |||
| 9389f69eb0 | |||
| d53a64650b | |||
| e349bf03ca | |||
| 23c4686b84 | |||
| 4c114b6319 | |||
| 3de5f9378d | |||
| ee9a786677 | |||
| debef98536 | |||
| e08f083ec8 | |||
| 9bbec2fe79 | |||
| 77201baddf | |||
| ce91f04974 | |||
| 65502ce5b4 | |||
| 3695303100 | |||
| 95e865495c | |||
| 6547a8abd3 | |||
| b24c9a8fdf | |||
| a5a252ab30 | |||
| 2237a902b6 | |||
| f060d7eb1f | |||
| 2e92f2f200 | |||
| 7f90c70c30 | |||
| b750c42ad6 | |||
| 73c4986f3d | |||
| e5c06019b3 | |||
| fae18bf4a7 | |||
| e5c1029165 | |||
| 2d167d0d67 | |||
| 569f467393 | |||
| 77d9d57937 | |||
| 7e0151ef93 | |||
| 49948852d6 | |||
| 83eaa960ec | |||
| e27c49e946 | |||
| 625e6edfd7 | |||
| 17cef0700a | |||
| 55c102c9ed | |||
| 70f1dbfb59 | |||
| f1575effc2 | |||
| 7e39a1d51f | |||
| 3722e572df | |||
| 7147e95252 | |||
| 9f2cfddce6 | |||
| 792cbd0677 | |||
| 5dca34e0e0 | |||
| 54d335c820 | |||
| 96b4e73f53 | |||
| 6e6054f744 | |||
| dc3288d15a | |||
| d872edca94 | |||
| 2ae63dbc2b | |||
| 26aa0cce29 | |||
| 7b0bf99ed1 | |||
| 89ada1b269 | |||
| 3438fe82c9 | |||
| a51a513804 | |||
| 995354f1a5 | |||
| 931c9591cd | |||
| 46096fc4ba | |||
| d3ecd907ee | |||
| 442469b9f5 | |||
| c45e042462 | |||
| 207da1b6ef | |||
| 9a1609435e | |||
| 13b83d7ee2 | |||
| a0312ed034 | |||
| 8ff74e1251 | |||
| 1b480d4ed5 | |||
| e13d87a077 | |||
| 5202f16972 | |||
| 5086596f94 | |||
| f7fc64db10 | |||
| 6b0778b420 | |||
| 5b92b3e790 | |||
| cc43906ae9 | |||
| dcaa2ad9c6 | |||
| 9d68cfcf2f | |||
| 2d346733d6 | |||
| cd75bf6d5a | |||
| e08de98ae6 | |||
| df213bc2ba | |||
| 869e68e834 | |||
| ed4623bc41 | |||
| 3ce198197d | |||
| 0ac8072a9a | |||
| 3ec54b8c72 | |||
| 47b3e5b55b | |||
| 99d1a0b926 | |||
| 884a62e8a6 | |||
| f7a40afc7a | |||
| a4f37ff427 | |||
| 2b97ef3722 | |||
| 63a86c43f4 | |||
| 92432232ef | |||
| d31ba5a410 | |||
| f0225e937c | |||
| 9e40c729e1 | |||
| 0e6ba414b3 | |||
| 10a2e89965 | |||
| f8e3e651e6 | |||
| 1558c9ccae | |||
| b68435128b | |||
| 5fb454a714 | |||
| 79cf9f1139 | |||
| 9bb203476d | |||
| 0726786016 | |||
| 204caf9d24 | |||
| 85663f5bc9 | |||
| f51b9bb046 | |||
| dd905c4daa | |||
| c3307ab5fb | |||
| 1484f51f48 | |||
| 51d21676c1 | |||
| c2806a1615 | |||
| 078f661e3a | |||
| adc60aa588 | |||
| 8d9eb5cc40 | |||
| 563acce012 | |||
| 49c359feb8 | |||
| 38202d4472 | |||
| 6d07dafc9f | |||
| 6c66e18c4b | |||
| 4048996652 | |||
| 470450e509 | |||
| 7e78c22fec | |||
| 610eaefb27 | |||
| 4bc33773fa | |||
| b74e31e1cc | |||
| 2f1e4407db | |||
| 4ccb4a73ca | |||
| 145baac393 | |||
| be59bff690 | |||
| 14b4fee214 | |||
| 7f84fc5d1e | |||
| a8b47f6185 | |||
| 5b62a8d60d | |||
| 0d4d71b9dc | |||
| 979d8049b1 | |||
| abd405015b | |||
| fddf78dc80 | |||
| 3136c26d4e | |||
| 4b84b4223d | |||
| 7a0e2cb11b | |||
| 74ab9218ff | |||
| da99857fd0 | |||
| a520cfdcc8 | |||
| 7febccf550 | |||
| 74977b4064 | |||
| 172e2d6a4f | |||
| 5c520dc0d4 | |||
| 6d18a3126e | |||
| 1e222a4db3 | |||
| 6a15052d77 | |||
| 2e69c14898 | |||
| dbda2a0161 | |||
| 2ee64f2eb1 | |||
| 8afe9427ca | |||
| e0f19833a1 | |||
| ca1b694aa9 | |||
| 9331373245 | |||
| ec072dc163 | |||
| f7ce1dcd56 | |||
| df275874e3 | |||
| 1da34ab5cd | |||
| c0fbc14f2d | |||
| 2d20900cbf | |||
| 7997f81f47 | |||
| 6d748d65d3 | |||
| 49324d3f35 | |||
| c98b4ef4ef | |||
| c8bae3a4a3 | |||
| ccbd7ee820 | |||
| e9c4873030 | |||
| 57719b7d81 | |||
| 62b1f9b0ae | |||
| 6c7a45d8d0 | |||
| 82d75e7beb | |||
| 61095e69ce | |||
| 2cfca710ec | |||
| 9679117e94 | |||
| d67a0389e0 | |||
| 9f84446509 | |||
| ec9b0e919d | |||
| 9bb7c1f4e3 | |||
| 3c092fbe34 | |||
| 3a7e2e5175 | |||
| 45b27ad562 | |||
| 1e418d6929 | |||
| 39b2665d8b | |||
| ba858cc997 | |||
| 0d57422b61 | |||
| b7d989f61f | |||
| 6813340f51 | |||
| eb788f17b8 | |||
| ebd3f415d3 | |||
| f15d8d8ce0 | |||
| 6c7bfd5e31 | |||
| 7c782a2603 | |||
| f1eef5b5e9 | |||
| f14583321d | |||
| 04283e99d4 | |||
| 7284228bec | |||
| da74d7ad18 | |||
| af5fbc1c4f | |||
| 5e4d2016e8 | |||
| 545aa6893b | |||
| 98139f7e8b | |||
| f8fa0a2623 | |||
| 9af773491b | |||
| 2a656f0f11 | |||
| aec35a2d9b | |||
| 23dc4e2078 | |||
| c812fe3655 | |||
| 3da97ca50c | |||
| 4c203d8588 | |||
| fcb5f825e1 | |||
| 4c57ace2f6 | |||
| dde7f76ecb | |||
| a102db36af | |||
| b5b1d22011 | |||
| c91599ef36 | |||
| 257f10c9fb | |||
| fb9a4d14f4 | |||
| c4435b76c4 | |||
| 61000a9466 | |||
| 7e4ceb3d48 | |||
| 4e991fa21d | |||
| f86b17045d | |||
| f302488075 | |||
| 8c1171478d | |||
| 7ee637803d | |||
| 4d6086fefb | |||
| 82cb53e107 | |||
| b97b12da7f | |||
| 49ea747b17 | |||
| 3b5e9db41f | |||
| 8b4b328c4e | |||
| ee2b8e63e6 | |||
| 51edd384c0 | |||
| b804d0f2c8 | |||
| fd5ccc668b | |||
| 0dc8ff9b52 | |||
| 8657a28bdb | |||
| a9c5e4ad4e | |||
| 2176b4371d | |||
| effc10d75b | |||
| 5887839aa1 | |||
| 3128bef20a | |||
| 4e4e2b7d96 | |||
| 99f4f9a0db | |||
| 6abdd67bb5 | |||
| c32e0c401f | |||
| ab5751459a | |||
| 62de6abdbf | |||
| 903dc70682 | |||
| 23c714da66 | |||
| 6639775d7d | |||
| 966b95b176 | |||
| 3bcf2c08dd | |||
| 700ab655ca | |||
| 85c5647385 | |||
| 2ef7c76d99 | |||
| 9bc1b0feda | |||
| 5cec84a4a7 | |||
| abfbe42d61 | |||
| e7e3bef1e4 | |||
| a68e8e31a4 | |||
| 3a9e60cda9 | |||
| 905ff03ccc | |||
| 495f7bcde4 | |||
| 51e0e8c5d0 | |||
| a2409a1fd1 | |||
| b3363f87d6 | |||
| 5831c0c9e6 | |||
| 42ed81cbe1 | |||
| e433c86203 | |||
| a2a144dffa | |||
| 8ef6e99d69 | |||
| 2545faef6c | |||
| 80be8be4d6 | |||
| 801adb385d | |||
| feba7b9d74 | |||
| b89224bbde | |||
| 131ffd9887 | |||
| af492c9e97 | |||
| f39fc94610 | |||
| 4e4eff6ba7 | |||
| 8ff1b4fa66 | |||
| 702f622e18 | |||
| 9da2c1e144 | |||
| 32653f54f9 | |||
| 72a200968a | |||
| b39b68add7 | |||
| d9fa1d9328 | |||
| 8375ad83f3 | |||
| 4158394dcf | |||
| eac7e155a5 | |||
| 0cf2cbfeb3 | |||
| 361dbb4ca8 | |||
| d6deccf3e8 | |||
| ee747243fe | |||
| a1ceb457e9 | |||
| 9900211fa4 | |||
| 60cebf0e4b | |||
| 7bd575187e | |||
| ab5a7e8e3d | |||
| 99b2e1cd81 | |||
| 363313d99c | |||
| 18ddf00d3d | |||
| 59f3fe3d1d | |||
| 1dccf5f140 | |||
| 0b40cf8026 | |||
| a7ec195587 | |||
| 13de820931 | |||
| 14ef59aaed | |||
| f387222fce | |||
| 9cb9008dfc | |||
| 083decc5b4 | |||
| 57cac5d3f7 | |||
| 0a772e03b4 | |||
| 0920062a38 | |||
| 39afe644eb | |||
| e3ee3de10a | |||
| 9c72db56e9 | |||
| bb2d606dbb | |||
| 9850767a8a | |||
| 74e2d21de5 | |||
| 7cb18a1a40 | |||
| b556fc2f4f | |||
| b99bd38eb4 | |||
| 701b6726d7 | |||
| 665039f4dc | |||
| ef8dae776e | |||
| d01775b68a | |||
| 0d6f2dd0ce | |||
| df40cbec6e | |||
| 0341e0c7c0 | |||
| 39af7d4f3c | |||
| bba582b4ca | |||
| 1f16a85330 | |||
| f9482639d4 | |||
| dce721cdbd | |||
| 98734644d6 | |||
| 951383226c | |||
| df58595d1e | |||
| c3c14e7468 | |||
| e7319ea016 | |||
| bd2d5e2496 | |||
| 115a44f629 | |||
| 18411dc5b5 | |||
| e23dc1ab6e | |||
| e1359ea227 | |||
| 7fdd99ec27 | |||
| a90231ce0c | |||
| ed879b8bb0 | |||
| 717451512a | |||
| 3ddb3a947b | |||
| c6632d5576 | |||
| ffc07922c7 | |||
| f3310d4d16 | |||
| 88cee96d8d | |||
| 2fece10215 | |||
| 0658f2f642 | |||
| a51228c803 | |||
| 4491fb5ccd | |||
| 30b905765c | |||
| 03eac70881 | |||
| 0f7e6b979f | |||
| c366912586 | |||
| 9fe44cd00d | |||
| 094b0d2532 | |||
| 98649f4d81 | |||
| 8a559efd5b | |||
| 72deccb4e2 | |||
| 5620fc5bcf | |||
| be57e675e0 | |||
| 3971443831 | |||
| a6b0c33e9f | |||
| 96b886e711 | |||
| 7d584ee6cd | |||
| 572a112c31 | |||
| ea87c335d6 | |||
| 7169ff04df | |||
| ef1f650bc0 | |||
| 0d02cb9fa0 | |||
| 0299b128cf | |||
| d723384888 | |||
| 54228055c8 | |||
| 23ed716450 | |||
| ab59bab044 | |||
| 71395bb076 | |||
| 79737edf79 | |||
| df2c765b7f | |||
| f050b9dd54 | |||
| 9c9cb54339 | |||
| 7657ec3ad6 | |||
| cee52aa092 | |||
| e920f3a8d5 | |||
| 591c529a09 | |||
| 7324c5a686 | |||
| d0936fb022 | |||
| 2aa074c5cf | |||
| 782d0cf3b9 | |||
| 083c01cfa0 | |||
| 2937696024 | |||
| b817a5b772 | |||
| 3022f20beb | |||
| ca1ded1821 | |||
| 3752f3ed28 | |||
| 870c2d69d5 | |||
| 135407ba7c | |||
| 228c348e42 | |||
| a813bd5a50 | |||
| d8f58dce31 | |||
| 7111edeca4 | |||
| 3aae4bbb12 | |||
| b29d8eeb50 | |||
| dffb432537 | |||
| 2dd38c7913 | |||
| bc2ade38d9 | |||
| 5be831eb13 | |||
| cae4d99a89 | |||
| e09dc0512d | |||
| ae82bc1ce0 | |||
| 01eb7aa1aa | |||
| 2ca700195c | |||
| 2b08c34539 | |||
| 79f1fc1e09 | |||
| 9c753270bd | |||
| b907cb01aa | |||
| 7824afd4a5 | |||
| 2a4e1e912c |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,6 +1,6 @@
|
|||||||
# ---> Codex
|
# ---> Codex
|
||||||
.codex
|
.codex
|
||||||
AGENTS.md
|
.releasekit/
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
@@ -26,6 +26,7 @@ AGENTS.md
|
|||||||
|
|
||||||
# Go cache
|
# Go cache
|
||||||
.gocache
|
.gocache
|
||||||
|
/dist/
|
||||||
|
|
||||||
# Go workspace file
|
# Go workspace file
|
||||||
go.work
|
go.work
|
||||||
@@ -52,4 +53,3 @@ pipeline.yml
|
|||||||
|
|
||||||
# Built Visual Studio Code Extensions
|
# Built Visual Studio Code Extensions
|
||||||
*.vsix
|
*.vsix
|
||||||
|
|
||||||
|
|||||||
@@ -1,50 +1,56 @@
|
|||||||
|
# Adapted from ReleaseKit v0.10.0 tag-delivery.yml.
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- GO_IMAGE: golang:1.27.4-bookworm
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- event: tag
|
- event: tag
|
||||||
|
ref: refs/tags/v*
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-release-assets
|
- name: deliver
|
||||||
image: golang:1.25
|
image: ${GO_IMAGE}
|
||||||
|
environment:
|
||||||
|
RELEASEKIT_GITEA_TOKEN:
|
||||||
|
from_secret: GITEA_RELEASE_TOKEN
|
||||||
commands:
|
commands:
|
||||||
- |
|
- |
|
||||||
set -eu
|
set -eu
|
||||||
|
test -n "$${CI_COMMIT_TAG}"
|
||||||
|
test -n "$${CI_COMMIT_SHA}"
|
||||||
|
git check-ref-format "refs/tags/$${CI_COMMIT_TAG}"
|
||||||
|
git fetch origin "refs/tags/$${CI_COMMIT_TAG}:refs/tags/$${CI_COMMIT_TAG}"
|
||||||
|
tag_commit=$(git rev-parse --verify "refs/tags/$${CI_COMMIT_TAG}^{commit}")
|
||||||
|
expected_commit=$(git rev-parse --verify "$${CI_COMMIT_SHA}^{commit}")
|
||||||
|
if [ "$${tag_commit}" != "$${expected_commit}" ]; then
|
||||||
|
printf 'Tag %s resolves to commit %s; event %s resolves to commit %s\n' \
|
||||||
|
"$${CI_COMMIT_TAG}" "$${tag_commit}" "$${CI_COMMIT_SHA}" "$${expected_commit}" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
git checkout --detach "$${tag_commit}"
|
||||||
|
test "$(git rev-parse HEAD | tr '[:upper:]' '[:lower:]')" = "$${expected_commit}"
|
||||||
|
test -z "$(git status --porcelain --untracked-files=all)"
|
||||||
|
|
||||||
version="$CI_COMMIT_TAG"
|
bootstrap_dir=$(mktemp -d "$${CI_WORKSPACE%/*}/.releasekit-bootstrap.XXXXXX")
|
||||||
dist="dist"
|
trap 'rm -rf "$${bootstrap_dir}"' EXIT
|
||||||
pkg="gitea.maximumdirect.net/eric/narratio/cmd/narratio"
|
cp go.mod "$${bootstrap_dir}/releasekit.mod"
|
||||||
|
if [ -f go.sum ]; then
|
||||||
|
cp go.sum "$${bootstrap_dir}/releasekit.sum"
|
||||||
|
else
|
||||||
|
: > "$${bootstrap_dir}/releasekit.sum"
|
||||||
|
fi
|
||||||
|
|
||||||
rm -rf "$dist"
|
export GOWORK=off
|
||||||
mkdir -p "$dist"
|
export GOTOOLCHAIN=local
|
||||||
|
releasekit_host_os=$(go env GOHOSTOS) || exit $?
|
||||||
build_binary() {
|
releasekit_host_arch=$(go env GOHOSTARCH) || exit $?
|
||||||
goos="$1"
|
export GOOS="$${releasekit_host_os}" GOARCH="$${releasekit_host_arch}"
|
||||||
goarch="$2"
|
releasekit_module=go.maximumdirect.net/releasekit
|
||||||
suffix="$3"
|
go list -mod=mod -modfile="$${bootstrap_dir}/releasekit.mod" -m "$${releasekit_module}"
|
||||||
output="$dist/narratio-$version-$goos-$goarch$suffix"
|
go mod edit -modfile="$${bootstrap_dir}/releasekit.mod" -tool="$${releasekit_module}/cmd/releasekit"
|
||||||
|
go list -mod=mod -modfile="$${bootstrap_dir}/releasekit.mod" -deps "$${releasekit_module}/cmd/releasekit" > /dev/null
|
||||||
CGO_ENABLED=0 GOOS="$goos" GOARCH="$goarch" \
|
go tool -modfile="$${bootstrap_dir}/releasekit.mod" "$${releasekit_module}/cmd/releasekit" ci-deliver \
|
||||||
go build -trimpath -ldflags "-s -w -X gitea.maximumdirect.net/eric/narratio/internal/buildinfo.Version=$version" \
|
--repo "$${CI_WORKSPACE}" \
|
||||||
-o "$output" "$pkg"
|
--prepared \
|
||||||
}
|
--commit "$${expected_commit}" \
|
||||||
|
"$${CI_COMMIT_TAG}"
|
||||||
build_binary linux amd64 ""
|
|
||||||
build_binary linux arm64 ""
|
|
||||||
build_binary darwin amd64 ""
|
|
||||||
build_binary darwin arm64 ""
|
|
||||||
build_binary windows amd64 ".exe"
|
|
||||||
build_binary windows arm64 ".exe"
|
|
||||||
|
|
||||||
- name: publish-release
|
|
||||||
image: woodpeckerci/plugin-release
|
|
||||||
depends_on:
|
|
||||||
- build-release-assets
|
|
||||||
settings:
|
|
||||||
api_key:
|
|
||||||
from_secret: GITEA_RELEASE_TOKEN
|
|
||||||
files:
|
|
||||||
- dist/narratio-*
|
|
||||||
checksum: sha256
|
|
||||||
checksum-file: SHA256SUMS
|
|
||||||
checksum-flatten: true
|
|
||||||
file-exists: skip
|
|
||||||
overwrite: false
|
|
||||||
prerelease: false
|
|
||||||
|
|||||||
8
.woodpecker/shuffle.yml
Normal file
8
.woodpecker/shuffle.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
when:
|
||||||
|
- event: cron
|
||||||
|
|
||||||
|
steps:
|
||||||
|
shuffled-race-tests:
|
||||||
|
image: golang:1.27.4
|
||||||
|
commands:
|
||||||
|
- go test -race -shuffle=on -count=3 ./...
|
||||||
40
.woodpecker/verify.yml
Normal file
40
.woodpecker/verify.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
when:
|
||||||
|
- event: [push, pull_request]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
tests:
|
||||||
|
image: golang:1.27.4
|
||||||
|
commands:
|
||||||
|
- go test ./...
|
||||||
|
|
||||||
|
race-tests:
|
||||||
|
image: golang:1.27.4
|
||||||
|
depends_on: tests
|
||||||
|
commands:
|
||||||
|
- go test -race ./...
|
||||||
|
|
||||||
|
static-analysis:
|
||||||
|
image: golang:1.27.4
|
||||||
|
depends_on: tests
|
||||||
|
commands:
|
||||||
|
- go vet ./...
|
||||||
|
|
||||||
|
build:
|
||||||
|
image: golang:1.27.4
|
||||||
|
depends_on: tests
|
||||||
|
commands:
|
||||||
|
- go build ./...
|
||||||
|
|
||||||
|
cross-build:
|
||||||
|
image: golang:1.27.4
|
||||||
|
depends_on: [race-tests, static-analysis, build]
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
set -eu
|
||||||
|
output_dir="$(mktemp -d)"
|
||||||
|
trap 'rm -rf "$output_dir"' EXIT
|
||||||
|
for target in linux/amd64 linux/arm64 darwin/arm64; do
|
||||||
|
goos="${target%/*}"
|
||||||
|
goarch="${target#*/}"
|
||||||
|
CGO_ENABLED=0 GOOS="$goos" GOARCH="$goarch" go build -o "$output_dir/narratio-$goos-$goarch" ./cmd/narratio
|
||||||
|
done
|
||||||
30
AGENTS.md
Normal file
30
AGENTS.md
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
Start with `docs/development.md` for orientation and use its policy reading guide
|
||||||
|
to select the policies applicable to the task. Do not read the entire suite by
|
||||||
|
default.
|
||||||
|
|
||||||
|
Read and follow `docs/policy/agents.md` before recommending, planning, or
|
||||||
|
implementing repository changes.
|
||||||
|
|
||||||
|
<!-- codebase-memory-mcp:start -->
|
||||||
|
# Codebase Knowledge Graph (codebase-memory-mcp)
|
||||||
|
|
||||||
|
This project uses codebase-memory-mcp to maintain a knowledge graph of the codebase.
|
||||||
|
ALWAYS prefer MCP graph tools over grep/glob/file-search for code discovery.
|
||||||
|
|
||||||
|
## Priority Order
|
||||||
|
1. `search_graph` — find functions, classes, routes, variables by pattern
|
||||||
|
2. `trace_path` — trace who calls a function or what it calls
|
||||||
|
3. `get_code_snippet` — read specific function/class source code
|
||||||
|
4. `query_graph` — run Cypher queries for complex patterns
|
||||||
|
5. `get_architecture` — high-level project summary
|
||||||
|
|
||||||
|
## When to fall back to grep/glob
|
||||||
|
- Searching for string literals, error messages, config values
|
||||||
|
- Searching non-code files (Dockerfiles, shell scripts, configs)
|
||||||
|
- When MCP tools return insufficient results
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
- Find a handler: `search_graph(name_pattern=".*OrderHandler.*")`
|
||||||
|
- Who calls it: `trace_path(function_name="OrderHandler", direction="inbound")`
|
||||||
|
- Read source: `get_code_snippet(qualified_name="pkg/orders.OrderHandler")`
|
||||||
|
<!-- codebase-memory-mcp:end -->
|
||||||
23
COPYRIGHT
Normal file
23
COPYRIGHT
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
Narratio
|
||||||
|
|
||||||
|
Copyright (C) 2026 Eric Rakestraw
|
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
Narratio is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
The GNU General Public License version 3 is provided in LICENSE.
|
||||||
|
|
||||||
|
Narratio is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
Third-party code and assets are subject to their respective license terms.
|
||||||
|
|
||||||
|
Policy documents adapted from Standard Repository Policies remain licensed
|
||||||
|
under CC-BY-SA-4.0. See docs/oss/attribution.md for the affected material,
|
||||||
|
upstream credit, and license links.
|
||||||
892
LICENSE
892
LICENSE
@@ -1,232 +1,674 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 3, 29 June 2007
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
Preamble
|
Preamble
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for software and other kinds of works.
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
|
your programs, too.
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
The precise terms and conditions for copying, distribution and modification follow.
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
TERMS AND CONDITIONS
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
0. Definitions.
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
“This License” refers to version 3 of the GNU General Public License.
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
|
know their rights.
|
||||||
|
|
||||||
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
A “covered work” means either the unmodified Program or a work based on the Program.
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
|
authors of previous versions.
|
||||||
|
|
||||||
1. Source Code.
|
Some devices are designed to deny users access to install or run
|
||||||
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that same work.
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
2. Basic Permissions.
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
|
0. Definitions.
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
6. Conveying Non-Source Forms.
|
permission, would make you directly or secondarily liable for
|
||||||
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
|
1. Source Code.
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
|
form of a work.
|
||||||
|
|
||||||
7. Additional Terms.
|
A "Standard Interface" means an interface that either is an official
|
||||||
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
8. Termination.
|
linked subprograms that the work is specifically designed to require,
|
||||||
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
9. Acceptance Not Required for Having Copies.
|
same work.
|
||||||
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
2. Basic Permissions.
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
11. Patents.
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
|
makes it unnecessary.
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
13. Use with the GNU Affero General Public License.
|
measure under any applicable law fulfilling obligations under article
|
||||||
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
14. Revised Versions of this License.
|
measures.
|
||||||
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
16. Limitation of Liability.
|
You may convey verbatim copies of the Program's source code as you
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
17. Interpretation of Sections 15 and 16.
|
keep intact all notices stating that this License and any
|
||||||
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
END OF TERMS AND CONDITIONS
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
narratio
|
produce it from the Program, in the form of source code under the
|
||||||
Copyright (C) 2026 eric
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
narratio Copyright (C) 2026 eric
|
<program> Copyright (C) <year> <name of author>
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/philosophy/why-not-lgpl.html>.
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||||
51
README.md
51
README.md
@@ -1,22 +1,47 @@
|
|||||||
# narratio
|
# narratio
|
||||||
|
|
||||||
Narratio is a Go orchestration application that turns D&D session audio into polished transcripts and generated session artifacts.
|
Narratio is a stage-driven Go orchestrator for turning D&D session audio into
|
||||||
|
polished transcripts, validated Notarius extraction lanes, and generated
|
||||||
|
artifacts.
|
||||||
|
|
||||||
It coordinates transcription, merge/polish/normalize/trim processing, artifact generation, archive publishing, and resumable run state in one operator workflow.
|
It runs a deterministic workflow with manifest-driven continuation, remote
|
||||||
|
publish, and restore support. Its CommandKit CLI provides native configuration
|
||||||
|
inspection, structured operation reports, progress, and shell completion.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
narratio run --session-id 2026-04-04
|
narratio run 2026-04-04
|
||||||
```
|
```
|
||||||
|
|
||||||
This command requires discoverable `pipeline.yml` and `session.yml` files (or explicit `--config` and `--session` flags).
|
This requires resolvable `pipeline.yml`, `campaign.yml`, and concrete
|
||||||
|
`session.yml` files or their explicit command-line alternatives.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
- [Configuration](docs/config.md)
|
- [CLI reference](docs/cli.md) — commands, arguments, flags, and invocation
|
||||||
- [CLI Reference](docs/cli.md)
|
behavior.
|
||||||
- [Operations and Recovery](docs/operations.md)
|
- [Configuration](docs/config.md) — discovery, fields, defaults, and
|
||||||
- [Troubleshooting](docs/troubleshooting.md)
|
validation.
|
||||||
- [Development Guide](docs/development.md)
|
- [Operations](docs/operations.md) — runtime workflow, state, publishing,
|
||||||
- [Architecture Principles](docs/architecture.md)
|
recovery, and cleanup.
|
||||||
- [Internal Component Contracts](docs/internal/README.md)
|
- [Troubleshooting](docs/troubleshooting.md) — symptom-driven diagnosis and
|
||||||
- [Config Examples](examples/)
|
safe remedies.
|
||||||
|
- [Integration contracts](docs/integrations/) — external tools, formats, and
|
||||||
|
compatibility expectations.
|
||||||
|
- [Maintained examples](examples/README.md) — complete copyable configuration
|
||||||
|
and input files, including the production/testing split bundle.
|
||||||
|
|
||||||
|
## Maintainer Documentation
|
||||||
|
|
||||||
|
- [Development guide](docs/development.md) — first-read orientation and
|
||||||
|
task-specific reading routes.
|
||||||
|
- [Internal overview](docs/internal/overview.md) — implemented component map.
|
||||||
|
- [Architecture](docs/policy/architecture.md) — normative boundaries and
|
||||||
|
invariants.
|
||||||
|
- [Documentation policy](docs/policy/documentation.md) — canonical ownership
|
||||||
|
and maintenance rules.
|
||||||
|
- [Testing policy](docs/policy/testing.md) — test value, boundaries, and
|
||||||
|
sufficiency.
|
||||||
|
|
||||||
|
Narratio is licensed under the [GPL v3.0 or later](COPYRIGHT).
|
||||||
|
|
||||||
|
[Open Source attribution notices](docs/oss/attribution.md) are available.
|
||||||
|
|||||||
@@ -1,11 +1,22 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"os"
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"gitea.maximumdirect.net/eric/narratio/internal/app"
|
"go.maximumdirect.net/commandkit"
|
||||||
|
|
||||||
|
"gitea.maximumdirect.net/eric/narratio/v4/internal/app"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
os.Exit(app.Execute(os.Args[1:], os.Stdout, os.Stderr))
|
os.Exit(runProcess(os.Args[1:], commandkit.Streams{Out: os.Stdout, Err: os.Stderr}, app.Execute))
|
||||||
|
}
|
||||||
|
|
||||||
|
func runProcess(args []string, streams commandkit.Streams, execute func(context.Context, []string, commandkit.Streams) commandkit.Outcome) int {
|
||||||
|
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
||||||
|
defer stop()
|
||||||
|
return execute(ctx, args, streams).Status
|
||||||
}
|
}
|
||||||
|
|||||||
56
cmd/narratio/main_test.go
Normal file
56
cmd/narratio/main_test.go
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"syscall"
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"go.maximumdirect.net/commandkit"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestProcessSignalsCancelInvocation(t *testing.T) {
|
||||||
|
if os.Getenv("NARRATIO_TEST_SIGNAL_CHILD") == "1" {
|
||||||
|
os.Exit(runProcess(nil, commandkit.Streams{Out: os.Stdout, Err: os.Stderr}, func(ctx context.Context, _ []string, streams commandkit.Streams) commandkit.Outcome {
|
||||||
|
fmt.Fprintln(streams.Out, "ready")
|
||||||
|
<-ctx.Done()
|
||||||
|
return commandkit.Failure("interrupted").WithCause(ctx.Err())
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
for _, sig := range []os.Signal{os.Interrupt, syscall.SIGTERM} {
|
||||||
|
t.Run(sig.String(), func(t *testing.T) {
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
child := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestProcessSignalsCancelInvocation$")
|
||||||
|
child.Env = append(os.Environ(), "NARRATIO_TEST_SIGNAL_CHILD=1")
|
||||||
|
out, err := child.StdoutPipe()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
child.Stderr = os.Stderr
|
||||||
|
if err := child.Start(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
scanner := bufio.NewScanner(out)
|
||||||
|
if !scanner.Scan() || scanner.Text() != "ready" {
|
||||||
|
_ = child.Process.Kill()
|
||||||
|
_ = child.Wait()
|
||||||
|
t.Fatal("child failed to register its signal context")
|
||||||
|
}
|
||||||
|
if err := child.Process.Signal(sig); err != nil {
|
||||||
|
_ = child.Process.Kill()
|
||||||
|
_ = child.Wait()
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
err = child.Wait()
|
||||||
|
exit, ok := err.(*exec.ExitError)
|
||||||
|
if !ok || exit.ExitCode() != 1 {
|
||||||
|
t.Fatalf("child result=%v, want operational exit 1", err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
84
docs/adr/0001-classify-session-content.md
Normal file
84
docs/adr/0001-classify-session-content.md
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
# 0001. Classify session content by purpose and lifecycle
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
Accepted
|
||||||
|
|
||||||
|
## Date
|
||||||
|
|
||||||
|
2026-11-29
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
Narratio coordinates applications that produce transcripts, artifacts,
|
||||||
|
diagnostics, and working files. The current session layout mixes some of these
|
||||||
|
roles, including complete Notarius bundles under `artifacts/`. Operators use
|
||||||
|
transcripts and artifacts to evaluate results during development and need
|
||||||
|
predictable locations for diagnostics.
|
||||||
|
|
||||||
|
A shared classification model will guide the workspace design and subsequent
|
||||||
|
adapter changes. The [operator guide](../operations.md#local-state-layout)
|
||||||
|
describes the implemented layout.
|
||||||
|
|
||||||
|
## Decision
|
||||||
|
|
||||||
|
Classify content by its primary purpose and lifecycle:
|
||||||
|
|
||||||
|
| Category | Purpose |
|
||||||
|
| --- | --- |
|
||||||
|
| Inputs | Material consumed by an application, including audio, configuration, and reference documents. |
|
||||||
|
| Outputs | Completed substantive products, including intermediate artifacts exposed for further use. |
|
||||||
|
| Logs | Records of execution, including process logs, execution reports, warnings, and diagnostic summaries. |
|
||||||
|
| Cache | Reusable information whose absence permits ordinary recomputation or retrieval. |
|
||||||
|
| State | Application condition, progress, recovery records, and unfinished work. |
|
||||||
|
|
||||||
|
Classification is relative to the consuming application. An output of one stage
|
||||||
|
can serve as an input to another while retaining its output location. Completed
|
||||||
|
outputs reused to skip work remain Outputs. Narratio's manifest is State and
|
||||||
|
records whether those outputs are reusable.
|
||||||
|
|
||||||
|
Classify checkpoints according to their recovery behavior. A checkpoint needed
|
||||||
|
to continue a particular interrupted operation is State. A saved work result
|
||||||
|
that can be reused or recomputed is Cache. Recomputation cost informs retention
|
||||||
|
policy. File-specific classification remains necessary for stores serving both
|
||||||
|
purposes.
|
||||||
|
|
||||||
|
Treat Debug as a capture and retention mode that can include detailed Logs,
|
||||||
|
snapshots of State, and other diagnostic evidence. Retained debug snapshots have
|
||||||
|
a diagnostic role; live recovery records retain their State role.
|
||||||
|
|
||||||
|
Apply these directory principles to Narratio:
|
||||||
|
|
||||||
|
- Store completed artifacts, including intermediate artifacts like
|
||||||
|
`session_bounds.json`, directly in a flat `artifacts/` directory.
|
||||||
|
- Store combined transcripts directly in `transcripts/`, with a subdirectory
|
||||||
|
for the initial per-speaker transcripts.
|
||||||
|
- Store prepared external audio in `audio/` and other prepared external inputs
|
||||||
|
in `inputs/`.
|
||||||
|
- Organize Logs under `logs/` by stage. Execution reports belong to this category.
|
||||||
|
- Organize Cache under a cache root by the application that owns its format and
|
||||||
|
reuse behavior.
|
||||||
|
- Treat scratch files and unfinished outputs as State until completion permits
|
||||||
|
promotion to Outputs.
|
||||||
|
|
||||||
|
## Alternatives Considered
|
||||||
|
|
||||||
|
- Group outputs by producer. This exposes subprocess packaging to operators;
|
||||||
|
flat artifact and transcript locations better support comparison and review.
|
||||||
|
- Group Logs by application. Stage names match the operator's workflow and
|
||||||
|
collect diagnostics from stages that invoke multiple applications.
|
||||||
|
- Classify all checkpoints as State. Recovery behavior provides a more useful
|
||||||
|
distinction for eviction and reuse decisions.
|
||||||
|
- Treat all Debug material as Logs. A separate debug location can accommodate
|
||||||
|
retained state snapshots and larger diagnostic bundles when needed.
|
||||||
|
|
||||||
|
## Consequences
|
||||||
|
|
||||||
|
Each managed file family needs an identified role, owner, scope, and retention
|
||||||
|
rule. Subprocess bundles require classification before their contents are
|
||||||
|
placed in Narratio's output and diagnostic directories.
|
||||||
|
|
||||||
|
The [workspace reference](../operations.md#local-state-layout) defines the selected
|
||||||
|
physical layout, latest-attempt views, retention boundaries, and new-session cutover.
|
||||||
|
Current versus historical views remain separate from content categories.
|
||||||
|
Acceptance of this policy does not establish implementation of that layout.
|
||||||
77
docs/adr/0002-assign-subprocess-content-ownership.md
Normal file
77
docs/adr/0002-assign-subprocess-content-ownership.md
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
# 0002. Assign subprocess content ownership
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
Accepted
|
||||||
|
|
||||||
|
## Date
|
||||||
|
|
||||||
|
2026-11-29
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
[ADR 0001](0001-classify-session-content.md) defines content categories and
|
||||||
|
operator-facing directory principles. Narratio also needs an ownership boundary
|
||||||
|
for the applications it invokes. That boundary determines who selects locations,
|
||||||
|
manages retained files, and controls cleanup.
|
||||||
|
|
||||||
|
Subprocesses have their own execution state and reusable caches. Narratio
|
||||||
|
maintains its own session progress and recovery records.
|
||||||
|
|
||||||
|
## Decision
|
||||||
|
|
||||||
|
Assign responsibility by content category:
|
||||||
|
|
||||||
|
| Category | Responsibility |
|
||||||
|
| --- | --- |
|
||||||
|
| Inputs | Narratio supplies paths to prepared inputs, transcripts, and artifacts. |
|
||||||
|
| Outputs | Narratio selects destinations and promotes completed products into the output locations defined by ADR 0001. |
|
||||||
|
| Logs | Narratio selects stage-based destinations and captures subprocess output streams. |
|
||||||
|
| Debug | Narratio selects the destination when capture is enabled; the subprocess defines the diagnostic contents. |
|
||||||
|
| Subprocess State | Each application manages its working directory, temporary files, and execution lifecycle through its own configuration and defaults. |
|
||||||
|
| Subprocess Cache | Each application manages its configured persistent cache, including its format, identity, and reuse behavior. |
|
||||||
|
|
||||||
|
Narratio retains ownership of its own State, including the session manifest,
|
||||||
|
recovery bookkeeping, and staging files it manages.
|
||||||
|
|
||||||
|
Recommend a dedicated cache root for each cache-aware application, configurable
|
||||||
|
through that application's supported controls. For system-wide deployments,
|
||||||
|
`/var/cache/<application>` is a suggested location; `/var/cache/notarius` is an
|
||||||
|
example for Notarius. Each application defines its cache configuration, defaults,
|
||||||
|
and internal layout. Operators select locations and retention settings through
|
||||||
|
those controls. Narratio's session cleanup leaves subprocess caches under their
|
||||||
|
separate lifecycle policies.
|
||||||
|
|
||||||
|
Subprocesses retain ownership of their file formats and bundle structures.
|
||||||
|
Narratio can receive a complete result bundle at a selected staging destination
|
||||||
|
and promote the selected products into its canonical output directories.
|
||||||
|
Diagnostic snapshots of subprocess State follow the Debug destination selected
|
||||||
|
by Narratio.
|
||||||
|
|
||||||
|
Narratio's `runs/` directory can hold staging outputs and retained execution
|
||||||
|
evidence. Subprocess working directories follow the application's configuration
|
||||||
|
and may reside elsewhere. Narratio cleanup manages Narratio-owned material;
|
||||||
|
subprocess State and Cache follow their separate lifecycle policies.
|
||||||
|
|
||||||
|
## Alternatives Considered
|
||||||
|
|
||||||
|
- Place all subprocess working files and caches inside each Narratio session.
|
||||||
|
This makes sessions easier to collect as a unit, but couples application
|
||||||
|
internals and cache retention to Narratio's session lifecycle.
|
||||||
|
- Allow subprocesses to choose output, log, and debug destinations independently.
|
||||||
|
This simplifies invocation but scatters the material operators inspect.
|
||||||
|
- Give Narratio control of downstream bundle formats. This simplifies some
|
||||||
|
destination mappings but increases integration coupling. Selecting and
|
||||||
|
promoting products preserves application ownership of those formats.
|
||||||
|
|
||||||
|
## Consequences
|
||||||
|
|
||||||
|
Adapters need supported controls for Narratio-selected output, log, and debug
|
||||||
|
locations. Upstream changes may be needed where those destinations are coupled
|
||||||
|
to application working directories or to one another.
|
||||||
|
|
||||||
|
Workspace layout and file classification remain independent of subprocess
|
||||||
|
working-directory conventions. The
|
||||||
|
[workspace reference](../operations.md#local-state-layout) defines debug
|
||||||
|
placement, retained diagnostic views, and the new-session cutover.
|
||||||
|
Acceptance of this policy does not establish implementation of those changes.
|
||||||
38
docs/adr/0003-assign-configuration-ownership.md
Normal file
38
docs/adr/0003-assign-configuration-ownership.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# 0003. Assign configuration ownership
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
Accepted
|
||||||
|
|
||||||
|
## Date
|
||||||
|
|
||||||
|
2026-11-19
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
Configuration loading, inspection, and domain execution need explicit ownership
|
||||||
|
so that effective configuration has one authority.
|
||||||
|
|
||||||
|
## Decision
|
||||||
|
|
||||||
|
- **ConfigKit owns configuration policy and resolution through the final
|
||||||
|
handoff.** Narratio supplies its schema, defaults, and configuration rules
|
||||||
|
through ConfigKit's supported extension points. The completed ConfigKit
|
||||||
|
result is authoritative.
|
||||||
|
- **Narratio owns domain interpretation and execution.** It consumes the
|
||||||
|
completed configuration without mutation and produces separate domain
|
||||||
|
objects. It must not construct a replacement effective configuration.
|
||||||
|
- **CommandKit owns CLI mechanics and presentation; `ckconfig` exposes
|
||||||
|
ConfigKit's inspection features.** Narratio supplies selection and acquisition
|
||||||
|
wiring and exposes those features through native adapters, without altering
|
||||||
|
their semantics or substituting its own inspection views.
|
||||||
|
|
||||||
|
## Alternatives Considered
|
||||||
|
|
||||||
|
Post-handoff configuration resolution and custom inspection projections are
|
||||||
|
rejected because they create competing configuration authorities.
|
||||||
|
|
||||||
|
## Consequences
|
||||||
|
|
||||||
|
Domain catalogs and plans remain separate from native configuration inspection.
|
||||||
|
Missing configuration or inspection capabilities are addressed upstream.
|
||||||
@@ -1,202 +0,0 @@
|
|||||||
# Narratio Architecture
|
|
||||||
|
|
||||||
## Purpose
|
|
||||||
|
|
||||||
`narratio` is a Go orchestration application for processing D&D session audio into polished transcripts and generated session artifacts.
|
|
||||||
|
|
||||||
This document defines the development principles for the project. It is inward-facing: its audience is developers and LLM coding agents. It should guide future changes, not serve as a complete implementation reference.
|
|
||||||
|
|
||||||
Implemented component details belong under `docs/internal/`.
|
|
||||||
|
|
||||||
## Project Shape
|
|
||||||
|
|
||||||
Narratio is a modular, stage-driven orchestrator.
|
|
||||||
|
|
||||||
It coordinates specialized downstream systems rather than reimplementing their domains:
|
|
||||||
|
|
||||||
- WhisperX handles transcription.
|
|
||||||
- Seriatim handles deterministic transcript merge/normalization/trim behavior.
|
|
||||||
- Audita handles transcript correction and polishing.
|
|
||||||
- Scriptorium handles prompt execution and generated artifacts.
|
|
||||||
|
|
||||||
Narratio owns orchestration, configuration loading, session/run state, local and remote path modeling, manifest persistence, stage sequencing, resume behavior, and archive semantics.
|
|
||||||
|
|
||||||
Narratio should remain explicit and comprehensible. It is not intended to become a generic workflow engine.
|
|
||||||
|
|
||||||
## Core Principles
|
|
||||||
|
|
||||||
### Modular and composable
|
|
||||||
|
|
||||||
Code should be organized around clear responsibilities. Stages, adapters, config loading, manifest persistence, path construction, and storage behavior should remain separable and independently testable.
|
|
||||||
|
|
||||||
### Hexagonal boundaries
|
|
||||||
|
|
||||||
External systems should be isolated behind narrow adapters. Stage logic should depend on Narratio-level interfaces and data structures, not on external SDK types, subprocess argument construction, or transport-specific details.
|
|
||||||
|
|
||||||
### Standard library preference
|
|
||||||
|
|
||||||
Prefer the Go standard library. Add dependencies only when they provide substantial value, are necessary for an external integration, or are a widely used de facto standard.
|
|
||||||
|
|
||||||
Accepted examples include a YAML library for configuration and the AWS SDK for S3-compatible storage.
|
|
||||||
|
|
||||||
### Explicit orchestration
|
|
||||||
|
|
||||||
The pipeline should remain stage-driven and explicit. New behavior should be added through clear stage, adapter, config, or manifest contracts rather than implicit side effects or generic workflow abstraction.
|
|
||||||
|
|
||||||
## Stage Design
|
|
||||||
|
|
||||||
Each stage should have a clear scope of responsibility.
|
|
||||||
|
|
||||||
A stage should define:
|
|
||||||
|
|
||||||
- its purpose;
|
|
||||||
- required input state;
|
|
||||||
- produced output state;
|
|
||||||
- config fields it consumes;
|
|
||||||
- external adapters it uses;
|
|
||||||
- manifest refs it reads or writes;
|
|
||||||
- skip, force, and resume behavior;
|
|
||||||
- failure behavior;
|
|
||||||
- tests that protect its contract.
|
|
||||||
|
|
||||||
Stages should avoid reaching across boundaries. If shared behavior is needed, prefer a helper or service with a narrow interface over duplicating ad hoc logic between stages.
|
|
||||||
|
|
||||||
## Transactionality and Resume
|
|
||||||
|
|
||||||
A stage should behave transactionally.
|
|
||||||
|
|
||||||
A stage is complete only when its outputs have been written, validated, and recorded in the manifest. If a stage fails, Narratio should preserve enough local state for inspection, recovery, and resume.
|
|
||||||
|
|
||||||
A failed or incomplete run must not be treated as successful. Later stages should depend on manifest-recorded success, not merely on incidental files existing on disk.
|
|
||||||
|
|
||||||
## Manifest Model
|
|
||||||
|
|
||||||
The manifest is the durable local ledger for a run.
|
|
||||||
|
|
||||||
It should record:
|
|
||||||
|
|
||||||
- run identity;
|
|
||||||
- stage status;
|
|
||||||
- input and output refs;
|
|
||||||
- logs and generated config refs;
|
|
||||||
- checksums or provenance where useful;
|
|
||||||
- non-secret adapter and archive metadata.
|
|
||||||
|
|
||||||
Resume behavior should be manifest-driven. Filesystem state may be inspected and validated, but it should not replace manifest stage state as the source of run progress.
|
|
||||||
|
|
||||||
## Adapter Boundaries
|
|
||||||
|
|
||||||
Adapters own external integration details.
|
|
||||||
|
|
||||||
Expected boundaries:
|
|
||||||
|
|
||||||
- WhisperX HTTP details stay in the WhisperX adapter.
|
|
||||||
- Seriatim CLI construction stays in the Seriatim adapter.
|
|
||||||
- Audita CLI construction stays in the Audita adapter.
|
|
||||||
- Scriptorium CLI construction stays in the Scriptorium adapter.
|
|
||||||
- Object-storage details stay behind the storage adapter interface.
|
|
||||||
- AWS SDK types stay inside the S3 storage implementation.
|
|
||||||
|
|
||||||
Stage code should express intent in Narratio terms and call adapters through narrow contracts.
|
|
||||||
|
|
||||||
## Configuration Philosophy
|
|
||||||
|
|
||||||
Configuration should be strict, explicit, and operator-friendly.
|
|
||||||
|
|
||||||
Principles:
|
|
||||||
|
|
||||||
- YAML decoding should reject unknown fields.
|
|
||||||
- Defaults should be centralized and testable.
|
|
||||||
- Empty configured values should not silently override meaningful defaults.
|
|
||||||
- Session templating should remain narrow and deterministic.
|
|
||||||
- Template support should serve operator convenience, not become a general configuration language.
|
|
||||||
|
|
||||||
Narratio should not become a secondary configuration system for downstream tools. Seriatim, Audita, and Scriptorium should own their runtime defaults wherever practical. Narratio should pass required stage-contract paths and explicit operator overrides.
|
|
||||||
|
|
||||||
## Path and Storage Discipline
|
|
||||||
|
|
||||||
Local and remote paths are part of Narratio’s application contract.
|
|
||||||
|
|
||||||
Code should use centralized path helpers for workspace, spool, session, run, artifact, log, config, and archive paths. Stages should avoid reconstructing canonical paths through scattered string concatenation.
|
|
||||||
|
|
||||||
Storage backends should receive explicit bucket-relative keys. Storage implementations should not infer campaign, session, run, or root-prefix semantics.
|
|
||||||
|
|
||||||
## Archive Invariants
|
|
||||||
|
|
||||||
Archive behavior must preserve a clear commit boundary.
|
|
||||||
|
|
||||||
A remote run is current only after the archive stage has successfully uploaded the run record, required promoted outputs, `current/manifest.json`, and finally `current/run_id.txt`.
|
|
||||||
|
|
||||||
`current/run_id.txt` is the final remote commit marker and must be written last.
|
|
||||||
|
|
||||||
Failed, incomplete, skipped, or uncommitted archive attempts must not be presented as current remote state. Local cleanup is permitted only after successful archive commit and only when explicitly configured.
|
|
||||||
|
|
||||||
## Security and Privacy
|
|
||||||
|
|
||||||
Narratio handles private campaign material.
|
|
||||||
|
|
||||||
Rules:
|
|
||||||
|
|
||||||
- Do not store raw secrets in pipeline or session YAML.
|
|
||||||
- Use environment variable names or secret-file references for secret handling.
|
|
||||||
- Do not write raw secret values to manifests, logs, generated configs, or archive metadata.
|
|
||||||
- Treat transcripts, generated artifacts, prompts, reports, and logs as potentially sensitive.
|
|
||||||
- Avoid logging transcript or prompt content unless there is a deliberate diagnostic reason.
|
|
||||||
|
|
||||||
## Diagnostics
|
|
||||||
|
|
||||||
Diagnostics should be durable and discoverable, but distinct from canonical outputs.
|
|
||||||
|
|
||||||
Logs, reports, generated invocation/config files, and render-debug files support debugging. Transcript tiers and configured artifacts are pipeline products.
|
|
||||||
|
|
||||||
Manifest refs should preserve that distinction.
|
|
||||||
|
|
||||||
## Determinism
|
|
||||||
|
|
||||||
Where practical, Narratio should prefer deterministic behavior:
|
|
||||||
|
|
||||||
- stable local path layout;
|
|
||||||
- stable remote key layout;
|
|
||||||
- sorted upload order;
|
|
||||||
- predictable generated config files;
|
|
||||||
- repeatable command construction;
|
|
||||||
- tests that do not depend on live external services.
|
|
||||||
|
|
||||||
Run IDs and timestamps may be intentionally variable, but surrounding behavior should remain testable.
|
|
||||||
|
|
||||||
## Testing Expectations
|
|
||||||
|
|
||||||
Core behavior should be testable without live external services.
|
|
||||||
|
|
||||||
Tests should cover:
|
|
||||||
|
|
||||||
- config loading, defaults, and validation;
|
|
||||||
- CLI parsing and command construction;
|
|
||||||
- path helpers;
|
|
||||||
- manifest transitions;
|
|
||||||
- stage success, failure, skip, and resume behavior;
|
|
||||||
- adapter command construction;
|
|
||||||
- fake storage behavior;
|
|
||||||
- archive commit ordering;
|
|
||||||
- example config validity where practical.
|
|
||||||
|
|
||||||
Live S3, WhisperX, LLM, or subprocess integration tests should be explicit integration tests, not required for ordinary unit test runs.
|
|
||||||
|
|
||||||
## Documentation Expectations
|
|
||||||
|
|
||||||
Documentation must follow `docs/documentation/policy.md`.
|
|
||||||
|
|
||||||
Current behavior belongs in user-facing docs and `docs/internal/`. Future, planned, aspirational, experimental, or unimplemented work belongs only under `docs/roadmap/`.
|
|
||||||
|
|
||||||
`docs/architecture.md` should remain concise and principle-focused. It should not duplicate the full config reference, CLI reference, operations guide, or internal stage documentation.
|
|
||||||
|
|
||||||
## Non-Goals
|
|
||||||
|
|
||||||
Narratio is not:
|
|
||||||
|
|
||||||
- a generic DAG or workflow engine;
|
|
||||||
- a replacement configuration layer for Seriatim, Audita, or Scriptorium;
|
|
||||||
- a storage backend abstraction beyond the needs of this pipeline;
|
|
||||||
- a place to embed raw secrets;
|
|
||||||
- a place for stage logic to depend directly on AWS SDK types or downstream tool internals;
|
|
||||||
- a prompt-authoring system.
|
|
||||||
608
docs/cli.md
608
docs/cli.md
@@ -1,278 +1,454 @@
|
|||||||
# CLI
|
# CLI Reference
|
||||||
|
|
||||||
## Shortest Useful Command
|
## Command tree
|
||||||
|
|
||||||
```bash
|
```text
|
||||||
narratio run --session-id 2026-04-04
|
narratio
|
||||||
|
├── run SESSION
|
||||||
|
├── preflight SESSION
|
||||||
|
├── artifacts
|
||||||
|
│ ├── list
|
||||||
|
│ └── regenerate SESSION
|
||||||
|
├── session
|
||||||
|
│ ├── init SESSION
|
||||||
|
│ ├── plan SESSION
|
||||||
|
│ ├── status SESSION
|
||||||
|
│ ├── restore SESSION
|
||||||
|
│ ├── clean [SESSION | --all]
|
||||||
|
│ ├── artifacts SESSION
|
||||||
|
│ └── locks
|
||||||
|
│ ├── list SESSION
|
||||||
|
│ ├── add SESSION SOURCE
|
||||||
|
│ └── remove SESSION SOURCE
|
||||||
|
├── config
|
||||||
|
│ ├── scopes
|
||||||
|
│ ├── validate
|
||||||
|
│ ├── show
|
||||||
|
│ ├── sources
|
||||||
|
│ ├── explain
|
||||||
|
│ └── diff
|
||||||
|
├── version
|
||||||
|
├── completion bash|zsh|fish
|
||||||
|
└── help [COMMAND...]
|
||||||
```
|
```
|
||||||
|
|
||||||
This command uses default discovery for `pipeline.yml` and `session.yml`; both files must be discoverable unless you pass explicit `--config` and `--session` paths.
|
Bare root and command groups display help. Use `narratio help session plan`
|
||||||
|
or `narratio session plan --help` for command-local flags and operands. Help,
|
||||||
|
version, completion, and `config scopes` do not bootstrap credentials, load
|
||||||
|
configuration, contact storage, or initialize adapters.
|
||||||
|
|
||||||
## Command Overview
|
## Invocation syntax
|
||||||
|
|
||||||
Implemented commands:
|
Place flags after the complete command path; they may be interspersed with
|
||||||
|
operands. Use command help for installed flags. The [CommandKit CLI contract](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/cli.md#registered-command-syntax)
|
||||||
|
describes parsing, repetition, and boolean values. Narratio additionally
|
||||||
|
normalizes repeatable `--artifacts` selections as described below.
|
||||||
|
|
||||||
- `run`: execute pipeline stages and persist manifest state.
|
## Configuration selectors
|
||||||
- `plan`: validate config, prepare workspace layout, and print stage run/skip decisions.
|
|
||||||
- `resume`: continue from first non-succeeded stage unless forced.
|
|
||||||
- `status`: read and print stage statuses from an existing manifest.
|
|
||||||
- `run-stage`: execute exactly one stage.
|
|
||||||
- `restore`: restore durable local session state from the committed remote archive state.
|
|
||||||
|
|
||||||
Unknown commands print usage and exit non-zero.
|
| Selector | Meaning |
|
||||||
|
| --- | --- |
|
||||||
|
| `--config PATH` | Exact pipeline root, regardless of configuration scope; omission uses discovery. |
|
||||||
|
| `--overlay NAME` | Pipeline overlay; omitted, empty, or `default` selects the base. |
|
||||||
|
| `--campaign ID` | Select and assert the effective campaign identity. |
|
||||||
|
| `--campaign-file PATH` | Exact campaign source; may accompany its identity assertion. |
|
||||||
|
| `--session ID` | Session identity for native configuration inspection only. |
|
||||||
|
| `--session-file PATH` | Exact session source; domain commands use positional `SESSION` as the identity assertion. |
|
||||||
|
| `--party-file PATH` | Select the canonical roster instead of the campaign's default file. |
|
||||||
|
| `--previous-session-id ID` | Assert the configured previous-session identity on applicable domain commands. |
|
||||||
|
|
||||||
For config semantics, see [docs/config.md](./config.md). For operator lifecycle and recovery, see [docs/operations.md](./operations.md).
|
Explicit relative file/directory paths use the invocation directory. Explicit
|
||||||
|
file errors and identity mismatches fail without fallback. A file selects the
|
||||||
|
source; an identity asserts its effective ID after resolution. File-only
|
||||||
|
configuration inspection may obtain identity from the file. Selecting a party
|
||||||
|
file does not rewrite the campaign's party setting; the selected roster feeds
|
||||||
|
players, family expansion, planning, and execution consistently.
|
||||||
|
|
||||||
## Complete Flag Reference
|
Selectors are installed only where applicable; command help lists them.
|
||||||
|
`session init` creates new input and therefore has no existing-session-file
|
||||||
|
or party-file selection. `session clean --all` accepts pipeline/overlay
|
||||||
|
selection and rejects campaign, session, party, and previous-session selectors.
|
||||||
|
|
||||||
### `run`
|
When no explicit session file is selected, local discovery precedes remote
|
||||||
|
acquisition. Only local absence permits remote fallback, with a known identity.
|
||||||
|
Remote loading prefers authored session-root YAML, then the current commit's
|
||||||
|
prepared snapshot only when the authored object is absent. Read-only commands
|
||||||
|
may perform these reads without initializing runtime state. See
|
||||||
|
[discovery](config.md#discovery-and-selection) and
|
||||||
|
[credential bootstrap](config.md#secrets-handling) for configuration details.
|
||||||
|
|
||||||
- `--config <path>`: optional explicit `pipeline.yml` path.
|
## Run
|
||||||
- `--session <path>`: optional explicit `session.yml` path.
|
|
||||||
- `--session-id <value>`: session template variable value.
|
|
||||||
- `--force`: force stage execution.
|
|
||||||
- `--artifacts <names>`: analyze artifact keys to execute (repeatable or comma-separated).
|
|
||||||
|
|
||||||
### `plan`
|
```sh
|
||||||
|
narratio run SESSION
|
||||||
- `--config <path>`
|
narratio run SESSION --from extract --through analyze
|
||||||
- `--session <path>`
|
narratio run SESSION --stage analyze --force --artifacts session_recap
|
||||||
- `--session-id <value>`
|
|
||||||
- `--force`
|
|
||||||
|
|
||||||
### `resume`
|
|
||||||
|
|
||||||
- `--config <path>`
|
|
||||||
- `--session <path>`
|
|
||||||
- `--session-id <value>`
|
|
||||||
- `--force`
|
|
||||||
- `--artifacts <names>`: analyze artifact keys to execute (repeatable or comma-separated).
|
|
||||||
|
|
||||||
### `run-stage`
|
|
||||||
|
|
||||||
- `--config <path>`
|
|
||||||
- `--session <path>`
|
|
||||||
- `--session-id <value>`
|
|
||||||
- `--force`
|
|
||||||
- `--artifacts <names>`: analyze artifact keys to execute (repeatable or comma-separated).
|
|
||||||
- positional `<stage>`: required stage name.
|
|
||||||
|
|
||||||
Valid stage names:
|
|
||||||
|
|
||||||
- `prepare`
|
|
||||||
- `transcribe`
|
|
||||||
- `merge`
|
|
||||||
- `polish`
|
|
||||||
- `normalize`
|
|
||||||
- `trim`
|
|
||||||
- `analyze`
|
|
||||||
- `archive`
|
|
||||||
- `notify`
|
|
||||||
|
|
||||||
### `restore`
|
|
||||||
|
|
||||||
- `--config <path>`
|
|
||||||
- `--session <path>`
|
|
||||||
- `--session-id <value>`
|
|
||||||
- `--dry-run`: plan restore actions without writing local files.
|
|
||||||
- `--force`: overwrite local conflicting files with remote archive files.
|
|
||||||
- `--include-audio`: include durable archived `audio/**` files in restore scope.
|
|
||||||
|
|
||||||
### `status`
|
|
||||||
|
|
||||||
- `--manifest <path>`: required manifest path.
|
|
||||||
|
|
||||||
## Command Reference
|
|
||||||
|
|
||||||
### `run`
|
|
||||||
|
|
||||||
Purpose:
|
|
||||||
- Execute configured stages in canonical order.
|
|
||||||
|
|
||||||
Syntax:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio run [--config <pipeline.yml>] [--session <session.yml>] [--session-id <id>] [--force] [--artifacts <name[,name...]>]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Success output:
|
The default is the full canonical pipeline:
|
||||||
- `narratio run: session <session_id>; executed=<n> skipped=<n>; manifest=<path>`
|
`prepare`, `transcribe`, `merge`, `polish`, `normalize`, `trim`, `render`,
|
||||||
|
`extract`, `analyze`, `publish`, `notify`, `cleanup`.
|
||||||
|
`--from` and `--through` select inclusive contiguous bounds. `--stage` selects
|
||||||
|
one stage and cannot accompany explicitly supplied range flags. `--force`
|
||||||
|
reruns selected work; dependent invalidation can extend beyond that range.
|
||||||
|
Bounded starts use valid preceding state or an imported-product baseline.
|
||||||
|
In an imported workspace, selected consumers require their actual inputs;
|
||||||
|
unrelated producer-stage history is unnecessary. Narratio prepares required
|
||||||
|
references before downstream checks. Ordinary execution uses
|
||||||
|
semantic resume checks rather than rerunning all selected work.
|
||||||
|
|
||||||
Common failure cases:
|
After preparation, `run` checks projected Audita, Notarius, and Scriptorium work before
|
||||||
- missing default config/session paths when flags omitted.
|
processing continues. Failed checks stop the invocation; prompt warnings alone
|
||||||
- invalid template/rendered session mismatch.
|
do not. `artifacts regenerate` uses the same check.
|
||||||
- unknown/invalid `--artifacts` value.
|
See [operations](operations.md#prompt-requirements-preflight) for recovery.
|
||||||
- `--artifacts` with unknown configured artifact key.
|
|
||||||
|
|
||||||
### `plan`
|
Analysis-only rebuilding uses `run SESSION --stage analyze --force`; it does
|
||||||
|
not refresh extraction. Publishing alone uses `run SESSION --stage publish`,
|
||||||
|
adding `--force` when a rerun is intended. It does not schedule cleanup. See
|
||||||
|
[operations](operations.md#artifact-development-workflows) for regeneration workflows.
|
||||||
|
|
||||||
Purpose:
|
## Artifacts regenerate
|
||||||
- Validate config, load secrets (if configured), prepare workdir, and print stage run/skip decisions.
|
|
||||||
|
|
||||||
Syntax:
|
```sh
|
||||||
|
narratio artifacts regenerate SESSION
|
||||||
```bash
|
narratio artifacts regenerate SESSION --artifacts session_recap,player_handout
|
||||||
narratio plan [--config <pipeline.yml>] [--session <session.yml>] [--session-id <id>] [--force]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Success output includes:
|
Forces the fixed inclusive `extract` through `analyze` range. It refreshes the
|
||||||
- `narratio plan: workdir prepared at <path>`
|
whole configured Notarius extraction bundle and chunk work, then selected
|
||||||
- one line per stage (`<stage>: run|skip`)
|
analysis targets and required prerequisites. `--artifacts` narrows analysis,
|
||||||
- `totals: run=<n> skip=<n>`
|
not extraction lanes. Publication, notification, and cleanup are outside this
|
||||||
|
range. Independent `--from`, `--through`, `--stage`, and `--force` flags are
|
||||||
|
not installed on this command. It accepts applicable context selectors and
|
||||||
|
returns the same run report as `run`.
|
||||||
|
|
||||||
Common failure cases:
|
## Artifacts list
|
||||||
- same config/session discovery and validation failures as `run`.
|
|
||||||
- secrets directory read failures when `pipeline.secrets.env_dir` is configured.
|
|
||||||
|
|
||||||
### `resume`
|
```sh
|
||||||
|
narratio artifacts list --config pipeline.yml --campaign-file campaign.yml
|
||||||
Purpose:
|
|
||||||
- Continue from session-manifest stage status.
|
|
||||||
|
|
||||||
Syntax:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio resume [--config <pipeline.yml>] [--session <session.yml>] [--session-id <id>] [--force] [--artifacts <name[,name...]>]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Success output:
|
Lists domain definitions: source identities, producers, outputs, dependencies,
|
||||||
- `narratio resume: session <session_id> has no remaining stages`
|
and selected-party family/member provenance. It acquires the context needed to
|
||||||
- or `narratio resume: session <session_id>; executed=<n> skipped=<n>; manifest=<path>`
|
derive that catalog, without requiring a session solely for listing definitions.
|
||||||
|
It does not add generated members to native `config show` output.
|
||||||
|
|
||||||
Common failure cases:
|
## Session plan
|
||||||
- same discovery/template/validation failures as `run`.
|
|
||||||
- manifest load errors when existing manifest is unreadable.
|
|
||||||
- invalid or unknown artifact selections.
|
|
||||||
|
|
||||||
### `status`
|
```sh
|
||||||
|
narratio session plan SESSION --stage analyze --force --format json
|
||||||
Purpose:
|
|
||||||
- Inspect one manifest file without executing stages.
|
|
||||||
|
|
||||||
Syntax:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio status --manifest <manifest.json>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Success output includes:
|
Accepts the same stage/range, force, artifact, and context selections as `run`.
|
||||||
- `session_id: <id>`
|
Reports execution/reuse actions and reasons, analysis targets, prerequisite work,
|
||||||
- `updated_at: <timestamp>`
|
and publication mappings through shared planners. For applicable bounded runs,
|
||||||
- `stages:` entries (`- <stage>: <status>`)
|
the report also describes reference preparation and identifies unavailable
|
||||||
|
built-in inputs. Planning reads existing state
|
||||||
|
without creating a workspace, changing manifests, acquiring execution locks, or
|
||||||
|
initializing stage-execution adapters or invoking requirements inspection. For a
|
||||||
|
selected, previously successful S3 audio preparation eligible for reuse, planning
|
||||||
|
composes object storage and reads current audio identities. An inspection failure
|
||||||
|
or insufficient identity evidence schedules preparation with an unverified-source
|
||||||
|
reason; dependent decisions reflect that projected rerun. Object-store
|
||||||
|
initialization errors fail the command. The check observes sources at planning
|
||||||
|
time and does not guarantee they remain unchanged during execution. Planning does
|
||||||
|
not predict unknown output identities.
|
||||||
|
|
||||||
Common failure cases:
|
## Preflight
|
||||||
- missing `--manifest`.
|
|
||||||
- unreadable or invalid manifest path.
|
|
||||||
|
|
||||||
### `run-stage`
|
```sh
|
||||||
|
narratio preflight SESSION --session-file ./session.yml
|
||||||
Purpose:
|
narratio preflight SESSION --format json
|
||||||
- Execute exactly one stage.
|
|
||||||
|
|
||||||
Syntax:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio run-stage [--config <pipeline.yml>] [--session <session.yml>] [--session-id <id>] [--force] [--artifacts <name[,name...]>] <stage>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Success output:
|
Preflight resolves the same session and configuration selectors as `run`,
|
||||||
- `narratio run-stage: stage=<name> executed=<n> skipped=<n> force=<true|false>; manifest=<path>`
|
prepares or reuses inputs, and checks enabled downstream capabilities and
|
||||||
|
prompt prerequisites even when their processing outputs are reusable. It may
|
||||||
|
create a workspace, download inputs, update the manifest, and contact providers.
|
||||||
|
It stops before processing and publication. Required failures or blocked
|
||||||
|
checks prevent readiness; conditional or incomplete prompt discovery can warn
|
||||||
|
without failing. Preparation remains reusable after a later readiness failure.
|
||||||
|
See [operations](operations.md#prompt-requirements-preflight) for details.
|
||||||
|
|
||||||
`--artifacts` behavior:
|
## Session status
|
||||||
- accepted only when `<stage>` is `analyze`.
|
|
||||||
- names are normalized (trimmed, deduplicated, sorted).
|
|
||||||
- unknown configured artifact keys fail.
|
|
||||||
|
|
||||||
Common failure cases:
|
```sh
|
||||||
- missing stage positional arg.
|
narratio session status SESSION --format json
|
||||||
- unknown stage name.
|
|
||||||
- using `--artifacts` with any non-`analyze` stage.
|
|
||||||
|
|
||||||
### `restore`
|
|
||||||
|
|
||||||
Purpose:
|
|
||||||
- Restore durable session state (`manifest.json`, `transcripts/**`, `artifacts/**`, and optional `audio/**`) from the committed remote archive current state.
|
|
||||||
|
|
||||||
Syntax:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio restore [--config <pipeline.yml>] [--session <session.yml>] [--session-id <id>] [--dry-run] [--force] [--include-audio]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Success output (dry-run):
|
Reports local manifest stages and artifacts, configuration provenance, readiness,
|
||||||
- `Restore plan for <campaign>/<session_id>`
|
and remote current state when storage is available. Remote output entries retain
|
||||||
- `Remote run: <run_id>`
|
exact committed declarations and carried-output origins separately from current
|
||||||
- `Would download: <n>`
|
configured destinations. An absent remote current pointer is a reported missing
|
||||||
- `Would skip unchanged: <n>`
|
state, rather than an error by itself. Genuine inspection failures can return a
|
||||||
- `Conflicts: <n>`
|
partial report with a failed outcome.
|
||||||
|
|
||||||
Success output (non-dry-run):
|
## Session artifacts
|
||||||
- `Restored session archive for <campaign>/<session_id>`
|
|
||||||
- `Remote run: <run_id>`
|
|
||||||
- `Downloaded: <n>`
|
|
||||||
- `Skipped unchanged: <n>`
|
|
||||||
- `Conflicts: <n>`
|
|
||||||
|
|
||||||
Common failure cases:
|
```sh
|
||||||
- storage backend is not configured.
|
narratio session artifacts SESSION --remote
|
||||||
- remote `current/run_id.txt` missing/empty.
|
|
||||||
- remote `current/manifest.json` missing or invalid.
|
|
||||||
- remote manifest session/campaign mismatch.
|
|
||||||
- local conflicts without `--force`.
|
|
||||||
- session lock conflict.
|
|
||||||
|
|
||||||
## Common Workflows
|
|
||||||
|
|
||||||
Default-discovery run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio run --session-id 2026-04-04
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Run only selected analyze artifacts:
|
Reports definitions, dependencies, local availability/evidence, and optional
|
||||||
|
remote publication state without reading artifact payload bodies. Without
|
||||||
|
`--remote`, this command avoids remote artifact inspection. Remote entries use
|
||||||
|
the selected publication inventory and current lock state.
|
||||||
|
For built-ins, `recorded` identifies producer-output or supplied-product manifest
|
||||||
|
evidence; supplied entries carry `manifest.supplied_product` provenance.
|
||||||
|
Consumer resolution performs the corresponding payload validation.
|
||||||
|
|
||||||
```bash
|
## Session init
|
||||||
narratio run --session-id 2026-04-04 --artifacts session_recap,player_handout
|
|
||||||
|
```sh
|
||||||
|
narratio session init SESSION --output ./session.yml --audio-dir ./audio
|
||||||
|
narratio session init SESSION --remote --audio-s3-prefix audio/session/
|
||||||
```
|
```
|
||||||
|
|
||||||
Resume with selected analyze artifacts:
|
Choose exactly one destination: `--output PATH` or `--remote`. Options include
|
||||||
|
`--date YYYY-MM-DD`, `--title TEXT`, `--previous-session-id ID`, `--force`,
|
||||||
|
configuration/overlay/campaign selectors, and exactly one audio override
|
||||||
|
if needed: `--audio-dir PATH` or `--audio-s3-prefix PREFIX`.
|
||||||
|
|
||||||
```bash
|
A configured session template retains its import/resource authoring context;
|
||||||
narratio resume --session-id 2026-04-04 --artifacts player_handout
|
relative CLI audio paths use the invocation directory. Generated YAML is
|
||||||
|
standalone and concrete. `--format` changes only the confirmation report,
|
||||||
|
never the generated YAML file. See [initialization](operations.md#session-initialization).
|
||||||
|
|
||||||
|
## Session restore
|
||||||
|
|
||||||
|
```sh
|
||||||
|
narratio session restore SESSION --dry-run
|
||||||
|
narratio session restore SESSION --force --include-audio
|
||||||
```
|
```
|
||||||
|
|
||||||
Run only analyze stage with selected artifacts:
|
Imports products from the pointer-selected publication and returns actions,
|
||||||
|
conflicts, and projected work. Dry runs make no local directory or
|
||||||
|
mode changes. Actual restore merges verified products with local progress under
|
||||||
|
the workspace lock and saves the local manifest last. `--force` permits
|
||||||
|
replacement only of eligible regular files; it does not force pipeline work.
|
||||||
|
Interrupted imports retain a recovery marker. Remote execution-checkpoint
|
||||||
|
recovery is deferred. See [restore operations](operations.md#restore-workflow).
|
||||||
|
|
||||||
```bash
|
## Session clean
|
||||||
narratio run-stage --session-id 2026-04-04 --artifacts player_handout analyze
|
|
||||||
|
```sh
|
||||||
|
narratio session clean SESSION --dry-run
|
||||||
|
narratio session clean --all --dry-run
|
||||||
```
|
```
|
||||||
|
|
||||||
Preview restore actions without writes:
|
Choose positional `SESSION` or `--all`. Removes the selected local workspace
|
||||||
|
state. Dry runs return planned
|
||||||
|
actions without deletion. Partial failures retain completed actions. This manual
|
||||||
|
operation is separate from the pipeline cleanup stage. Exact scope and recovery
|
||||||
|
implications belong in [cleanup operations](operations.md#cleanup).
|
||||||
|
|
||||||
```bash
|
## Session locks
|
||||||
narratio restore --session-id 2026-04-04 --dry-run
|
|
||||||
|
```sh
|
||||||
|
narratio session locks list SESSION
|
||||||
|
narratio session locks add SESSION narratio.artifact.session_recap --reason 'manual review'
|
||||||
|
narratio session locks remove SESSION narratio.artifact.session_recap
|
||||||
```
|
```
|
||||||
|
|
||||||
Restore and then force analyze:
|
A bare locks group displays help. List reports independent remote locks sorted
|
||||||
|
by source. Add reports an existing lock unless `--force` requests one
|
||||||
|
conditional, generation-matched replacement; concurrent change requires retry.
|
||||||
|
Remove is idempotent. `--reason TEXT` is available on add. See
|
||||||
|
[publish locks](operations.md#publish-locks) for their publication effect.
|
||||||
|
|
||||||
```bash
|
## `--artifacts` selection rules
|
||||||
narratio restore --session-id 2026-04-04
|
|
||||||
narratio run-stage --session-id 2026-04-04 --force analyze
|
`run`, `session plan`, and `artifacts regenerate` accept repeatable
|
||||||
|
`--artifacts NAME[,NAME...]`. Values are trimmed, deduplicated, and sorted.
|
||||||
|
Family keys select all concrete members; concrete keys select one member.
|
||||||
|
Analysis includes required prerequisite closure. Publication selects applicable
|
||||||
|
configured artifact outputs. The option requires a selected analysis or publish
|
||||||
|
consumer and does not select built-in output sources or individual extraction
|
||||||
|
lanes. See [artifact configuration](config.md#scriptorium-artifact-families).
|
||||||
|
|
||||||
|
## Configuration inspection
|
||||||
|
|
||||||
|
`config scopes` lists operations and features without loading. The four scopes
|
||||||
|
are `app` (default), `campaign`, `session`, and `party`. They expose their actual
|
||||||
|
typed ConfigKit results, with native provenance, resolution history, and safe
|
||||||
|
secret views. App inspection needs no campaign/party expansion. Domain catalogs
|
||||||
|
and execution plans are separate views.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
narratio config show --scope app --format json
|
||||||
|
narratio config show --scope session --session SESSION --session-file ./session.yml
|
||||||
|
narratio config show --scope party --party-file ./party.yml
|
||||||
|
narratio config show --path /scriptorium --format yaml
|
||||||
|
narratio config sources --scope campaign --campaign-file ./campaign.yml
|
||||||
|
narratio config explain --path /scriptorium --format json
|
||||||
|
narratio config explain --list --under /scriptorium --historical
|
||||||
|
narratio config validate --details --severity error
|
||||||
```
|
```
|
||||||
|
|
||||||
## Diagnostic / Recovery Commands
|
Use native show, sources, explain, and validation operations; their options,
|
||||||
|
path syntax, findings, and report shapes are described in the
|
||||||
|
[CommandKit configuration contract](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/cli.md#configuration-scopes).
|
||||||
|
`--scope all` is supported for show and validate and requires applicable context
|
||||||
|
for every reached scope. Domain catalog and plan views remain separate.
|
||||||
|
|
||||||
Inspect stage status:
|
### Independent comparisons and overrides
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
narratio status --manifest <manifest.json>
|
narratio config diff --config pipeline.yml --against-config pipeline.yml --against-overlay testing --details --check
|
||||||
|
narratio config diff --scope party --party-file before.yml --against-party-file after.yml
|
||||||
|
narratio config show --scope app --set '/whisperx/concurrency=2'
|
||||||
```
|
```
|
||||||
|
|
||||||
Get manifest path from previous output:
|
Diff loads each side independently. In addition to native `--against-config`
|
||||||
- `run`, `resume`, and `run-stage` print `manifest=<path>` on success.
|
and `--against-overlay`, applicable scopes accept `--against-campaign`,
|
||||||
|
`--against-campaign-file`, `--against-session`, `--against-session-file`, and
|
||||||
|
`--against-party-file`. Omitted right-side selectors use their own normal
|
||||||
|
defaults; they never inherit left-side selections. Each party default follows
|
||||||
|
that side's campaign.
|
||||||
|
|
||||||
## `--artifacts` and `--force`
|
Each reached pipeline side performs its own configured startup; both sides use
|
||||||
|
the process environment. See the [native comparison contract](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/cli.md#compare-configuration-selections)
|
||||||
|
for report and comparison semantics.
|
||||||
|
|
||||||
- `--artifacts` filters which configured artifacts are executable when analyze runs.
|
Only app inspection supports ordered, repeatable `--set POINTER=JSON`, plus
|
||||||
- `--artifacts` does not imply `--force`.
|
`--against-set POINTER=JSON` for the comparison side. ConfigKit applies these
|
||||||
- if analyze is already `succeeded` and `--force` is not set, runner-level skip still applies.
|
during that load. They affect only that invocation. Other scopes and aggregate
|
||||||
|
inspection reject overrides. Execution/planning use files and overlays;
|
||||||
|
they have no field-override flags.
|
||||||
|
|
||||||
|
## Reporting and visibility
|
||||||
|
|
||||||
|
Reports go to stdout; diagnostics and progress go to stderr. Domain commands
|
||||||
|
return one final public report where useful, including meaningful partial work
|
||||||
|
on failure. `--format text|yaml|json` selects presentation. Automatic structured
|
||||||
|
reports use YAML; text uses the same data. Version and native inspection commands
|
||||||
|
may have native text renderers. Report format does not change artifact formats.
|
||||||
|
There is no public report schema-version field.
|
||||||
|
|
||||||
|
[CommandKit reporting](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/cli.md#reporting) defines formats and visibility controls.
|
||||||
|
Bootstrap evidence is presented as final diagnostics on stderr, independently
|
||||||
|
of the substantive command report and its `--format` selection.
|
||||||
|
|
||||||
|
Progress covers stage transitions/reuse, audio transfers/cache reuse, and
|
||||||
|
individual durable speaker/artifact checkpoints and validated reuse. Info adds
|
||||||
|
selected sources, destinations, and decision context. Concurrent completion
|
||||||
|
order is not fixed. Workers settle before the final report.
|
||||||
|
|
||||||
|
Console debug does not enable downstream debug captures or change retention.
|
||||||
|
Downstream streams stay in captured logs and are not replayed automatically.
|
||||||
|
Quiet changes visibility, not execution, persistence, or logging. A report or
|
||||||
|
diagnostic delivery failure can fail the invocation after durable work has
|
||||||
|
completed; it does not roll back that work.
|
||||||
|
|
||||||
|
### Public domain report fields
|
||||||
|
|
||||||
|
Optional fields appear when meaningful; these reports do not expose raw
|
||||||
|
manifests, resolved credentials, or internal dependency containers.
|
||||||
|
|
||||||
|
| Report | Fields |
|
||||||
|
| --- | --- |
|
||||||
|
| Run/regenerate | `campaign`, `session_id`, `run_id`, `stages`, `executed`, `skipped`, `stage_results`, `available_artifacts`, `artifact_targets`, `complete` |
|
||||||
|
| Plan | `campaign`, `session_id`, `stages` with `name`, `action`, `reason`, optional `analysis`; `publication_actions` |
|
||||||
|
| Catalog | `artifacts` with source, producer, output, enabled state, dependencies, optional concrete key and family/member/source provenance |
|
||||||
|
| Preflight | `campaign`, `session_id`, optional `session_source` and `run_id`, `preparation` with outcome and optional reason, `ready`, `checks` with group, outcome and optional message, `findings` with severity, category and message |
|
||||||
|
| Status/artifacts | Identities/source, `local_manifest`, `stages`, `artifacts`, optional `remote`, configuration provenance, audio/previous-artifact readiness, `findings` |
|
||||||
|
| Init | `campaign`, `session_id`, `destination`, `remote`, `written` |
|
||||||
|
| Locks | Identities, `operation`, `result`, `complete`, optional `source`, `locks` |
|
||||||
|
| Restore | Identities/run, `dry_run`, `complete`, `status`, `downloaded`, `conflicts`, `actions`, projected satisfied/remaining work |
|
||||||
|
| Clean | Optional identities, `all`, `dry_run`, `complete`, `cache`, `actions`, optional `error` |
|
||||||
|
|
||||||
|
Preflight preparation outcomes are `completed`, `reused`, `failed`, or
|
||||||
|
`not_attempted`. Check outcomes are `succeeded`, `failed`, or `blocked`;
|
||||||
|
inapplicable groups may be omitted. Findings include errors, warnings, and
|
||||||
|
information where available. Quiet mode suppresses the report and retains
|
||||||
|
failure diagnostics on stderr.
|
||||||
|
|
||||||
|
Run `stages` is the complete selection. `executed` includes attempted work,
|
||||||
|
including failures and self-skips. `skipped` includes reuse and self-skips.
|
||||||
|
Each `stage_results` entry has `name`, `attempted`, `outcome`
|
||||||
|
(`completed`, `failed`, `reused`, `skipped`, `not_attempted`), and optional
|
||||||
|
`reason`. Available artifacts carry `stage`, optional `source`, `kind`, `path`,
|
||||||
|
optional `producer_run_id`, and durable `evidence` (`stage_result`,
|
||||||
|
`speaker_checkpoint`, `artifact_checkpoint`). Failed or unpersisted work is not
|
||||||
|
reported as completed.
|
||||||
|
|
||||||
|
Plan analysis contains `targets`, `prerequisites`, `execute`, and `reuse`;
|
||||||
|
artifact entries identify key, optional family/character, role, reason, and
|
||||||
|
force. Publication actions identify source, destination, required, and selected.
|
||||||
|
Remote status outputs retain source, destination, required, state, lock state,
|
||||||
|
declared destination/key, origin run, and error. Restore
|
||||||
|
actions carry kind, optional product source, relative local path, remote key,
|
||||||
|
status, and optional reason/error.
|
||||||
|
Clean actions carry path, status (`would_delete`, `deleted`, `missing`, `empty`,
|
||||||
|
`failed`), and optional error; cache records whether it was preserved, requested,
|
||||||
|
processed, or not applicable. Lock rows include source, reason, creation time,
|
||||||
|
and whether publication is configured for that source.
|
||||||
|
|
||||||
|
## Cancellation and exit status
|
||||||
|
|
||||||
|
Ctrl-C and termination cancel acquisition and active operations. Narratio stops
|
||||||
|
scheduling work, waits for started workers, attempts terminal local manifest
|
||||||
|
persistence, and releases acquired resources. Successful checkpoints remain
|
||||||
|
resumable. Cancellation does not schedule cleanup. Abrupt process death has no
|
||||||
|
added finalization guarantee.
|
||||||
|
|
||||||
|
| Status | Meaning |
|
||||||
|
| --- | --- |
|
||||||
|
| `0` | Success, including ordinary diff with differences. |
|
||||||
|
| `1` | Operational/readiness failure, cancellation, or output failure. |
|
||||||
|
| `2` | Invalid invocation or identifiable invalid configuration input. |
|
||||||
|
| `3` | `config diff --check` found differences. |
|
||||||
|
|
||||||
|
Missing/unreadable sources and ambiguous or callback loading failures are
|
||||||
|
operational; malformed or explicitly rejected configuration input uses native
|
||||||
|
input classification. Mixed failures preserve underlying causes and operational
|
||||||
|
precedence. Terminal failure is presented once, including in quiet mode.
|
||||||
|
|
||||||
|
## Version and completion
|
||||||
|
|
||||||
|
```sh
|
||||||
|
narratio version --format text
|
||||||
|
narratio version --scope commandkit --format json
|
||||||
|
source <(narratio completion bash)
|
||||||
|
source <(narratio completion zsh)
|
||||||
|
narratio completion fish | source
|
||||||
|
```
|
||||||
|
|
||||||
|
Version text is `NAME VERSION` with an optional revision; structured identity
|
||||||
|
contains `name`, `version`, and `revision`. ReleaseKit supplies the version:
|
||||||
|
it uses an injected release identifier, then the main-module version when
|
||||||
|
available, and otherwise reports `dev`. Bash requires bash-completion
|
||||||
|
initialized; Zsh requires its completion system initialized. Native completion offers command/flag names,
|
||||||
|
static stage/scope values, and applicable file/directory hints. Dynamic campaign
|
||||||
|
and artifact completion is deferred.
|
||||||
|
|
||||||
|
## Migration from the previous CLI
|
||||||
|
|
||||||
|
Removed command paths have no compatibility aliases.
|
||||||
|
|
||||||
|
| Previous invocation | Current invocation |
|
||||||
|
| --- | --- |
|
||||||
|
| `session validate SESSION` | `preflight SESSION` |
|
||||||
|
| `run-stage STAGE SESSION` | `run SESSION --stage STAGE` |
|
||||||
|
| `analyze SESSION` | `run SESSION --stage analyze --force` |
|
||||||
|
| `publish SESSION` | `run SESSION --stage publish --force` |
|
||||||
|
| `regenerate-artifacts SESSION` | `artifacts regenerate SESSION` |
|
||||||
|
| `clean SESSION` / `clean --all` | `session clean SESSION` / `session clean --all` |
|
||||||
|
| `config artifacts` | `artifacts list` |
|
||||||
|
| `session locks SESSION` | `session locks list SESSION` |
|
||||||
|
| `--session FILE` | `--session-file FILE`; inspection `--session` now asserts identity |
|
||||||
|
| `--session-id ID` | Positional `SESSION` on domain commands; `--session ID` on config inspection |
|
||||||
|
| `--secrets-dir PATH` | Configure the main pipeline file or supply environment values; see [Secrets Handling](config.md#secrets-handling). |
|
||||||
|
| `config diff LEFT_OVERLAY RIGHT_OVERLAY` | `config diff --overlay LEFT_OVERLAY --against-overlay RIGHT_OVERLAY` |
|
||||||
|
|
||||||
|
Unlike the former `session validate`, `preflight` prepares or reuses inputs and
|
||||||
|
can create workspace state, download inputs, and update the manifest. See
|
||||||
|
[preflight](#preflight) for its readiness-check behavior.
|
||||||
|
|
||||||
|
Campaign identity and file selectors may now accompany each other. Party-file
|
||||||
|
selection consistently overrides the roster without editing campaign settings.
|
||||||
|
Native configuration inspection retains declarations and their actual evidence;
|
||||||
|
use catalog/plan/session views for generated domain products. Comparison defaults
|
||||||
|
are independent. Field overrides are inspection-only. Update scripts to consume
|
||||||
|
structured reports and exit classifications, place flags after the complete
|
||||||
|
command path, and account for native repetition and cancellation behavior.
|
||||||
|
|||||||
860
docs/config.md
860
docs/config.md
@@ -1,174 +1,313 @@
|
|||||||
# Configuration
|
# Configuration Reference
|
||||||
|
|
||||||
## 1. Overview
|
## Purpose
|
||||||
|
|
||||||
Narratio loads two YAML files:
|
Narratio loads pipeline, campaign, and session YAML, with a canonical party
|
||||||
|
roster selected explicitly or through the campaign:
|
||||||
|
|
||||||
- `pipeline.yml`: pipeline-level runtime configuration.
|
- `pipeline.yml`: pipeline/runtime settings
|
||||||
- `session.yml`: per-session metadata and input selection.
|
- `campaign.yml`: campaign identity and stable input defaults
|
||||||
|
- `session.yml`: session identity, metadata, and audio source selection
|
||||||
|
|
||||||
These commands load and validate both files before running:
|
## Discovery and Selection
|
||||||
|
|
||||||
- `narratio run`
|
### `pipeline.yml`
|
||||||
- `narratio plan`
|
|
||||||
- `narratio resume`
|
|
||||||
- `narratio run-stage`
|
|
||||||
- `narratio restore`
|
|
||||||
|
|
||||||
Behavior:
|
An explicit `--config` selects exactly that file, including a custom filename.
|
||||||
|
Otherwise ConfigKit searches these locations in order:
|
||||||
|
|
||||||
- strict YAML decode is enabled (`KnownFields(true)`): unknown fields fail.
|
1. The working directory, for `narratio.yml` then `narratio.yaml`.
|
||||||
- session templates render before session YAML decode.
|
2. The Go user-config directory's `narratio/` subdirectory, for those named
|
||||||
- defaults are applied for optional pipeline fields.
|
files followed by `config.yml`, `config.yaml`, `main.yml`, and `main.yaml`.
|
||||||
- validation enforces required fields, value formats, and cross-field constraints.
|
3. The Go user-config directory itself, for the named files.
|
||||||
|
4. `/usr/local/etc/narratio/` and then `/etc/narratio/`, each for named files
|
||||||
|
followed by the generic filenames above.
|
||||||
|
5. `/etc/`, for the named files.
|
||||||
|
|
||||||
## 2. Config file discovery
|
On Linux, the user-config directory normally follows `XDG_CONFIG_HOME`, or
|
||||||
|
`~/.config` when it is unset. A selected invalid file fails loading; discovery
|
||||||
|
does not continue to another candidate.
|
||||||
|
|
||||||
Pipeline config lookup for `run`, `plan`, `resume`, `run-stage`, and `restore`:
|
### `campaign.yml`
|
||||||
|
|
||||||
- if `--config <path>` is provided, that path is used.
|
Selection rules:
|
||||||
- if omitted, Narratio searches in order:
|
|
||||||
1. `/usr/local/etc/narratio/pipeline.yml`
|
|
||||||
2. `/etc/narratio/pipeline.yml`
|
|
||||||
- first existing file wins.
|
|
||||||
|
|
||||||
## 3. Session file discovery and templating
|
- if `--campaign-file` is set, use that path;
|
||||||
|
- else if `--campaign <id>` is set, use `{pipeline.campaigns.root}/{id}/campaign.yml`;
|
||||||
|
- else use `{pipeline.campaigns.root}/{pipeline.campaigns.default_campaign_id}/campaign.yml`.
|
||||||
|
|
||||||
Session config lookup for `run`, `plan`, `resume`, `run-stage`, and `restore`:
|
### `session.yml`
|
||||||
|
|
||||||
- if `--session <path>` is provided, that path is used.
|
An explicit `--session-file` selects exactly that file. Otherwise local search
|
||||||
- if omitted, Narratio searches in order:
|
order is:
|
||||||
1. `./session.yml`
|
|
||||||
2. `/usr/local/etc/narratio/session.yml`
|
|
||||||
3. `/etc/narratio/session.yml`
|
|
||||||
- first existing file wins.
|
|
||||||
|
|
||||||
Template behavior:
|
1. `/usr/local/etc/narratio/session.yml`
|
||||||
|
2. `/etc/narratio/session.yml`
|
||||||
|
|
||||||
- supported placeholders:
|
If no local session exists and a `session_id` is known, Narratio loads the
|
||||||
- `{{session_id}}`
|
session from configured object storage. Downloaded session bytes are contextless
|
||||||
- `{{ session_id }}`
|
snapshots, with remote object
|
||||||
- `--session-id <value>` supplies the placeholder value.
|
provenance retained independently of locally materialized checksums.
|
||||||
- unresolved placeholders fail load.
|
|
||||||
- if rendered `session_id` mismatches `--session-id`, load fails.
|
|
||||||
|
|
||||||
## 4. Minimal pipeline config
|
Remote loading prefers an authored session-root `session.yml`, including updates
|
||||||
|
from `session init --remote --force`. When that object is absent, loading falls
|
||||||
|
back to the current commit's standalone prepared session. Published snapshots
|
||||||
|
remain immutable; restore validates the pointer-selected committed state.
|
||||||
|
|
||||||
|
### Native inspection and domain derivation
|
||||||
|
|
||||||
|
Native configuration inspection exposes four actual typed ConfigKit results:
|
||||||
|
app (the default pipeline scope), campaign, session, and party. Defaults,
|
||||||
|
normalization, and configuration-owned validation finish within their supported
|
||||||
|
load lifecycle. Session configuration includes applicable campaign defaults
|
||||||
|
before handoff. Completed values remain unchanged by planning or execution.
|
||||||
|
|
||||||
|
App inspection retains artifact-family declarations and needs no campaign or
|
||||||
|
party solely for expansion. Narratio derives concrete artifact catalogs, players,
|
||||||
|
resolved dependencies, and publication actions separately using the selected
|
||||||
|
canonical roster. `artifacts list` inspects those domain definitions;
|
||||||
|
`session plan` and `session artifacts` expose decisions and availability.
|
||||||
|
|
||||||
|
Native sources/explanations retain actual imports, origins, history, and recorded
|
||||||
|
resolution evidence. Comparisons load each side independently using its own
|
||||||
|
normal defaults. App-only inspection overrides apply during that invocation's
|
||||||
|
load. Safe views hide resolved credentials. Persisted preparation projections
|
||||||
|
retain reference names and do not replace the native inspection result.
|
||||||
|
See the [CLI reference](cli.md#configuration-inspection) for scopes, selectors,
|
||||||
|
path operations, overrides, comparison modes, and report shapes.
|
||||||
|
|
||||||
|
### Party selection
|
||||||
|
|
||||||
|
`--party-file` selects an exact canonical roster instead of the campaign-default
|
||||||
|
file. Explicit relative paths use the invocation directory; invalid or missing
|
||||||
|
explicit input fails without fallback. The campaign's configured party field
|
||||||
|
remains unchanged. Inspection, players, family derivation, planning, and execution
|
||||||
|
use the same selected roster. Format and validation belong in the
|
||||||
|
[party integration contract](integrations/party.md).
|
||||||
|
|
||||||
|
### Migrating to the maintained bundle
|
||||||
|
|
||||||
|
Use the [production/testing bundle](../examples/production-testing/pipeline.yml)
|
||||||
|
as the complete copyable migration reference. Keep production settings in the
|
||||||
|
base, split them into explicit additive imports, and place testing differences
|
||||||
|
in the fixed `overlays/testing.yml` overlay. Put ordinary artifacts and families
|
||||||
|
in the recommended one-definition files shown by that bundle. Convert campaign
|
||||||
|
rosters to [canonical party input](integrations/party.md), then express character
|
||||||
|
work as families. Inspect the result with `config validate`, `config show`,
|
||||||
|
`config sources`, and `artifacts list`; use
|
||||||
|
`config diff --against-overlay testing` to
|
||||||
|
review the overlay before running a session. Unversioned party documents are
|
||||||
|
rejected.
|
||||||
|
|
||||||
|
### Identity segments
|
||||||
|
|
||||||
|
Campaign IDs (`campaign_id` and `default_campaign_id`), session IDs, previous
|
||||||
|
session IDs, and Narratio run IDs are opaque portable segments. They must use
|
||||||
|
only ASCII letters, digits, `.`, `_`, and `-`; empty values, `.`/`..`, path
|
||||||
|
separators, drive forms, whitespace, control characters, and non-ASCII text are
|
||||||
|
rejected. Narratio does not trim or rewrite these values. Existing manifests or
|
||||||
|
remote state with an unsafe legacy identity must be migrated before use.
|
||||||
|
|
||||||
|
## Validation and Merge Rules
|
||||||
|
|
||||||
|
- Local pipeline, campaign, session, and party documents may declare native
|
||||||
|
imports and sibling inheritance. Only the pipeline selects an overlay.
|
||||||
|
- An omitted overlay, empty overlay option, and exact `default` select the base;
|
||||||
|
another name selects `overlays/<name>.yml` relative to the pipeline root.
|
||||||
|
- Configured timeout and retry-delay durations must be positive. An omitted
|
||||||
|
artifact timeout continues to inherit its configured Scriptorium timeout.
|
||||||
|
- Session files must be concrete; unresolved `{{ ... }}` placeholders fail load.
|
||||||
|
- Pipeline defaults are applied before validation.
|
||||||
|
- Defaults apply only to absent fields. Explicit empty strings, zero values,
|
||||||
|
`false`, and `null` retain ConfigKit's typed meaning and are then checked by
|
||||||
|
Narratio domain validation; they are not silently replaced by defaults.
|
||||||
|
Explicit null optional stage sections stay absent, while required sections
|
||||||
|
fail validation.
|
||||||
|
- Campaign and session identities must agree.
|
||||||
|
- The campaign supplies required speakers, autocorrect, and canonical party
|
||||||
|
files. Sessions may independently override speakers and autocorrect.
|
||||||
|
Optional glossary selections and the separate spell overlay inherit as
|
||||||
|
described under [glossary inputs](#glossary-inputs).
|
||||||
|
- The selected party is parsed when domain context or party inspection needs
|
||||||
|
it. It must be a versioned [canonical party](integrations/party.md). The
|
||||||
|
campaign supplies its default file; an explicit CLI selection replaces it
|
||||||
|
for the invocation and supplies the derived players input. `players_file` and
|
||||||
|
session `party_file` are unsupported configuration keys.
|
||||||
|
- When audio is needed, configure one audio mode in session input:
|
||||||
|
- local (`audio_dir` or `audio_files`), or
|
||||||
|
- S3 (`audio_s3.prefix`).
|
||||||
|
|
||||||
|
### Pipeline imports and overlays
|
||||||
|
|
||||||
|
Narratio uses ConfigKit v1.4.0 for imports, composition, inheritance, and
|
||||||
|
pipeline overlays. The [ConfigKit configuration contract](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md)
|
||||||
|
owns their syntax and semantics; the [maintained bundle](../examples/production-testing/pipeline.yml)
|
||||||
|
shows a complete Narratio configuration. Only the pipeline selects an overlay;
|
||||||
|
Narratio validates the resulting effective domain entries.
|
||||||
|
|
||||||
|
Relative host-resource paths, including integration configuration files,
|
||||||
|
workspace/campaign roots, campaign template and stable inputs, and
|
||||||
|
session stable inputs and local audio references, resolve from the effective
|
||||||
|
value's defining source. Inherited values follow their origin. When no distinct
|
||||||
|
usable source context exists, the main source is the fallback; if it too is
|
||||||
|
contextless, the invocation directory is used. Explicit CLI-relative file paths
|
||||||
|
use the invocation directory. Artifact outputs, publish destinations, logical
|
||||||
|
IDs, and binary names retain their domain meanings.
|
||||||
|
|
||||||
|
The effective digest excludes source layout, overlay identity, and secret values;
|
||||||
|
credential reference names and resolved resource paths participate. Prepared
|
||||||
|
campaign, session, and party documents contain effective standalone values rather
|
||||||
|
than authored import directives. A prepared session snapshot carries the resolved
|
||||||
|
values used for that session; retain authored files for future edits.
|
||||||
|
|
||||||
|
### Upgrade from earlier configuration
|
||||||
|
|
||||||
|
- Rename source-root `configkit:` controls to `config:`. Nested `config` data
|
||||||
|
and the Go `configkit` package and secret tags have different meanings.
|
||||||
|
- Rename or move pipeline files to the discovery names above, or retain a custom
|
||||||
|
filename such as `pipeline.yml` and pass it with `--config`.
|
||||||
|
- Remove `--secrets-dir` from invocations and configure the pipeline main file
|
||||||
|
as described in [Secrets Handling](#secrets-handling), or provision environment values.
|
||||||
|
- Review relative resource references moved into fragments: their defining
|
||||||
|
source now supplies the base. Mark necessary imports `required: true`.
|
||||||
|
- Review lists and use `config.sequences` where append or whole-record upsert is
|
||||||
|
intended. Verify the effective result with the inspection commands.
|
||||||
|
- Prepared documents contain effective values; retain authored roots and their
|
||||||
|
companions separately for editing. Separately installed downstream tools own
|
||||||
|
their own configuration migrations.
|
||||||
|
|
||||||
|
These control-key changes require a major version for the eventual Narratio
|
||||||
|
release. This migration does not itself publish a release.
|
||||||
|
|
||||||
|
## Minimal Working Configuration
|
||||||
|
|
||||||
|
`pipeline.yml`
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
campaigns:
|
||||||
|
root: /usr/local/share/narratio/campaigns
|
||||||
|
default_campaign_id: sample-campaign
|
||||||
whisperx:
|
whisperx:
|
||||||
transcribe_url: "https://transcription.example.com/transcribe"
|
transcribe_url: https://transcription.example.com/transcribe
|
||||||
```
|
```
|
||||||
|
|
||||||
Why this is sufficient:
|
`campaign.yml`
|
||||||
|
|
||||||
- `whisperx.transcribe_url` is required.
|
|
||||||
- `workspace.root` defaults to `/var/lib/narratio`.
|
|
||||||
- optional sections (`seriatim`, `audita`, `archive`, `scriptorium`, `trim`, `normalize`, etc.) receive defaults or stay inactive.
|
|
||||||
|
|
||||||
## 5. Minimal session template
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
session_id: "{{ session_id }}"
|
schema_version: maximumdirect.rpg.campaign.v1
|
||||||
campaign: sample-campaign
|
id: sample-campaign
|
||||||
|
references: {party: ./party.yml}
|
||||||
|
narratio:
|
||||||
|
inputs:
|
||||||
|
speakers_file: ./speakers.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
`session.yml` (local audio)
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
session_id: 2026-05-03
|
||||||
inputs:
|
inputs:
|
||||||
audio_dir: ./audio
|
audio_dir: ./audio
|
||||||
speakers_file: ./examples/speakers.yml
|
|
||||||
autocorrect_file: ./examples/autocorrect.yml
|
|
||||||
glossary_file: ./examples/glossary.yml
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Usage:
|
## Secrets Handling
|
||||||
|
|
||||||
```bash
|
Credential fields contain environment-variable names as ConfigKit typed secret
|
||||||
narratio run --config /path/to/pipeline.yml --session ./session.yml --session-id 2026-05-03
|
references. Each surviving reference must resolve to a nonempty value when the
|
||||||
```
|
pipeline loads, including for disabled integrations or stages outside the run.
|
||||||
|
Do not put raw secret values in YAML.
|
||||||
|
|
||||||
## 6. Production-oriented config
|
A pipeline main file can select configured bootstrap before its typed load:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
workspace:
|
config:
|
||||||
root: /var/lib/narratio/workspace
|
secrets_dir: secrets
|
||||||
cleanup_after_archive: true
|
```
|
||||||
|
|
||||||
storage:
|
Narratio passes the selected pipeline source to ConfigKit's configured bootstrap,
|
||||||
backend: s3
|
then loads the returned prepared source. Without a directory declaration,
|
||||||
s3:
|
credentials may be supplied in the process environment. Narratio no longer
|
||||||
bucket: my-dnd-archive
|
accepts `--secrets-dir` or probes a conventional directory automatically. See
|
||||||
root_prefix: dnd
|
[ConfigKit's configured-startup contract](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap)
|
||||||
region: us-east-1
|
for path rules, environment precedence and overwrite controls.
|
||||||
access_key_id_env: OBJECT_STORAGE_KEY_ID
|
|
||||||
secret_access_key_env: OBJECT_STORAGE_KEY
|
|
||||||
|
|
||||||
spool:
|
Each pipeline acquisition prepares its own source; an already acquired result is
|
||||||
root: /var/spool/narratio
|
reused. Comparisons use ordinary acquisition on each reached side and share the
|
||||||
delete_audio_after_archive: true
|
process environment. Direct local campaign, session, and party inspection does
|
||||||
|
not load a pipeline solely for bootstrap. Bootstrap reports and diagnostics are
|
||||||
|
safe, final stderr output, separate from command reports. Protect provisioned
|
||||||
|
secret directories and files from access by other users.
|
||||||
|
|
||||||
archive:
|
## Publish Configuration Summary
|
||||||
|
|
||||||
|
Publish rules live under `pipeline.publish`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
publish:
|
||||||
enabled: true
|
enabled: true
|
||||||
upload_run: true
|
upload_run: true
|
||||||
promote_artifacts:
|
outputs:
|
||||||
- source: narratio.transcript.trimmed
|
- source: narratio.transcript.final_trimmed
|
||||||
dest: transcripts/trimmed.json
|
dest: transcripts/final.trimmed.json
|
||||||
|
required: true
|
||||||
|
- source: narratio.transcript.final_markdown
|
||||||
|
dest: transcripts/final.md
|
||||||
|
required: true
|
||||||
|
- source: narratio.transcript.final_trimmed_markdown
|
||||||
|
dest: transcripts/final.trimmed.md
|
||||||
required: true
|
required: true
|
||||||
- source: narratio.artifact.session_recap
|
- source: narratio.artifact.session_recap
|
||||||
dest: artifacts/session_recap.md
|
dest: artifacts/session_recap.md
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
whisperx:
|
|
||||||
transcribe_url: "https://transcription.example.com/transcribe"
|
|
||||||
|
|
||||||
scriptorium:
|
|
||||||
artifacts:
|
|
||||||
session_recap:
|
|
||||||
enabled: true
|
|
||||||
prompt_id: dnd.session_recap
|
|
||||||
output_path: artifacts/session_recap.md
|
|
||||||
inputs:
|
|
||||||
transcript:
|
|
||||||
source: narratio.transcript.trimmed
|
|
||||||
required: true
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Operational notes:
|
Rules:
|
||||||
|
|
||||||
- archive promotion is explicit and source-based via `archive.promote_artifacts`.
|
- `outputs[].source` is required.
|
||||||
- `source` is required; `dest` is optional and derived when omitted.
|
- `outputs[].dest` may be omitted when derivable from source.
|
||||||
- Narratio does not auto-promote all generated analyze artifacts.
|
- extraction sources require an explicit `outputs[].dest` and publish only when
|
||||||
- `restore` reads the same config/session inputs and restore scope is bounded by committed archive current state.
|
a rule names that source; the Notarius bundle is not
|
||||||
|
publish sources.
|
||||||
|
- `outputs[].required` defaults to `true`.
|
||||||
|
- publish locks are independent remote session objects managed with
|
||||||
|
`narratio session locks`; they are not pipeline configuration fields.
|
||||||
|
|
||||||
## 7. Full pipeline reference
|
## Full Schema
|
||||||
|
|
||||||
| Path | Type | Required | Default |
|
### Pipeline
|
||||||
|
|
||||||
|
| Field | Type | Required | Default / Rule |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
|
| `config.imports` | list | No | native source-root import selections; see [imports and overlays](#pipeline-imports-and-overlays) |
|
||||||
|
| `pipeline.reference_catalog.settings` | map[string]string | No | setting IDs to source-relative vocabulary files |
|
||||||
|
| `pipeline.reference_catalog.systems` | map[string]string | No | system IDs to source-relative vocabulary files |
|
||||||
| `pipeline.workspace.root` | string | No | `/var/lib/narratio` |
|
| `pipeline.workspace.root` | string | No | `/var/lib/narratio` |
|
||||||
| `pipeline.workspace.cleanup_after_archive` | bool | No | `false` |
|
| `pipeline.workspace.cleanup_after_publish` | bool | No | `false`; selects the session's entire run history for final cleanup and requires effective `pipeline.publish.enabled=true` and `pipeline.publish.upload_run=true` |
|
||||||
| `pipeline.secrets.env_dir` | string | Conditional | none |
|
| `pipeline.campaigns.root` | string | No | `/usr/local/share/narratio/campaigns` |
|
||||||
| `pipeline.storage.backend` | string | No | empty |
|
| `pipeline.campaigns.default_campaign_id` | string | No | empty |
|
||||||
| `pipeline.storage.bucket` | string | No | empty |
|
| `pipeline.campaigns.session_template_file` | string | No | installation session template; built-in default when absent |
|
||||||
| `pipeline.storage.prefix` | string | No | empty |
|
| `pipeline.storage.backend` | string | No | `local`; supported values are `local` and `s3` (case-insensitive) |
|
||||||
| `pipeline.storage.s3.bucket` | string | Conditional | empty |
|
| `pipeline.storage.s3.bucket` | string | Conditional | required when backend is `s3` and S3 session-audio or publish upload is enabled |
|
||||||
| `pipeline.storage.s3.root_prefix` | string | No | `dnd` |
|
| `pipeline.storage.s3.root_prefix` | string | No | `dnd` |
|
||||||
| `pipeline.storage.s3.region` | string | No | empty |
|
| `pipeline.storage.s3.region` | string | No | empty |
|
||||||
| `pipeline.storage.s3.endpoint` | string | No | empty |
|
| `pipeline.storage.s3.endpoint` | string | No | empty |
|
||||||
| `pipeline.storage.s3.force_path_style` | bool | No | `false` |
|
| `pipeline.storage.s3.force_path_style` | bool | No | `false` |
|
||||||
| `pipeline.storage.s3.access_key_id_env` | string | No | `OBJECT_STORAGE_KEY_ID` |
|
| `pipeline.storage.s3.access_key_id` | secret reference | Conditional | unset; must be paired with `secret_access_key` |
|
||||||
| `pipeline.storage.s3.secret_access_key_env` | string | No | `OBJECT_STORAGE_KEY` |
|
| `pipeline.storage.s3.secret_access_key` | secret reference | Conditional | unset; must be paired with `access_key_id` |
|
||||||
| `pipeline.spool.root` | string | No | `/var/spool/narratio` |
|
| `pipeline.publish.enabled` | bool | No | `true` |
|
||||||
| `pipeline.spool.delete_audio_after_archive` | bool | No | `false` |
|
| `pipeline.publish.upload_run` | bool | No | `true` |
|
||||||
| `pipeline.archive.enabled` | bool | No | `true` |
|
| `pipeline.publish.outputs[]` | list | No | defaults to final trimmed JSON plus final and final-trimmed Markdown outputs |
|
||||||
| `pipeline.archive.upload_run` | bool | No | `true` |
|
| `pipeline.publish.outputs[].source` | string | Yes (per rule) | must reference built-in or configured artifact source |
|
||||||
| `pipeline.archive.promote_artifacts[]` | list | No | trimmed transcript rule |
|
| `pipeline.publish.outputs[].dest` | string | Conditional | derived if omitted and source supports derivation |
|
||||||
| `pipeline.archive.promote_artifacts[].source` | string | Yes (per rule) | none |
|
| `pipeline.publish.outputs[].required` | bool | No | `true` |
|
||||||
| `pipeline.archive.promote_artifacts[].dest` | string | No | derived from source |
|
| `pipeline.whisperx.transcribe_url` | string | Yes | absolute `http` or `https` URL |
|
||||||
| `pipeline.archive.promote_artifacts[].required` | bool | No | `true` |
|
|
||||||
| `pipeline.whisperx.transcribe_url` | string | Yes | none |
|
|
||||||
| `pipeline.whisperx.language` | string | No | `en` |
|
| `pipeline.whisperx.language` | string | No | `en` |
|
||||||
| `pipeline.whisperx.timeout` | duration string | No | `30m` |
|
| `pipeline.whisperx.timeout` | duration | No | `30m` |
|
||||||
| `pipeline.whisperx.retries` | int | No | `3` |
|
| `pipeline.whisperx.retries` | int | No | `3` |
|
||||||
| `pipeline.whisperx.retry_delay` | duration string | No | `2s` |
|
| `pipeline.whisperx.retry_delay` | duration | No | `2s` |
|
||||||
| `pipeline.whisperx.concurrency` | int | No | `2` |
|
| `pipeline.whisperx.concurrency` | int | No | `2` |
|
||||||
| `pipeline.seriatim.binary` | string | No | `seriatim` |
|
| `pipeline.seriatim.binary` | string | No | `seriatim` |
|
||||||
| `pipeline.seriatim.timeout` | duration string | No | `10m` |
|
| `pipeline.seriatim.timeout` | duration | No | `10m` |
|
||||||
| `pipeline.seriatim.output_schema` | string | No | `seriatim-intermediate` |
|
| `pipeline.seriatim.output_schema` | string | No | `seriatim-intermediate` |
|
||||||
| `pipeline.seriatim.coalesce_gap` | float | No | `3.0` |
|
| `pipeline.seriatim.coalesce_gap` | float | No | `3.0` |
|
||||||
| `pipeline.seriatim.report` | bool | No | `true` |
|
| `pipeline.seriatim.report` | bool | No | `true` |
|
||||||
@@ -177,154 +316,415 @@ Operational notes:
|
|||||||
| `pipeline.seriatim.env.backchannel_max_duration` | float | No | unset |
|
| `pipeline.seriatim.env.backchannel_max_duration` | float | No | unset |
|
||||||
| `pipeline.seriatim.env.filler_max_duration` | float | No | unset |
|
| `pipeline.seriatim.env.filler_max_duration` | float | No | unset |
|
||||||
| `pipeline.audita.binary` | string | No | `audita` |
|
| `pipeline.audita.binary` | string | No | `audita` |
|
||||||
| `pipeline.audita.timeout` | duration string | No | `3h` |
|
| `pipeline.audita.timeout` | duration | No | `3h` |
|
||||||
| `pipeline.audita.llm_api_key_env` | string | No | empty |
|
| `pipeline.audita.credentials[]` | list[secret reference] | No | empty; exact environment-variable names forwarded to Audita |
|
||||||
| `pipeline.audita.modules[]` | list[string] | No | empty |
|
| `pipeline.audita.debug` | bool | No | `false`; true requests Audita debug capture |
|
||||||
| `pipeline.audita.base_url` | string | No | empty |
|
| `pipeline.audita.overlay` | string | No | empty; no downstream overlay override |
|
||||||
| `pipeline.audita.model` | string | No | empty |
|
| `pipeline.audita.proposal_profile` | string | No | empty; no downstream proposal-profile override |
|
||||||
| `pipeline.audita.total_llm_concurrency` | int | No | unset |
|
| `pipeline.audita.validation_profile` | string | No | empty; no downstream validation-profile override |
|
||||||
| `pipeline.audita.proposal_llm_concurrency` | int | No | unset |
|
|
||||||
| `pipeline.audita.validation_model` | string | No | empty |
|
|
||||||
| `pipeline.audita.validation_llm_concurrency` | int | No | unset |
|
|
||||||
| `pipeline.audita.transcript_description` | string | No | empty |
|
| `pipeline.audita.transcript_description` | string | No | empty |
|
||||||
| `pipeline.audita.config_path` | string | No | empty |
|
| `pipeline.audita.config_path` | string | No | empty |
|
||||||
| `pipeline.audita.output_schema` | string | No | empty |
|
| `pipeline.audita.output_schema` | string | No | empty |
|
||||||
| `pipeline.audita.work_dir_retention` | string | No | empty |
|
| `pipeline.normalize.output_path` | string | No | `transcripts/final.json` |
|
||||||
| `pipeline.audita.report` | bool | No | `true` |
|
|
||||||
| `pipeline.normalize.output_path` | string | No | `transcripts/normalized.json` |
|
|
||||||
| `pipeline.normalize.output_schema` | string | No | `seriatim-intermediate` |
|
| `pipeline.normalize.output_schema` | string | No | `seriatim-intermediate` |
|
||||||
| `pipeline.normalize.report` | bool | No | `true` |
|
| `pipeline.normalize.report` | bool | No | `true` |
|
||||||
| `pipeline.trim.enabled` | bool | No | `false` |
|
| `pipeline.trim.enabled` | bool | No | `true` |
|
||||||
| `pipeline.trim.output_path` | string | Conditional | none |
|
| `pipeline.trim.output_path` | string | No | `transcripts/final.trimmed.json` |
|
||||||
| `pipeline.trim.bounds.prompt_id` | string | Conditional | none |
|
| `pipeline.trim.bounds.prompt_id` | string | No | `dnd.session_bounds` |
|
||||||
| `pipeline.trim.bounds.profile_id` | string | No | empty |
|
| `pipeline.trim.bounds.profile_id` | string | No | empty |
|
||||||
| `pipeline.trim.bounds.transcript_input_name` | string | Conditional | none |
|
| `pipeline.trim.bounds.transcript_input_name` | string | No | `transcript` |
|
||||||
| `pipeline.trim.bounds.output_path` | string | Conditional | none |
|
| `pipeline.trim.bounds.output_path` | string | No | `artifacts/session_bounds.json` |
|
||||||
| `pipeline.trim.bounds.timeout` | duration string | No | `10m` |
|
| `pipeline.trim.bounds.timeout` | duration | No | `10m` |
|
||||||
| `pipeline.trim.bounds.render_debug` | bool | No | `false` |
|
| `pipeline.trim.bounds.render_debug` | bool | No | `false` |
|
||||||
| `pipeline.trim.bounds.render_output_path` | string | Conditional | none |
|
| `pipeline.trim.bounds.render_output_path` | string | Conditional | required when `render_debug` is true |
|
||||||
| `pipeline.trim.seriatim.report` | bool | No | `false` |
|
| `pipeline.trim.seriatim.report` | bool | No | `false` |
|
||||||
|
| `pipeline.notarius.enabled` | bool | No | `false` |
|
||||||
|
| `pipeline.notarius.binary` | string | No | `notarius` |
|
||||||
|
| `pipeline.notarius.credentials[]` | list[secret reference] | No | empty; exact environment-variable names forwarded to Notarius |
|
||||||
|
| `pipeline.notarius.config_overlay` | string | No | unset; exact Notarius ConfigKit overlay selector |
|
||||||
|
| `pipeline.notarius.config_path` | string | Conditional | required when enabled; relative paths resolve from their defining source |
|
||||||
|
| `pipeline.notarius.pipeline_id` | string | Conditional | required when enabled |
|
||||||
|
| `pipeline.notarius.timeout` | duration | No | `3h`; must be positive |
|
||||||
|
| `pipeline.notarius.working_directory` | string | No | directory containing resolved `config_path`; relative paths resolve from their defining source |
|
||||||
|
| `pipeline.notarius.cache` | string | No | unset; when set, `auto`, `bypass`, or `refresh` |
|
||||||
|
| `pipeline.notarius.debug` | bool | No | `false`; true requests debug capture |
|
||||||
|
| `pipeline.notarius.references` | map[string]string | No | empty; maps normalized Notarius selectors to supported prepared Narratio source IDs; maximum 256 entries |
|
||||||
|
| `pipeline.notarius.outputs` | map | Conditional | at least one entry when enabled |
|
||||||
|
| `pipeline.render.enabled` | bool | No | `true` |
|
||||||
|
| `pipeline.render.variants` | list[string] | No | `[normalized, trimmed]`; select either or both; `[]` or `null` selects none |
|
||||||
|
| `pipeline.render.format` | string | No | `markdown` (only supported value) |
|
||||||
|
| `pipeline.render.title` | string | No | empty (falls back to `session.title` when set) |
|
||||||
|
| `pipeline.render.include_timestamps` | bool | No | `true` |
|
||||||
|
| `pipeline.render.include_segment_ids` | bool | No | `true` |
|
||||||
|
| `pipeline.render.include_metadata` | bool | No | `false` |
|
||||||
| `pipeline.scriptorium.binary` | string | No | `scriptorium` |
|
| `pipeline.scriptorium.binary` | string | No | `scriptorium` |
|
||||||
|
| `pipeline.scriptorium.credentials[]` | list[secret reference] | No | empty; exact environment-variable names forwarded to Scriptorium |
|
||||||
| `pipeline.scriptorium.config_path` | string | No | empty |
|
| `pipeline.scriptorium.config_path` | string | No | empty |
|
||||||
| `pipeline.scriptorium.timeout` | duration string | No | `10m` |
|
| `pipeline.scriptorium.timeout` | duration | No | `10m` |
|
||||||
| `pipeline.scriptorium.render_debug` | bool | No | `false` |
|
| `pipeline.scriptorium.render_debug` | bool | No | `false` |
|
||||||
| `pipeline.scriptorium.artifacts` | map | No | empty |
|
| `pipeline.scriptorium.artifacts` | map | No | empty |
|
||||||
| `pipeline.scriptorium.artifacts.<name>.enabled` | bool | No | `false` |
|
| `pipeline.scriptorium.artifact_families` | map | No | empty; expands one ordinary artifact per canonical party character |
|
||||||
| `pipeline.scriptorium.artifacts.<name>.depends_on[]` | list[string] | No | empty |
|
| `pipeline.notification.mode` | string | No | `noop`; the only supported notification mode until a provider is implemented |
|
||||||
| `pipeline.scriptorium.artifacts.<name>.render_debug` | bool | No | unset |
|
|
||||||
| `pipeline.scriptorium.artifacts.<name>.prompt_id` | string | Conditional | none |
|
|
||||||
| `pipeline.scriptorium.artifacts.<name>.profile_id` | string | No | empty |
|
|
||||||
| `pipeline.scriptorium.artifacts.<name>.output_path` | string | Conditional | none |
|
|
||||||
| `pipeline.scriptorium.artifacts.<name>.timeout` | duration string | No | empty |
|
|
||||||
| `pipeline.scriptorium.artifacts.<name>.inputs.<key>.source` | string | Conditional | none |
|
|
||||||
| `pipeline.scriptorium.artifacts.<name>.inputs.<key>.artifact` | string | No | empty |
|
|
||||||
| `pipeline.scriptorium.artifacts.<name>.inputs.<key>.path` | string | No | empty |
|
|
||||||
| `pipeline.scriptorium.artifacts.<name>.inputs.<key>.required` | bool | No | `false` |
|
|
||||||
| `pipeline.scriptorium.artifacts.<name>.vars.<key>` | map value | No | empty |
|
|
||||||
| `pipeline.analyzer.binary_path` | string | No | empty |
|
|
||||||
| `pipeline.analyzer.timeout` | duration string | No | empty |
|
|
||||||
| `pipeline.analyzer.artifacts.output_dir` | string | No | empty |
|
|
||||||
| `pipeline.analyzer.artifacts.types[]` | list[string] | No | empty |
|
|
||||||
| `pipeline.notification.backend` | string | No | empty |
|
|
||||||
| `pipeline.notification.recipient` | string | No | empty |
|
|
||||||
| `pipeline.notification.timeout` | duration string | No | empty |
|
|
||||||
|
|
||||||
Scriptorium artifact-key and dependency rules:
|
### Audita Selection and Credentials
|
||||||
|
|
||||||
- artifact keys must match `^[a-z][a-z0-9_]*$`.
|
`pipeline.audita.config_path` optionally selects an Audita v4.3.0 configuration;
|
||||||
- enabled artifacts require `prompt_id` and `output_path`.
|
otherwise Audita uses native discovery. `overlay`, `proposal_profile`, and
|
||||||
- `output_path` must be relative, traversal-safe, and under `artifacts/`.
|
`validation_profile` independently select downstream settings. Empty values
|
||||||
- configured artifact input sources use `narratio.artifact.<name>`.
|
add no override. Narratio does not create Audita configuration or infer its
|
||||||
- if input source references `narratio.artifact.<name>`, artifact `<name>` must exist and must be listed in `depends_on`.
|
selectors from a Narratio overlay. Configure the ordered Audita pipeline in
|
||||||
- every `depends_on` entry must be a configured artifact key.
|
Audita itself; the retired `pipeline.audita.modules` field is rejected. See
|
||||||
- self-dependency is rejected.
|
[Audita's configuration guide](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/config.md)
|
||||||
- enabled dependency cycles are rejected.
|
and the [integration contract](integrations/audita.md). `debug: true` requests
|
||||||
- any artifact referenced by `depends_on` or `narratio.artifact.<name>` source must define `output_path` (even if not enabled).
|
Audita debug capture; false or omission adds no debug override. Debug alone does
|
||||||
|
not invalidate a completed polish result.
|
||||||
|
|
||||||
Allowed `pipeline.scriptorium.artifacts.<name>.inputs.<key>.source` values:
|
`pipeline.audita.credentials` contains exact environment-variable references,
|
||||||
|
not values. Narratio resolves each name at pipeline load and forwards its value
|
||||||
|
under the same name. Supply every credential required by the selected Audita
|
||||||
|
configuration. Omission, `null`, or `[]` forwards nothing; a Narratio overlay
|
||||||
|
replaces the list. Captured diagnostics redact those values.
|
||||||
|
|
||||||
- `previous_session_artifact`
|
<a id="notarius-configuration-profile"></a>
|
||||||
- `narratio.transcript.merged`
|
|
||||||
- `narratio.transcript.polished`
|
|
||||||
- `narratio.transcript.full`
|
|
||||||
- `narratio.transcript.trimmed`
|
|
||||||
- `narratio.bounds.session`
|
|
||||||
- `narratio.artifact.<configured_artifact_key>`
|
|
||||||
|
|
||||||
`pipeline.archive.promote_artifacts[].source` values:
|
### Notarius Configuration Overlay
|
||||||
|
|
||||||
- `narratio.transcript.merged`
|
Migration: rename `pipeline.notarius.config_profile` to `config_overlay`.
|
||||||
- `narratio.transcript.polished`
|
The old field is rejected; there is no compatibility alias. For current Notarius versions, move selected downstream files from `profiles/`
|
||||||
- `narratio.transcript.full`
|
to `overlays/` beside its root configuration. This does not rename PromptKit LLM profiles.
|
||||||
- `narratio.transcript.trimmed`
|
The renamed selector also changes extraction resume evidence for named
|
||||||
- `narratio.bounds.session`
|
selections: their existing extraction is regenerated on the next applicable
|
||||||
- `narratio.artifact.<configured_artifact_key>`
|
run, with normal dependent invalidation. Omitted/base selections do not acquire
|
||||||
|
a new invalidation solely from this rename.
|
||||||
|
|
||||||
Archive promotion destination rules:
|
`pipeline.notarius.config_overlay` optionally selects a Notarius ConfigKit
|
||||||
|
configuration overlay when extraction executes:
|
||||||
|
|
||||||
- `dest` must be a clean relative path (not absolute, no traversal).
|
```yaml
|
||||||
- duplicate `dest` values are rejected.
|
notarius:
|
||||||
- if `dest` is omitted:
|
config_overlay: downstream-economy
|
||||||
- built-in sources derive their canonical destination path;
|
```
|
||||||
- configured sources derive from `pipeline.scriptorium.artifacts.<name>.output_path`;
|
|
||||||
- derivation failure is a config validation error.
|
|
||||||
|
|
||||||
Restore-related implications:
|
When the field is omitted or `null`, Narratio supplies no downstream overlay
|
||||||
|
selector and preserves Notarius's existing configuration-selection behavior.
|
||||||
|
When present, Narratio forwards the exact string to Notarius, including an
|
||||||
|
empty string or `default`, which explicitly select Notarius's composed base
|
||||||
|
configuration. Notarius owns selector interpretation and validation; Narratio
|
||||||
|
does not restrict overlay names, resolve overlay files, or rewrite the value.
|
||||||
|
|
||||||
- restore remote identity requires archive S3 identity to resolve (`pipeline.storage.s3.bucket` and session prefix derivation inputs).
|
This selection is independent of Narratio's own `--overlay` selection. A
|
||||||
- restore scope considers only committed current state and durable paths (`manifest.json`, `transcripts/**`, `artifacts/**`, optional `audio/**`).
|
Narratio overlay may explicitly select a differently named Notarius overlay,
|
||||||
|
but Narratio never forwards its own overlay name automatically. It is also
|
||||||
|
independent of `pipeline.notarius.credentials`: an overlay may change either or
|
||||||
|
both fields according to the deployed Notarius configuration. See the
|
||||||
|
[Notarius integration contract](./integrations/notarius.md) for invocation and
|
||||||
|
failure behavior.
|
||||||
|
|
||||||
## 8. Full session reference
|
### Notarius Credentials
|
||||||
|
|
||||||
| Path | Type | Required | Default |
|
`pipeline.notarius.credentials` optionally lists environment-variable names
|
||||||
|
to forward to the Notarius child process:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
notarius:
|
||||||
|
credentials: [OPENROUTER_API_KEY, ANTHROPIC_API_KEY]
|
||||||
|
```
|
||||||
|
|
||||||
|
The list contains variable names, not credential values. Those names must
|
||||||
|
match the references used by the Notarius/PromptKit profiles that Notarius
|
||||||
|
loads. Notarius owns profile lookup; Narratio neither infers those names nor
|
||||||
|
remaps them. Omission, `null`, or `[]` forwards nothing. Each selected reference
|
||||||
|
must resolve at pipeline load time through the process environment or existing
|
||||||
|
secrets-directory bootstrap, even when Notarius is disabled, extract is outside
|
||||||
|
the requested range, or a completed extraction can be reused.
|
||||||
|
|
||||||
|
The Notarius child receives only Narratio's minimal execution environment plus
|
||||||
|
these exact selected names and loaded values. Other credentials are not forwarded.
|
||||||
|
Changing a value, name, presence, or absence does not invalidate extract's
|
||||||
|
semantic resume evidence. The public names remain part of safe effective
|
||||||
|
inspection, so renaming them may appear in `config diff` and change the effective
|
||||||
|
configuration digest; rotating only their values does neither. An overlay
|
||||||
|
replaces the whole list, including with `[]` to clear it.
|
||||||
|
|
||||||
|
See the [Notarius integration contract](./integrations/notarius.md) for the
|
||||||
|
delivery and redaction boundary.
|
||||||
|
|
||||||
|
### Notarius Cache Controls
|
||||||
|
|
||||||
|
`pipeline.notarius.cache` is optional; omission leaves the Notarius configuration
|
||||||
|
in control. Supply `auto`, `bypass`, or `refresh` to select native cache behavior.
|
||||||
|
Forced extraction uses `refresh`. Narratio's own completed-stage reuse is separate;
|
||||||
|
changing cache or debug selection alone does not invalidate completed products.
|
||||||
|
Notarius owns its configuration, pipeline, and cache storage.
|
||||||
|
|
||||||
|
### Notarius Reference Bindings
|
||||||
|
|
||||||
|
Map selectors to prepared source IDs, for example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
notarius:
|
||||||
|
references:
|
||||||
|
party: narratio.input.party
|
||||||
|
glossary: narratio.input.glossary.combined
|
||||||
|
spell_catalog: narratio.input.glossary.combined
|
||||||
|
```
|
||||||
|
|
||||||
|
Supported IDs are `narratio.input.party`, `narratio.input.players`, and
|
||||||
|
`narratio.input.glossary.{party,campaign,setting,spells,combined}`. Every
|
||||||
|
configured binding is required; omit unused bindings. Selectors use Notarius's
|
||||||
|
native slot forms. Narratio verifies and snapshots the prepared files before
|
||||||
|
passing them to the subprocess. See the [Notarius contract](integrations/notarius.md)
|
||||||
|
and [complete example](../examples/pipeline.full.annotated.yml).
|
||||||
|
|
||||||
|
### Notarius Output Entries
|
||||||
|
|
||||||
|
Each `pipeline.notarius.outputs.<name>` requires a unique `lane_id` and may set
|
||||||
|
`filename` to a flat JSON filename. The default is `<name>.json`. Names create
|
||||||
|
`narratio.extraction.<name>` source IDs. Each configured lane is required, and
|
||||||
|
its completed JSON is promoted into the session's flat artifacts directory.
|
||||||
|
See the [Notarius contract](integrations/notarius.md).
|
||||||
|
|
||||||
|
### Scriptorium Credentials
|
||||||
|
|
||||||
|
Set `scriptorium.credentials: [OPENROUTER_API_KEY]` in the pipeline file to
|
||||||
|
forward that provider key to Scriptorium. List additional provider names only
|
||||||
|
when the selected downstream configuration needs them. The same list applies
|
||||||
|
to requirements inspection, trim bounds generation, analysis (including
|
||||||
|
character families), and their render-debug calls. Scriptorium retains
|
||||||
|
provider/profile selection; Narratio does not pass a model-request
|
||||||
|
`--api-key-env` override.
|
||||||
|
|
||||||
|
As with Audita and Notarius, names are ConfigKit secret references resolved at
|
||||||
|
pipeline load time using the configured bootstrap and environment,
|
||||||
|
even when no Scriptorium stage executes. Omitted, null, or empty lists forward
|
||||||
|
nothing. An overlay replaces the entire list; `[]` clears it. Captured values
|
||||||
|
are forwarded under their exact names and registered for diagnostic redaction.
|
||||||
|
Inspection and generated metadata contain names only. Credential changes do
|
||||||
|
not invalidate completed trim or analysis work; rotating values also leaves
|
||||||
|
the effective configuration digest unchanged. Other environment variables
|
||||||
|
retain the shared minimal subprocess inheritance rules.
|
||||||
|
|
||||||
|
### Scriptorium Artifact Entries
|
||||||
|
|
||||||
|
For each `pipeline.scriptorium.artifacts.<name>`:
|
||||||
|
|
||||||
|
| Field | Type | Required | Rule |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| `session.session_id` | string | Yes | none |
|
| `enabled` | bool | No | `false` if omitted |
|
||||||
| `session.campaign` | string | Yes | none |
|
| `depends_on[]` | list[string] | No | explicit ordering-only edges; must reference configured artifact keys, may not self-reference, and join inferred input edges in one acyclic graph |
|
||||||
| `session.date` | string | No | empty |
|
| `render_debug` | bool | No | per-artifact override |
|
||||||
| `session.title` | string | No | empty |
|
| `prompt_id` | string | Conditional | required when artifact is enabled |
|
||||||
| `session.inputs.audio_dir` | string | Conditional | empty |
|
| `profile_id` | string | No | empty |
|
||||||
| `session.inputs.audio_files[]` | list[string] | Conditional | empty |
|
| `output_path` | string | Conditional | required when enabled; also required when referenced by publish/output/input rules |
|
||||||
| `session.inputs.audio_s3.prefix` | string | Conditional | none |
|
| `timeout` | duration | No | artifact override |
|
||||||
| `session.inputs.speakers_file` | string | Yes | none |
|
| `inputs` | map | No | input key names must be non-empty |
|
||||||
| `session.inputs.autocorrect_file` | string | Yes | none |
|
| `vars` | map | No | values must be string or bool; `session_id` is reserved and overwritten by Narratio |
|
||||||
| `session.inputs.glossary_file` | string | Yes | none |
|
|
||||||
|
|
||||||
Audio-source rule:
|
Narratio adds `session_id=narratio-session-<session_id>` to every Scriptorium request for sticky upstream LLM routing. If an artifact config sets `vars.session_id`, Narratio replaces that value before invoking Scriptorium. Use a different variable name if a prompt needs the raw Narratio session ID as content.
|
||||||
|
Discovery, preview, and generation receive the same effective variables,
|
||||||
|
including family member values and explicitly empty strings. Narratio forwards
|
||||||
|
the sticky value as a template variable, not as a direct session override.
|
||||||
|
|
||||||
- configure exactly one mode:
|
Without `--artifacts`, analyze executes enabled configured artifacts. With an
|
||||||
- `audio_dir`, or
|
explicit `--artifacts` list, the exact named configured artifacts are the
|
||||||
- `audio_files` (at least one), or
|
one-invocation targets even if their `enabled` values are false. Analyze closes
|
||||||
- `audio_s3.prefix`
|
those targets over the effective dependency graph: a current prerequisite is reused, while a
|
||||||
- `audio_s3` cannot be combined with local audio fields.
|
stale, missing, or failed prerequisite is rebuilt before its dependent.
|
||||||
|
Unrelated artifacts are not executed. Named targets and any prerequisite that
|
||||||
|
may require rebuilding must therefore have valid executable fields. This
|
||||||
|
override affects analyze planning only; publish uses the list only to filter
|
||||||
|
configured `narratio.artifact.<name>` output rules.
|
||||||
|
|
||||||
## 9. Secrets
|
For each artifact input `pipeline.scriptorium.artifacts.<name>.inputs.<input_name>`:
|
||||||
|
|
||||||
Narratio supports filesystem-based secret injection via `pipeline.secrets.env_dir`.
|
| Field | Type | Required | Rule |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| `source` | string | Yes | built-in runtime source, prepared input source, `narratio.extraction.<name>`, `narratio.artifact.<name>`, or `narratio.previous_session.artifact.<name>` |
|
||||||
|
| `required` | bool | No | optional input requirement |
|
||||||
|
|
||||||
Behavior:
|
The input map key is the prompt input name; `source` identifies the Narratio
|
||||||
|
artifact that supplies it. Requirements discovery compares exact input names
|
||||||
|
with these keys before generated files exist. A required prompt input bound to
|
||||||
|
an optional source produces a warning when availability is unknown; runtime
|
||||||
|
resolution may still omit the source. See
|
||||||
|
[prompt preflight](operations.md#prompt-requirements-preflight).
|
||||||
|
|
||||||
- `env_dir` may be absolute or relative.
|
`artifact` and `path` are obsolete and rejected by strict configuration
|
||||||
- relative `env_dir` resolves from current working directory.
|
loading. Use the canonical `source` identifier to select the input; Narratio
|
||||||
- files with valid env-var names (`[A-Za-z_][A-Za-z0-9_]*`) are loaded.
|
does not provide adapter-specific input passthrough fields.
|
||||||
- values are loaded from file contents with trailing newline trimming.
|
|
||||||
- existing process env vars are preserved.
|
|
||||||
- invalid names and subdirectories are skipped.
|
|
||||||
- missing/unreadable `env_dir` fails command execution.
|
|
||||||
|
|
||||||
Guidance:
|
Each `narratio.artifact.<name>` input source automatically contributes an
|
||||||
|
effective dependency on that configured artifact. Narratio unions these inferred
|
||||||
|
edges with explicit `depends_on` entries, then trims, deduplicates, and sorts the
|
||||||
|
result during domain catalog derivation. Authors use `depends_on` only for
|
||||||
|
ordering constraints that are not already expressed by an artifact input.
|
||||||
|
Use [`narratio artifacts list`](./cli.md#artifacts-list)
|
||||||
|
to inspect keys, definition sources, outputs, and effective dependencies without
|
||||||
|
loading a session or creating runtime state.
|
||||||
|
|
||||||
- do not put secret values directly in YAML.
|
### Scriptorium Artifact Families
|
||||||
- configure env var names in config and provide values via env/secrets files.
|
|
||||||
|
|
||||||
## 10. Examples
|
`pipeline.scriptorium.artifact_families` declares a shared artifact template
|
||||||
|
for every canonical campaign character. Domain catalog derivation expands each
|
||||||
|
family into separate concrete artifact entries before analyze planning or
|
||||||
|
Scriptorium invocation, retaining the authored declarations in configuration.
|
||||||
|
Party parsing rejects unsupported document schemas before family expansion.
|
||||||
|
|
||||||
Maintained examples:
|
For each `pipeline.scriptorium.artifact_families.<name>`:
|
||||||
|
|
||||||
- `examples/pipeline.minimal.yml`
|
| Field | Type | Required | Rule |
|
||||||
- `examples/pipeline.production.yml`
|
| --- | --- | --- | --- |
|
||||||
- `examples/pipeline.full.annotated.yml`
|
| `enabled`, `prompt_id`, `profile_id`, `timeout`, `render_debug`, `depends_on`, `inputs`, `vars` | ordinary artifact fields | No | copied to each generated artifact under the corresponding ordinary rules |
|
||||||
- `examples/session.template.yml`
|
| `for_each` | string | Yes | exactly `party.characters` |
|
||||||
- `examples/session.local-audio.yml`
|
| `output_path_pattern` | string | Yes | flat filename directly beneath `artifacts/` with exactly one `{character_id}` token and no other brace syntax |
|
||||||
- `examples/session.s3-audio.yml`
|
| `member_vars` | map | No | maps an ordinary Scriptorium variable name to a supported canonical character selector |
|
||||||
|
| `member_dependencies` | list | No | unique family keys; each generated member depends on the corresponding generated member of each listed family |
|
||||||
|
| `publish` | map | No | typed family publish policy (`enabled`, `required`, `dest_pattern`) validated against effective `pipeline.publish` settings and expanded into concrete publish outputs when enabled |
|
||||||
|
|
||||||
These examples are validated by `internal/config` tests.
|
An enabled family publish declaration is validated against the effective
|
||||||
|
`pipeline.publish` configuration, including its defaults; it does not require
|
||||||
|
an explicit `publish.enabled` declaration in the same source file.
|
||||||
|
|
||||||
|
Explicit and generated analysis artifacts and session bounds must use flat
|
||||||
|
filenames directly beneath `artifacts/`; combined transcripts use flat filenames
|
||||||
|
directly beneath `transcripts/`. Remote publish destinations remain independent.
|
||||||
|
Collisions among effective producers are rejected.
|
||||||
|
|
||||||
|
Generated keys are `<family>_<character_id>` and generated output paths must
|
||||||
|
not collide with explicit artifacts or another generated artifact. Families
|
||||||
|
expand even when disabled; normal analyze selection still omits disabled
|
||||||
|
artifacts unless they are explicitly selected by their concrete key.
|
||||||
|
|
||||||
|
Supported `member_vars` selectors are `character_id`, `player.name`,
|
||||||
|
`character.name`, `character.class_summary`, and `character.alias_summary`.
|
||||||
|
Their resolved values are strings. A member variable may not reuse a static
|
||||||
|
`vars` name; `session_id` remains owned and overwritten by Narratio as for any
|
||||||
|
other Scriptorium artifact.
|
||||||
|
|
||||||
|
Within a family only, an input source may use
|
||||||
|
`narratio.member_artifact.<family>`. Resolution rewrites the source to the
|
||||||
|
corresponding ordinary `narratio.artifact.<family>_<character_id>` source and
|
||||||
|
infers the concrete member dependency. Use `member_dependencies` only for
|
||||||
|
additional same-character ordering constraints that are not already inputs.
|
||||||
|
This syntax is rejected in explicit artifacts and never reaches runtime stages
|
||||||
|
or Scriptorium.
|
||||||
|
|
||||||
|
### Notifications
|
||||||
|
|
||||||
|
Narratio currently supports only `notification.mode: noop`, which is also the
|
||||||
|
default when the section is omitted. The notify stage performs no delivery in
|
||||||
|
this mode. Backend, recipient, timeout, and other provider settings are
|
||||||
|
rejected by strict configuration loading until Narratio has a provider
|
||||||
|
integration.
|
||||||
|
|
||||||
|
### Campaign
|
||||||
|
|
||||||
|
The campaign is a shared [RPG campaign document](https://schemas.maximumdirect.net/rpg/campaign/v0.2.0/schema.json).
|
||||||
|
Shared extensions are allowed; Narratio's `narratio` settings are strict.
|
||||||
|
|
||||||
|
| Field | Required | Meaning |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `schema_version` | Yes | `maximumdirect.rpg.campaign.v1` |
|
||||||
|
| `id` | Yes | campaign identity |
|
||||||
|
| `name`, `description` | No | shared context |
|
||||||
|
| `references.party` | Yes | shared roster path; `--party-file` can select another roster |
|
||||||
|
| `setting`, `system` | No | selected installed catalog IDs |
|
||||||
|
| `references.glossaries` | No | shared relationships, not an ordered Narratio composition list |
|
||||||
|
| `narratio.inputs.speakers_file` | Yes | speaker mapping path |
|
||||||
|
| `narratio.inputs.glossary_file` | No | shared campaign glossary path |
|
||||||
|
| `narratio.inputs.glossary` | No | inline campaign collection |
|
||||||
|
| `narratio.inputs.autocorrect` | No | replacement rules, default empty |
|
||||||
|
| `narratio.session_template_file` | No | campaign template; otherwise installation or built-in template |
|
||||||
|
|
||||||
|
Resource paths resolve relative to their defining source. See the
|
||||||
|
[three-file example](../examples/campaigns/lantern-coast/campaign.yml) and
|
||||||
|
[party contract](integrations/party.md).
|
||||||
|
|
||||||
|
### Glossary Inputs
|
||||||
|
|
||||||
|
Install a reference catalog and import its root into the pipeline. Selected
|
||||||
|
setting and system IDs resolve to source-relative shared glossary files; only
|
||||||
|
selected files are read. Campaign file and inline contributions compose using
|
||||||
|
ConfigKit identity and list controls. Session omissions inherit each selection
|
||||||
|
independently; explicit null or empty optional selectors clear them. A supplied
|
||||||
|
inline glossary or autocorrection list replaces the campaign contribution as a
|
||||||
|
whole, and null clears it. Clearing inline vocabulary leaves a selected file
|
||||||
|
unchanged; `autocorrect: []` disables inherited campaign rules.
|
||||||
|
|
||||||
|
Preparation writes shared envelopes for party, campaign, setting, spells, and
|
||||||
|
combined collections, including empty collections. Audita receives the four
|
||||||
|
individual envelopes and Notarius may bind the combined envelope to both glossary
|
||||||
|
roles. Collection extensions such as `instruction` are data, not prompt guidance.
|
||||||
|
[Shared glossary schema](https://schemas.maximumdirect.net/glossary/v0.2.0/schema.json)
|
||||||
|
and [semantics](https://schemas.maximumdirect.net/glossary/v0.2.0/semantics.md)
|
||||||
|
own the contract; see the [maintained examples](../examples/README.md).
|
||||||
|
|
||||||
|
### Session
|
||||||
|
|
||||||
|
| Field | Type | Required in session file | Notes |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| `session_id` | string | Yes | opaque identity; must match CLI session target when provided |
|
||||||
|
| `previous_session_id` | string | No | opaque identity; must not equal `session_id` |
|
||||||
|
| `campaign` | string | No | opaque identity; filled from `campaign_id` during resolve if omitted |
|
||||||
|
| `date` | string | No | metadata |
|
||||||
|
| `title` | string | No | metadata |
|
||||||
|
| `inputs.speakers_file` | string | No | overrides campaign stable input |
|
||||||
|
| `inputs.autocorrect` | list | No | replaces inherited rules; null or empty clears them |
|
||||||
|
| `inputs.setting` | string | No | independently overrides the campaign setting selection |
|
||||||
|
| `inputs.system` | string | No | independently overrides the campaign system selection |
|
||||||
|
| `inputs.glossary_file` | string | No | independently overrides the campaign vocabulary file |
|
||||||
|
| `inputs.glossary` | mapping | No | replaces the campaign's inline contribution |
|
||||||
|
| `inputs.audio_dir` | string | Conditional | local audio mode |
|
||||||
|
| `inputs.audio_files[]` | list[string] | Conditional | local audio mode |
|
||||||
|
| `inputs.audio_s3.prefix` | string | Conditional | S3 audio mode |
|
||||||
|
|
||||||
|
Audio rules:
|
||||||
|
|
||||||
|
- Audio selection may be omitted when remaining work does not require it;
|
||||||
|
uncovered or forced transcription requires audio.
|
||||||
|
- configure local mode (`audio_dir` or `audio_files`) or S3 mode (`audio_s3.prefix`), not both.
|
||||||
|
- `audio_s3` requires `pipeline.storage.backend: s3` and a configured S3 bucket.
|
||||||
|
- Explicit `audio_files` take precedence over `audio_dir`. Paths are resolved relative
|
||||||
|
to the session document and must identify regular files. Explicit files and
|
||||||
|
manifest-registered audio may have any suffix or none.
|
||||||
|
- Local directory scans are non-recursive. S3 selection scans the configured
|
||||||
|
prefix relative to the session's S3 prefix. Both use the same case-insensitive
|
||||||
|
candidate suffixes: `.aac`, `.aif`, `.aifc`, `.aiff`, `.alac`, `.amr`,
|
||||||
|
`.ape`, `.au`, `.caf`, `.flac`, `.m4a`, `.m4b`, `.mka`, `.mp2`, `.mp3`,
|
||||||
|
`.mp4`, `.oga`, `.ogg`, `.opus`, `.snd`, `.wav`, `.wave`, `.weba`, `.webm`,
|
||||||
|
`.wma`, and `.wv`. Other entries are ignored by automatic discovery.
|
||||||
|
- Distinct local paths with the same full basename receive distinct prepared
|
||||||
|
names. Speaker IDs use the prepared filename without its final extension. If
|
||||||
|
two resulting IDs match, choose one encoding or rename the recordings. S3
|
||||||
|
objects with the same full basename are rejected.
|
||||||
|
- Selection does not verify encoding. The transcription backend determines
|
||||||
|
whether it can decode the selected bytes.
|
||||||
|
|
||||||
|
### Storage backend selection
|
||||||
|
|
||||||
|
`local` is the default and disables remote object-store operations. Configure
|
||||||
|
`s3` explicitly before supplying `storage.s3`; a populated S3 block does not
|
||||||
|
select a backend on its own. Unknown backend names and an S3 block paired with
|
||||||
|
`local` are rejected during configuration validation.
|
||||||
|
|
||||||
|
### Previous-session expectation
|
||||||
|
|
||||||
|
`previous_session_id` is optional in a session file. When a command supplies
|
||||||
|
`--previous-session-id`, however, the session file must contain the same value;
|
||||||
|
an omitted or different value is rejected before the command performs work.
|
||||||
|
|
||||||
|
## Shared contract provenance
|
||||||
|
|
||||||
|
Narratio validates the shared glossary, RPG party, and RPG campaign `0.2.0`
|
||||||
|
schemas and their dependency closure offline from schemas distribution
|
||||||
|
`2026.11.1`, commit `f7e3cedeca11ed903311cdf29ca4d81fb1f216b7`.
|
||||||
|
The supplied synthetic catalog data is based on commit
|
||||||
|
`02dd53c6ea026347452d497350c40249c949f8ce`. Installed catalogs are selected
|
||||||
|
independently. See [attribution](oss/attribution.md) and the
|
||||||
|
[integration contracts](integrations/README.md) for tested consumers.
|
||||||
|
|
||||||
|
## Maintained Examples
|
||||||
|
|
||||||
|
See the [maintained examples index](../examples/README.md) for complete pipeline,
|
||||||
|
campaign, session, template, and input fixtures. Keep complete copyable files
|
||||||
|
there rather than duplicating them in this reference.
|
||||||
|
|||||||
@@ -1,92 +1,95 @@
|
|||||||
# Development Guide
|
# Development
|
||||||
|
|
||||||
## Purpose
|
This is the first-read landing page for people and LLM coding agents working on
|
||||||
Canonical contributor workflow and engineering conventions for implemented Narratio behavior.
|
Narratio. It provides a concise repository orientation and routes each kind of
|
||||||
|
change to its canonical documentation.
|
||||||
|
|
||||||
## Repository layout
|
Narratio is a stage-driven Go orchestrator for turning D&D session audio into
|
||||||
|
polished transcripts and generated artifacts. Start with the
|
||||||
|
[README](../README.md) for product context,
|
||||||
|
[Architecture](policy/architecture.md) for normative system boundaries, and the
|
||||||
|
[Internal Overview](internal/overview.md) for implemented component ownership.
|
||||||
|
|
||||||
- `cmd/narratio/`: CLI entrypoint.
|
Agents must read [Agent Policy](policy/agents.md) before recommending, planning,
|
||||||
- `internal/app/`: command handlers, plan/run/resume orchestration, cleanup gates, secrets loading.
|
or implementing changes. It owns implementation discipline and the default
|
||||||
- `internal/config/`: strict YAML loading, defaults, and validation.
|
commit-after-completed-work rule; it does not authorize pushing or releasing.
|
||||||
- `internal/stage/`: stage implementations and stage registry/order.
|
|
||||||
- `internal/adapters/`: external boundary adapters (WhisperX, Seriatim, Audita, Scriptorium, storage, notify).
|
|
||||||
- `internal/manifest/`: session/run manifest types and persistence.
|
|
||||||
- `internal/artifacts/`: canonical local/remote path helpers and local artifact store.
|
|
||||||
- `docs/`: canonical documentation set.
|
|
||||||
- `examples/`: maintained config examples used by tests.
|
|
||||||
|
|
||||||
## Build and test commands
|
Narratio integrates [ConfigKit v1.4.0](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/consumers/README.md), [CommandKit v0.8.0](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/consumers/guide.md), and [ReleaseKit v0.10.0](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/adoption.md); their guides own upstream APIs and behavior.
|
||||||
|
|
||||||
- Run focused CLI behavior checks:
|
## Go Prerequisite
|
||||||
|
|
||||||
```bash
|
The Go consumer minimum is 1.27.0, declared in `go.mod`. Maintained development
|
||||||
go test ./internal/app -run TestExecute -v
|
and verification use the official Go 1.27.4 toolchain. Release validation and
|
||||||
```
|
builds use the selected patch version and setup instructions in the
|
||||||
|
[release procedure](release.md#release-toolchain).
|
||||||
|
|
||||||
- Run config example load/validate checks:
|
## Policy Reading Guide
|
||||||
|
|
||||||
```bash
|
| Policy | Read before… |
|
||||||
go test ./internal/config -run TestExamplesLoadAndValidate -v
|
| --- | --- |
|
||||||
```
|
| [Policy set provenance](policy/meta.md) | Adopting policies, checking upstream revisions, or updating the adopted policy set. |
|
||||||
|
| [Agents](policy/agents.md) | Recommending, planning, or implementing repository changes. |
|
||||||
|
| [Architecture](policy/architecture.md) | Planning or changing application code or its structure. |
|
||||||
|
| [Testing](policy/testing.md) | Selecting validation for code changes, or adding, changing, removing, or evaluating tests. |
|
||||||
|
| [Documentation](policy/documentation.md) | Writing, revising, or reorganizing documentation. |
|
||||||
|
| [OSS](policy/oss.md) | Adding or updating dependencies or incorporated third-party material, or changing licensing or attribution. |
|
||||||
|
| [Release](policy/release.md) | Preparing or publishing a release, changing release procedures, or making versioning and compatibility decisions. |
|
||||||
|
|
||||||
- Run full test suite:
|
- Read applicable policies before making decisions they govern; multiple policies
|
||||||
|
may apply.
|
||||||
|
- Select policies using the task triggers above. Follow cross-references to
|
||||||
|
relevant sections when needed to resolve a concrete question.
|
||||||
|
- Reuse policies already available in context; reread when changed or no longer
|
||||||
|
available.
|
||||||
|
- Expand reading when the task's scope expands.
|
||||||
|
- When revising a policy itself, read that policy and any provisions elsewhere
|
||||||
|
affected by the revision.
|
||||||
|
|
||||||
```bash
|
## What To Read
|
||||||
|
|
||||||
|
| When working on | Read | Why |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Finding the package or component that owns current behavior | [Internal Overview](internal/overview.md) | It is the implemented component inventory and routes to focused internal documents. |
|
||||||
|
| Application shape, boundaries, dependency direction, runtime invariants, safety properties, or dependencies | [Architecture](policy/architecture.md) | It defines the intended system shape, ownership, and non-goals. |
|
||||||
|
| Any documentation addition or revision | [Documentation Policy](policy/documentation.md) | It defines canonical owners, audiences, current-behavior rules, and maintenance requirements. |
|
||||||
|
| Adding, changing, reviewing, rewriting, or deleting tests | [Testing Policy](policy/testing.md) | It defines risk-based sufficiency, durable test boundaries, test-double guidance, and test lifecycle decisions. |
|
||||||
|
| CLI composition or command behavior | [Internal Overview](internal/overview.md) and [CLI Reference](cli.md) | The overview routes to command ownership; the reference owns public syntax and invocation behavior. |
|
||||||
|
| Configuration loading, resolution, or user-visible configuration | [Internal Overview](internal/overview.md) and [Configuration](config.md) | The overview routes to implementation ownership; the reference owns fields, defaults, discovery, and validation. |
|
||||||
|
| Session workflow, status, restore, cleanup, or object storage | [Restore Internals](internal/command-restore.md), [Workspace Internals](internal/workspace.md), [Storage Internals](internal/storage.md), [Operations](operations.md), and [Troubleshooting](troubleshooting.md) | These separate implementation mechanics, operator procedures, and symptom-driven recovery. |
|
||||||
|
| Pipeline sequencing or the behavior of a stage | [Internal Overview](internal/overview.md) and its focused stage documents | The overview owns the implemented stage inventory and routes to each stage contract. |
|
||||||
|
| Adapters or external tool contracts | [Adapter Internals](internal/adapters.md) and [Integration Contracts](integrations/README.md) | The internal guide owns adapter composition and mechanics; integration documents own external formats and protocols. |
|
||||||
|
| Manifests, artifacts, workspace paths, or publish behavior | [Manifest Internals](internal/manifest.md), [Artifact Internals](internal/artifacts.md), [Workspace Internals](internal/workspace.md), [Publish Internals](internal/stage-publish.md), and [Operations](operations.md) | These separate implementation state and resolution from operator-visible layout and lifecycle. |
|
||||||
|
| Maintained configuration or input examples | [Configuration](config.md) and [Examples](../examples/README.md) | The reference owns field meanings; the examples directory owns complete copyable files. |
|
||||||
|
| Preparing, validating, or publishing a release | [Release Policy](policy/release.md) and [Release Procedure](release.md) | Policy owns requirements; the procedure owns concrete validation, guarded publication, and optional later inspection. |
|
||||||
|
| Proposed or unimplemented behavior | `docs/roadmap/` | Future work belongs only in roadmap documentation until implemented. |
|
||||||
|
|
||||||
|
For an existing subsystem, also inspect its focused tests and package-level
|
||||||
|
contracts before changing behavior.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
Use focused package tests while iterating. Push and pull-request CI runs these
|
||||||
|
repository-wide checks and cross-builds the declared targets:
|
||||||
|
|
||||||
|
```sh
|
||||||
go test ./...
|
go test ./...
|
||||||
|
go test -race ./...
|
||||||
|
go vet ./...
|
||||||
|
go build ./...
|
||||||
```
|
```
|
||||||
|
|
||||||
## Coding conventions
|
The full suite includes documentation-link and Woodpecker dependency checks
|
||||||
|
and loads maintained pipeline and session examples. For focused diagnosis,
|
||||||
|
run `go test ./internal/doccheck` or
|
||||||
|
`go test ./internal/config -run '^TestExamplesLoadAndValidate$'` directly;
|
||||||
|
these are available developer tools, not additional CI steps. Tag CI delivers assets asynchronously from the tagged source; it does not
|
||||||
|
repeat candidate validation. The normal maintainer
|
||||||
|
entry point is the single publication command in the
|
||||||
|
[Release Procedure](release.md).
|
||||||
|
|
||||||
- Keep orchestration explicit and stage-driven; do not introduce generic workflow/DAG abstractions.
|
Woodpecker also runs `go test -race -shuffle=on -count=3 ./...` on its scheduled
|
||||||
- Keep external-system details inside adapter packages; stages should consume Narratio-level contracts only.
|
job to expose ordering and repeatability defects. Current runners cross-compile
|
||||||
- Use centralized path helpers from `internal/artifacts` rather than ad hoc path concatenation.
|
the supported Linux amd64 and arm64 targets and the best-effort macOS arm64
|
||||||
- Preserve manifest-driven state transitions (`running`, `succeeded`, `failed`, `skipped`, `stale`) as the source of run progress.
|
target. The macOS cross-build establishes compilation only, not native runtime
|
||||||
- Keep user/operator docs implementation-accurate; planned work belongs only under `docs/roadmap/`.
|
evidence. Add a native check only when an official runner label and successful
|
||||||
|
native-run evidence are available.
|
||||||
For design principles and invariants, see [docs/architecture.md](./architecture.md). For stage/adapter contracts, see [docs/internal/README.md](./internal/README.md).
|
|
||||||
|
|
||||||
## Dependency policy
|
|
||||||
|
|
||||||
- Prefer Go standard library where practical.
|
|
||||||
- Add third-party dependencies only when they provide clear value for required behavior.
|
|
||||||
- Keep dependency additions narrow to the boundary package that needs them.
|
|
||||||
|
|
||||||
## Change playbooks
|
|
||||||
|
|
||||||
### Add config fields
|
|
||||||
|
|
||||||
1. Add fields to config structs in `internal/config`.
|
|
||||||
2. Set defaults in `internal/config/defaults.go` when appropriate.
|
|
||||||
3. Add validation rules in `internal/config/validate.go`.
|
|
||||||
4. Add or update load/validate tests in `internal/config/*_test.go`.
|
|
||||||
5. Update canonical config docs and examples:
|
|
||||||
- [docs/config.md](./config.md)
|
|
||||||
- relevant files under `examples/`
|
|
||||||
|
|
||||||
### Add CLI flags or commands
|
|
||||||
|
|
||||||
1. Update command parsing and behavior in `internal/app`.
|
|
||||||
2. Add or update command tests (`TestExecute` and command-specific tests).
|
|
||||||
3. Update [docs/cli.md](./cli.md) and, if operator workflow changes, [docs/operations.md](./operations.md).
|
|
||||||
|
|
||||||
### Add or modify stages/adapters
|
|
||||||
|
|
||||||
1. Implement stage behavior in `internal/stage` with clear input/output boundaries.
|
|
||||||
2. Keep external transport/subprocess details in `internal/adapters`.
|
|
||||||
3. Preserve manifest and promotion semantics expected by runner and archive logic.
|
|
||||||
4. Add/update stage and adapter tests.
|
|
||||||
5. Update internal component contracts in `docs/internal/`.
|
|
||||||
|
|
||||||
### Update examples
|
|
||||||
|
|
||||||
1. Keep canonical examples only in `examples/`.
|
|
||||||
2. Ensure examples load and validate through runtime config paths.
|
|
||||||
3. Update `internal/config/load_validate_test.go` as needed.
|
|
||||||
4. Update links in `docs/config.md` if example filenames change.
|
|
||||||
|
|
||||||
### Update docs and roadmap
|
|
||||||
|
|
||||||
1. Keep implemented behavior in canonical docs (`README`, `docs/*.md`, `docs/internal/`).
|
|
||||||
2. Keep planned/unimplemented behavior only in `docs/roadmap/`.
|
|
||||||
3. After completing roadmap items, remove or mark them complete in `docs/roadmap/documentation.md`.
|
|
||||||
4. Run a link/path sweep before finalizing changes.
|
|
||||||
|
|||||||
@@ -1,356 +0,0 @@
|
|||||||
# Go Project Documentation Policy
|
|
||||||
|
|
||||||
## Purpose
|
|
||||||
|
|
||||||
Project documentation must help four audiences:
|
|
||||||
|
|
||||||
1. users who need to run the application;
|
|
||||||
2. administrators/operators who need to configure and operate it;
|
|
||||||
3. developers who need to understand and change it safely;
|
|
||||||
4. LLM coding agents that need clear scope, boundaries, and invariants.
|
|
||||||
|
|
||||||
Docs should be accurate, concise, task-oriented, and organized by audience. Prefer links to canonical docs over repetition.
|
|
||||||
|
|
||||||
## Core Rules
|
|
||||||
|
|
||||||
### 1. Keep docs concise
|
|
||||||
|
|
||||||
Each document should cover a defined scope and only the essentials for that scope.
|
|
||||||
|
|
||||||
Avoid:
|
|
||||||
- long background explanations;
|
|
||||||
- repeated reference material;
|
|
||||||
- implementation detail in user-facing docs;
|
|
||||||
- aspirational language outside roadmap docs;
|
|
||||||
- verbose examples where one minimal example is clearer.
|
|
||||||
|
|
||||||
### 2. Document only implemented behavior outside roadmap files
|
|
||||||
|
|
||||||
Unimplemented, planned, aspirational, experimental, or future work may be described only under:
|
|
||||||
|
|
||||||
- `docs/roadmap/`
|
|
||||||
|
|
||||||
No other documentation file, including `README.md`, should describe code, features, modules, stages, commands, config fields, or behaviors that do not currently exist.
|
|
||||||
|
|
||||||
If a feature is partial, non-roadmap docs may describe only the implemented portion and its current boundary.
|
|
||||||
|
|
||||||
### 3. Use canonical homes
|
|
||||||
|
|
||||||
Each type of information should have one canonical location.
|
|
||||||
|
|
||||||
Canonical homes:
|
|
||||||
|
|
||||||
- project purpose and quickstart: `README.md`
|
|
||||||
- development principles: `docs/architecture.md`
|
|
||||||
- configuration reference: `docs/config.md`
|
|
||||||
- CLI reference: `docs/cli.md`
|
|
||||||
- operations and recovery: `docs/operations.md`
|
|
||||||
- troubleshooting: `docs/troubleshooting.md`
|
|
||||||
- implemented internals: `docs/internal/`
|
|
||||||
- future work: `docs/roadmap/`
|
|
||||||
- contributor workflow: `docs/development.md`
|
|
||||||
- copyable examples: `examples/`
|
|
||||||
|
|
||||||
Other files should summarize briefly and link to the canonical source.
|
|
||||||
|
|
||||||
### 4. Keep examples real
|
|
||||||
|
|
||||||
Examples should be valid, maintained, and free of secrets.
|
|
||||||
|
|
||||||
Where practical:
|
|
||||||
- example configs should load successfully;
|
|
||||||
- example commands should match real CLI syntax;
|
|
||||||
- important examples should be covered by tests.
|
|
||||||
|
|
||||||
## Documentation Profiles
|
|
||||||
|
|
||||||
All projects require:
|
|
||||||
|
|
||||||
- `README.md`
|
|
||||||
- `docs/architecture.md`
|
|
||||||
|
|
||||||
Additional docs depend on the project.
|
|
||||||
|
|
||||||
### Small library
|
|
||||||
|
|
||||||
Recommended:
|
|
||||||
- `docs/development.md`, if contributor conventions are non-obvious
|
|
||||||
|
|
||||||
### Simple CLI
|
|
||||||
|
|
||||||
Required:
|
|
||||||
- `docs/cli.md`
|
|
||||||
|
|
||||||
Recommended:
|
|
||||||
- `docs/development.md`
|
|
||||||
|
|
||||||
### Config-driven CLI
|
|
||||||
|
|
||||||
Required:
|
|
||||||
- `docs/cli.md`
|
|
||||||
- `docs/config.md`
|
|
||||||
|
|
||||||
Recommended:
|
|
||||||
- `examples/`
|
|
||||||
- `docs/development.md`
|
|
||||||
|
|
||||||
### Stateful or operator-facing application
|
|
||||||
|
|
||||||
Required:
|
|
||||||
- `docs/cli.md`, if CLI-based
|
|
||||||
- `docs/config.md`, if config-driven
|
|
||||||
- `docs/operations.md`
|
|
||||||
|
|
||||||
Recommended:
|
|
||||||
- `docs/troubleshooting.md`
|
|
||||||
- `examples/`
|
|
||||||
- `docs/development.md`
|
|
||||||
|
|
||||||
### Modular, staged, service-oriented, or orchestration application
|
|
||||||
|
|
||||||
Required:
|
|
||||||
- `docs/cli.md`, if CLI-based
|
|
||||||
- `docs/config.md`, if config-driven
|
|
||||||
- `docs/operations.md`
|
|
||||||
- `docs/internal/`
|
|
||||||
- `docs/development.md`
|
|
||||||
|
|
||||||
Recommended:
|
|
||||||
- `docs/troubleshooting.md`
|
|
||||||
- validated examples under `examples/`
|
|
||||||
|
|
||||||
## Required Documents
|
|
||||||
|
|
||||||
### README.md
|
|
||||||
|
|
||||||
**Audience:** users, administrators, operators
|
|
||||||
|
|
||||||
The README is the outward-facing project orientation page.
|
|
||||||
|
|
||||||
It should include, in order:
|
|
||||||
|
|
||||||
1. concise description;
|
|
||||||
2. elevator pitch;
|
|
||||||
3. shortest useful command or usage example;
|
|
||||||
4. links to targeted docs.
|
|
||||||
|
|
||||||
The README should be short. It is not a manual.
|
|
||||||
|
|
||||||
The “shortest useful command” means the simplest command that performs the project’s core use case. (It does not mean `app --help`.)
|
|
||||||
|
|
||||||
### docs/architecture.md
|
|
||||||
|
|
||||||
**Audience:** developers, LLM coding agents
|
|
||||||
|
|
||||||
`docs/architecture.md` is required for every project.
|
|
||||||
|
|
||||||
It is an inward-facing development policy document. It should describe how the project is intended to be built and changed.
|
|
||||||
|
|
||||||
It should include:
|
|
||||||
|
|
||||||
- project shape;
|
|
||||||
- core design principles;
|
|
||||||
- package and boundary philosophy;
|
|
||||||
- state/persistence philosophy, if applicable;
|
|
||||||
- external integration philosophy, if applicable;
|
|
||||||
- error-handling and logging principles;
|
|
||||||
- testing expectations;
|
|
||||||
- documentation expectations;
|
|
||||||
- architectural invariants;
|
|
||||||
- explicit non-goals, if useful.
|
|
||||||
|
|
||||||
For small projects, this file may be brief. It may simply state that the project is intentionally narrow, monolithic, and dependency-light.
|
|
||||||
|
|
||||||
### docs/config.md
|
|
||||||
|
|
||||||
**Audience:** administrators, operators, advanced users
|
|
||||||
|
|
||||||
Required for applications with configuration files.
|
|
||||||
|
|
||||||
It should include, in order:
|
|
||||||
|
|
||||||
1. config file locations and discovery precedence;
|
|
||||||
2. minimal working config;
|
|
||||||
3. production-oriented config;
|
|
||||||
4. full configuration reference;
|
|
||||||
5. secrets handling, if applicable;
|
|
||||||
6. links to maintained examples.
|
|
||||||
|
|
||||||
The full configuration reference should be canonical.
|
|
||||||
|
|
||||||
### docs/cli.md
|
|
||||||
|
|
||||||
**Audience:** users, administrators, operators
|
|
||||||
|
|
||||||
Required for CLI applications.
|
|
||||||
|
|
||||||
It should include, in order:
|
|
||||||
|
|
||||||
1. shortest useful command;
|
|
||||||
2. command overview;
|
|
||||||
3. complete flag reference;
|
|
||||||
4. common workflows;
|
|
||||||
5. diagnostic or recovery commands, if applicable.
|
|
||||||
|
|
||||||
Explain when commands are useful, not just their syntax.
|
|
||||||
|
|
||||||
### docs/operations.md
|
|
||||||
|
|
||||||
**Audience:** administrators, operators
|
|
||||||
|
|
||||||
Required for applications that maintain state, support resume behavior, run multiple stages, write durable artifacts, use remote storage, or require recovery procedures.
|
|
||||||
|
|
||||||
It should cover:
|
|
||||||
|
|
||||||
- normal workflow;
|
|
||||||
- filesystem layout;
|
|
||||||
- remote storage layout, if applicable;
|
|
||||||
- logs and manifests;
|
|
||||||
- resume/retry behavior;
|
|
||||||
- cleanup behavior;
|
|
||||||
- archive/backup behavior;
|
|
||||||
- safe recovery procedures;
|
|
||||||
- operational caveats.
|
|
||||||
|
|
||||||
### docs/troubleshooting.md
|
|
||||||
|
|
||||||
**Audience:** administrators, operators
|
|
||||||
|
|
||||||
Recommended once recurring failure modes exist.
|
|
||||||
|
|
||||||
Each entry should include:
|
|
||||||
|
|
||||||
- symptom;
|
|
||||||
- likely cause;
|
|
||||||
- diagnostic command or inspection step;
|
|
||||||
- safe fix;
|
|
||||||
- relevant links.
|
|
||||||
|
|
||||||
### docs/development.md
|
|
||||||
|
|
||||||
**Audience:** developers, LLM coding agents
|
|
||||||
|
|
||||||
Required for projects maintained by humans and LLM coding agents.
|
|
||||||
|
|
||||||
It should include:
|
|
||||||
|
|
||||||
- repository layout;
|
|
||||||
- build/test commands;
|
|
||||||
- coding conventions;
|
|
||||||
- dependency policy;
|
|
||||||
- how to add config fields;
|
|
||||||
- how to add CLI flags;
|
|
||||||
- how to add stages/modules/adapters, if applicable;
|
|
||||||
- how to update examples;
|
|
||||||
- documentation update expectations.
|
|
||||||
|
|
||||||
### docs/internal/
|
|
||||||
|
|
||||||
**Audience:** developers, LLM coding agents
|
|
||||||
|
|
||||||
Required for modular, staged, service-oriented, or orchestration projects.
|
|
||||||
|
|
||||||
This directory describes implemented internal components. It is not the roadmap.
|
|
||||||
|
|
||||||
Use one file per major component where useful.
|
|
||||||
|
|
||||||
Each component doc should include:
|
|
||||||
|
|
||||||
1. purpose;
|
|
||||||
2. inputs and outputs;
|
|
||||||
3. boundaries;
|
|
||||||
4. config fields used;
|
|
||||||
5. external adapters used;
|
|
||||||
6. state or manifest behavior, if applicable;
|
|
||||||
7. skip/resume behavior, if applicable;
|
|
||||||
8. failure behavior;
|
|
||||||
9. tests to inspect before changing;
|
|
||||||
10. architectural invariants.
|
|
||||||
|
|
||||||
### docs/roadmap/
|
|
||||||
|
|
||||||
**Audience:** maintainers, developers, LLM coding agents
|
|
||||||
|
|
||||||
This is the only place for planned, future, aspirational, experimental, or unimplemented work.
|
|
||||||
|
|
||||||
Roadmap docs should clearly distinguish:
|
|
||||||
|
|
||||||
- proposed work;
|
|
||||||
- accepted plans;
|
|
||||||
- deferred ideas;
|
|
||||||
- rejected ideas;
|
|
||||||
- implementation prompts or task breakdowns, if useful.
|
|
||||||
|
|
||||||
Roadmap docs should not be confused with current behavior.
|
|
||||||
|
|
||||||
### docs/integrations/
|
|
||||||
|
|
||||||
**Audience:** developers, LLM coding agents
|
|
||||||
|
|
||||||
Required for projects that depend on external CLIs, APIs, services, protocols, or file formats where the integration contract is important to maintain.
|
|
||||||
|
|
||||||
This directory contains concise, versioned reference notes for external integration contracts. It should document only the parts of the external system that this project actually uses.
|
|
||||||
|
|
||||||
Use one file per integration where useful.
|
|
||||||
|
|
||||||
## Examples Directory
|
|
||||||
|
|
||||||
Projects with non-trivial configuration or workflows should include `examples/`.
|
|
||||||
|
|
||||||
Useful examples include:
|
|
||||||
|
|
||||||
- minimal working config;
|
|
||||||
- production-oriented config;
|
|
||||||
- full annotated config;
|
|
||||||
- local development config;
|
|
||||||
- remote/object-storage config;
|
|
||||||
- minimal session/input file.
|
|
||||||
|
|
||||||
Examples should be valid, maintained, tested when practical, and linked from relevant docs.
|
|
||||||
|
|
||||||
## Security and Privacy
|
|
||||||
|
|
||||||
Docs and examples must not include:
|
|
||||||
|
|
||||||
- real API keys;
|
|
||||||
- tokens;
|
|
||||||
- passwords;
|
|
||||||
- private keys;
|
|
||||||
- private environment dumps;
|
|
||||||
- sensitive user data;
|
|
||||||
- raw private transcripts;
|
|
||||||
- private infrastructure details unless intentionally public.
|
|
||||||
|
|
||||||
Document secret-handling mechanisms, not actual secret values.
|
|
||||||
|
|
||||||
## Maintenance Rules
|
|
||||||
|
|
||||||
When docs change, verify the affected behavior.
|
|
||||||
|
|
||||||
Where practical:
|
|
||||||
|
|
||||||
- load example config files in tests;
|
|
||||||
- test CLI examples or command parser behavior;
|
|
||||||
- validate documented flags against real flags;
|
|
||||||
- remove stale references;
|
|
||||||
- update links after renames;
|
|
||||||
- keep roadmap content out of non-roadmap docs.
|
|
||||||
|
|
||||||
If documentation and code disagree, fix the documentation and/or open a roadmap item; do not leave aspirational behavior in current-behavior docs.
|
|
||||||
|
|
||||||
Documentation is complete only when it matches the current code.
|
|
||||||
|
|
||||||
## Documentation Change Checklist
|
|
||||||
|
|
||||||
Before merging documentation changes, verify:
|
|
||||||
|
|
||||||
- README is concise and orientation-focused.
|
|
||||||
- `docs/architecture.md` describes development principles.
|
|
||||||
- Future work appears only under `docs/roadmap/`.
|
|
||||||
- User-facing docs avoid unnecessary internals.
|
|
||||||
- Developer-facing docs preserve boundaries and invariants.
|
|
||||||
- Config examples match the schema.
|
|
||||||
- CLI examples match real commands and flags.
|
|
||||||
- Defaults appear in the canonical config reference.
|
|
||||||
- No secrets or private data are included.
|
|
||||||
- Links are accurate.
|
|
||||||
@@ -1,15 +1,36 @@
|
|||||||
# Integration Documentation Index
|
# Integrations Index
|
||||||
|
|
||||||
## Audience
|
## Audience
|
||||||
Developers and LLM coding agents changing Narratio's external integration contracts.
|
|
||||||
|
Operators, developers, and coding agents who need to understand Narratio's
|
||||||
|
externally observable integration boundaries.
|
||||||
|
|
||||||
## Scope
|
## Scope
|
||||||
Implemented-only reference notes for the external systems Narratio currently integrates with.
|
|
||||||
|
|
||||||
## Integration Docs
|
`docs/integrations/` is the canonical reference for protocols, invocation and
|
||||||
- `audita.md`: Audita adapter invocation and validation contract.
|
data contracts, logical outputs, and compatibility behavior at external tool
|
||||||
- `seriatim.md`: Seriatim normalize/merge/trim adapter contract.
|
boundaries.
|
||||||
- `scriptorium.md`: Scriptorium run/render adapter contract.
|
|
||||||
|
|
||||||
## Canonical Owner
|
These documents describe what Narratio sends or invokes, what it accepts in
|
||||||
`docs/integrations/` is the canonical home for external integration reference notes per `docs/documentation/policy.md`.
|
return, and how failures are surfaced. Internal composition and stage mechanics
|
||||||
|
belong in [the adapter implementation guide](../internal/adapters.md) and the
|
||||||
|
focused stage documents.
|
||||||
|
|
||||||
|
## Integration Contracts
|
||||||
|
|
||||||
|
- [Audita](./audita.md): transcript polishing (`audita process`).
|
||||||
|
- [Notarius](./notarius.md): complete pipeline execution and safe JSON product
|
||||||
|
promotion (`notarius run`).
|
||||||
|
- [Party](./party.md): canonical campaign roster input.
|
||||||
|
- [Seriatim](./seriatim.md): merge, normalize, trim, and render operations.
|
||||||
|
- [Scriptorium](./scriptorium.md): artifact generation, prepared previews, and
|
||||||
|
prompt requirements discovery.
|
||||||
|
- [WhisperX](./whisperx.md): speaker-audio transcription over HTTP.
|
||||||
|
|
||||||
|
## Related Canonical Docs
|
||||||
|
|
||||||
|
- [Configuration](../config.md): operator-facing configuration reference.
|
||||||
|
- [Adapter implementation](../internal/adapters.md): shared adapter boundary and
|
||||||
|
runner wiring.
|
||||||
|
- [Internal documentation](../internal/overview.md): stage-specific integration
|
||||||
|
usage and component ownership.
|
||||||
|
|||||||
@@ -1,66 +1,46 @@
|
|||||||
# Integration: audita
|
# Integration: Audita
|
||||||
|
|
||||||
## Purpose
|
Narratio invokes Audita v4.3.0 for polishing. Its adapter supplies the prepared
|
||||||
Define Narratio's adapter contract for transcript polishing via Audita CLI subprocess execution.
|
party, campaign, setting, and spells documents as repeated `--glossary-file`
|
||||||
|
arguments, the merged transcript and requested output, and run-local report and
|
||||||
|
work destinations. Optional config, overlay, profile, transcript-description,
|
||||||
|
and output-schema selectors are forwarded only when set. `audita.debug: true`
|
||||||
|
forwards `--debug`; false adds no debug override. Audita owns its
|
||||||
|
configuration, ordered pipeline, profiles, and native discovery. Narratio does
|
||||||
|
not generate a downstream configuration. See [Audita configuration](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/config.md)
|
||||||
|
and its [runtime glossary input contract](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/integrations/transcript-glossary-files.md).
|
||||||
|
|
||||||
## Inputs and Outputs
|
All four entry lists are supplied, including empty ones, and replace same-named
|
||||||
Inputs (`audita.PolishRequest`):
|
Audita-configured lists. Other collections and configured instructions retain native downstream
|
||||||
- merged transcript path
|
composition; shared collection extensions are data, not prompt guidance. The [configuration reference](../config.md#glossary-inputs)
|
||||||
- glossary path
|
explains selection and migration of the prepared inputs.
|
||||||
- output processed transcript path
|
|
||||||
- optional report path (required when report enabled)
|
|
||||||
- work dir
|
|
||||||
- generated config path
|
|
||||||
- stdout/stderr log paths
|
|
||||||
- optional module/model/base URL and concurrency knobs
|
|
||||||
|
|
||||||
Outputs (`audita.PolishResult`):
|
After preparation, Narratio runs native Audita preflight when projected polish
|
||||||
- processed transcript path
|
work needs execution. The adapter supplies the same selections and prepared
|
||||||
- optional report path
|
files with a synthetic transcript. Audita's provider smoke checks remain enabled;
|
||||||
- generated config path
|
they can contact providers and destination probes can create directories.
|
||||||
- stdout/stderr log paths
|
Standalone `preflight` prepares or reuses inputs and checks Audita regardless
|
||||||
- exit code, duration, invoked binary
|
of output reuse, using invocation-scoped probe destinations. A successful check
|
||||||
- adapter metadata
|
does not guarantee later real-transcript processing or editorial quality. See
|
||||||
|
[operations](../operations.md#prompt-requirements-preflight)
|
||||||
|
and [Audita preflight](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/cli.md#preflight).
|
||||||
|
|
||||||
## Boundaries
|
Each `pipeline.audita.credentials` value is an exact ConfigKit secret reference.
|
||||||
Owns:
|
Narratio forwards selected names and captured values in the child environment
|
||||||
- Deterministic CLI argument construction for `audita process`
|
and registers them for captured-stream redaction. It does not discover backend
|
||||||
- Environment bridging for API credentials
|
credentials or scrub files created by Audita. The configured timeout and parent
|
||||||
- Invocation config emission
|
cancellation initiate subprocess shutdown; completion can take longer while
|
||||||
- Output validation for processed transcript and report
|
process output finishes.
|
||||||
|
|
||||||
Does not own:
|
The corrected transcript is the only canonical polish output. It must be valid
|
||||||
- Upstream/downstream stage orchestration
|
JSON with a top-level `segments` array within Narratio's 64 MiB limit. Exit zero
|
||||||
- Credential sourcing policy beyond required env-var presence check
|
is accepted even when ordinary reports describe recoverable errors or no
|
||||||
|
corrections. Narratio records available `errors.yml`, `recoveries.yml`, and
|
||||||
|
`report.md` from the requested report directory as diagnostics, each subject
|
||||||
|
to a 16 MiB bound. Reports may be absent when disabled. See Audita's
|
||||||
|
[output contract](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/integrations/output-files.md).
|
||||||
|
|
||||||
## Config Fields Used
|
On nonzero exit, Narratio preserves the subprocess error and available run-local
|
||||||
Via `pipeline.audita.*` mapped in app/stage wiring:
|
evidence and does not promote an incidental transcript. The generated invocation
|
||||||
- `binary`, `timeout`, `llm_api_key_env`, `modules`, `base_url`, `model`
|
record contains arguments, paths, and credential names, never values; it is a
|
||||||
- `transcript_description`, `config_path`, `output_schema`, `work_dir_retention`
|
diagnostic record, not an Audita configuration file.
|
||||||
- `total_llm_concurrency`, `proposal_llm_concurrency`, `validation_model`, `validation_llm_concurrency`, `report`
|
|
||||||
|
|
||||||
## External Adapters Used
|
|
||||||
- Shared subprocess helper (`internal/adapters/subprocess`) to run CLI and capture logs.
|
|
||||||
|
|
||||||
## State and Manifest Behavior
|
|
||||||
- No direct manifest writes.
|
|
||||||
- Stage-level metadata records adapter provenance and credential-present signal.
|
|
||||||
- Generated invocation YAML is written when `GeneratedConfigPath` is provided.
|
|
||||||
|
|
||||||
## Skip and Resume Behavior
|
|
||||||
- Adapter has no skip/resume logic. Stage/runner controls this.
|
|
||||||
|
|
||||||
## Failure Behavior
|
|
||||||
- Constructor validation fails on invalid binary/timeout/schema/concurrency/URL values.
|
|
||||||
- Run fails on missing required paths, missing required credential env var, subprocess errors, invalid processed JSON shape, or invalid report JSON.
|
|
||||||
- Failures preserve stdout/stderr paths in returned result metadata.
|
|
||||||
|
|
||||||
## Tests to Inspect Before Changing
|
|
||||||
- `internal/adapters/audita/subprocess_test.go`
|
|
||||||
- `internal/adapters/audita/fake_test.go`
|
|
||||||
- `internal/stage/polish_test.go`
|
|
||||||
|
|
||||||
## Architectural Invariants
|
|
||||||
- Processed output must be valid JSON with top-level `segments` array.
|
|
||||||
- When report is enabled, report output must be valid JSON.
|
|
||||||
- If `llm_api_key_env` is configured, credential must be present in environment.
|
|
||||||
|
|||||||
50
docs/integrations/notarius.md
Normal file
50
docs/integrations/notarius.md
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# Notarius Integration Contract
|
||||||
|
|
||||||
|
Narratio invokes a separately installed Notarius v0.10.0 executable and the
|
||||||
|
operator's existing Notarius configuration and pipeline. Narratio does not build
|
||||||
|
that configuration. The [Notarius consumer guide](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.10.0/docs/consumers/dnd-pipeline.md)
|
||||||
|
owns the maintained pipeline and [CLI](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.10.0/docs/cli.md)
|
||||||
|
owns its invocation and native output contracts. Controlled local-provider
|
||||||
|
compatibility was exercised against commit `752c9b44d2c0bb3bfb1e02a5d4379f7cc5b6261e`.
|
||||||
|
|
||||||
|
## Invocation
|
||||||
|
|
||||||
|
Narratio supplies `run <pipeline_id>`, `--config`, `--input-file`, `--output-dir`,
|
||||||
|
`--debug-dir`, and `--format json`. It forwards an explicitly selected overlay,
|
||||||
|
cache mode, and reference bindings; debug true requests capture. The configured
|
||||||
|
child credentials are forwarded by exact name and captured streams are redacted.
|
||||||
|
The same selected configuration, credentials, references and cache mode are used
|
||||||
|
for native pipeline inspection and preflight. Preflight may contact providers and
|
||||||
|
probe destinations; a synthetic transcript establishes readiness for that input
|
||||||
|
only. See [operations](../operations.md#prompt-requirements-preflight).
|
||||||
|
|
||||||
|
The prepared shared roster can bind to `party`; the combined shared glossary can
|
||||||
|
bind to both `glossary` and `spell_catalog`. Notarius owns collection selection,
|
||||||
|
D&D recognition, its configuration and caches. See [configuration](../config.md#notarius-reference-bindings).
|
||||||
|
Narratio stage reuse and Notarius cache reuse are separate. Forced extraction
|
||||||
|
requests native cache refresh.
|
||||||
|
|
||||||
|
## Accepted Result
|
||||||
|
|
||||||
|
After a successful exit, Narratio reads the native JSON completion report, checks
|
||||||
|
its pipeline and confined output directory, and validates each configured
|
||||||
|
`lanes/<lane-id>.json` as a safe regular JSON file. It promotes those required
|
||||||
|
lanes to flat session artifacts and records content evidence. The reported
|
||||||
|
`artifact_count` can include reused or auxiliary results; it is not an inventory.
|
||||||
|
Optional `chunk-map.json` and `evidence-context.json` stay in the original
|
||||||
|
bundle, which is subject to Narratio cleanup. Selected canonical products and
|
||||||
|
their recorded evidence support reuse without that bundle. A positive native
|
||||||
|
`fallback_count` remains visible in fresh and reused reports.
|
||||||
|
|
||||||
|
Nonzero exit, malformed completion, unsafe output, or a missing required lane
|
||||||
|
fails extraction. Diagnostics and available files remain for investigation; an
|
||||||
|
incidental file or partial report does not establish success. See
|
||||||
|
[extraction operations](../operations.md#extraction-workflow).
|
||||||
|
|
||||||
|
## Opt-in Integration Test
|
||||||
|
|
||||||
|
The [catalog compatibility script](https://forge.maximumdirect.net/eric/narratio-reference-catalog/src/commit/016473fd16b15847f3e913670c423faa7c35720b/scripts/check-compatibility.sh)
|
||||||
|
accepts explicit Narratio and Notarius checkouts and Audita and Notarius binary
|
||||||
|
paths. It uses a controlled local provider and verifies readiness, the ten-lane
|
||||||
|
pipeline, flat promotion, cache reuse, and forced refresh. Ordinary tests skip
|
||||||
|
external binaries.
|
||||||
27
docs/integrations/party.md
Normal file
27
docs/integrations/party.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# Canonical Party Input
|
||||||
|
|
||||||
|
`party.yml` is a campaign-owned roster conforming to the [shared RPG party
|
||||||
|
contract](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/rpg/party/v0.2.0/semantics.md).
|
||||||
|
ConfigKit resolves native imports before Narratio validates the complete roster.
|
||||||
|
Shared extensions and the authored null or empty `aliases` values survive in the
|
||||||
|
prepared party document and native inspection.
|
||||||
|
|
||||||
|
Narratio additionally requires a nonempty roster, stable character IDs using the
|
||||||
|
configured-artifact key grammar, player and character names, and at least one
|
||||||
|
class per character. Names, aliases, and class names must be nonempty, trimmed
|
||||||
|
strings without control characters. Character names and aliases cannot be
|
||||||
|
ambiguous under case-insensitive comparison; class names cannot repeat within
|
||||||
|
one character. Player names may repeat. A supplied class level must be positive.
|
||||||
|
|
||||||
|
The maintained [party example](../../examples/campaigns/sample-campaign/party.yml)
|
||||||
|
shows the shared marker and plural `aliases` field. The configuration reference
|
||||||
|
owns party selection and source-relative paths.
|
||||||
|
|
||||||
|
## Derived players document
|
||||||
|
|
||||||
|
During preparation, Narratio writes the resolved shared roster to
|
||||||
|
`inputs/party.yml` and derives `inputs/players.yml`. The projection uses
|
||||||
|
`narratio.players.v1`, contains one entry per character sorted by stable ID,
|
||||||
|
and keeps its existing singular `alias` field. It contains player and character
|
||||||
|
names and aliases, but no class data. Repeated player names remain separate
|
||||||
|
entries. Its manifest source is `derived_from_party`.
|
||||||
@@ -1,64 +1,57 @@
|
|||||||
# Integration: scriptorium
|
# Integration: Scriptorium
|
||||||
|
|
||||||
## Purpose
|
## Boundary
|
||||||
Define Narratio's adapter contract for Scriptorium artifact generation and render-debug subprocess invocations.
|
|
||||||
|
|
||||||
## Inputs and Outputs
|
Narratio uses the independently installed Scriptorium v0.16.0 native CLI for
|
||||||
Inputs:
|
trim bounds and configured analysis artifacts. It invokes `run PROMPT_ID` for
|
||||||
- `RunArtifactRequest`: binary, config path, prompt/profile IDs, input map, vars map, timeout, output path, logs/config paths, optional API env and working dir
|
generation, `promptkit show prepared PROMPT_ID` for optional preview, and
|
||||||
- `RenderArtifactRequest`: same core fields for render mode
|
`promptkit requirements show PROMPT_ID` for early discovery. Scriptorium owns
|
||||||
|
prompt, profile, backend, and private configuration resolution. The
|
||||||
|
[upstream CLI migration guide](https://forge.maximumdirect.net/eric/scriptorium/src/tag/v0.16.0/docs/consumers/upgrading-cli.md)
|
||||||
|
and [subprocess contract](https://forge.maximumdirect.net/eric/scriptorium/src/tag/v0.16.0/docs/integrations/subprocess.md)
|
||||||
|
own the native interface and deployment migration.
|
||||||
|
|
||||||
Outputs (`ArtifactResult`):
|
Configured glossary inputs use explicit prepared `narratio.input.glossary.*`
|
||||||
- output path
|
source IDs while prompt input names remain independently configured bindings.
|
||||||
- stdout/stderr log paths
|
See [glossary inputs](../config.md#glossary-inputs).
|
||||||
- generated config path
|
|
||||||
- exit code and duration
|
|
||||||
- command mode (`run` or `render`)
|
|
||||||
- prompt/profile provenance
|
|
||||||
- validation failure signal
|
|
||||||
- adapter metadata
|
|
||||||
|
|
||||||
## Boundaries
|
Generation selects artifact-only text output. Preview and requirements use
|
||||||
Owns:
|
native JSON. Narratio forwards selected configuration and profile identifiers,
|
||||||
- Deterministic CLI arg construction for `scriptorium run` and `scriptorium render`
|
sorted repeated `--input-file NAME=PATH` bindings where files are needed, and
|
||||||
- Common request validation
|
repeated `--var KEY=VALUE` assignments. Commas and later equals signs remain
|
||||||
- Invocation config emission
|
literal. Discovery supplies no input paths and makes no model call. Narratio's
|
||||||
- Output existence/non-empty checks
|
supervisor deadline covers each invocation; generation also forwards the same
|
||||||
- Validation-failure mapping for run exit code 2
|
duration as `--run-timeout`, separate from Scriptorium's per-attempt timeout.
|
||||||
|
|
||||||
Does not own:
|
## Streams And Outcomes
|
||||||
- Artifact selection policy (`analyze` stage)
|
|
||||||
- Bounds semantic validation (`trim` stage)
|
|
||||||
|
|
||||||
## Config Fields Used
|
Narratio captures stdout directly into the run-local artifact or preview, or
|
||||||
Via `pipeline.scriptorium.*` and stage-level artifact config:
|
into memory for discovery. Result bytes are preserved and limited to 64 MiB;
|
||||||
- `binary`, `config_path`, `timeout`, `render_debug`
|
they are not diagnostic logs and are not redacted. Treat generated artifacts
|
||||||
- artifact-level `prompt_id`, `profile_id`, `timeout`, `inputs`, `vars`, `output_path`
|
and prepared previews as potentially sensitive. Stderr remains separately
|
||||||
|
bounded and redacted. A capture failure aborts the supervised subprocess.
|
||||||
|
|
||||||
## External Adapters Used
|
A successful generation or preview must produce a nonempty result; preview must
|
||||||
- Shared subprocess helper (`internal/adapters/subprocess`).
|
also be valid JSON. Narratio validates the result before stage-owned canonical
|
||||||
|
promotion. A nonzero outcome or delivery failure remains an error even if
|
||||||
|
stdout contains bytes. Native exit status 4 identifies completed generated
|
||||||
|
content validation failure; status 2 is a usage or configuration failure.
|
||||||
|
Invocation records describe the actual arguments and stdout destination.
|
||||||
|
|
||||||
## State and Manifest Behavior
|
Requirements discovery returns the native inventories, identities,
|
||||||
- No direct manifest writes.
|
completeness, and structured issues. A successful partial report is distinct
|
||||||
- Stage metadata records adapter outputs and command mode.
|
from a process or decoding failure. Narratio compares the reported requirements
|
||||||
- Generated invocation YAML is written when requested.
|
with its intended bindings; discovery does not establish future file availability
|
||||||
|
or guarantee a later model call. See [preflight internals](../internal/preflight.md)
|
||||||
|
and the [upstream requirements contract](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/cli.md#promptkit-requirements).
|
||||||
|
|
||||||
## Skip and Resume Behavior
|
## Credentials And Configuration
|
||||||
- Adapter has no skip/resume logic. Stage/runner controls execution.
|
|
||||||
|
|
||||||
## Failure Behavior
|
Selected ConfigKit secret references are forwarded by exact environment name
|
||||||
- Request validation fails for missing binary/prompt/output, invalid timeout, invalid input/var names, or missing required API env var.
|
for discovery, preview, and generation. Their captured values are registered
|
||||||
- Subprocess errors bubble with command context.
|
for stderr diagnostic redaction, while invocation records retain names only.
|
||||||
- `run` exit code 2 is treated as `ValidationFailed=true` and surfaced as error by calling stage.
|
Narratio does not choose the provider or pass a direct API-key override. This
|
||||||
- Successful subprocess still fails if output file is missing/empty.
|
does not scrub arbitrary result content or files written by Scriptorium. See
|
||||||
|
[Scriptorium credentials](../config.md#scriptorium-credentials) and
|
||||||
## Tests to Inspect Before Changing
|
[artifact entries](../config.md#scriptorium-artifact-entries) for Narratio's
|
||||||
- `internal/adapters/scriptorium/subprocess_test.go`
|
configuration and binding semantics.
|
||||||
- `internal/adapters/scriptorium/fake_test.go`
|
|
||||||
- `internal/stage/analyze_test.go`
|
|
||||||
- `internal/stage/trim_test.go`
|
|
||||||
|
|
||||||
## Architectural Invariants
|
|
||||||
- Both modes require explicit timeout > 0.
|
|
||||||
- Input/var maps are sorted into deterministic CLI argument order.
|
|
||||||
- Run-mode validation failures are represented explicitly, not silently skipped.
|
|
||||||
|
|||||||
@@ -1,60 +1,63 @@
|
|||||||
# Integration: seriatim
|
# Integration: Seriatim
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
Define Narratio's adapter contract for merge, normalize, and trim subprocess invocations of Seriatim.
|
Define the Seriatim adapter contract used by `merge`, `normalize`, `trim`, and `render`.
|
||||||
|
|
||||||
## Inputs and Outputs
|
## External Boundary
|
||||||
Inputs:
|
|
||||||
- `MergeRequest`: raw/normalized transcript inputs, output path, optional report, speaker/autocorrect paths, logs/config
|
|
||||||
- `NormalizeRequest`: input transcript, output path, schema, optional report, timeout/log/config
|
|
||||||
- `TrimRequest`: input transcript, output path, keep selector, timeout/log/config
|
|
||||||
|
|
||||||
Outputs:
|
Narratio invokes Seriatim as a subprocess in these modes:
|
||||||
- `MergeResult`, `NormalizeResult`, `TrimResult` with output paths, logs/config paths, exit code, duration, binary provenance, and metadata.
|
|
||||||
|
|
||||||
## Boundaries
|
- `seriatim merge`
|
||||||
Owns:
|
- `seriatim normalize`
|
||||||
- Validated deterministic CLI invocation construction
|
- `seriatim trim`
|
||||||
- Optional env tuning propagation for merge
|
- `seriatim render`
|
||||||
- Invocation config file emission
|
|
||||||
- JSON output validation
|
|
||||||
|
|
||||||
Does not own:
|
The configured timeout and parent cancellation initiate subprocess shutdown;
|
||||||
- Transcript input selection/promotion logic (stage-owned)
|
completion can take longer while process output finishes. Internal
|
||||||
- Bounds computation (scriptorium/trim-stage-owned)
|
runner composition is documented in
|
||||||
|
[the adapter implementation guide](../internal/adapters.md).
|
||||||
|
|
||||||
## Config Fields Used
|
## Request/Result Contracts
|
||||||
Via `pipeline.seriatim.*` mapped in app/stage wiring:
|
- `MergeRequest`/`MergeResult`: multi-input merge to base transcript, optional report.
|
||||||
- `binary`, `timeout`, `output_schema`, `coalesce_gap`, `report`
|
- `NormalizeRequest`/`NormalizeResult`: transcript normalization with explicit schema.
|
||||||
- `env.overlap_word_run_gap`
|
- `TrimRequest`/`TrimResult`: transcript trimming with required keep selector.
|
||||||
- `env.overlap_word_run_reorder_window`
|
- `RenderRequest`/`RenderResult`: transcript-to-markdown rendering with explicit format and render booleans.
|
||||||
- `env.backchannel_max_duration`
|
|
||||||
- `env.filler_max_duration`
|
|
||||||
|
|
||||||
## External Adapters Used
|
Results include output/log/config paths, timing, exit code, and metadata.
|
||||||
- Shared subprocess helper (`internal/adapters/subprocess`).
|
|
||||||
|
|
||||||
## State and Manifest Behavior
|
## Validation and Failure Semantics
|
||||||
- No direct manifest writes.
|
Runner construction validates:
|
||||||
- Stage metadata consumes adapter result fields and preserves generated config/log references.
|
- binary presence;
|
||||||
|
- timeout > 0;
|
||||||
|
- supported output schema (`seriatim-minimal|seriatim-intermediate|seriatim-full`);
|
||||||
|
- non-negative coalesce gap.
|
||||||
|
|
||||||
## Skip and Resume Behavior
|
Invocation fails on:
|
||||||
- Adapter has no skip/resume logic. Runner controls stage execution.
|
- missing required request paths/inputs;
|
||||||
|
- invalid normalize schema override;
|
||||||
|
- unsupported render format;
|
||||||
|
- subprocess failure;
|
||||||
|
- invalid JSON outputs for merge/normalize/trim;
|
||||||
|
- missing `segments` array for normalize/trim transcript outputs;
|
||||||
|
- empty render output files.
|
||||||
|
|
||||||
## Failure Behavior
|
When report paths are provided/enabled, report files must parse as JSON.
|
||||||
- Constructor fails for invalid binary/timeout/output-schema/coalesce-gap.
|
Each Seriatim JSON or rendered-text result is limited to 64 MiB and must be a
|
||||||
- Merge fails on missing output path/inputs/report path (if enabled), subprocess errors, invalid merged output JSON, invalid report JSON.
|
regular file without symlinked path components.
|
||||||
- Normalize fails on missing input/output, invalid schema, subprocess errors, invalid normalized output JSON shape, invalid report JSON.
|
|
||||||
- Trim fails on missing input/output/keep selector, subprocess errors, invalid trimmed output JSON shape.
|
|
||||||
|
|
||||||
## Tests to Inspect Before Changing
|
## Deterministic Behavior
|
||||||
- `internal/adapters/seriatim/subprocess_test.go`
|
- argument ordering is deterministic per command construction.
|
||||||
- `internal/adapters/seriatim/fake_test.go`
|
- merge env overrides are explicit (`SERIATIM_*`) and only emitted when configured.
|
||||||
- `internal/stage/merge_test.go`
|
- generated invocation YAML (`seriatim.generated.v1`) is emitted when requested.
|
||||||
- `internal/stage/normalize_test.go`
|
- adapter does not write manifests or choose stage inputs.
|
||||||
- `internal/stage/trim_test.go`
|
|
||||||
|
|
||||||
## Architectural Invariants
|
## Configuration
|
||||||
- Supported output schemas are limited to `seriatim-minimal`, `seriatim-intermediate`, `seriatim-full`.
|
|
||||||
- Normalize/trim outputs must include `segments` arrays.
|
Operator-selected values are defined under `pipeline.seriatim.*` and
|
||||||
- Merge/normalize/trim all route through deterministic subprocess invocation.
|
`pipeline.render.*` in the
|
||||||
|
[configuration reference](../config.md#pipeline).
|
||||||
|
|
||||||
|
Maintained examples with Seriatim config:
|
||||||
|
|
||||||
|
- [Full annotated pipeline](../../examples/pipeline.full.annotated.yml)
|
||||||
|
- [Production-shaped pipeline](../../examples/pipeline.production.yml)
|
||||||
|
|||||||
95
docs/integrations/whisperx.md
Normal file
95
docs/integrations/whisperx.md
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
# Integration: WhisperX
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
|
||||||
|
WhisperX transcribes each prepared speaker audio file for Narratio's
|
||||||
|
`transcribe` stage. Narratio uses an HTTP boundary and installs each successful
|
||||||
|
response as that speaker's raw transcript JSON.
|
||||||
|
|
||||||
|
## HTTP Boundary
|
||||||
|
|
||||||
|
Narratio sends an HTTP `POST` to the configured transcription URL using
|
||||||
|
`multipart/form-data` with:
|
||||||
|
|
||||||
|
- `file`: the audio file, retaining its base filename; and
|
||||||
|
- `language`: the configured language string.
|
||||||
|
|
||||||
|
The server must return a `2xx` response whose body is valid JSON. Narratio does
|
||||||
|
not currently require a more specific response schema at this boundary. The
|
||||||
|
backend determines codec and container support; a malformed or unsupported
|
||||||
|
recording remains a transcription failure. Narratio does not transcode or probe
|
||||||
|
the selected audio. See [audio selection](../config.md#session).
|
||||||
|
|
||||||
|
The transcription URL must be an absolute `http` or `https` URL. Each
|
||||||
|
application attempt creates one bounded multipart framing and streams the audio
|
||||||
|
from an open file between that framing; it does not buffer the complete audio
|
||||||
|
or spool a multipart copy. The file field precedes the language field.
|
||||||
|
WhisperX response acquisition is capped at 10 MiB.
|
||||||
|
|
||||||
|
The initial request body and any transport-requested replay use the same
|
||||||
|
multipart boundary and framing. Every body opens an independent audio handle
|
||||||
|
and replay starts at the beginning. Narratio closes all bodies created for the
|
||||||
|
attempt on response, failure, timeout, or cancellation, including when a
|
||||||
|
transport abandons an earlier body. Genuine source read/close failures remain
|
||||||
|
request failures; deliberate early closure of an abandoned original does not
|
||||||
|
poison a valid replay.
|
||||||
|
|
||||||
|
## Request And Result Contract
|
||||||
|
|
||||||
|
Each adapter request identifies a speaker, a readable audio file, and the
|
||||||
|
destination for the raw transcript. The HTTP request carries the audio and
|
||||||
|
language; the speaker identifier remains Narratio orchestration metadata.
|
||||||
|
|
||||||
|
On success, Narratio atomically writes the response body to the requested
|
||||||
|
destination. The adapter result reports that logical output together with the
|
||||||
|
attempt count, final HTTP status when available, elapsed duration, and adapter
|
||||||
|
identity metadata. A failed or invalid response is not installed as the
|
||||||
|
transcript output.
|
||||||
|
|
||||||
|
## Retry, Timeout, And Cancellation
|
||||||
|
|
||||||
|
- The configured timeout applies independently to each HTTP attempt.
|
||||||
|
- `retries` means additional attempts after the first.
|
||||||
|
- HTTP `429`, HTTP `5xx`, attempt timeouts, and network errors are retryable.
|
||||||
|
- Other HTTP `4xx` responses and explicit cancellation are not retryable.
|
||||||
|
- Narratio waits the configured retry delay between attempts and aborts that
|
||||||
|
wait when the parent context is canceled.
|
||||||
|
|
||||||
|
Transport replay occurs inside one application attempt and does not consume an
|
||||||
|
entry from the configured retry budget or increment the reported attempt
|
||||||
|
count. The standard HTTP redirect policy remains in effect; body replay can
|
||||||
|
also support body-preserving redirects.
|
||||||
|
|
||||||
|
## Validation And Failure Semantics
|
||||||
|
|
||||||
|
Client construction rejects a missing or non-HTTP(S) absolute transcription URL,
|
||||||
|
a missing language, a non-positive timeout, negative retries, or a negative
|
||||||
|
retry delay. A request fails before transmission when its audio or output path
|
||||||
|
is missing.
|
||||||
|
|
||||||
|
Non-`2xx` status, transport failure, response-size overflow, invalid JSON, or
|
||||||
|
failure to install the output causes the transcription to fail. Errors include
|
||||||
|
attempt context, and the result retains attempts, final status when available,
|
||||||
|
and elapsed duration for diagnostics.
|
||||||
|
|
||||||
|
Replay makes a fresh request body available to the HTTP transport; it does not
|
||||||
|
provide an exactly-once server guarantee and does not prove recovery from every
|
||||||
|
proxy or protocol-level failure. A server may have received work before the
|
||||||
|
client learns that a request failed. WhisperX operations should therefore be
|
||||||
|
safe to retry for the same input when practical.
|
||||||
|
|
||||||
|
## Determinism And Concurrency
|
||||||
|
|
||||||
|
Each audio request has stable multipart field names, and successful bytes are
|
||||||
|
installed atomically. The transcribe stage may process speaker files in
|
||||||
|
parallel, bounded by the configured concurrency. Each validated speaker is
|
||||||
|
checkpointed independently; any speaker failure still fails the aggregate
|
||||||
|
stage, while committed earlier speakers remain reusable on an ordinary retry.
|
||||||
|
|
||||||
|
## Related Canonical Docs
|
||||||
|
|
||||||
|
- [Configuration](../config.md#pipeline) defines the operator-selected
|
||||||
|
WhisperX URL, language, timeouts, retry policy, and concurrency.
|
||||||
|
- [Adapter implementation](../internal/adapters.md) describes internal wiring.
|
||||||
|
- [Transcribe stage](../internal/stage-transcribe.md) describes stage mechanics,
|
||||||
|
durable artifacts, and manifests.
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
# Internal Documentation Index
|
|
||||||
|
|
||||||
## Audience
|
|
||||||
Developers and LLM coding agents changing Narratio internals.
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
Implementation-accurate contracts for workspace/state, manifests, stages, artifact resolution, adapter boundaries, and restore command behavior.
|
|
||||||
|
|
||||||
## Component Docs
|
|
||||||
- `adapters.md`: external adapter map, runtime wiring, and boundary ownership.
|
|
||||||
- `storage.md`: remote storage backend contracts and object-store invariants.
|
|
||||||
- `manifest.md`: session/run manifest schemas, lifecycle transitions, and persistence semantics.
|
|
||||||
- `artifacts.md`: built-in artifact registry, runtime artifact catalog, and source-resolution behavior.
|
|
||||||
- `workspace.md`: local state model, manifests, run-local layout, promotion, and cleanup invariants.
|
|
||||||
- `command-restore.md`: restore command discovery/planning/execution/reporting contract.
|
|
||||||
- `stage-prepare.md`: input materialization and provenance capture.
|
|
||||||
- `stage-transcribe.md`: WhisperX transcript generation.
|
|
||||||
- `stage-merge.md`: Seriatim normalization + merge.
|
|
||||||
- `stage-polish.md`: Audita transcript polishing.
|
|
||||||
- `stage-normalize.md`: post-polish normalization.
|
|
||||||
- `stage-trim.md`: bounds-driven transcript trimming.
|
|
||||||
- `stage-analyze.md`: dependency-ordered Scriptorium artifact generation for selected configured artifacts.
|
|
||||||
- `stage-archive.md`: archive upload and current-pointer publish contract.
|
|
||||||
|
|
||||||
## External Integration Notes
|
|
||||||
- `../integrations/README.md`: canonical location for external integration contracts (`audita.md`, `seriatim.md`, `scriptorium.md`).
|
|
||||||
|
|
||||||
## Canonical Owner
|
|
||||||
`docs/internal/` is the canonical home for implemented internals per `docs/documentation/policy.md`.
|
|
||||||
@@ -1,79 +1,134 @@
|
|||||||
# Internal: Adapters
|
# Internal: Adapters
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
Describe the external adapter boundaries used by Narratio stages and app orchestration, including default runtime wiring.
|
|
||||||
|
|
||||||
## Inputs and outputs
|
Explain the adapter interfaces and production composition used by application
|
||||||
Inputs:
|
and stage orchestration. Externally observable protocols and formats belong in
|
||||||
- Stage requests passed through adapter interfaces (for example transcription, merge/normalize/trim, polish, artifact generation, object-store operations, notifications).
|
the [integration contracts](../integrations/).
|
||||||
- Resolved config values used to construct default adapters.
|
|
||||||
|
|
||||||
Outputs:
|
## Adapter Boundaries
|
||||||
- Adapter-specific result structs (paths, metadata, status/attempt info, duration/exit details).
|
|
||||||
- Adapter errors returned to stage/app orchestration.
|
|
||||||
|
|
||||||
## Boundaries
|
Narratio stage logic depends on adapter interfaces, not transport-specific details.
|
||||||
Owns:
|
|
||||||
- Transport/process/SDK details at system boundaries (`HTTP`, subprocess CLI invocation, AWS SDK calls).
|
|
||||||
- Request/response contracts in `internal/adapters/*` packages.
|
|
||||||
|
|
||||||
Does not own:
|
Primary adapters:
|
||||||
- Stage sequencing, skip/force/resume decisions.
|
|
||||||
- Manifest transition logic.
|
|
||||||
- Canonical workspace path policy.
|
|
||||||
|
|
||||||
## Config fields used
|
|
||||||
Default wiring and adapter calls consume:
|
|
||||||
- `pipeline.whisperx.*`
|
|
||||||
- `pipeline.seriatim.*`
|
|
||||||
- `pipeline.audita.*`
|
|
||||||
- `pipeline.scriptorium.*`
|
|
||||||
- `pipeline.storage.*` and `pipeline.archive.*` (object-store construction/gating)
|
|
||||||
- `pipeline.notification.*` (sender boundary exists; placeholder behavior today)
|
|
||||||
|
|
||||||
## External adapters used
|
|
||||||
Runtime env boundary fields (`internal/stage.Env`):
|
|
||||||
- `whisperx.Client`
|
- `whisperx.Client`
|
||||||
- `seriatim.Runner`
|
- `seriatim.Runner`
|
||||||
- `audita.Runner`
|
- `audita.Runner`
|
||||||
- `scriptorium.Runner`
|
- `scriptorium.Runner`
|
||||||
|
- `notarius.Runner`
|
||||||
- `storage.ObjectStore`
|
- `storage.ObjectStore`
|
||||||
- `notify.Sender`
|
- `notify.Sender`
|
||||||
- `analyzer.Runner`
|
|
||||||
|
|
||||||
Current execution usage:
|
## Ownership
|
||||||
- Actively used by implemented stages: `WhisperX`, `Seriatim`, `Audita`, `Scriptorium`, `ObjectStore`, `Notifier`.
|
|
||||||
- Present but not used by implemented stage set: `Analyzer`, legacy `storage.Backend`.
|
|
||||||
|
|
||||||
Default construction in app runner:
|
Adapters own:
|
||||||
- Auto-constructed when not injected: WhisperX HTTP client, Seriatim subprocess runner, Audita subprocess runner, Scriptorium subprocess runner, object store (only when needed), and `notify.NoopSender`.
|
|
||||||
- Callers can inject test/fake implementations through `app.RunOptions.Env`.
|
|
||||||
|
|
||||||
## State and manifest behavior
|
- HTTP/subprocess/SDK argument and transport details.
|
||||||
- Adapters do not directly mutate session/run manifests.
|
- Backend-specific request/response mapping.
|
||||||
- Stages and runner own manifest writes and stage status transitions.
|
|
||||||
- Adapter outputs are persisted indirectly through stage result mapping (outputs/logs/generated configs/metadata).
|
|
||||||
|
|
||||||
## Skip and resume behavior
|
Adapters do not own:
|
||||||
- No adapter-level skip/resume semantics.
|
|
||||||
- Skip/resume/force behavior is decided by app runner using manifest stage state.
|
|
||||||
|
|
||||||
## Failure behavior
|
- stage ordering/skip/force logic;
|
||||||
- Adapter constructors validate config-derived values and fail early on invalid required inputs.
|
- manifest transitions;
|
||||||
- Adapter run-time failures are returned to stage code with boundary context and are recorded as stage failures by runner logic.
|
- canonical path policy.
|
||||||
- Subprocess adapters preserve stdout/stderr and generated-config paths to aid diagnosis.
|
|
||||||
|
|
||||||
## Tests to inspect before changing
|
## Default Wiring
|
||||||
|
|
||||||
|
The application composes default adapters per invocation when they were not
|
||||||
|
injected through the stage environment, and only when the selected execution
|
||||||
|
plan needs them:
|
||||||
|
|
||||||
|
- WhisperX HTTP client for `transcribe`.
|
||||||
|
- Seriatim subprocess runner for `merge`, `normalize`, `trim`, or `render`.
|
||||||
|
- Audita subprocess runner for `polish`.
|
||||||
|
- Scriptorium subprocess runner for `trim` or `analyze`.
|
||||||
|
- Notarius subprocess runner for `extract` when extraction is enabled.
|
||||||
|
- Noop notifier (`notify.NoopSender`) for `notify`.
|
||||||
|
- Object store only when required by selected stages/config.
|
||||||
|
|
||||||
|
Remote publish locks are loaded only for a selected, enabled publish that
|
||||||
|
uploads a run. Shared session lifecycle setup still applies to every selected
|
||||||
|
range, but an unselected integration is neither initialized nor validated by
|
||||||
|
application-owned composition. Constructor, clock, randomness, remote-lock,
|
||||||
|
and post-publish deletion boundaries are scoped to the invocation; stages still
|
||||||
|
receive their collaborators through the stage environment. Each selected stage
|
||||||
|
retains its own fail-fast configuration and input validation.
|
||||||
|
|
||||||
|
`session plan` is outside production adapter composition. It performs
|
||||||
|
resume validation and models selected transitions against cloned manifest
|
||||||
|
state without constructing or invoking stage-execution adapters. The shared
|
||||||
|
command configuration loader may still use object storage to retrieve a missing
|
||||||
|
remote session file before planning begins.
|
||||||
|
|
||||||
|
After preparation, the application projects remaining selected work and uses
|
||||||
|
invocation-owned Audita, Notarius, and Scriptorium runners for applicable
|
||||||
|
readiness checks. The same runners are available to processing. Standalone
|
||||||
|
preflight prepares inputs through the same lifecycle and uses invocation-owned
|
||||||
|
factories for all enabled readiness checks. See
|
||||||
|
[preflight internals](preflight.md).
|
||||||
|
|
||||||
|
Notarius is composed only when extraction is enabled. The stage resolves
|
||||||
|
prepared references and promotes configured products; the adapter builds native
|
||||||
|
inspection, preflight, and run commands, resolves the executable and native
|
||||||
|
lane paths, and validates the completion report.
|
||||||
|
Force selects native cache refresh before request construction.
|
||||||
|
Its request may also carry already-resolved ConfigKit secret references.
|
||||||
|
Audita and Scriptorium requests carry the same kind of list. All three adapters use the shared
|
||||||
|
subprocess helper to convert their selected references into exact-name child
|
||||||
|
environment overrides and sensitive-name registration. That helper rejects
|
||||||
|
unresolved or empty programmatic references, but no adapter rereads the
|
||||||
|
parent environment or inspects downstream configuration to discover names.
|
||||||
|
Empty lists add no credential overrides. See the public [Audita](../integrations/audita.md)
|
||||||
|
[Notarius](../integrations/notarius.md), and [Scriptorium](../integrations/scriptorium.md) contracts for selection and
|
||||||
|
downstream-file boundaries.
|
||||||
|
|
||||||
|
Invocation configuration acquisition calls [ConfigKit configured startup](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap);
|
||||||
|
the storage factory consumes resolved values. [Operations](../operations.md#workspace-permissions)
|
||||||
|
describes credential permissions. Production commands use the concrete storage
|
||||||
|
adapter constructor; focused tests can supply an in-memory backend.
|
||||||
|
|
||||||
|
## Failure Semantics
|
||||||
|
|
||||||
|
- Constructor errors fail stage execution setup early.
|
||||||
|
- Runtime adapter errors propagate to stage code and then manifest failure handling.
|
||||||
|
- Subprocess adapters persist stage logs/generated configs through stage-managed paths.
|
||||||
|
- Shared subprocess execution keeps private lifecycle mechanics separate from
|
||||||
|
Narratio's environment, diagnostics, redaction, and error policy. It starts
|
||||||
|
an owned process group on Linux and macOS. Every terminal path disposes of
|
||||||
|
that owned tree before returning. After a natural leader exit, the runner checks
|
||||||
|
for remaining group members and uses bounded graceful then forceful termination.
|
||||||
|
Cancellation, deadlines, and
|
||||||
|
diagnostic limits use the same terminal disposal path without losing their
|
||||||
|
original result classification. Escalation is bounded, but the command waiter
|
||||||
|
and output copying are joined before logs are flushed or ownership returns;
|
||||||
|
blocked I/O may prolong shutdown and workspace lock ownership. Child environments contain only the execution
|
||||||
|
baseline and adapter-specified values; configured credentials are resolved
|
||||||
|
once by ConfigKit and passed explicitly as sensitive values. Adapters do not
|
||||||
|
re-read their named environment references. Diagnostic-only stdout and stderr
|
||||||
|
are redacted while streaming into separate 8 MiB captures. Scriptorium result
|
||||||
|
mode directs stdout to a caller-owned, byte-preserving bounded writer instead;
|
||||||
|
capture failures use the same abort path. A bounded wait closes a stream retained by a
|
||||||
|
departed leader's descendant. Unsupported platforms reject owned command
|
||||||
|
execution.
|
||||||
|
|
||||||
|
## Implementation And Tests
|
||||||
|
|
||||||
|
- Composition: `internal/app/runner_composition.go`,
|
||||||
|
`internal/app/runner_dependencies.go`, `internal/app/object_store.go`
|
||||||
|
- Shared subprocess mechanics: `internal/adapters/subprocess`
|
||||||
|
- Focused adapters: `internal/adapters/{whisperx,seriatim,audita,scriptorium,notarius,storage,notify}`
|
||||||
- `internal/adapters/whisperx/http_test.go`
|
- `internal/adapters/whisperx/http_test.go`
|
||||||
- `internal/adapters/seriatim/subprocess_test.go`
|
- `internal/adapters/seriatim/subprocess_test.go`
|
||||||
- `internal/adapters/audita/subprocess_test.go`
|
- `internal/adapters/audita/subprocess_test.go`
|
||||||
- `internal/adapters/scriptorium/subprocess_test.go`
|
- `internal/adapters/scriptorium/subprocess_test.go`
|
||||||
|
- `internal/adapters/notarius/subprocess_test.go`
|
||||||
- `internal/adapters/storage/*_test.go`
|
- `internal/adapters/storage/*_test.go`
|
||||||
- `internal/adapters/notify/fake_test.go`
|
|
||||||
- `internal/adapters/analyzer/fake_test.go`
|
|
||||||
- `internal/app/runner_test.go`
|
- `internal/app/runner_test.go`
|
||||||
|
|
||||||
## Architectural invariants
|
See the [WhisperX](../integrations/whisperx.md),
|
||||||
- Stage code depends on adapter interfaces, not transport-specific implementation types.
|
[Seriatim](../integrations/seriatim.md), [Audita](../integrations/audita.md),
|
||||||
- External SDK-specific types remain inside adapter implementations.
|
[Scriptorium](../integrations/scriptorium.md), and
|
||||||
- Default app wiring must remain deterministic and overrideable via injected env dependencies.
|
[Notarius](../integrations/notarius.md) contracts before changing an
|
||||||
|
externally visible boundary. Operator-selected values belong in
|
||||||
|
[Configuration](../config.md).
|
||||||
|
|||||||
@@ -1,87 +1,328 @@
|
|||||||
# Internal: Artifacts
|
# Internal: Artifacts
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
Define Narratio's artifact identity and resolution model for built-in transcript/bounds artifacts and runtime-configured analyze artifacts.
|
|
||||||
|
|
||||||
## Inputs and outputs
|
Explain the artifact registry, runtime catalog, resolver, previous-input
|
||||||
Inputs:
|
requirements, and shared remote current-state mechanics implemented by
|
||||||
- artifact sources from config/runtime (`pipeline.scriptorium.artifacts.*.inputs.*.source`)
|
`internal/artifacts`. Configuration fields that accept source IDs belong in
|
||||||
- session paths and optional session manifest stage outputs
|
[Configuration](../config.md); physical placement belongs in
|
||||||
- runtime artifact catalog state for configured artifact sources
|
[Operations](../operations.md).
|
||||||
|
|
||||||
Outputs:
|
## Built-in Source IDs
|
||||||
- resolved local artifact path and provenance (`ResolvedSessionArtifact`)
|
|
||||||
- runtime catalog entries for planned/executable/available artifacts
|
|
||||||
- validation errors for unsupported, missing, or invalid artifact sources
|
|
||||||
|
|
||||||
## Boundaries
|
The internal registry recognizes these stable built-in source IDs:
|
||||||
Owns:
|
|
||||||
- built-in artifact registry and content validation rules
|
|
||||||
- runtime artifact catalog for configured artifact source IDs
|
|
||||||
- source resolution behavior for built-in and configured artifact sources
|
|
||||||
|
|
||||||
Does not own:
|
- `narratio.transcript.base`
|
||||||
- artifact generation (stages produce files)
|
- `narratio.transcript.polished`
|
||||||
- manifest transition policy
|
- `narratio.transcript.final`
|
||||||
- archive promotion behavior
|
- `narratio.transcript.final_trimmed`
|
||||||
|
- `narratio.transcript.final_markdown`
|
||||||
|
- `narratio.transcript.final_trimmed_markdown`
|
||||||
|
- `narratio.bounds.session`
|
||||||
|
|
||||||
## Config fields used
|
Registry entries bind each ID to its producer, output kind, and content
|
||||||
- `pipeline.scriptorium.artifacts.<name>.enabled`
|
validator. The focused stage documents own their input/output flow;
|
||||||
- `pipeline.scriptorium.artifacts.<name>.output_path`
|
[Configuration](../config.md) owns where operators may select these IDs.
|
||||||
- `pipeline.scriptorium.artifacts.<name>.inputs.<key>.source`
|
|
||||||
|
|
||||||
## External adapters used
|
## Configured, Extraction, And Previous-Session Sources
|
||||||
- none
|
|
||||||
|
|
||||||
## State and manifest behavior
|
- configured source ID format: `narratio.artifact.<artifact_key>`
|
||||||
Built-in registry entries:
|
- extraction source ID format: `narratio.extraction.<output_key>`
|
||||||
|
- previous-session source ID format: `narratio.previous_session.artifact.<artifact_key>`
|
||||||
|
|
||||||
| Artifact ID | Canonical file | Producer stage | Output kind |
|
All formats are validated by strict source-policy rules. Configured artifact and
|
||||||
| --- | --- | --- | --- |
|
extraction keys use `^[a-z][a-z0-9_]*$`; source parsers never normalize an
|
||||||
| `narratio.transcript.merged` | `transcripts/merged.json` | `merge` | `transcript_merged` |
|
unrecognized token into a valid source. Extraction sources are registered only
|
||||||
| `narratio.transcript.polished` | `transcripts/processed.json` | `polish` | `transcript_processed` |
|
from `pipeline.notarius.outputs`; the original bundle is not a selectable
|
||||||
| `narratio.transcript.full` | `transcripts/normalized.json` | `normalize` | `transcript_normalized` |
|
source.
|
||||||
| `narratio.transcript.trimmed` | `transcripts/trimmed.json` | `trim` | `transcript_trimmed` |
|
|
||||||
| `narratio.bounds.session` | `artifacts/session_bounds.json` | `trim` | `session_bounds` |
|
|
||||||
|
|
||||||
Runtime catalog entries include built-ins and configured `narratio.artifact.<name>` sources.
|
Prepared stable source IDs are `narratio.input.players`,
|
||||||
|
`narratio.input.party`, `narratio.input.glossary.party`,
|
||||||
|
`narratio.input.glossary.campaign`, `narratio.input.glossary.setting`,
|
||||||
|
`narratio.input.glossary.spells`, and `narratio.input.glossary.combined`. Artifact policy owns their canonical manifest
|
||||||
|
kind and prepared filename vocabulary. Canonical party mode preserves the
|
||||||
|
effective standalone party document in the party record and supplies the players record from the
|
||||||
|
deterministic `derived_from_party` projection; both remain ordinary prepared
|
||||||
|
source IDs for consumers.
|
||||||
|
|
||||||
Catalog states:
|
## Runtime Catalog
|
||||||
- `planned`: source is registered and known for this run
|
|
||||||
- `executable`: configured artifact is selected for analyze execution
|
|
||||||
- `available`: artifact has a usable file path (generated this run or reused from disk)
|
|
||||||
|
|
||||||
Resolution behavior:
|
`ArtifactCatalog` tracks:
|
||||||
- built-in sources resolve via manifest producer outputs first, then canonical fallback path
|
|
||||||
- configured `narratio.artifact.<name>` sources resolve through runtime catalog availability
|
- `planned`: source registered for run context;
|
||||||
- configured source lookup requires catalog context
|
- `executable`: included in the effective analyze artifact set;
|
||||||
|
- `available`: the source's canonical evidence owner validates its current
|
||||||
|
manifest record and durable bytes;
|
||||||
|
- `provenance`: availability source.
|
||||||
|
|
||||||
|
Configured definitions are always registered. Without an explicit selection,
|
||||||
|
the effective analyze set contains enabled definitions. With `--artifacts`, the
|
||||||
|
exact named configured definitions become the effective set for that invocation,
|
||||||
|
regardless of their `enabled` value. The effective-set resolver itself does not
|
||||||
|
expand dependencies. Shared domain catalog derivation has materialized the sorted
|
||||||
|
union of explicit ordering edges and configured-artifact input edges. The
|
||||||
|
derived catalog holds an immutable `internal/artifactdeps` graph shared by
|
||||||
|
validation, prerequisite ordering, and analysis planning. Supplied products can
|
||||||
|
stop prerequisite traversal; explicit forced targets still include their
|
||||||
|
prerequisites.
|
||||||
|
Availability is separate from executability. Invocation selection normalizes a
|
||||||
|
family selection into its concrete generated members before this resolver runs.
|
||||||
|
The effective set retains optional family
|
||||||
|
and character origin metadata, but its keys, catalog sources, and runtime
|
||||||
|
lookups remain concrete configured-artifact identities.
|
||||||
|
Family publish policies are likewise expanded into ordinary configured-source
|
||||||
|
publish actions during domain catalog derivation.
|
||||||
|
Configured outputs, including non-executable prerequisites, become available
|
||||||
|
when the versioned analyze state identifies a current result whose source,
|
||||||
|
contract, canonical configured path, size, and checksum match a confined
|
||||||
|
no-follow regular file, or when a supplied record validates against that path
|
||||||
|
and its bytes. An incidental canonical file is unavailable, and a
|
||||||
|
manifest with an unsupported aggregate-only representation is rejected before
|
||||||
|
catalog construction.
|
||||||
|
Extraction entries are registered from configuration and become available only
|
||||||
|
after compatible extraction evidence is hydrated.
|
||||||
|
|
||||||
|
During an analyze invocation, a newly validated and atomically materialized
|
||||||
|
configured output is marked available with its producer run ID, contract,
|
||||||
|
checksum, and size. Later scheduled dependents therefore observe the same
|
||||||
|
semantic identity whether their prerequisite was reused from current manifest
|
||||||
|
evidence or produced earlier in the invocation.
|
||||||
|
|
||||||
|
Current provenance values:
|
||||||
|
|
||||||
Configured artifact provenance values:
|
|
||||||
- `generated.current_analyze_run`
|
- `generated.current_analyze_run`
|
||||||
- `filesystem.disabled_artifact_output`
|
- `manifest.current_analyze_artifact`
|
||||||
|
- `manifest.supplied_product`
|
||||||
|
- `manifest.inputs.previous_cache`
|
||||||
|
- `current_session.previous_cache`
|
||||||
|
|
||||||
Content validation:
|
## Resolution Rules
|
||||||
- transcript built-ins: JSON with top-level `segments` array
|
|
||||||
- bounds built-in: valid JSON
|
|
||||||
- configured artifacts: non-empty text file
|
|
||||||
|
|
||||||
## Skip and resume behavior
|
Built-ins:
|
||||||
- resolver and catalog have no direct skip/resume decisions
|
|
||||||
- stage/runner skip-resume behavior consumes catalog/resolver results
|
|
||||||
|
|
||||||
## Failure behavior
|
- resolve from validated supplied records or the current manifest's succeeded
|
||||||
- unsupported source -> source validation error
|
registered producer;
|
||||||
- known source unavailable -> `ErrSessionArtifactNotFound`
|
- for generated products, require exactly one output with the registered source
|
||||||
- configured source without catalog -> resolution error
|
ID and output kind, a safe session-rooted path, producer run ID, canonical
|
||||||
- resolved file with invalid content -> validation error
|
checksum, and valid content; and
|
||||||
|
- verify the registered checksum against the durable bytes. Incidental files,
|
||||||
|
canonical filenames, duplicate outputs, failed/stale producer records, and
|
||||||
|
malformed evidence are unavailable.
|
||||||
|
|
||||||
## Tests to inspect before changing
|
Configured sources (`narratio.artifact.*`):
|
||||||
- `internal/artifacts/artifact_resolver_test.go`
|
|
||||||
- `internal/artifacts/catalog_test.go`
|
|
||||||
- `internal/stage/analyze_test.go`
|
|
||||||
- `internal/config/scriptorium_test.go`
|
|
||||||
|
|
||||||
## Architectural invariants
|
- resolve only through runtime catalog availability;
|
||||||
- built-in IDs are static and registry-backed
|
- accept a validated supplied record without historical analyze evidence;
|
||||||
- configured artifact IDs are runtime-derived (`narratio.artifact.<name>`) and catalog-backed
|
- use the shared typed analyze-evidence inspection in
|
||||||
- built-in/source resolution remains deterministic and validation-gated
|
`analyze_evidence.go` for prior current-session results;
|
||||||
|
- for generated products, require the supported analyze-state and fingerprint versions, a `current`
|
||||||
|
record for the exact configured key and source ID, a complete contract, the
|
||||||
|
configured canonical relative path, positive stored size, and stored
|
||||||
|
checksum matching bytes read from a confined no-follow regular file; and
|
||||||
|
- treat non-current statuses, malformed records, removed keys,
|
||||||
|
unsafe or missing files, and size/checksum mismatches as unavailable without
|
||||||
|
rewriting manifest state. Catalog construction iterates current
|
||||||
|
configuration, so removed or renamed records are not advertised.
|
||||||
|
|
||||||
|
`narratio.member_artifact.*` is not a runtime source family. Configuration
|
||||||
|
resolution accepts it only in an artifact-family declaration and rewrites it
|
||||||
|
to the corresponding configured source before this catalog is built.
|
||||||
|
|
||||||
|
Prepared stable sources (`narratio.input.*`):
|
||||||
|
|
||||||
|
- resolve only from the current manifest's exact prepared-input record;
|
||||||
|
- require the policy-owned canonical path below the session root, a confined
|
||||||
|
non-symlink regular file, a non-empty payload, and a matching SHA-256
|
||||||
|
checksum; and
|
||||||
|
- return an immutable source/path/checksum/size identity shared by extract and
|
||||||
|
analyze rather than falling back to campaign/session source paths.
|
||||||
|
|
||||||
|
Extraction sources (`narratio.extraction.*`):
|
||||||
|
|
||||||
|
- accept individually validated supplied products without historical Notarius
|
||||||
|
metadata or transcript fingerprints; all configured products must be present
|
||||||
|
to satisfy extraction as a whole;
|
||||||
|
- use the shared product evidence inspection in `extraction_evidence.go`;
|
||||||
|
- for locally generated products, require a current successful extract record with the exact configured source,
|
||||||
|
Notarius provenance, a confined regular flat product with matching size and
|
||||||
|
checksum, and the current resolved trimmed-transcript
|
||||||
|
identity;
|
||||||
|
- remain unavailable unless catalog hydration receives valid evidence. Resume
|
||||||
|
treats absent or obsolete evidence as a rerun decision and unsafe evidence as
|
||||||
|
an error; and
|
||||||
|
- are never inferred by scanning the Notarius bundle directory.
|
||||||
|
|
||||||
|
Previous-session sources (`narratio.previous_session.artifact.*`):
|
||||||
|
|
||||||
|
- resolve only from one matching `previous_artifact` input record in the
|
||||||
|
current manifest, including its exact source ID and checksum;
|
||||||
|
- are hydrated only from the unique `published_output` declaration for their
|
||||||
|
canonical source in the selected remote commit; and
|
||||||
|
- never infer a path from a previous manifest, current configuration, basename,
|
||||||
|
or existing cache file.
|
||||||
|
|
||||||
|
Source absence is evaluated by the consuming artifact input. An optional input
|
||||||
|
is omitted from that invocation; a required input fails resolution. This is
|
||||||
|
separate from a stage's lifecycle outcome.
|
||||||
|
|
||||||
|
Validation by content type:
|
||||||
|
|
||||||
|
- transcript JSON built-ins: JSON with top-level `segments` array, validated
|
||||||
|
through the shared `internal/contracts` envelope predicate;
|
||||||
|
- transcript Markdown built-ins: non-empty text file;
|
||||||
|
- bounds built-in: valid JSON;
|
||||||
|
- configured/previous-session artifact files: non-empty text file.
|
||||||
|
|
||||||
|
## Previous Requirement Collection
|
||||||
|
|
||||||
|
`CollectPreviousArtifactRequirements`:
|
||||||
|
|
||||||
|
- expands the effective target set to its full configured prerequisite closure,
|
||||||
|
including disabled prerequisites, independently of artifact reuse;
|
||||||
|
- scans only definitions in that closure;
|
||||||
|
- extracts only canonical previous-session sources;
|
||||||
|
- deduplicates by artifact key;
|
||||||
|
- merges required and optional references (required wins);
|
||||||
|
- returns deterministic ordering and source locations.
|
||||||
|
|
||||||
|
`PreviousArtifactRequirementsForKeys` applies the same source collection to
|
||||||
|
planned generation and reused local checkpoint keys. Bounded reference
|
||||||
|
preparation uses it after analysis planning has resolved supplied-product reuse
|
||||||
|
boundaries.
|
||||||
|
|
||||||
|
## Current-State Helpers
|
||||||
|
|
||||||
|
Artifacts package owns shared remote current-state loading mechanics used by
|
||||||
|
restore, status and validation checks, and previous-cache planning.
|
||||||
|
`LoadCurrentInventory` reads and verifies the pointer-selected commit without
|
||||||
|
fetching an execution snapshot. Status, publication inspection, and session
|
||||||
|
configuration acquisition and previous-session acquisition use that inventory.
|
||||||
|
Restore uses the same inventory. Obsolete execution-snapshot declarations are
|
||||||
|
ignored without reading their contents; unsupported local progress must be moved
|
||||||
|
aside before creating a new local baseline.
|
||||||
|
|
||||||
|
Session inspection collects local catalog, remote publication and lock, and
|
||||||
|
input-readiness evidence separately before projecting its existing report.
|
||||||
|
|
||||||
|
For a new-protocol current state, the pointer-selected immutable commit is the
|
||||||
|
complete restore authority. Callers receive its declared object identities and
|
||||||
|
must not supplement them by listing mutable session prefixes.
|
||||||
|
|
||||||
|
A `published_output` declaration must use a canonical publish-compatible source
|
||||||
|
ID and an exact `runs/{run_id}/published/{destination}` key in the same session.
|
||||||
|
Only this declaration type may refer to an earlier run; other declared objects
|
||||||
|
remain confined to the selected commit's run.
|
||||||
|
|
||||||
|
The reader opens each small control object directly and enforces owner-specific
|
||||||
|
limits before decoding: 64 KiB for the mutable commit pointer and 4 MiB for the
|
||||||
|
immutable commit manifest. These are exposed as `MaxCurrentCommitPointerBytes`
|
||||||
|
and `MaxRemoteCommitManifestBytes`.
|
||||||
|
|
||||||
|
Each read uses the generation and size metadata returned with its opened body.
|
||||||
|
Actual bytes remain subject to a limit-plus-one read even if size metadata is
|
||||||
|
absent or inaccurate. Immutable selections then retain their declared-size,
|
||||||
|
checksum, generation, and identity checks. No current-state control object is
|
||||||
|
downloaded through a temporary file. Artifact and previous-session downloads
|
||||||
|
validate their complete sibling temporary file against available committed
|
||||||
|
identity before replacing a canonical local path.
|
||||||
|
|
||||||
|
Core helpers:
|
||||||
|
|
||||||
|
- `LoadCurrentInventory`, returning the selected `CurrentState`
|
||||||
|
- `CurrentStateValidation`, supplying optional expected publication identity
|
||||||
|
- `RemoteCommitManifest` and `CurrentCommitPointer`
|
||||||
|
|
||||||
|
Typed missing-state error:
|
||||||
|
|
||||||
|
- `CurrentCommitPointerMissingError` (`ErrCurrentCommitPointerMissing`)
|
||||||
|
|
||||||
|
Identity validation supports caller-provided expectations:
|
||||||
|
|
||||||
|
- expected campaign;
|
||||||
|
- expected session ID;
|
||||||
|
- expected publication run ID.
|
||||||
|
|
||||||
|
The reader always checks campaign, session, and run identity agreement between
|
||||||
|
the current pointer and selected publication inventory. It verifies the selected
|
||||||
|
inventory's namespace, size, checksum, and storage generation. These reads use
|
||||||
|
the pointer and inventory; execution-snapshot bodies are not fetched.
|
||||||
|
|
||||||
|
Caller policy is intentionally outside artifacts helpers:
|
||||||
|
|
||||||
|
- some callers fail on missing current state;
|
||||||
|
- some callers downgrade missing state to status/findings;
|
||||||
|
- some callers skip optional behavior when state is missing.
|
||||||
|
|
||||||
|
## Remote Lock Objects
|
||||||
|
|
||||||
|
The artifacts package defines the independent remote-lock payload and identity
|
||||||
|
contract. Each canonical publish source maps to one object below the validated
|
||||||
|
session `locks/` prefix; its filename is the lowercase SHA-256 digest of the
|
||||||
|
exact source followed by `.lock`.
|
||||||
|
|
||||||
|
Lock payloads are strict versioned JSON containing the canonical source, an
|
||||||
|
optional reason, and a UTC creation time. Reads are bounded to
|
||||||
|
`MaxRemoteLockObjectBytes` (64 KiB), reject unknown fields and trailing values,
|
||||||
|
and verify that the payload source matches the key digest. Exact lookup reports
|
||||||
|
presence explicitly, prefix listing validates every object and sorts by source,
|
||||||
|
creation uses an absence precondition, forced replacement uses one observed
|
||||||
|
generation, and removal is idempotent.
|
||||||
|
|
||||||
|
## Key Path Helpers
|
||||||
|
|
||||||
|
`internal/artifacts/paths.go` and S3-key helpers define canonical helpers for:
|
||||||
|
|
||||||
|
- session/work/run paths;
|
||||||
|
- previous-cache paths;
|
||||||
|
- managed session, run, and diagnostic paths;
|
||||||
|
- S3 session/run/current-state key layout.
|
||||||
|
|
||||||
|
New publication creates run-scoped immutable objects, including
|
||||||
|
`runs/{run_id}/commit.json`, without an execution snapshot. The sole
|
||||||
|
mutable selector is `current/commit-pointer.json`; readers verify its selected
|
||||||
|
commit and declared object generations/checksums.
|
||||||
|
|
||||||
|
A `published_output` declaration may identify its commit's run or an earlier
|
||||||
|
immutable run in the same campaign/session namespace. The key parser validates
|
||||||
|
that namespace, rejects mutable and malformed keys, and derives the originating
|
||||||
|
run from the exact declaration. All other commit artifacts remain confined to
|
||||||
|
the commit's own run prefix.
|
||||||
|
|
||||||
|
Campaign, session, and Narratio run IDs are validated as portable opaque
|
||||||
|
segments at configuration and artifact boundaries before they can be used in a
|
||||||
|
workspace or S3 namespace. Previous-artifact destinations remain typed,
|
||||||
|
multi-segment relative paths and are confined beneath `previous/artifacts`; they
|
||||||
|
are not treated as opaque identifiers.
|
||||||
|
|
||||||
|
See [Workspace Internals](workspace.md) for how callers consume local helpers
|
||||||
|
and [Operations](../operations.md#local-state-layout) for the authoritative
|
||||||
|
physical layout.
|
||||||
|
|
||||||
|
## Invariants
|
||||||
|
|
||||||
|
- source ID formats are stable contracts;
|
||||||
|
- artifact resolution is deterministic and manifest-aware;
|
||||||
|
- extraction sources require compatible local generation evidence or a valid
|
||||||
|
supplied-product record;
|
||||||
|
- previous-session source resolution in `analyze` is local-only;
|
||||||
|
- remote current-state key construction remains centralized in artifacts helpers.
|
||||||
|
|
||||||
|
## Implementation And Tests
|
||||||
|
|
||||||
|
- Registry and resolution: `internal/artifacts/artifact_resolver.go`,
|
||||||
|
`internal/artifacts/catalog.go`, `internal/artifacts/transcripts.go`,
|
||||||
|
`internal/artifacts/extraction_catalog.go`,
|
||||||
|
`internal/artifacts/extraction_evidence.go`,
|
||||||
|
`internal/artifacts/extraction_input.go`,
|
||||||
|
`internal/artifacts/prepared_input.go`
|
||||||
|
- Current state: `internal/artifacts/current_state.go`,
|
||||||
|
`internal/artifacts/current_state_commit.go`,
|
||||||
|
- Paths and keys: `internal/artifacts/paths.go`,
|
||||||
|
`internal/artifacts/s3_keys.go`
|
||||||
|
- Previous requirements: `internal/artifacts/previous_requirements.go`, `internal/artifacts/dependencies.go`
|
||||||
|
- Tests: `internal/artifacts/artifact_resolver_test.go`,
|
||||||
|
`internal/artifacts/catalog_test.go`,
|
||||||
|
`internal/artifacts/extraction_catalog_test.go`,
|
||||||
|
`internal/artifacts/current_state_test.go`,
|
||||||
|
`internal/artifacts/paths_model_test.go`,
|
||||||
|
`internal/artifacts/previous_requirements_test.go`
|
||||||
|
|||||||
@@ -1,86 +1,70 @@
|
|||||||
# Internal: Command Restore
|
# Internal: Command Restore
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
Define the implemented `narratio restore` command contract: committed remote-state discovery, deterministic planning, safe file installation, conflict policy, and restore reporting.
|
|
||||||
|
|
||||||
## Inputs and outputs
|
Restore imports products declared by the selected publication inventory into a
|
||||||
Inputs:
|
local session. The [CLI](../cli.md#session-restore) describes invocation and
|
||||||
- CLI flags: `--config`, `--session`, `--session-id`, `--dry-run`, `--force`, `--include-audio`.
|
[Operations](../operations.md#restore-workflow) describes operator recovery.
|
||||||
- Resolved/validated `pipeline.yml` and `session.yml`.
|
The session progress manifest stays local; publication is not a checkpoint backup.
|
||||||
- Configured remote object store.
|
|
||||||
- Remote committed current-state markers (`current/run_id.txt`, `current/manifest.json`).
|
|
||||||
|
|
||||||
Outputs:
|
## Discovery and planning
|
||||||
- Dry-run summary to stdout (plan + counts).
|
|
||||||
- Non-dry-run completion summary to stdout.
|
|
||||||
- Local durable session files restored under canonical session root.
|
|
||||||
- Non-dry-run restore report at `reports/restore-latest.json`.
|
|
||||||
|
|
||||||
## Boundaries
|
`internal/artifacts` validates the current pointer and its immutable commit,
|
||||||
Owns:
|
including campaign, session, run, checksum, size, generation, and namespace.
|
||||||
- Restore command flag parsing and command wiring.
|
Discovery binds the plan to that inventory. Obsolete execution-snapshot
|
||||||
- Remote current-state discovery and identity validation.
|
declarations are ignored without reading their bodies. Authored session YAML
|
||||||
- Restore plan construction and conflict classification.
|
remains a separate configuration input.
|
||||||
- Restore execution for planned downloads.
|
|
||||||
- Restore report model and persistence.
|
|
||||||
|
|
||||||
Does not own:
|
The planner maps each recognized published source through the built-in product
|
||||||
- Stage execution orchestration (`run`, `resume`, `run-stage`).
|
registry or current concrete configured definitions. Local products use flat
|
||||||
- Archive publish behavior (owned by archive stage).
|
canonical paths regardless of remote destination names. Exact immutable keys,
|
||||||
- Storage transport implementation details (owned by storage adapters).
|
checksums, sizes, and generations remain attached to actions, including products
|
||||||
|
carried from earlier publications by locks. Supported prepared documents and,
|
||||||
|
with `--include-audio`, audio retain their input paths. Prepared glossary inputs
|
||||||
|
include the four individual envelopes and the combined glossary. Previous-session
|
||||||
|
requirements use the shared prerequisite-inclusive collector and exact
|
||||||
|
published-output declarations; execution diagnostics and remote progress
|
||||||
|
snapshots are not imported.
|
||||||
|
|
||||||
## Config fields used
|
Each target is classified as `download`, `skip_same`, or `conflict` beneath the
|
||||||
- Config/session discovery and templating fields consumed by all commands.
|
session root. Symlinked or non-regular ancestors and leaves remain conflicts;
|
||||||
- `pipeline.workspace.root` (local restore target root).
|
`--force` authorizes replacement of differing regular files only. Duplicate
|
||||||
- `pipeline.storage.*` (remote backend + archive identity derivation).
|
local destinations fail planning. Dry runs perform no durable session writes and
|
||||||
- `pipeline.storage.s3.*` identity components used by archive prefix helpers.
|
report imports plus projected work using the normal read-only assessment for
|
||||||
- `session.session_id`
|
preserved local progress. Product coverage is conditional on successful
|
||||||
- `session.campaign`
|
verification of planned downloads; unavailable local assessment is conservative.
|
||||||
|
|
||||||
## External adapters used
|
## Installation and local baseline
|
||||||
- `storage.ObjectStore` for `Exists`, `List`, `Download`.
|
|
||||||
- `artifacts.Store` (`LocalStore`) for layout and session lock management.
|
|
||||||
- `manifest.LocalStore` for manifest decode/validation and identity checks.
|
|
||||||
|
|
||||||
## State and manifest behavior
|
A non-dry run acquires the same workspace lock used by runners before loading
|
||||||
- Restore is not a pipeline run and does not create a run manifest.
|
local state and classifying files. It writes an incomplete-restore marker before
|
||||||
- Restore uses committed remote current state only:
|
installation. Transfers use confined sibling temporary files and verify the
|
||||||
- `current/run_id.txt` must exist and be non-empty.
|
inventory's content and object identity before replacement. Installed products
|
||||||
- `current/manifest.json` must decode and match requested session/campaign.
|
are checked against their canonical paths, content rules, sizes, and checksums.
|
||||||
- Non-dry-run writes restore files to canonical session paths.
|
|
||||||
- Manifest install behavior:
|
|
||||||
- validated before replacement.
|
|
||||||
- installed last among download actions.
|
|
||||||
- existing local manifest is preserved if restored manifest validation/install fails.
|
|
||||||
- Non-dry-run report persists summary/action status metadata in `reports/restore-latest.json`.
|
|
||||||
|
|
||||||
## Skip and resume behavior
|
Restore merges accepted products into a clone of local state and saves the local
|
||||||
- Restore does not participate in stage skip/resume decisions.
|
manifest last. Identical content with valid local generation evidence keeps that
|
||||||
- Restore provides durable local state so subsequent stage commands can resume or rerun based on restored manifest state.
|
authority. Other accepted products receive typed supplied records. Changed
|
||||||
- Dry-run is read-only and returns plan output only.
|
products invalidate dependent local work using the existing stage relations;
|
||||||
|
unrelated checkpoints and locally recorded diagnostics remain. Co-published
|
||||||
|
products need no shared generation history. The resulting coverage satisfies
|
||||||
|
work without inventing intermediate files or successful publish, notify, or
|
||||||
|
cleanup execution.
|
||||||
|
|
||||||
## Failure behavior
|
Failure leaves the marker and any already-installed files. A retry reclassifies
|
||||||
- Fails when storage backend is unavailable or archive identity cannot be resolved.
|
those files, verifies them, and saves the merged baseline; the marker is removed
|
||||||
- Fails when remote current pointer/manifest is missing or invalid.
|
after that save succeeds. This is not a whole-workspace rollback guarantee.
|
||||||
- Fails when remote manifest identity mismatches requested campaign/session.
|
|
||||||
- Fails on local conflicts unless `--force` is set.
|
|
||||||
- Fails fast on session lock acquisition conflict for non-dry-run execution.
|
|
||||||
- On execution failure, previously installed files remain; no rollback is performed.
|
|
||||||
|
|
||||||
## Tests to inspect before changing
|
## Reporting and ownership
|
||||||
- `internal/app/restore_test.go`
|
|
||||||
- `internal/app/restore_discovery_test.go`
|
|
||||||
- `internal/app/restore_plan_test.go`
|
|
||||||
- `internal/app/restore_execution_test.go`
|
|
||||||
- `internal/app/restore_workflow_test.go`
|
|
||||||
- `internal/artifacts/archive_identity_test.go`
|
|
||||||
|
|
||||||
## Architectural invariants
|
Reports identify publication identity, actions, counts, and failures. Actual
|
||||||
- Restore relies on centralized archive identity/key helpers (`internal/artifacts`) rather than ad hoc key building.
|
attempts persist under the restore run's logs. `restore --force` governs file
|
||||||
- `current/run_id.txt` is the remote commit marker; restore must not infer committed state from incidental files.
|
replacement and is independent of pipeline force.
|
||||||
- Local path mapping is traversal-safe and constrained to session root.
|
|
||||||
- Restore scope is deterministic and path-classified:
|
Discovery is in `internal/app/restore_discovery.go`, planning and coverage in
|
||||||
- include `manifest.json`, `transcripts/**`, `artifacts/**`
|
`internal/app/restore_plan.go`, transfers in `internal/app/restore_execute.go`,
|
||||||
- include `audio/**` only with `--include-audio`
|
local baseline installation in `internal/app/restore_manifest_paths.go`, and
|
||||||
- exclude `runs/**`, `logs/**`, `reports/**`, `config/**`, `inputs/**`
|
command coordination/reporting in `internal/app/restore_command.go` and
|
||||||
- Command remains standalone; no implicit `run --restore` behavior.
|
`internal/app/restore_report.go`. The restore, import-workflow, artifact, and
|
||||||
|
recovery tests cover source mapping, identity, conflicts, preservation, retry,
|
||||||
|
and carried products.
|
||||||
|
|||||||
124
docs/internal/configuration.md
Normal file
124
docs/internal/configuration.md
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
# Configuration Internals
|
||||||
|
|
||||||
|
User-visible fields, defaults, discovery, and selection belong in the
|
||||||
|
[Configuration Reference](../config.md). This document describes the
|
||||||
|
`internal/config` loading and derivation boundary established by
|
||||||
|
[ADR 0003](../adr/0003-assign-configuration-ownership.md).
|
||||||
|
|
||||||
|
## Typed Configuration Handoff
|
||||||
|
|
||||||
|
Pipeline, campaign, session, and party loaders retain their actual
|
||||||
|
ConfigKit results. Campaign and party inputs retain shared extensions, while
|
||||||
|
Narratio's operational settings use strict typed bindings. ConfigKit owns imports, overlay composition, inheritance,
|
||||||
|
presence, typed secrets, and native source/history evidence. Narratio's
|
||||||
|
supported definition callbacks complete configuration-owned defaults,
|
||||||
|
normalization, resource resolution, and validation before handoff. Consumers
|
||||||
|
read completed values without mutation.
|
||||||
|
|
||||||
|
Session definitions receive selected-campaign defaults before loading finishes.
|
||||||
|
Recorded resolution preserves explicit empty/null/false/zero behavior and
|
||||||
|
truthful dependencies. Campaign, session, and previous-session assertions run
|
||||||
|
against resolved values in native validation callbacks. Standalone document
|
||||||
|
renderers preserve materialization semantics without providing a second
|
||||||
|
inspection authority.
|
||||||
|
|
||||||
|
Resource resolution consults native entry origins and source contexts. A usable
|
||||||
|
effective source supplies the base, otherwise the main source and then captured
|
||||||
|
invocation directory provide the fallback. Explicit CLI paths use the invocation
|
||||||
|
directory. Reference-catalog entries are resolved individually from their native
|
||||||
|
field origins; selection does not read unused vocabulary files. See [resource rules](../config.md#pipeline-imports-and-overlays).
|
||||||
|
|
||||||
|
## Resolved Domain Validation
|
||||||
|
|
||||||
|
`Validate` checks cross-document storage/audio relations and product destinations
|
||||||
|
after the configuration handoff. These rejections use `DomainInputError`;
|
||||||
|
catalog derivation retains `ArtifactCatalogInputError`. Both preserve their
|
||||||
|
causes for the application's [CLI classification](../cli.md#cancellation-and-exit-status).
|
||||||
|
Native loading errors retain their existing classification. Path-resolution
|
||||||
|
failures during destination validation remain operational. Joined operational
|
||||||
|
or cancellation causes retain precedence over input errors.
|
||||||
|
|
||||||
|
## Invocation Acquisition
|
||||||
|
|
||||||
|
`internal/app/configuration_acquisition.go` owns lazy invocation selections and
|
||||||
|
acquired context. Exact sources and effective-identity assertions are
|
||||||
|
complementary. App acquisition needs no campaign or party for expansion;
|
||||||
|
campaign acquisition needs no session. Session acquisition loads campaign
|
||||||
|
context when required for defaults. Explicit party acquisition does not require
|
||||||
|
a session. Each reached pipeline acquisition prepares its native source and applies
|
||||||
|
configured bootstrap after static input checks; completed acquisitions are reused.
|
||||||
|
|
||||||
|
`LoadedPipelineCampaign` retains one selected pipeline/campaign while local or
|
||||||
|
remote session resolution proceeds. Only absence permits remote fallback;
|
||||||
|
access, decoding, and identity failures retain their causes. Remote acquisition
|
||||||
|
prefers authored session-root input and uses the committed prepared snapshot
|
||||||
|
only when authored input is absent. Temporary materialization retains object
|
||||||
|
provenance and releases resources on success or failure. Read-only acquisition
|
||||||
|
creates no runtime workspace, execution lock, restore state, or stage adapter.
|
||||||
|
|
||||||
|
## Native Inspection
|
||||||
|
|
||||||
|
`configuration_commands.go` adapts actual results with `ckconfig.FromConfigKit`.
|
||||||
|
Native show, sources, explain/history, validation, and comparisons consume that
|
||||||
|
result's values and evidence. There is no flattened replacement snapshot,
|
||||||
|
synthetic source reconciliation, or generated family catalog in app inspection.
|
||||||
|
|
||||||
|
Comparison sides load independently using each side's normal defaults and
|
||||||
|
selectors. App-only overrides pass through native selection into ConfigKit;
|
||||||
|
they remain invocation-local. Field overrides are unavailable to domain
|
||||||
|
execution/planning and other scopes. Comparison sides acquire separately and share the process environment while
|
||||||
|
retaining separate completed results. Public inspection and error paths preserve typed-secret
|
||||||
|
redaction and credential reference metadata. Load failures retain native errors
|
||||||
|
and source evidence; domain commands use `ckconfig.AdaptDiagnostics` for their
|
||||||
|
presentation without rewriting diagnostic records.
|
||||||
|
|
||||||
|
## Glossary Derivation
|
||||||
|
|
||||||
|
`internal/config` adapts resolved selections and canonical party context to
|
||||||
|
`internal/glossary`. That owner loads native vocabulary, validates the pinned
|
||||||
|
schema, projects the roster, and serializes four individual envelopes and a
|
||||||
|
combined envelope.
|
||||||
|
Preparation and resume comparison share this resolver. Derived vocabulary does
|
||||||
|
not replace the authored ConfigKit results used by native inspection. Catalog
|
||||||
|
entry imports use the source file's native relative context.
|
||||||
|
|
||||||
|
## Canonical Party And Derived Catalog
|
||||||
|
|
||||||
|
File-backed party loading supports imports; contextless `ParseParty` accepts
|
||||||
|
bytes. The completed native mapping is validated against the shared contract and
|
||||||
|
Narratio's roster requirements. Character IDs determine projection order. The
|
||||||
|
native result supplies standalone canonical party YAML. The selected roster
|
||||||
|
supplies both the players projection and concrete family members, including when
|
||||||
|
an explicit party file replaces the campaign default.
|
||||||
|
|
||||||
|
`ArtifactCatalog` carries derived artifacts, family/member origins, resolved
|
||||||
|
dependencies, and expanded publication outputs separately from pipeline values.
|
||||||
|
Family declarations remain in the typed pipeline result. Derivation sorts
|
||||||
|
family keys and character IDs, substitutes `{character_id}` in outputs,
|
||||||
|
resolves closed member variables, and checks key/output collisions and domain
|
||||||
|
dependencies. Member-artifact inputs become ordinary concrete artifact sources;
|
||||||
|
family publish declarations become ordinary publication actions. No family
|
||||||
|
wildcard matcher is added to runtime publication.
|
||||||
|
|
||||||
|
Catalog listing, planning, stage execution, artifact inspection, fingerprinting,
|
||||||
|
and previous-session requirements consume the same derived products. Validation
|
||||||
|
of these products belongs to domain derivation rather than app inspection.
|
||||||
|
External roster shape belongs in the [party contract](../integrations/party.md).
|
||||||
|
|
||||||
|
## Safe Persistence And Semantic Resume
|
||||||
|
|
||||||
|
Preparation materializes standalone campaign/session/party/players and five glossary inputs and
|
||||||
|
a secret-safe pipeline projection. The projection preserves credential names,
|
||||||
|
family declarations, numeric values, and null/empty distinctions. It is a
|
||||||
|
persistence service, not a fabricated native result. An effective digest is
|
||||||
|
informational; resume compares result-affecting semantic evidence from the same
|
||||||
|
concrete products used by execution. Source arrangement, provenance, and overlay
|
||||||
|
labels alone do not invalidate work.
|
||||||
|
|
||||||
|
Focused configuration/application fixtures cover imports, defaults, selected
|
||||||
|
rosters, independent comparisons, override isolation, secret-safe persistence,
|
||||||
|
and unchanged completed configuration across domain derivation and execution.
|
||||||
|
|
||||||
|
ConfigKit's [consumer guide](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/consumers/README.md)
|
||||||
|
and [CommandKit consumer guide](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/consumers/guide.md)
|
||||||
|
own the upstream APIs and feature behavior.
|
||||||
58
docs/internal/fileops.md
Normal file
58
docs/internal/fileops.md
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
# Internal: File Operations
|
||||||
|
|
||||||
|
`internal/fileops` owns the narrow mechanics for atomically visible replacement of one
|
||||||
|
byte file. Callers keep ownership of serialization, validation, cancellation,
|
||||||
|
and destination-directory policy.
|
||||||
|
|
||||||
|
## Destination Paths
|
||||||
|
|
||||||
|
Ordinary workspace replacement uses standard operating-system path semantics.
|
||||||
|
Callers with a root-scoped safety contract own that validation at their boundary.
|
||||||
|
|
||||||
|
Remote object acquisition is owned by its domain caller. `WriteSiblingTemp` writes and closes a sibling temporary file, returning
|
||||||
|
ownership to the caller. The caller validates the complete result and passes it
|
||||||
|
to `InstallSiblingTempFile` only when it is ready to become canonical. Callers own
|
||||||
|
remote object selection, validation, conflict handling, and temporary-file
|
||||||
|
cleanup.
|
||||||
|
|
||||||
|
Directory bundles are not promoted by `internal/fileops`; extraction keeps
|
||||||
|
the original bundle in its run until cleanup and promotes individual validated
|
||||||
|
products.
|
||||||
|
|
||||||
|
The workspace path owner manages latest-attempt links; fileops provides confined
|
||||||
|
directory creation and removal mechanics.
|
||||||
|
|
||||||
|
## Cleanup Contract
|
||||||
|
|
||||||
|
`RemoveAllUnderRoot` accepts an explicit root and a proper descendant, opens
|
||||||
|
that root with `os.OpenRoot`, and removes the normalized root-relative target
|
||||||
|
with `Root.RemoveAll`. It rejects root, traversal, and out-of-root targets; a
|
||||||
|
missing target is successful. `RemoveFileUnderRoot` additionally requires an
|
||||||
|
existing leaf to be regular. Command and post-publish policy remains owned by
|
||||||
|
`internal/app`.
|
||||||
|
|
||||||
|
## Bounded Reads
|
||||||
|
|
||||||
|
`ReadFileBounded` opens a normal path and reads at most its caller-supplied
|
||||||
|
limit.
|
||||||
|
|
||||||
|
## Replacement Contract
|
||||||
|
|
||||||
|
`ReplaceFileAtomic` requires an existing destination directory. It creates a
|
||||||
|
sibling temporary file, writes the complete byte sequence, applies the
|
||||||
|
caller-supplied mode, closes the file, runs an optional pre-rename check, and
|
||||||
|
replaces the destination with a rename.
|
||||||
|
|
||||||
|
The pre-rename check is the last point at which a caller can cancel without
|
||||||
|
installing a new destination. A failure before the rename leaves the old
|
||||||
|
destination unchanged and removes the temporary file. Successful replacement
|
||||||
|
provides atomic visibility; it makes no crash- or power-loss durability claim.
|
||||||
|
|
||||||
|
Replacement follows the operating system's same-filesystem rename semantics.
|
||||||
|
If a platform cannot replace an existing destination, the operation returns an
|
||||||
|
error and never removes the old file as an emulation step.
|
||||||
|
|
||||||
|
`WriteFileAtomic` and the copy helpers create the destination parent with the
|
||||||
|
repository's workspace permissions. `InstallSiblingTempFile` requires the
|
||||||
|
caller to provide an existing temporary file in the existing destination
|
||||||
|
directory.
|
||||||
@@ -1,81 +1,403 @@
|
|||||||
# Internal: Manifest
|
# Internal: Manifest
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
Describe Narratio's durable execution state model for session-level and run-level manifests, including lifecycle transitions and persistence behavior.
|
|
||||||
|
|
||||||
## Inputs and outputs
|
Explain the session-progress model implemented by `internal/manifest`. Physical
|
||||||
Inputs:
|
manifest placement belongs in
|
||||||
- Session identity and run identity from app orchestration.
|
[Operations](../operations.md#local-state-layout).
|
||||||
- Stage transition events and stage result payloads.
|
|
||||||
|
|
||||||
Outputs:
|
## Session Manifest
|
||||||
- Session manifest at `{workspace.root}/work/{campaign}/{session_id}/manifest.json`.
|
|
||||||
- Run manifest at `{workspace.root}/work/{campaign}/{session_id}/runs/{run_id}/manifest.json`.
|
|
||||||
|
|
||||||
## Boundaries
|
`manifest.Manifest` records:
|
||||||
Owns:
|
|
||||||
- Manifest schemas (`Manifest`, `RunManifest`, stage records, error records, input/artifact records).
|
|
||||||
- Stage status/action transition methods.
|
|
||||||
- Persistent store contract (`manifest.Store`) and local JSON store implementation.
|
|
||||||
|
|
||||||
Does not own:
|
- required `schema_version: narratio.session-manifest.v2`
|
||||||
- Stage implementation details.
|
- identity (`session_id`, `campaign`, `run_id`)
|
||||||
- Path construction policy outside manifest file persistence calls.
|
- local path metadata (`local_workdir`)
|
||||||
- CLI command behavior.
|
- remote identity metadata (`s3_bucket`, `s3_session_prefix`, `s3_run_prefix`)
|
||||||
|
- `inputs` records
|
||||||
|
- durable `artifacts` records
|
||||||
|
- optional versioned `supplied_products` records, keyed by source ID
|
||||||
|
- per-stage `stages` map, including the ordinary cleanup stage record
|
||||||
|
|
||||||
## Config fields used
|
Supplied records hold a canonical session-relative path, SHA-256 checksum,
|
||||||
Manifest package itself does not read config directly.
|
byte size, and optional product contract. The manifest store validates their
|
||||||
|
structure; artifact helpers check the recorded path and actual content. A
|
||||||
|
separate coverage helper derives transcript work satisfied by valid supplied
|
||||||
|
transcripts without creating records for absent intermediate products. Planning
|
||||||
|
and execution use that coverage to reuse satisfied transcript work without
|
||||||
|
historical producer evidence. Restore merges verified records into local progress
|
||||||
|
as described in [restore internals](command-restore.md).
|
||||||
|
|
||||||
Manifest identity fields are populated by app/stage orchestration from:
|
Session, campaign, and run identities in local manifests must be
|
||||||
- `session.session_id`
|
portable opaque segments. Unsafe legacy identities are rejected with migration
|
||||||
- `session.campaign`
|
guidance rather than being normalized into a different workspace or remote
|
||||||
- `pipeline.workspace.root`
|
namespace.
|
||||||
- `pipeline.storage.s3.*` (when archive/S3 identity is set)
|
|
||||||
|
|
||||||
## External adapters used
|
Decoding rejects unknown typed fields, including informational fields inside
|
||||||
- No external service adapters.
|
`effective_config` and its nested selection. The schema version is
|
||||||
- Uses local filesystem for persistence via `manifest.LocalStore`.
|
`narratio.session-manifest.v2`; there is no compatibility reader that silently
|
||||||
|
drops retired fields. See [overlay provenance](../operations.md#migrating-manifest-overlay-provenance)
|
||||||
|
for handling retired selection provenance. Cleanup progress uses only the
|
||||||
|
cleanup entry in `stages`.
|
||||||
|
|
||||||
## State and manifest behavior
|
Every persisted session manifest has a non-nil `stages` map. Each entry is
|
||||||
Session manifest model:
|
non-nil and its embedded `name` exactly matches its map key; loading never
|
||||||
- Tracks durable per-session stage state and provenance (`pending`, `running`, `succeeded`, `failed`, `skipped`, `stale`, `interrupted`).
|
invents either marker. A missing or unsupported schema version, or incomplete
|
||||||
- Stores resolved inputs, durable artifacts, stage logs/config refs, and stage metadata.
|
stage identity, is unsupported local state: move it aside before regenerating
|
||||||
|
or importing published products into a new local baseline.
|
||||||
|
|
||||||
Run manifest model:
|
Prepare records independent `party` and `players` input checksums. In canonical
|
||||||
- Tracks one invocation (`run_id`) with requested stages and force mode.
|
party mode, the party record retains its campaign source identity while the
|
||||||
- Tracks per-stage action (`run` or `skip`) and per-stage status.
|
players record uses `derived_from_party`; raw roster content is never embedded
|
||||||
- Tracks overall run status (`running`, `succeeded`, `failed`).
|
in manifest metadata. Both records remain the durable authority for consumers
|
||||||
|
of their prepared input source IDs.
|
||||||
|
|
||||||
Persistence behavior:
|
The model admits these stage states:
|
||||||
- Load validates required identity/timestamp fields and normalizes maps/records.
|
|
||||||
- Save updates `updated_at` and writes JSON atomically (temp file + rename).
|
|
||||||
- Session and run manifests are saved incrementally before/after stage transitions.
|
|
||||||
|
|
||||||
Relationship during execution:
|
- `pending`
|
||||||
- Runner updates both manifests for every stage transition.
|
- `running`
|
||||||
- Session manifest is the durable pipeline-progress ledger.
|
- `succeeded`
|
||||||
- Run manifest is invocation history and audit record.
|
- `failed`
|
||||||
- Analyze stage outputs are persisted as `kind=scriptorium_artifact` with `source_id=narratio.artifact.<name>` for configured artifact identity.
|
- `skipped`
|
||||||
|
- `stale`
|
||||||
|
- `interrupted`
|
||||||
|
|
||||||
## Skip and resume behavior
|
### Transcribe-owned speaker state
|
||||||
- Resume and skip decisions are based on session-manifest stage statuses.
|
|
||||||
- `--force` reruns selected stages and marks downstream succeeded stages as `stale` in session manifest.
|
|
||||||
- Run manifest records whether each stage was executed or skipped in that invocation.
|
|
||||||
|
|
||||||
## Failure behavior
|
A `transcribe` stage record may carry `transcribe_state_version: 1` and a
|
||||||
- Stage failure marks both manifests failed for that stage and records error messages/timestamps.
|
`transcribe_speakers` map keyed by the existing derived speaker ID. The version
|
||||||
- Save failures are returned immediately and fail the command.
|
is the authority marker: a versioned empty map means that no earlier speaker
|
||||||
- Invalid/malformed manifest files fail load with explicit validation/decode errors.
|
completion is reusable. Absence of both fields is accepted as legacy
|
||||||
|
aggregate-only state so current Narratio can read older manifests.
|
||||||
|
|
||||||
## Tests to inspect before changing
|
Each map entry represents one completed speaker only. It binds a versioned
|
||||||
- `internal/manifest/manifest_test.go`
|
fingerprint to the session-relative audio path, audio SHA-256 and size, one
|
||||||
- `internal/manifest/run_manifest_test.go`
|
canonical `transcript_raw` output with its path, SHA-256 and size, and the
|
||||||
- `internal/manifest/store_test.go`
|
producer run ID. Paths must be canonical and session-relative, checksums must
|
||||||
- `internal/app/runner_test.go`
|
be lowercase SHA-256 values, and the record and output producer identities
|
||||||
- `internal/app/run_control_test.go`
|
must agree. Other stages cannot carry this transcribe-owned state.
|
||||||
- `internal/app/resume_run_stage_test.go`
|
Audio size is nonnegative; WhisperX determines whether that audio can be
|
||||||
|
transcribed. Output size remains positive and the transcript must be valid JSON.
|
||||||
|
|
||||||
## Architectural invariants
|
Transcribe reconciles this collection against the current prepared audio set
|
||||||
- Session manifest is authoritative for stage progression across invocations.
|
and observable WhisperX semantics. Missing or corrupt regular outputs become
|
||||||
- Run manifest is invocation-scoped and never replaces session manifest as progress authority.
|
work; unsafe or non-regular evidence is rejected. It saves the reconciled
|
||||||
- Manifest writes are atomic and deterministic (JSON + newline, temp rename pattern).
|
collection before HTTP dispatch and saves a detached candidate after each
|
||||||
|
validated completion. Only after a save succeeds is the candidate installed as
|
||||||
|
live authority. Canonical bytes produced before an unsuccessful save are not a
|
||||||
|
completion record.
|
||||||
|
|
||||||
|
Aggregate transcribe status still describes the whole invocation. A failed,
|
||||||
|
running, stale, or interrupted aggregate may therefore retain reusable speaker
|
||||||
|
records, while aggregate outputs are declared only after the current
|
||||||
|
collection is complete. Ordinary retry reconciles and reuses those records.
|
||||||
|
Force first checkpoints an empty current collection, preventing later retries
|
||||||
|
from reviving pre-force results.
|
||||||
|
|
||||||
|
Older aggregate-only transcribe success is conservatively regenerated once
|
||||||
|
when transcribe is selected because it does not bind individual outputs to the
|
||||||
|
audio bytes used. The transcribe subcollection has its own version independent
|
||||||
|
of the session-manifest marker.
|
||||||
|
|
||||||
|
### Analyze-owned artifact state
|
||||||
|
|
||||||
|
Every `analyze` stage record carries `analyze_state_version: 1` and an
|
||||||
|
`analyze_artifacts` map keyed by normalized configured artifact key. The
|
||||||
|
version is the authority marker: version 1 with no entries is a valid evaluated
|
||||||
|
empty set. An absent or unsupported version is unsupported local state and is
|
||||||
|
rejected rather than being treated as aggregate-only authority.
|
||||||
|
|
||||||
|
Each analyze artifact record has one disposition:
|
||||||
|
|
||||||
|
- `current`: the configured artifact is available and carries a versioned
|
||||||
|
fingerprint plus a complete output record and separate output size;
|
||||||
|
- `stale`: the recorded semantic identity is no longer current;
|
||||||
|
- `missing`: no validated current result exists;
|
||||||
|
- `failed`: the attempted work failed and carries a bounded diagnostic; or
|
||||||
|
- `unselected`: the artifact was intentionally outside the evaluated set.
|
||||||
|
|
||||||
|
Records bind their normalized key and dependencies, fingerprint contract when
|
||||||
|
evaluated, canonical session-relative output identity when current, producing
|
||||||
|
Narratio run, update time, and bounded non-secret Scriptorium provenance and
|
||||||
|
diagnostic paths. A current output includes its configured source ID, contract,
|
||||||
|
checksum, and positive byte size. Non-current records cannot carry an output,
|
||||||
|
so an older file is not advertised through stale, missing, failed, or
|
||||||
|
unselected state.
|
||||||
|
|
||||||
|
Family-produced records additionally retain optional `family` and
|
||||||
|
`character_id` provenance supplied by configuration resolution. These fields
|
||||||
|
do not replace the concrete configured key or infer family membership from a
|
||||||
|
name, so older records without them remain valid.
|
||||||
|
|
||||||
|
The session-stage collection is the reconciled authority across invocations.
|
||||||
|
These records remain analyze-owned data inside the fixed stage; they are not
|
||||||
|
dynamic stages or generic subtasks.
|
||||||
|
|
||||||
|
Analyze checkpoints one complete validated candidate collection after each
|
||||||
|
successful artifact and before exposing that artifact to later work. It saves a
|
||||||
|
detached manifest candidate and installs its version, collection, and updated
|
||||||
|
timestamp into live state only after the store reports success. Aggregate stage
|
||||||
|
outputs are ordinary result outputs rebuilt in configured-key order from current
|
||||||
|
session records only.
|
||||||
|
|
||||||
|
Successful incremental execution replaces only evaluated artifact records and
|
||||||
|
preserves valid unrelated current records. Rebuilt outputs are compared by
|
||||||
|
bytes and contract: an unchanged identity permits an unselected dependent with
|
||||||
|
the same recomputed fingerprint to remain current, while a changed identity
|
||||||
|
removes output authority from every unselected transitive dependent by marking
|
||||||
|
it stale. A partial analyze invocation can therefore succeed while unrelated
|
||||||
|
configured records remain stale. Existing canonical files never create current
|
||||||
|
records without validated execution and a successful checkpoint.
|
||||||
|
|
||||||
|
Aggregate analyze status is deliberately coarser than this collection. Resume
|
||||||
|
validation may skip a succeeded aggregate record when the selected artifact
|
||||||
|
closure is current even if unrelated records are stale. Conversely, a stale
|
||||||
|
aggregate record may cross the ordinary runner boundary and perform zero
|
||||||
|
Scriptorium calls when reconciliation proves every selected artifact current;
|
||||||
|
ordinary successful stage completion then restores the aggregate status.
|
||||||
|
|
||||||
|
On an artifact error, analyze installs a complete retry collection on the live
|
||||||
|
manifest before returning. The active record is failed without output, current
|
||||||
|
transitive dependents are stale, unrelated current records survive, and only
|
||||||
|
earlier checkpointed completions remain current. The runner's ordinary failure
|
||||||
|
path marks aggregate analyze failed, clears aggregate outputs, invalidates
|
||||||
|
delivery dependents, and saves that collection. A terminal session-save failure
|
||||||
|
is joined with the original adapter, validation, filesystem, cancellation, or
|
||||||
|
checkpoint cause.
|
||||||
|
|
||||||
|
If an artifact checkpoint fails, analyze rolls its working collection back to
|
||||||
|
the last committed collection before constructing the active failed record.
|
||||||
|
Newly materialized canonical bytes therefore remain incidental and cannot
|
||||||
|
become current authority. A later ordinary run reconciles the durable records,
|
||||||
|
reuses earlier current artifacts, and resumes with the failed or stale work.
|
||||||
|
The same recovery applies after process interruption: the aggregate record may
|
||||||
|
be non-successful, but every completed artifact checkpoint remains reusable.
|
||||||
|
|
||||||
|
## Remote Commit Manifest
|
||||||
|
|
||||||
|
`artifacts.RemoteCommitManifest` is a separate, versioned publication inventory
|
||||||
|
contract. It is not a serialized session manifest and contains no local
|
||||||
|
post-publication assertion such as `current_pointer_written`. A remote commit
|
||||||
|
identifies one campaign, session, and run and declares its immutable artifact
|
||||||
|
set. Each artifact has a typed source, immutable destination key, SHA-256
|
||||||
|
checksum, size, and storage generation.
|
||||||
|
|
||||||
|
`current/commit-pointer.json` is the sole mutable selector for the new
|
||||||
|
contract. It identifies exactly one run-scoped `runs/{run_id}/commit.json` and
|
||||||
|
binds that object by checksum, size, and generation. Readers strictly reject
|
||||||
|
unknown fields, version mismatches, pointer/commit identity mismatches, and
|
||||||
|
objects that do not match their declaration.
|
||||||
|
|
||||||
|
An absent commit pointer means no remote state is published. Republish to
|
||||||
|
establish a current immutable publication.
|
||||||
|
|
||||||
|
## Persistence Semantics
|
||||||
|
|
||||||
|
`manifest.LocalStore`:
|
||||||
|
|
||||||
|
- accepts only the exact supported session-manifest schema version;
|
||||||
|
- rejects unknown fields and multiple JSON values;
|
||||||
|
- validates stage-map identity without synthesizing missing maps, records, or
|
||||||
|
names;
|
||||||
|
- retains only representation-preserving collection normalization;
|
||||||
|
- writes through a sibling temporary file and atomic replacement visibility;
|
||||||
|
- updates `updated_at` on save.
|
||||||
|
|
||||||
|
### Checkpoint persistence boundary
|
||||||
|
|
||||||
|
Analyze and transcribe share one private checkpoint operation in
|
||||||
|
`internal/stage`. Their typed callers still decide when to checkpoint, validate
|
||||||
|
their collections, populate stage-owned fields, and serialize access. The
|
||||||
|
shared operation copies the manifest and its checkpoint-relevant mutable
|
||||||
|
collections, applies the typed update to the copied target record, and calls
|
||||||
|
the existing `manifest.Store` exactly once. Only after that save succeeds does
|
||||||
|
it promote the saved target record and manifest `updated_at` into live state;
|
||||||
|
it preserves an existing target record's identity and leaves unrelated live
|
||||||
|
stage records in place.
|
||||||
|
|
||||||
|
The copy boundary includes stage records, input and artifact slices, supplied
|
||||||
|
product records, aggregate output/log/configuration slices, and the typed analyze and transcribe
|
||||||
|
collections that callbacks or `LocalStore.Save` may modify. Metadata and other
|
||||||
|
pointer fields remain shared read-only because neither checkpoint callback nor
|
||||||
|
the store mutates them. This is a bounded execution helper, not a general
|
||||||
|
manifest clone or a transaction across transcript/artifact files.
|
||||||
|
|
||||||
|
Manifest replacement provides atomic visibility, not a crash- or power-loss
|
||||||
|
durability guarantee. Callers reload after a returned save error before retrying.
|
||||||
|
A transcribe or analyze checkpoint error leaves the prior manifest collection
|
||||||
|
as authority. The runner then attempts to persist the aggregate failure; if
|
||||||
|
that terminal save also fails, its error is joined with the originating failure
|
||||||
|
and the next invocation must reconcile from the last readable manifest.
|
||||||
|
|
||||||
|
## Execution Semantics
|
||||||
|
|
||||||
|
Planning and execution share one pure pre-execution decision over the recorded
|
||||||
|
stage status, force selection, and normalized resume-validation result. That
|
||||||
|
decision identifies run versus reuse and any required stale and dependent
|
||||||
|
invalidation transition. Planning applies it only to a cloned manifest.
|
||||||
|
Execution remains the sole owner of observed stage results and persistence.
|
||||||
|
|
||||||
|
For each selected stage, the application runner computes semantic evidence,
|
||||||
|
performs any eligible resume validation, applies the pre-execution decision,
|
||||||
|
and persists required invalidation before either reusing the existing success
|
||||||
|
or beginning an attempt. The same one-stage execution owner marks the attempt
|
||||||
|
running before invoking the stage and then records and persists its failed,
|
||||||
|
skipped, or successful terminal state before a later stage may start. On
|
||||||
|
success it records outputs, logs, generated configuration references, metadata,
|
||||||
|
and—when the stage implements the optional contract—a versioned
|
||||||
|
semantic-configuration fingerprint. Artifact
|
||||||
|
records may include optional contract and external provenance objects; old
|
||||||
|
manifests remain compatible when those fields are absent. A successful forced
|
||||||
|
rerun marks only succeeded transitive dependent session-stage records stale.
|
||||||
|
The application owns a fixed dependency relation distinct from execution order;
|
||||||
|
dependents are returned in canonical order. Render and extract therefore never
|
||||||
|
stale one another, while either can stale analyze, publish, notify, and cleanup.
|
||||||
|
|
||||||
|
Starting an execution clears the current session-stage record's prior outputs,
|
||||||
|
logs, generated configuration references, metadata, and semantic fingerprint.
|
||||||
|
Failed and skipped
|
||||||
|
transitions enforce the same clearing rule directly, while success repopulates
|
||||||
|
only fields returned by the new result. Marking a record stale does not clear
|
||||||
|
those details because resume validation and diagnosis may still require them
|
||||||
|
before execution begins.
|
||||||
|
|
||||||
|
Aggregate lifecycle clearing deliberately preserves both the transcribe-owned
|
||||||
|
speaker collection and the analyze-owned per-artifact collection. This lets
|
||||||
|
later reconciliation replace only non-current entries without erasing durable
|
||||||
|
completions. Other stages retain aggregate-only lifecycle behavior and are
|
||||||
|
forbidden from carrying either collection.
|
||||||
|
|
||||||
|
A stage may explicitly return a skipped disposition and stable reason. The
|
||||||
|
runner persists that outcome in the session manifest, clears older outputs,
|
||||||
|
logs, generated configuration references, and metadata, then applies any
|
||||||
|
bounded details from the current skip and continues. This self-skip is distinct from deciding not to execute an
|
||||||
|
already-succeeded stage and is reconsidered on later runs. Skipped results
|
||||||
|
cannot contain outputs. An intentional self-skip records the current semantic
|
||||||
|
fingerprint because it is a completed, reusable stage result; failed or
|
||||||
|
interrupted work never promotes one.
|
||||||
|
|
||||||
|
Supplied completion is revalidated against local bytes before planning or
|
||||||
|
execution reuses it. It can satisfy transcript work through the supplied JSON,
|
||||||
|
selected render outputs, or a complete configured extraction set. An attempted
|
||||||
|
replacement retires the supplied authority for its affected products before
|
||||||
|
execution; forced work therefore cannot revive an earlier supplied result.
|
||||||
|
Coverage never makes an absent consumer input available.
|
||||||
|
|
||||||
|
When an already-succeeded stage is skipped, the session manifest deliberately
|
||||||
|
retains its existing succeeded record because it remains the cross-invocation
|
||||||
|
progress authority. If a stage supplies semantic configuration evidence, reuse first
|
||||||
|
requires the persisted positive schema version and lowercase SHA-256 digest to
|
||||||
|
match the current resolved stage semantics. Missing semantic evidence, malformed
|
||||||
|
evidence, or a mismatch makes the stage and its fixed transitive dependents
|
||||||
|
stale. The existing stage-specific resume
|
||||||
|
validator runs only after this semantic check succeeds; both checks are
|
||||||
|
required. Extraction, analyze, and cleanup have resume validators and may
|
||||||
|
reject an otherwise eligible skip when their selected durable evidence is
|
||||||
|
obsolete; the runner marks the aggregate record stale and executes it.
|
||||||
|
Analyze's validator can still accept a partial selection when only unrelated
|
||||||
|
artifact records are stale.
|
||||||
|
|
||||||
|
Implemented reuse coverage is deliberately split between aggregate semantic
|
||||||
|
evidence and focused durable validators:
|
||||||
|
|
||||||
|
| Work | Reuse authority | Focused owners |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| prepare | aggregate semantic fingerprint plus durable-copy and current-source validation | [prepare](stage-prepare.md) |
|
||||||
|
| transcribe speakers | aggregate semantic fingerprint plus per-speaker input/output reconciliation | [transcribe](stage-transcribe.md), [WhisperX](../integrations/whisperx.md) |
|
||||||
|
| merge | aggregate semantic fingerprint | [merge](stage-merge.md), [Seriatim](../integrations/seriatim.md) |
|
||||||
|
| polish | aggregate semantic fingerprint | [polish](stage-polish.md), [Audita](../integrations/audita.md) |
|
||||||
|
| normalize | aggregate semantic fingerprint | [normalize](stage-normalize.md), [Seriatim](../integrations/seriatim.md) |
|
||||||
|
| trim | aggregate semantic fingerprint | [trim](stage-trim.md), [Scriptorium](../integrations/scriptorium.md), [Seriatim](../integrations/seriatim.md) |
|
||||||
|
| render | aggregate semantic fingerprint | [render](stage-render.md), [Seriatim](../integrations/seriatim.md) |
|
||||||
|
| extract | aggregate semantic fingerprint plus reference/output validator | [extract](stage-extract.md), [Notarius](../integrations/notarius.md) |
|
||||||
|
| analyze artifacts | per-artifact fingerprint, reconciliation, and output validator | [analyze](stage-analyze.md), [Scriptorium](../integrations/scriptorium.md) |
|
||||||
|
| publish | aggregate semantic fingerprint plus immediate lock/commit checks | [publish](stage-publish.md), [storage adapter](adapters.md) |
|
||||||
|
| notify | aggregate delivery-mode fingerprint | [pipeline overview](overview.md), [configuration](../config.md#notifications) |
|
||||||
|
| cleanup | aggregate semantic fingerprint plus publish-evidence and target-absence validator | [cleanup](stage-cleanup.md), [workspace](workspace.md) |
|
||||||
|
|
||||||
|
These contracts record resolved choices Narratio can observe, not operational
|
||||||
|
runner tuning. External model, module, prompt, profile, and configuration-file
|
||||||
|
contents that a tool privately loads remain outside the contract when their
|
||||||
|
configured identifier is unchanged; operators must force the affected work
|
||||||
|
after such a private content change.
|
||||||
|
|
||||||
|
The session manifest is the authoritative stage-progress ledger across
|
||||||
|
invocations. It retains the most recently resolved invocation's bounded
|
||||||
|
configuration provenance. It identifies the selected overlay name and source
|
||||||
|
(`explicit` when selected) plus the effective configuration digest, but never a raw
|
||||||
|
secret or overlay content. This provenance is informational: it does not
|
||||||
|
participate in stage resume or cache decisions. An overlay change therefore
|
||||||
|
invalidates only stages whose semantic configuration changed. When a private
|
||||||
|
external-tool model, module, prompt, or profile changes behind an unchanged
|
||||||
|
configured identifier, use `--force` for the affected work.
|
||||||
|
|
||||||
|
`session plan` computes the same current fingerprint and applies the shared
|
||||||
|
decision and invalidation rules to a cloned manifest. It predicts the runner
|
||||||
|
decision without persisting session state. The semantic fingerprint owner
|
||||||
|
hashes deterministic JSON from stage-owned typed structs; stage providers must
|
||||||
|
exclude secrets, complete effective-configuration dumps, and operational
|
||||||
|
values that cannot affect canonical results. Concrete coverage is owned by the
|
||||||
|
focused stage and integration documents linked above.
|
||||||
|
|
||||||
|
Before an explicitly bounded execution starts after `prepare`, the application
|
||||||
|
reads the session manifest and checks excluded canonical prefix stages. Valid
|
||||||
|
supplied transcript coverage satisfies the corresponding producer work; in that
|
||||||
|
context prepare and the independent render and extract stages do not block a
|
||||||
|
downstream selection. Other excluded stages require `succeeded` or `skipped`.
|
||||||
|
The first other status or absent record fails
|
||||||
|
the request before layout mutation, adapter initialization, session-manifest
|
||||||
|
writes, or run-directory creation. Excluded prefix records are not passed to
|
||||||
|
resume validators. Records after the selected end are not prerequisites and
|
||||||
|
may be made stale by selected work without being scheduled.
|
||||||
|
|
||||||
|
Cleanup is an ordinary selected stage. It validates recorded successful
|
||||||
|
publication evidence before deleting local run history, saves its normal stage
|
||||||
|
transition, and retries incomplete work on a later selected invocation without
|
||||||
|
republishing. Historical run-local paths in records are provenance, not a
|
||||||
|
requirement that those files remain present. See [cleanup](stage-cleanup.md).
|
||||||
|
|
||||||
|
Each invocation derives campaign, session, run, local-path, and remote-prefix
|
||||||
|
metadata from the validated resolved configuration as one projection. A persisted
|
||||||
|
session manifest must agree on campaign and session identity before execution;
|
||||||
|
the current projection is refreshed for every invocation while stage progress,
|
||||||
|
inputs, and durable artifacts remain session history.
|
||||||
|
|
||||||
|
For handled failures after the session identity transition, the runner records
|
||||||
|
the failure on the session ledger and atomically attempts its save while
|
||||||
|
preserving the originating error. Abrupt process death remains an accepted case
|
||||||
|
where the last session transition can require operator interpretation.
|
||||||
|
|
||||||
|
## Invariants
|
||||||
|
|
||||||
|
- stage resume/skip decisions are session-manifest driven.
|
||||||
|
- ordinary local semantic fingerprint comparison precedes stage-specific resume
|
||||||
|
validation; valid supplied coverage is assessed independently.
|
||||||
|
- only successful and intentional-skipped results promote current semantic
|
||||||
|
evidence.
|
||||||
|
- running, failed, and self-skipped stages do not retain result payloads from
|
||||||
|
an earlier success.
|
||||||
|
- stale stages retain prior details until replacement execution starts.
|
||||||
|
- force reruns stale succeeded stages in the fixed dependency relation.
|
||||||
|
- the session manifest is the only durable local progress ledger.
|
||||||
|
- remote commitment is established by a verified current pointer and remote
|
||||||
|
commit relationship, never by a mutable session-manifest boolean.
|
||||||
|
|
||||||
|
## Implementation And Tests
|
||||||
|
|
||||||
|
- Models and transitions: `internal/manifest/manifest.go`
|
||||||
|
- Remote commit model and readers: `internal/artifacts/remote_commit.go`,
|
||||||
|
`internal/artifacts/current_state_commit.go`,
|
||||||
|
- Persistence and validation: `internal/manifest/store.go`
|
||||||
|
- Transcribe speaker state: `internal/manifest/transcribe_state.go`
|
||||||
|
- Package tests: `internal/manifest/*_test.go`
|
||||||
|
- Assembled execution behavior: `internal/app/runner_test.go`,
|
||||||
|
`internal/app/run_selection_test.go`
|
||||||
|
|
||||||
|
## Prepared Glossary Evidence
|
||||||
|
|
||||||
|
Preparation records the party, campaign, setting, spells, and combined glossary
|
||||||
|
documents with canonical paths, checksums, sizes, and provenance. Audita's polish
|
||||||
|
request consumes the four individual envelopes. Publish includes recorded
|
||||||
|
prepared documents, and restore selects their declared immutable objects.
|
||||||
|
See [prepare](stage-prepare.md), [polish](stage-polish.md), and
|
||||||
|
[artifact internals](artifacts.md).
|
||||||
|
|||||||
155
docs/internal/overview.md
Normal file
155
docs/internal/overview.md
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
# Internal Overview
|
||||||
|
|
||||||
|
This document is the implemented component map for Narratio. Normative system
|
||||||
|
boundaries and dependency direction belong in
|
||||||
|
[Architecture](../policy/architecture.md). User and operator contracts belong
|
||||||
|
in the [CLI](../cli.md), [Configuration](../config.md),
|
||||||
|
[Operations](../operations.md), and [Troubleshooting](../troubleshooting.md).
|
||||||
|
Externally observable tool and format contracts belong under
|
||||||
|
[Integrations](../integrations/).
|
||||||
|
|
||||||
|
Configuration and CLI integration use [ConfigKit v1.4.0](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/consumers/README.md) and [CommandKit v0.8.0](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/docs/consumers/guide.md); the upstream guides
|
||||||
|
own their APIs.
|
||||||
|
|
||||||
|
## Execution Path
|
||||||
|
|
||||||
|
```text
|
||||||
|
cmd/narratio -> internal/app -> configuration and production composition
|
||||||
|
-> internal/stage -> adapters and external systems
|
||||||
|
-> manifests and artifact resolution -> durable local/remote output
|
||||||
|
```
|
||||||
|
|
||||||
|
The executable supplies signal-aware context and caller-owned streams to the
|
||||||
|
native CommandKit application boundary. The
|
||||||
|
application resolves configuration, composes concrete collaborators, acquires
|
||||||
|
session safety controls, and runs commands. Pipeline commands execute the
|
||||||
|
canonical stage sequence through adapter interfaces, while manifests record
|
||||||
|
progress and artifact services resolve durable inputs and outputs.
|
||||||
|
|
||||||
|
The pipeline runner follows one explicit invocation lifecycle: inspect bounded
|
||||||
|
prerequisites without mutation, acquire the workspace lock, prepare the workspace
|
||||||
|
layout, load or create the authoritative session manifest, complete or
|
||||||
|
reuse selected preparation, check projected downstream work, compose only the
|
||||||
|
collaborators needed by selected work, execute each selected stage in order, finalize terminal state, release resources, and return a possibly partial
|
||||||
|
summary with preserved failure causes. Narrow terminal local persistence detaches
|
||||||
|
cancellation; active work retains the canceled operation context. Cleanup, when
|
||||||
|
selected, is the ordinary final stage rather than runner finalization work.
|
||||||
|
The lock remains held from layout preparation through finalization, and a
|
||||||
|
failed stage or required manifest save prevents later stages from starting.
|
||||||
|
Standalone preflight shares that lifecycle, runs only preparation, and checks
|
||||||
|
enabled capabilities while holding the same lock.
|
||||||
|
|
||||||
|
## Components
|
||||||
|
|
||||||
|
| Area | Implemented owners | Responsibility |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Executable | `cmd/narratio` | Process entry, standard stream wiring, argument handoff, and exit status. |
|
||||||
|
| Application orchestration | `internal/app` | Native CommandKit declarations/reporting, lazy configuration selection, ConfigKit startup invocation, production composition, workspace locking, planning, execution, restore, and user-facing reporting. |
|
||||||
|
| Configuration | [`internal/config`](configuration.md) | Typed ConfigKit results and lifecycle defaults, imports/overlays, canonical party loading, separate catalog/player/publication derivation, session templating, and validation. |
|
||||||
|
| Pipeline stages | `internal/stage` | Canonical stage registry, shared stage contract, execution dependencies, and implemented stage behavior. |
|
||||||
|
| Glossaries | `internal/glossary` | Native vocabulary resolution, schema validation, party projection, and deterministic documents. |
|
||||||
|
| Downstream preflight | [`internal/preflight`](preflight.md) | Assess Audita, Notarius, and prompt requirements for execution and standalone preflight. |
|
||||||
|
| External boundaries | `internal/adapters`, `internal/audio` | WhisperX HTTP, downstream subprocesses, notification, object storage, and S3 audio materialization behind Narratio contracts. |
|
||||||
|
| Manifests | `internal/manifest` | Durable session progress, stage transitions, validation, and atomic persistence. |
|
||||||
|
| Artifacts and paths | `internal/artifacts`, `internal/pathsafe` | Artifact identities and resolution, local and remote path/key models, current-state discovery, and confined relative destinations. |
|
||||||
|
| Previous-session cache | `internal/previouscache` | Deterministic planning and materialization requirements for configured previous-session inputs. |
|
||||||
|
| Artifact dependencies | `internal/artifactdeps` | Immutable configured-artifact dependency ordering, closure, and dependent traversal. |
|
||||||
|
| Artifact policy | `internal/artifactpolicy` | Source and destination policy, configured artifact identity validation, and publish destination safety. |
|
||||||
|
| Shared models and file operations | `internal/artifactmodel`, `internal/contracts`, [`internal/fileops`](fileops.md) | Transcript and artifact data contracts plus atomic single-file replacement, bounded reads, workspace modes, and root-scoped cleanup helpers. |
|
||||||
|
| Logging | `internal/logging` | Small Narratio-owned diagnostic/progress interface adapted to the invocation reporter. |
|
||||||
|
|
||||||
|
The application boundary composes concrete implementations. Stages depend on
|
||||||
|
Narratio-level contracts; external transport and SDK details remain in
|
||||||
|
adapters. The normative rules for these relationships remain in
|
||||||
|
[Architecture](../policy/architecture.md).
|
||||||
|
|
||||||
|
Command execution normalizes one private dependency value per invocation.
|
||||||
|
Pipeline configuration-path discovery, configuration reads, secret-directory
|
||||||
|
reads, remote downloads, object-store construction, and restore phase functions
|
||||||
|
use that value throughout the command. Public command entry points supply the
|
||||||
|
canonical discovery and production defaults, while focused tests may provide
|
||||||
|
invocation-owned discovery candidates or replace only the external or sequencing
|
||||||
|
boundary they exercise without mutating package state.
|
||||||
|
|
||||||
|
Pipeline execution and `session plan` share the same inclusive contiguous-range
|
||||||
|
model and the same pure pre-execution decision over recorded status, force, and
|
||||||
|
normalized resume validation. Planning applies that decision and modeled
|
||||||
|
selected-stage transitions to cloned session state; it does not persist, create
|
||||||
|
invocation state, initialize stage-execution adapters, or claim to observe an
|
||||||
|
execution result. For eligible S3 preparation reuse, the projection receives a
|
||||||
|
read-only object-store collaborator for the shared resume validator. Command
|
||||||
|
configuration loading can still retrieve a missing session file through
|
||||||
|
configured remote storage. It retains the initially
|
||||||
|
composed pipeline and selected campaign while resolving either a local or
|
||||||
|
downloaded remote session, so one invocation cannot mix pipeline revisions.
|
||||||
|
Analyze planning additionally exposes the artifact closure's targets,
|
||||||
|
prerequisite rebuilds, execution order, and current reuse.
|
||||||
|
|
||||||
|
## Pipeline Stage Set
|
||||||
|
|
||||||
|
The implemented canonical order is:
|
||||||
|
|
||||||
|
1. [`prepare`](stage-prepare.md)
|
||||||
|
2. [`transcribe`](stage-transcribe.md)
|
||||||
|
3. [`merge`](stage-merge.md)
|
||||||
|
4. [`polish`](stage-polish.md)
|
||||||
|
5. [`normalize`](stage-normalize.md)
|
||||||
|
6. [`trim`](stage-trim.md)
|
||||||
|
7. [`render`](stage-render.md)
|
||||||
|
8. [`extract`](stage-extract.md)
|
||||||
|
9. [`analyze`](stage-analyze.md)
|
||||||
|
10. [`publish`](stage-publish.md)
|
||||||
|
11. `notify` (no-op)
|
||||||
|
12. [`cleanup`](stage-cleanup.md)
|
||||||
|
|
||||||
|
`notify` currently has no persisted pipeline outputs and uses the explicit
|
||||||
|
`noop` notification mode. Its versioned semantic evidence records that delivery
|
||||||
|
mode and excludes adapter credentials and response data. The focused stage
|
||||||
|
documents own implementation mechanics. The
|
||||||
|
[CLI](../cli.md) and [Operations](../operations.md) own user-visible invocation
|
||||||
|
and execution semantics.
|
||||||
|
|
||||||
|
Execution order and invalidation are separate application contracts. The stage
|
||||||
|
registry owns the flat execution sequence. The application orchestration owner
|
||||||
|
uses a fixed, validated dependency relation to find transitive dependents in
|
||||||
|
canonical order. In particular, `render` and `extract` are sibling consumers of
|
||||||
|
trimmed transcript state: neither invalidates the other, while either can stale
|
||||||
|
`analyze`, `publish`, `notify`, and `cleanup`. Cleanup is a dependent of notify,
|
||||||
|
so any earlier replacement can stale a prior cleanup result.
|
||||||
|
|
||||||
|
## Focused Documentation
|
||||||
|
|
||||||
|
- [Configuration Internals](configuration.md): pipeline imports and overlays,
|
||||||
|
field ownership, decoding, and source-relative resource semantics.
|
||||||
|
- [Adapter Internals](adapters.md): external adapter boundaries, composition,
|
||||||
|
failure behavior, and test surfaces.
|
||||||
|
- [Preflight Internals](preflight.md): projected target selection and shared
|
||||||
|
requirements assessment and standalone preparation.
|
||||||
|
- [Artifact Internals](artifacts.md): source identities, runtime catalog,
|
||||||
|
resolution, previous requirements, and current-state helpers.
|
||||||
|
- [Manifest Internals](manifest.md): session records, persistence, and execution
|
||||||
|
transitions.
|
||||||
|
- [Storage Internals](storage.md): object-store interface and S3 behavior.
|
||||||
|
- [Workspace Internals](workspace.md): local layout, locking, and cleanup
|
||||||
|
guardrails.
|
||||||
|
- [Restore Internals](command-restore.md): discovery, planning, execution, and
|
||||||
|
reporting.
|
||||||
|
- [`prepare`](stage-prepare.md)
|
||||||
|
- [`transcribe`](stage-transcribe.md)
|
||||||
|
- [`merge`](stage-merge.md)
|
||||||
|
- [`polish`](stage-polish.md)
|
||||||
|
- [`normalize`](stage-normalize.md)
|
||||||
|
- [`trim`](stage-trim.md)
|
||||||
|
- [`render`](stage-render.md)
|
||||||
|
- [`extract`](stage-extract.md)
|
||||||
|
- [`analyze`](stage-analyze.md)
|
||||||
|
- [`publish`](stage-publish.md)
|
||||||
|
- [`cleanup`](stage-cleanup.md)
|
||||||
|
|
||||||
|
Use this map to find an owner, then read its focused documentation and tests
|
||||||
|
before changing behavior.
|
||||||
|
|
||||||
|
The stage registry is implemented in `internal/stage/placeholders.go` and its
|
||||||
|
ordering is protected by `internal/app/planner_test.go`. Cross-invocation skip,
|
||||||
|
force, failure, and invalidation behavior is exercised in
|
||||||
|
`internal/app/runner_test.go` and `internal/app/run_selection_test.go`.
|
||||||
52
docs/internal/preflight.md
Normal file
52
docs/internal/preflight.md
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# Internal: Downstream Preflight
|
||||||
|
|
||||||
|
The application runs automatic downstream checks after selected preparation and
|
||||||
|
before selected processing. It projects remaining work against a clone of the
|
||||||
|
locked manifest, using the stage decisions and analysis planner shared with
|
||||||
|
`session plan`. Projected polish selects Audita; projected enabled extraction
|
||||||
|
selects Notarius; projected trim and analysis select Scriptorium requirements.
|
||||||
|
A projection is not an execution commitment, and an empty target set invokes no
|
||||||
|
checker.
|
||||||
|
|
||||||
|
Standalone `preflight` acquires configuration once and uses the runner's locked
|
||||||
|
invocation lifecycle to execute or reuse `prepare`. Within that same lock it
|
||||||
|
selects all enabled capabilities and prompt prerequisites regardless of reuse,
|
||||||
|
then invokes the shared downstream request builders and checkers. A preparation
|
||||||
|
failure blocks probes requiring prepared inputs but permits independent prompt
|
||||||
|
and remote-lock inspection while the context remains active. Preparation success
|
||||||
|
is persisted even when later readiness fails; readiness itself creates no stage
|
||||||
|
or reusable success record.
|
||||||
|
|
||||||
|
The composed store is passed to the shared preparation validator. If source
|
||||||
|
inspection fails, preparation attempts the ordinary rerun, and its report retains
|
||||||
|
the unverified-source reason alongside any resulting preparation failure.
|
||||||
|
|
||||||
|
Shared finalization retains terminal manifest evidence while locked. Normal
|
||||||
|
pipeline execution projects that evidence into its run-artifact inventory;
|
||||||
|
standalone preflight returns its readiness report without building that inventory.
|
||||||
|
|
||||||
|
Audita receives verified prepared glossary files and production selections with
|
||||||
|
an embedded synthetic transcript. Its adapter performs native provider smoke
|
||||||
|
checks and retains failure causes. Notarius receives production controls and
|
||||||
|
verified reference snapshots, which are checked again after its native call.
|
||||||
|
The application projects transcript-producing work before allowing a verified
|
||||||
|
current transcript; otherwise it reports the synthetic fallback. Neither probe
|
||||||
|
publishes work, and the synthetic input cannot establish real-transcript
|
||||||
|
feasibility or editorial quality.
|
||||||
|
|
||||||
|
Scriptorium input-map keys remain binding names distinct from Narratio source
|
||||||
|
IDs. Missing required bindings or variables and inspection failures are errors;
|
||||||
|
optional sources for required inputs, conditional requirements, incomplete
|
||||||
|
discovery, and discovery issues produce warnings. Findings survive independent
|
||||||
|
failures and cancellation stops new work. Each report is interpreted by a pure
|
||||||
|
assessment; the surrounding loop owns provider calls and ordered failure handling.
|
||||||
|
Tool-specific readiness operations retain initialized adapters on the invocation;
|
||||||
|
preparation and transcript projection are assessed before report presentation.
|
||||||
|
|
||||||
|
Probe files use invocation-scoped destinations under `runs/`, protected by the
|
||||||
|
workspace lock through report consumption, reference verification, and terminal
|
||||||
|
persistence. A later authorized cleanup can remove those files without removing
|
||||||
|
durable prepared inputs. See [workspace internals](workspace.md),
|
||||||
|
[CLI](../cli.md#preflight), and [operations](../operations.md#prompt-requirements-preflight).
|
||||||
|
Implementation is in `internal/preflight`, `internal/app/downstream_readiness.go`,
|
||||||
|
`internal/app/runner_preflight.go`, and `internal/app/session_readiness.go`.
|
||||||
@@ -1,84 +1,226 @@
|
|||||||
# Stage: analyze
|
# Stage: analyze
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
Execute selected configured Scriptorium artifacts in deterministic dependency order and promote successful outputs to canonical session artifact paths.
|
|
||||||
|
|
||||||
## Inputs and Outputs
|
Reconcile configured Scriptorium artifacts, execute only required work in
|
||||||
Inputs:
|
dependency order, and safely materialize validated outputs.
|
||||||
- configured artifact definitions from `pipeline.scriptorium.artifacts`
|
|
||||||
- selected artifact filter from runtime (`--artifacts`) when provided
|
|
||||||
- resolved artifact input sources declared per artifact (`inputs.*.source`)
|
|
||||||
- optional previous-session file inputs (`previous_session_artifact`)
|
|
||||||
|
|
||||||
Outputs:
|
## Inputs
|
||||||
- one promoted output file per executed configured artifact at that artifact's configured `output_path`
|
|
||||||
- stage metadata containing generated artifact entries and reused disabled-artifact entries
|
|
||||||
|
|
||||||
## Boundaries
|
- ordinary configured artifacts from `pipeline.scriptorium.artifacts`; canonical
|
||||||
Owns:
|
party artifact families have already expanded into this map during
|
||||||
- runtime artifact catalog construction for analyze execution
|
configuration resolution, including corresponding member dependencies and
|
||||||
- selected-artifact planning and dependency ordering
|
rewritten member-artifact input sources. Each artifact's dependency list is
|
||||||
- per-artifact input resolution, var resolution, timeout/render-debug resolution
|
already the normalized union of explicit ordering edges and configured-artifact
|
||||||
- Scriptorium run/render invocation for each selected artifact
|
input edges.
|
||||||
- run-local output generation and canonical promotion
|
- optional selected artifact keys supplied through the stage environment
|
||||||
|
- built-in, configured, extraction, and previous-session source references in
|
||||||
|
artifact inputs
|
||||||
|
|
||||||
Does not own:
|
Supported source families:
|
||||||
- transcript generation/processing stages
|
- built-ins: `narratio.transcript.*`, `narratio.bounds.session`
|
||||||
- archive promotion policy
|
- prepared stable inputs: `narratio.input.players`, `narratio.input.party`,
|
||||||
- per-artifact resume semantics
|
`narratio.input.glossary.{party,campaign,setting,spells,combined}`
|
||||||
|
- configured artifacts: `narratio.artifact.<key>`
|
||||||
|
- extraction lanes: `narratio.extraction.<key>`
|
||||||
|
- previous-session cache: `narratio.previous_session.artifact.<key>`
|
||||||
|
|
||||||
## Config Fields Used
|
## Outputs
|
||||||
- `session.session_id`
|
|
||||||
- `session.campaign`
|
|
||||||
- `pipeline.workspace.root`
|
|
||||||
- `pipeline.scriptorium.binary`
|
|
||||||
- `pipeline.scriptorium.config_path`
|
|
||||||
- `pipeline.scriptorium.timeout`
|
|
||||||
- `pipeline.scriptorium.render_debug`
|
|
||||||
- `pipeline.scriptorium.artifacts.<name>.*`
|
|
||||||
- `enabled`
|
|
||||||
- `depends_on`
|
|
||||||
- `prompt_id`
|
|
||||||
- `profile_id`
|
|
||||||
- `timeout`
|
|
||||||
- `output_path`
|
|
||||||
- `render_debug`
|
|
||||||
- `inputs`
|
|
||||||
- `vars`
|
|
||||||
|
|
||||||
## External Adapters Used
|
- one current per-artifact manifest record per validated materialized output
|
||||||
- Scriptorium adapter:
|
- stage metadata describing selected/generated/reused artifacts
|
||||||
- optional `RenderArtifact` (render debug)
|
|
||||||
- `RunArtifact` (artifact generation)
|
|
||||||
|
|
||||||
## State and Manifest Behavior
|
## Key Behavior
|
||||||
- If `pipeline.scriptorium` is absent, stage returns success metadata with `skipped=true`.
|
|
||||||
- If no artifacts are configured, stage returns success metadata with `skipped=true`.
|
|
||||||
- If zero artifacts are executable after `enabled` + `--artifacts` filtering, stage returns success metadata with `skipped=true`.
|
|
||||||
- Builds runtime catalog with built-ins and configured artifacts.
|
|
||||||
- Non-executable configured artifacts are marked available only when their configured output file exists and is valid on disk.
|
|
||||||
- Executes selected configured artifacts in topological order with deterministic tie-breaking.
|
|
||||||
- For each generated artifact, records metadata fields including `name`, `source_id`, `output_kind`, `path`, `prompt_id`, `profile_id`, and `provenance`.
|
|
||||||
- Reused disabled artifacts are recorded separately in `reused_artifacts` with provenance `filesystem.disabled_artifact_output`.
|
|
||||||
|
|
||||||
## Skip and Resume Behavior
|
- when `pipeline.scriptorium` is absent or no configured artifact is
|
||||||
- Runner-level skip applies when analyze is already `succeeded` and `--force` is not set.
|
executable, completes successfully and records explanatory metadata. Before
|
||||||
- Analyze remains stage-scoped for resume/skip; there is no per-artifact resume state.
|
returning, it reconciles and checkpoints the complete session collection:
|
||||||
- `--artifacts` filters which configured artifacts are executable when analyze runs; it does not imply `--force`.
|
records removed from configuration are dropped, while valid records for
|
||||||
|
configured but unselected artifacts remain authoritative. This is not an
|
||||||
|
explicit self-skip: the session manifest records success, satisfies publish's
|
||||||
|
prerequisite, and an ordinary later run reuses the result while the effective
|
||||||
|
set remains empty. Enabling or selecting an artifact later makes missing
|
||||||
|
versioned evidence non-resumable and schedules it without requiring force.
|
||||||
|
- builds a runtime artifact catalog containing built-ins, configured artifacts,
|
||||||
|
and configured extraction lanes. Extraction availability is hydrated only
|
||||||
|
from compatible successful extraction evidence.
|
||||||
|
- uses enabled configured artifacts by default. An explicit `--artifacts`
|
||||||
|
selection is a one-invocation override that makes exactly the named
|
||||||
|
configured artifacts explicit targets even when disabled. The work planner
|
||||||
|
adds required configured prerequisites, reuses current ones, and schedules
|
||||||
|
stale, missing, or otherwise non-current prerequisites before dependents.
|
||||||
|
- makes a non-executable configured artifact reusable only when its current
|
||||||
|
manifest record and durable output pass the configured-artifact evidence
|
||||||
|
contract; an incidental or stale canonical file is unavailable.
|
||||||
|
- uses the shared artifact closure and cycle-safe dependency ordering described in
|
||||||
|
[Artifact Internals](artifacts.md#previous-requirement-collection).
|
||||||
|
- consumes only the concrete dependency graph derived in the shared domain catalog;
|
||||||
|
planning, prerequisite closure, execution, reuse, invalidation, and semantic
|
||||||
|
evidence do not infer a second graph from inputs.
|
||||||
|
- resolves required/optional inputs per artifact source definition into an
|
||||||
|
ordered semantic identity. Each identity records the configured input name,
|
||||||
|
canonical source ID, required policy, explicit presence, source contract,
|
||||||
|
checksum, size, and a source-based logical identity. Workspace paths and
|
||||||
|
producer run IDs are excluded.
|
||||||
|
- orders input identities by configured input name independently of Go map
|
||||||
|
iteration. Runtime adapter paths remain a separate execution-only map.
|
||||||
|
- omits an unavailable optional input from the adapter request while retaining
|
||||||
|
explicit absence in its semantic identity; an unavailable required input
|
||||||
|
fails.
|
||||||
|
- resolves prepared stable input sources through the shared manifest-authoritative
|
||||||
|
identity resolver; it does not accept incidental files or fall back to
|
||||||
|
campaign/session source paths.
|
||||||
|
- reuses checksums and sizes from validated prepared, extraction, and current
|
||||||
|
configured-artifact evidence. Other resolved inputs are hashed as confined
|
||||||
|
regular files with streaming reads and the central resolved-artifact size
|
||||||
|
limit.
|
||||||
|
- owns a versioned SHA-256 fingerprint contract with one fixed-field canonical
|
||||||
|
JSON payload and no map serialization. Configured artifacts are fingerprinted
|
||||||
|
in deterministic dependency order.
|
||||||
|
- fingerprints the normalized artifact key, prompt and profile identifiers,
|
||||||
|
session-relative output identity, sorted
|
||||||
|
dependency keys, ordered input declarations and semantic identities,
|
||||||
|
validated current dependency-output identities, and sorted effective
|
||||||
|
Scriptorium variables (including Narratio's sticky session variable).
|
||||||
|
Render-debug is diagnostic and does not affect the fingerprint.
|
||||||
|
- provides read-only reconciliation that classifies each configured record as
|
||||||
|
supplied, current, stale, missing, failed, or otherwise non-resumable, and
|
||||||
|
separately identifies manifest records removed from current configuration.
|
||||||
|
A record is current only when its fingerprint version and value match and its
|
||||||
|
configured output still passes manifest-authoritative evidence validation.
|
||||||
|
A valid supplied product is classified first and does not need its historical
|
||||||
|
generation inputs or fingerprint.
|
||||||
|
- owns a read-only typed work planner. Its explicit targets are enabled
|
||||||
|
artifacts by default or the exact normalized `--artifacts` selection when
|
||||||
|
supplied. It closes targets over configured prerequisites, stopping at valid
|
||||||
|
supplied products unless they are explicit forced targets. It orders the work
|
||||||
|
topologically, reuses current or supplied members, and schedules non-current
|
||||||
|
members before their dependents.
|
||||||
|
- force applies only to explicit targets. A current prerequisite is reused
|
||||||
|
unless it is itself an explicit forced target; disabled prerequisites may be
|
||||||
|
rebuilt when required, while unrelated disabled artifacts are excluded.
|
||||||
|
- the work plan carries explicit targets, prerequisite-only work, deterministic
|
||||||
|
execution and reuse lists, invalidated and removed records, and a cloned
|
||||||
|
reconciled starting collection. Valid unrelated configured records survive
|
||||||
|
reconciliation, removed records are omitted, and incidental files never
|
||||||
|
become current without manifest-backed regeneration.
|
||||||
|
- implements aggregate resume validation by running the same read-only catalog,
|
||||||
|
fingerprint reconciliation, and work planner used by execution. A succeeded
|
||||||
|
aggregate record is reusable exactly when the selected closure schedules no
|
||||||
|
artifact work and no removed configuration records require a checkpoint;
|
||||||
|
stale unrelated records do not block a partial selection.
|
||||||
|
- exposes the typed artifact decision to `session plan`. Planning applies it to
|
||||||
|
a cloned manifest after modeling earlier selected stage transitions, so
|
||||||
|
aggregate run/skip and artifact execute/reuse decisions match the ordinary
|
||||||
|
runner without creating durable state or invoking Scriptorium.
|
||||||
|
- executes only the work plan's scheduled entries. Manifest-validated current
|
||||||
|
prerequisites remain available through the runtime catalog without invoking
|
||||||
|
Scriptorium; newly produced prerequisites enter that catalog with the same
|
||||||
|
contract, checksum, and size identity used for persisted current evidence.
|
||||||
|
- before the first adapter call, checkpoints the reconciled starting collection
|
||||||
|
when it removed configuration records or cleared obsolete authority. A
|
||||||
|
scheduled replacement retires its supplied record in this checkpoint, so a
|
||||||
|
failed attempt cannot revive the old supplied product. After
|
||||||
|
each successful artifact, checkpoints the complete collection before making
|
||||||
|
that artifact available to the next scheduled dependent. Analyze supplies
|
||||||
|
its typed update to the shared
|
||||||
|
[checkpoint persistence boundary](manifest.md#checkpoint-persistence-boundary)
|
||||||
|
and refreshes its working and committed collections only after the save
|
||||||
|
succeeds.
|
||||||
|
- keeps adapter output in the invocation's run-local analyze directory until
|
||||||
|
it is a safe, non-empty, bounded regular file with a calculated checksum and
|
||||||
|
complete output contract. Canonical replacement uses the shared atomic file
|
||||||
|
operation boundary and verifies that the installed checksum matches the
|
||||||
|
validated run-local bytes.
|
||||||
|
- records each successful artifact's freshly computed fingerprint, canonical
|
||||||
|
relative output path, contract, checksum, size, producer run ID, bounded
|
||||||
|
Scriptorium provenance, logs, and generated configuration references in the
|
||||||
|
analyze-owned manifest collection.
|
||||||
|
- preserves valid unrelated current records during partial execution. If a
|
||||||
|
rebuilt output's bytes and contract are unchanged, unselected dependents may
|
||||||
|
remain current. If that semantic identity changes, unselected transitive
|
||||||
|
dependents become stale without being executed; dependents included in the
|
||||||
|
invocation are evaluated in dependency order instead.
|
||||||
|
- returns aggregate outputs from every current session record in normalized-key
|
||||||
|
order after the complete reconciled collection has been checkpointed;
|
||||||
|
unrelated stale records do not make an otherwise successful partial
|
||||||
|
invocation fail.
|
||||||
|
- resolves previous-session sources from manifest-backed local `previous/` cache
|
||||||
|
only; preparation collects requirements for the selected prerequisite closure.
|
||||||
|
- runs optional render-debug, then artifact execution.
|
||||||
|
- validates non-empty output files and materializes canonical outputs.
|
||||||
|
- shares effective prompt context and variables with requirements inspection;
|
||||||
|
preview and generation capture their own results separately from stderr logs.
|
||||||
|
Application preflight selects projected work through the same planner; see
|
||||||
|
[preflight internals](preflight.md).
|
||||||
|
|
||||||
## Failure Behavior
|
## Failure Semantics
|
||||||
- Fails on invalid dependency ordering, unavailable required configured inputs, invalid built-in input prerequisites, render/run adapter failures, validation-failed adapter results, or missing/empty outputs.
|
|
||||||
- Required configured dependency missing from catalog availability fails clearly before invocation.
|
|
||||||
- Optional missing inputs are omitted.
|
|
||||||
|
|
||||||
## Tests to Inspect Before Changing
|
- required missing configured/previous-session inputs fail.
|
||||||
- `internal/stage/analyze_test.go`
|
- missing required prepared stable input source includes prepare rerun guidance.
|
||||||
- `internal/artifacts/catalog_test.go`
|
- missing required previous-session source includes prepare rerun guidance.
|
||||||
- `internal/artifacts/artifact_resolver_test.go`
|
- missing required `narratio.transcript.final_markdown` or
|
||||||
- `internal/adapters/scriptorium/subprocess_test.go`
|
`narratio.transcript.final_trimmed_markdown` inputs includes render rerun
|
||||||
|
guidance.
|
||||||
|
- dependency cycles or unavailable required dependencies fail.
|
||||||
|
- adapter validation failures fail stage.
|
||||||
|
- a scheduled artifact failure installs a retry collection on the live manifest
|
||||||
|
with the active artifact marked `failed`, a bounded error, and no output
|
||||||
|
authority. Current transitive dependents become stale without execution.
|
||||||
|
- earlier artifacts remain current only after their run-local output passed
|
||||||
|
validation, canonical materialization, and a successful complete-collection
|
||||||
|
manifest checkpoint; unattempted later artifacts retain their reconciled
|
||||||
|
session state.
|
||||||
|
- unrelated current records survive a partial failure. Old canonical bytes for
|
||||||
|
the failed artifact and newly materialized bytes whose checkpoint fails are
|
||||||
|
incidental, not current evidence.
|
||||||
|
- a checkpoint failure stops the queue immediately. The in-memory retry
|
||||||
|
collection starts from the last successful checkpoint, marks the active
|
||||||
|
artifact failed without output authority, and stales its current transitive
|
||||||
|
dependents.
|
||||||
|
- the runner's ordinary error path marks aggregate analyze failed, clears its
|
||||||
|
aggregate outputs, invalidates publish, notify, and cleanup through the
|
||||||
|
application dependency relation, and persists the live retry collection.
|
||||||
|
Terminal-save errors are joined with the original artifact or checkpoint
|
||||||
|
failure.
|
||||||
|
|
||||||
## Architectural Invariants
|
## Invariants
|
||||||
- Configured artifacts are identified by `narratio.artifact.<name>` source IDs.
|
|
||||||
- Artifact-to-artifact references rely on explicit `depends_on` declarations validated in config.
|
- `analyze` performs no remote storage calls for previous-session source resolution.
|
||||||
- Generated analyze outputs are treated uniformly as Scriptorium artifacts.
|
- input-identity resolution is read-only: it does not invoke adapters,
|
||||||
- Successful outputs must exist and be non-empty before promotion.
|
materialize outputs, update status, or create run-local files.
|
||||||
|
- fingerprints exclude timeouts, retries, timestamps, producer and Narratio run
|
||||||
|
IDs, executable and config paths, workspace roots, diagnostic locations, and
|
||||||
|
executable or private transitive configuration contents. A change that is
|
||||||
|
visible only inside Scriptorium—such as a file privately loaded by its config
|
||||||
|
path—requires an explicit forced regeneration.
|
||||||
|
- output provenance and metadata are deterministic per execution.
|
||||||
|
- a canonical file without current per-artifact evidence or a validated
|
||||||
|
supplied-product record is never promoted to current state.
|
||||||
|
- an ordinary retry after interruption or partial failure reuses every valid
|
||||||
|
earlier checkpoint and schedules only failed, stale, missing, or otherwise
|
||||||
|
non-current work in dependency order.
|
||||||
|
|
||||||
|
## Related Contracts And Tests
|
||||||
|
|
||||||
|
- [Configuration](../config.md#scriptorium-artifact-entries) owns artifact
|
||||||
|
fields and source-selection rules, including
|
||||||
|
[artifact families](../config.md#scriptorium-artifact-families).
|
||||||
|
- [CLI](../cli.md) owns user-visible artifact selection.
|
||||||
|
- [Scriptorium](../integrations/scriptorium.md) owns the subprocess contract.
|
||||||
|
- Implementation and tests: `internal/stage/analyze.go`,
|
||||||
|
`internal/stage/analyze_artifact_execution.go`,
|
||||||
|
`internal/stage/analyze_execution_state.go`,
|
||||||
|
`internal/stage/analyze_input_identity.go`,
|
||||||
|
`internal/stage/analyze_fingerprint.go`,
|
||||||
|
`internal/stage/analyze_reconciliation.go`, `internal/stage/analyze_plan.go`,
|
||||||
|
`internal/stage/analyze_resume.go`, `internal/stage/analyze_test.go`,
|
||||||
|
`internal/stage/analyze_checkpoint_test.go`,
|
||||||
|
`internal/stage/analyze_input_identity_test.go`,
|
||||||
|
`internal/stage/analyze_fingerprint_test.go`,
|
||||||
|
`internal/stage/analyze_reconciliation_test.go`,
|
||||||
|
`internal/stage/analyze_plan_test.go`,
|
||||||
|
`internal/stage/analyze_incremental_execution_test.go`,
|
||||||
|
`internal/stage/analyze_failure_test.go`,
|
||||||
|
`internal/stage/analyze_resume_test.go`, and
|
||||||
|
`internal/app/analyze_checkpoint_recovery_test.go`.
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
# Stage: archive
|
|
||||||
|
|
||||||
## Purpose
|
|
||||||
Publish run records and promoted session artifacts to object storage, then atomically advance the remote current pointer.
|
|
||||||
|
|
||||||
## Inputs and Outputs
|
|
||||||
Inputs:
|
|
||||||
- session manifest and prerequisite stage records
|
|
||||||
- run root contents under `runs/{run_id}/`
|
|
||||||
- promotion rules with artifact `source` IDs and archive `dest` paths (`archive.promote_artifacts`)
|
|
||||||
|
|
||||||
Outputs:
|
|
||||||
- uploaded run files under `{session_prefix}/runs/{run_id}/...`
|
|
||||||
- uploaded promoted artifacts under `{session_prefix}/...`
|
|
||||||
- `{session_prefix}/current/manifest.json`
|
|
||||||
- `{session_prefix}/current/run_id.txt` written last
|
|
||||||
|
|
||||||
## Boundaries
|
|
||||||
Owns:
|
|
||||||
- Archive enable/disable gate behavior
|
|
||||||
- Prerequisite stage success enforcement
|
|
||||||
- Run file collection and upload (excluding `audio/`)
|
|
||||||
- Promotion rule resolution and upload
|
|
||||||
- Commit pointer publish order
|
|
||||||
|
|
||||||
Does not own:
|
|
||||||
- Stage execution before archive
|
|
||||||
- Post-archive local cleanup policy execution (handled by app cleanup logic)
|
|
||||||
|
|
||||||
## Config Fields Used
|
|
||||||
- `pipeline.archive.enabled`
|
|
||||||
- `pipeline.archive.upload_run`
|
|
||||||
- `pipeline.archive.promote_artifacts`
|
|
||||||
- `pipeline.storage.s3.bucket`
|
|
||||||
- `pipeline.storage.s3.root_prefix`
|
|
||||||
- `pipeline.workspace.root`
|
|
||||||
- `session.campaign`
|
|
||||||
- `session.session_id`
|
|
||||||
|
|
||||||
## External Adapters Used
|
|
||||||
- Object storage backend (`env.ObjectStore`) for upload/list primitives.
|
|
||||||
|
|
||||||
## State and Manifest Behavior
|
|
||||||
- Requires `prepare`, `transcribe`, `merge`, `polish`, `normalize`, `trim`, and `analyze` status `succeeded`.
|
|
||||||
- Resolves bucket/prefix from manifest identity first, then config fallback.
|
|
||||||
- Writes metadata including:
|
|
||||||
- upload counts/paths
|
|
||||||
- `current_manifest_key`
|
|
||||||
- `current_run_id_key`
|
|
||||||
- `current_pointer_written`
|
|
||||||
- On skipped archive path, returns metadata with `skipped=true` and pointer not written.
|
|
||||||
|
|
||||||
## Skip and Resume Behavior
|
|
||||||
- Stage may self-skip (metadata skip) when archive disabled or run upload disabled.
|
|
||||||
- Runner-level skip also applies for previously succeeded stage unless forced.
|
|
||||||
|
|
||||||
## Failure Behavior
|
|
||||||
- Fails on missing prerequisite success, missing object store when required, missing run root, missing required promotion source, upload failures, or pointer write failures.
|
|
||||||
- Pointer semantics are fail-safe: `current/run_id.txt` is not written if prior required uploads fail.
|
|
||||||
|
|
||||||
## Tests to Inspect Before Changing
|
|
||||||
- `internal/stage/archive_test.go`
|
|
||||||
- `internal/app/post_archive_cleanup_test.go`
|
|
||||||
|
|
||||||
## Architectural Invariants
|
|
||||||
- Run upload excludes `audio/` subtree.
|
|
||||||
- `current/manifest.json` uploads before `current/run_id.txt`.
|
|
||||||
- `current/run_id.txt` is the remote publish commit marker.
|
|
||||||
28
docs/internal/stage-cleanup.md
Normal file
28
docs/internal/stage-cleanup.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# Stage: cleanup
|
||||||
|
|
||||||
|
## Purpose And Authorization
|
||||||
|
|
||||||
|
The final selected cleanup stage removes local run history after successful
|
||||||
|
publication when `workspace.cleanup_after_publish` is enabled. It validates the
|
||||||
|
published run, commit and pointer evidence and configured campaign/session
|
||||||
|
identity. Explicit whole-session cleanup is a separate operator action.
|
||||||
|
|
||||||
|
## Execution And Resume
|
||||||
|
|
||||||
|
Cleanup removes recognized managed stage and restore log/debug links without
|
||||||
|
following them, then deletes the selected session's entire `runs/` directory
|
||||||
|
through a confined workspace root. Missing runs and links are successful;
|
||||||
|
unsafe paths and managed-name conflicts fail. Subprocess state, caches, durable
|
||||||
|
session products and remote objects are outside its scope.
|
||||||
|
|
||||||
|
Resume inspects both the runs directory and managed views without mutation. An
|
||||||
|
empty runs directory, a new attempt, or a dangling managed view requires cleanup
|
||||||
|
again. Deletion is not transactional: a failure can leave partial progress and
|
||||||
|
is recorded as a failed stage. A later selected cleanup retries without another
|
||||||
|
publish. See [operations](../operations.md#cleanup).
|
||||||
|
|
||||||
|
## Implementation And Tests
|
||||||
|
|
||||||
|
`internal/stage/cleanup_plan.go`, `cleanup.go`, `internal/fileops/cleanup.go`,
|
||||||
|
`internal/artifacts/attempt_views.go`, and their tests own authorization, inspection, managed view
|
||||||
|
removal and confined deletion.
|
||||||
52
docs/internal/stage-extract.md
Normal file
52
docs/internal/stage-extract.md
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# Internal: Extract Stage
|
||||||
|
|
||||||
|
## Responsibility
|
||||||
|
|
||||||
|
The extract stage invokes the configured Notarius pipeline on the verified
|
||||||
|
final trimmed transcript and prepared references, promotes configured lane
|
||||||
|
products, and records Narratio-owned content evidence. Notarius owns its
|
||||||
|
pipeline, cache, validation and completion protocol; see the
|
||||||
|
[integration contract](../integrations/notarius.md).
|
||||||
|
|
||||||
|
## Lifecycle
|
||||||
|
|
||||||
|
Disabled extraction records a skip. An execution resolves manifest-backed input
|
||||||
|
identities, creates immutable content-addressed reference snapshots, and invokes
|
||||||
|
Notarius with run-local output, log and debug destinations. Execution and
|
||||||
|
readiness share resolved binary, configuration, credential, timeout and cache
|
||||||
|
options while retaining their own input and diagnostic paths. The adapter accepts a
|
||||||
|
successful native completion report for the expected pipeline and confined output
|
||||||
|
directory. The stage reads each configured lane JSON, validates its safe path and
|
||||||
|
content, then promotes all required products to flat artifact paths before
|
||||||
|
recording success. The original bundle and optional domain auxiliaries stay in
|
||||||
|
the producing run until authorized cleanup removes run history. Positive native
|
||||||
|
fallback counts are recorded and reported. `internal/artifacts` owns the typed
|
||||||
|
metadata codecs shared by extraction, evidence hydration, resume, and fallback
|
||||||
|
reporting.
|
||||||
|
|
||||||
|
An imported lane is individually available from its validated supplied record
|
||||||
|
without historical Notarius metadata. Extraction is satisfied by supplied
|
||||||
|
products only when all configured lanes are available. Executing a missing
|
||||||
|
bundle regenerates the complete configured set and retires its supplied records.
|
||||||
|
|
||||||
|
## Resume Validation
|
||||||
|
|
||||||
|
Resume checks the direct transcript identity, configured pipeline and lane
|
||||||
|
selection, reference identities, and manifest-backed output checksums and sizes.
|
||||||
|
It does not reopen the original bundle or completion report.
|
||||||
|
Cache and debug selection, executable version and private downstream config are
|
||||||
|
not blanket invalidators. Force invokes extraction with cache refresh. A failed
|
||||||
|
replacement is not represented as a current successful extraction.
|
||||||
|
|
||||||
|
## Failure Behavior
|
||||||
|
|
||||||
|
Native errors, malformed completion, missing required lanes, unsafe paths, or
|
||||||
|
invalid JSON fail the attempt while preserving available diagnostics. A partial
|
||||||
|
report or incidental output is not success. See [operations](../operations.md#extraction-workflow).
|
||||||
|
|
||||||
|
## Implementation And Focused Tests
|
||||||
|
|
||||||
|
`internal/stage/extract.go`, `extract_preflight.go`, `extract_native_test.go`,
|
||||||
|
`internal/artifacts/extraction_evidence.go`, and `internal/adapters/notarius/`
|
||||||
|
own the stage, readiness, evidence and subprocess boundaries. The opt-in
|
||||||
|
`notarius_cache_integration_test.go` exercises a real executable.
|
||||||
@@ -1,63 +1,60 @@
|
|||||||
# Stage: merge
|
# Stage: merge
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
Normalize per-speaker raw transcripts and merge them into one merged transcript via Seriatim.
|
|
||||||
|
|
||||||
## Inputs and Outputs
|
Normalize raw transcript inputs and merge into base transcript via Seriatim.
|
||||||
Inputs:
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
- `transcripts/raw/*.json`
|
- `transcripts/raw/*.json`
|
||||||
- `inputs/speakers.yml`
|
- `inputs/speakers.yml`
|
||||||
- `inputs/autocorrect.yml`
|
- `inputs/autocorrect.yml`
|
||||||
|
|
||||||
Outputs:
|
## Outputs
|
||||||
- `transcripts/merged.json`
|
|
||||||
- optional `artifacts/seriatim.report.json` (when report enabled)
|
|
||||||
|
|
||||||
## Boundaries
|
- `transcripts/base.json`
|
||||||
Owns:
|
|
||||||
- Raw transcript discovery/validation
|
|
||||||
- Per-input normalize calls to Seriatim
|
|
||||||
- Final merge call to Seriatim
|
|
||||||
- Run-local log/config/report path wiring
|
|
||||||
- Promotion of merged/report outputs to canonical paths
|
|
||||||
|
|
||||||
Does not own:
|
The optional Seriatim report is a run-local diagnostic, not a canonical
|
||||||
- Transcript polishing or downstream artifact generation
|
product. See [Operations](../operations.md#local-state-layout) for placement
|
||||||
|
and retention.
|
||||||
|
|
||||||
## Config Fields Used
|
## Key Behavior
|
||||||
- `session.session_id`
|
|
||||||
- `session.campaign`
|
|
||||||
- `pipeline.workspace.root`
|
|
||||||
- `pipeline.seriatim.binary`
|
|
||||||
- `pipeline.seriatim.timeout`
|
|
||||||
- `pipeline.seriatim.output_schema`
|
|
||||||
- `pipeline.seriatim.coalesce_gap`
|
|
||||||
- `pipeline.seriatim.report`
|
|
||||||
- `pipeline.seriatim.env.*`
|
|
||||||
|
|
||||||
## External Adapters Used
|
- discovers and validates raw transcript inputs. For versioned transcribe
|
||||||
- Seriatim adapter:
|
state, discovery requires aggregate transcribe success and consumes only the
|
||||||
- `Normalize` for each raw input
|
aggregate outputs that exactly match the current per-speaker collection.
|
||||||
- `Run` for final merge
|
Partial checkpoints and orphaned files are not merge inputs. Legacy/manual
|
||||||
|
workflows without versioned speaker state retain directory discovery.
|
||||||
|
- normalizes each raw transcript (`seriatim.Normalize`) into run-local scratch output.
|
||||||
|
- merges normalized inputs (`seriatim.Run`) into base transcript.
|
||||||
|
- validates merged transcript and optional report JSON.
|
||||||
|
- materializes canonical outputs and records stage logs/generated configs.
|
||||||
|
|
||||||
## State and Manifest Behavior
|
## Invariants
|
||||||
- Reads transcript inputs from transcribe stage outputs in manifest when present; falls back to canonical raw directory.
|
|
||||||
- Writes run-local outputs/logs/config under `runs/{run_id}/merge/...` when enabled.
|
|
||||||
- Promotes canonical merged transcript and optional report.
|
|
||||||
- Records normalized-input provenance and adapter metadata in stage metadata.
|
|
||||||
|
|
||||||
## Skip and Resume Behavior
|
- merge always consumes normalized forms of raw inputs.
|
||||||
- Runner-level skip applies when already succeeded and not forced.
|
- a versioned transcribe collection is usable only through its complete,
|
||||||
- Forced rerun of this or upstream stages can stale downstream succeeded stages via runner invalidation.
|
successful aggregate output declaration.
|
||||||
|
- base transcript must validate before stage success.
|
||||||
|
- report output is config-gated.
|
||||||
|
|
||||||
## Failure Behavior
|
## Resume Evidence
|
||||||
- Fails on missing/invalid raw transcripts, missing speakers/autocorrect files, normalize failure, merge failure, invalid merged output JSON, or invalid report JSON when enabled.
|
|
||||||
|
|
||||||
## Tests to Inspect Before Changing
|
Merge records a versioned semantic-configuration fingerprint for the Seriatim
|
||||||
- `internal/stage/merge_test.go`
|
merge operation, output schema, coalesce gap, and every configured advanced
|
||||||
- `internal/adapters/seriatim/subprocess_test.go`
|
merge transformation. A change reruns merge and stales only its fixed
|
||||||
|
descendants; prepare and transcribe remain reusable. Binary path, timeout,
|
||||||
|
report emission, logs, and diagnostic retention are operational exclusions.
|
||||||
|
|
||||||
## Architectural Invariants
|
Configuration or resources loaded privately inside Seriatim are outside
|
||||||
- Merge consumes normalized forms of each raw transcript.
|
Narratio's observable contract and require `--force` when changed. An existing
|
||||||
- Merged transcript must validate before promotion.
|
successful merge record without evidence reruns once when selected.
|
||||||
- Report output is optional and gated by config.
|
|
||||||
|
## Related Contracts And Tests
|
||||||
|
|
||||||
|
- [Seriatim](../integrations/seriatim.md) owns subprocess and output semantics.
|
||||||
|
- [Configuration](../config.md#pipeline) owns operator-selected Seriatim values.
|
||||||
|
- Implementation and tests: `internal/stage/merge.go`,
|
||||||
|
`internal/stage/merge_test.go`,
|
||||||
|
`internal/stage/semantic_contracts_initial.go`, and
|
||||||
|
`internal/stage/semantic_contracts_initial_test.go`
|
||||||
|
|||||||
@@ -1,56 +1,45 @@
|
|||||||
# Stage: normalize
|
# Stage: normalize
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
Normalize the processed transcript into a deterministic intermediate schema for trim and optionally emit a normalize report.
|
|
||||||
|
|
||||||
## Inputs and Outputs
|
Normalize polished transcript into final transcript using Seriatim.
|
||||||
Inputs:
|
|
||||||
- `transcripts/processed.json`
|
|
||||||
|
|
||||||
Outputs:
|
## Inputs
|
||||||
- `transcripts/normalized.json` (or configured normalize output path)
|
|
||||||
- optional `artifacts/seriatim.normalize.report.json`
|
|
||||||
|
|
||||||
## Boundaries
|
- `transcripts/polished.json`
|
||||||
Owns:
|
|
||||||
- Processed transcript discovery/validation
|
|
||||||
- Normalize request construction and invocation
|
|
||||||
- Optional normalize report wiring
|
|
||||||
- Promotion of normalized transcript and optional report
|
|
||||||
|
|
||||||
Does not own:
|
## Outputs
|
||||||
- Bounds detection or segment trimming
|
|
||||||
|
|
||||||
## Config Fields Used
|
- `transcripts/final.json` (or configured normalize output path)
|
||||||
- `session.session_id`
|
|
||||||
- `session.campaign`
|
|
||||||
- `pipeline.workspace.root`
|
|
||||||
- `pipeline.normalize.output_path`
|
|
||||||
- `pipeline.normalize.output_schema`
|
|
||||||
- `pipeline.normalize.report`
|
|
||||||
- `pipeline.seriatim.binary`
|
|
||||||
- `pipeline.seriatim.timeout`
|
|
||||||
|
|
||||||
## External Adapters Used
|
The optional Seriatim report is a run-local diagnostic, not a canonical
|
||||||
- Seriatim adapter (`Normalize`).
|
product. See [Operations](../operations.md#local-state-layout) for placement
|
||||||
|
and retention.
|
||||||
|
|
||||||
## State and Manifest Behavior
|
## Key Behavior
|
||||||
- Reads processed transcript from polish outputs in manifest when present; falls back to canonical path.
|
|
||||||
- Uses run-local output/report/log/config paths when run layout is enabled.
|
|
||||||
- Promotes canonical normalized transcript and optional normalize report.
|
|
||||||
- Records adapter/result metadata including source path selection.
|
|
||||||
|
|
||||||
## Skip and Resume Behavior
|
- resolves polished transcript only from verified manifest output evidence.
|
||||||
- Runner-level skip applies when already succeeded and not forced.
|
- applies `pipeline.normalize` config or default normalize config.
|
||||||
- Forced reruns can stale downstream succeeded stages.
|
- runs Seriatim normalize with configured timeout/binary.
|
||||||
|
- validates normalized transcript and optional report.
|
||||||
|
- materializes canonical outputs and records logs/generated configs.
|
||||||
|
|
||||||
## Failure Behavior
|
## Invariants
|
||||||
- Fails on missing/invalid processed transcript, adapter error, invalid normalized output, or invalid report output when report enabled.
|
|
||||||
|
|
||||||
## Tests to Inspect Before Changing
|
- final transcript must validate as processed transcript JSON (`segments` array).
|
||||||
- `internal/stage/normalize_test.go`
|
- normalize defaults are applied when `pipeline.normalize` is unset.
|
||||||
- `internal/adapters/seriatim/subprocess_test.go`
|
|
||||||
|
|
||||||
## Architectural Invariants
|
## Resume Semantics
|
||||||
- Normalized output must validate as processed-transcript-compatible JSON (`segments` array required).
|
|
||||||
- Default normalize config is applied when `pipeline.normalize` is unset.
|
The versioned semantic fingerprint covers the Seriatim normalize operation,
|
||||||
|
output schema and canonical output identity, plus the configured transcript
|
||||||
|
transformations. Seriatim's executable and timeout and optional report
|
||||||
|
generation are operational and do not invalidate the normalized transcript.
|
||||||
|
|
||||||
|
## Related Contracts And Tests
|
||||||
|
|
||||||
|
- [Seriatim](../integrations/seriatim.md) owns subprocess and output semantics.
|
||||||
|
- [Configuration](../config.md#pipeline) owns normalize fields and defaults.
|
||||||
|
- Implementation and tests: `internal/stage/normalize.go`,
|
||||||
|
`internal/stage/normalize_test.go`,
|
||||||
|
`internal/stage/semantic_contracts_refinement.go`
|
||||||
|
|||||||
@@ -1,69 +1,23 @@
|
|||||||
# Stage: polish
|
# Stage: polish
|
||||||
|
|
||||||
## Purpose
|
Polish resolves the base transcript from verified merge evidence and all four
|
||||||
Polish merged transcript with Audita and produce a processed transcript for downstream normalization/analyze.
|
prepared glossary documents from manifest-backed input records. It invokes the
|
||||||
|
Audita adapter with those paths and configured downstream selectors, then
|
||||||
|
validates the returned transcript before promoting `transcripts/polished.json`.
|
||||||
|
The transcript is the only canonical output. Available ordinary reports,
|
||||||
|
stdout/stderr, and the generated invocation record are run-local diagnostics;
|
||||||
|
Audita's work directory is separately selected. The [Audita contract](../integrations/audita.md)
|
||||||
|
owns invocation and diagnostic behavior.
|
||||||
|
|
||||||
## Inputs and Outputs
|
Polish records the prepared glossary identities as resume evidence alongside
|
||||||
Inputs:
|
semantic configuration. Changes to effective glossary content require new
|
||||||
- `transcripts/merged.json`
|
polish work through ordinary prepare invalidation. Credentials, executable,
|
||||||
- `inputs/glossary.yml`
|
timeout, and diagnostics are operational. Narratio does not fingerprint the
|
||||||
|
contents of Audita-owned configuration or profiles: force polish after changing
|
||||||
|
those files behind unchanged selectors. Older evidence is reconsidered when
|
||||||
|
polish is selected; a downstream-only invocation does not eagerly run it.
|
||||||
|
|
||||||
Outputs:
|
A failed invocation does not promote an incidental output. Preflight is an
|
||||||
- `transcripts/processed.json`
|
invocation check after preparation, not a successful polish record. See
|
||||||
- optional `artifacts/audita.report.json` (when report enabled)
|
[preflight internals](preflight.md), `internal/stage/polish.go`,
|
||||||
|
`internal/stage/polish_resume.go`, and their focused tests.
|
||||||
## Boundaries
|
|
||||||
Owns:
|
|
||||||
- Merged transcript discovery/validation
|
|
||||||
- Audita invocation request construction
|
|
||||||
- Run-local logs/config/work-dir/report wiring
|
|
||||||
- Promotion of processed transcript and optional report
|
|
||||||
|
|
||||||
Does not own:
|
|
||||||
- Upstream merge normalization
|
|
||||||
- Downstream normalize/trim/analyze logic
|
|
||||||
|
|
||||||
## Config Fields Used
|
|
||||||
- `session.session_id`
|
|
||||||
- `session.campaign`
|
|
||||||
- `pipeline.workspace.root`
|
|
||||||
- `pipeline.audita.binary`
|
|
||||||
- `pipeline.audita.timeout`
|
|
||||||
- `pipeline.audita.llm_api_key_env`
|
|
||||||
- `pipeline.audita.modules`
|
|
||||||
- `pipeline.audita.base_url`
|
|
||||||
- `pipeline.audita.model`
|
|
||||||
- `pipeline.audita.transcript_description`
|
|
||||||
- `pipeline.audita.config_path`
|
|
||||||
- `pipeline.audita.output_schema`
|
|
||||||
- `pipeline.audita.work_dir_retention`
|
|
||||||
- `pipeline.audita.total_llm_concurrency`
|
|
||||||
- `pipeline.audita.proposal_llm_concurrency`
|
|
||||||
- `pipeline.audita.validation_model`
|
|
||||||
- `pipeline.audita.validation_llm_concurrency`
|
|
||||||
- `pipeline.audita.report`
|
|
||||||
|
|
||||||
## External Adapters Used
|
|
||||||
- Audita adapter (`env.Audita.Run`).
|
|
||||||
|
|
||||||
## State and Manifest Behavior
|
|
||||||
- Reads merged transcript from merge manifest outputs when available; falls back to canonical merged path.
|
|
||||||
- Uses run-local output/report/log/config/scratch paths when run layout is enabled.
|
|
||||||
- Promotes canonical `transcripts/processed.json` and optional report.
|
|
||||||
- Records adapter invocation metadata, credential presence signal, and output provenance in stage metadata.
|
|
||||||
|
|
||||||
## Skip and Resume Behavior
|
|
||||||
- Runner-level skip applies when already succeeded and not forced.
|
|
||||||
- Forced rerun can stale downstream succeeded stages via runner invalidation.
|
|
||||||
|
|
||||||
## Failure Behavior
|
|
||||||
- Fails on missing/invalid merged transcript, missing glossary, adapter error, invalid processed output shape (`segments` array required), or invalid report JSON when enabled.
|
|
||||||
|
|
||||||
## Tests to Inspect Before Changing
|
|
||||||
- `internal/stage/polish_test.go`
|
|
||||||
- `internal/adapters/audita/subprocess_test.go`
|
|
||||||
|
|
||||||
## Architectural Invariants
|
|
||||||
- Processed transcript must contain a top-level `segments` array.
|
|
||||||
- Report behavior is strictly config-gated.
|
|
||||||
- Stage output canonicalization always ends at `transcripts/processed.json`.
|
|
||||||
|
|||||||
@@ -1,74 +1,127 @@
|
|||||||
# Stage: prepare
|
# Stage: prepare
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
Materialize all required session inputs into canonical local workspace paths and record input provenance in the session manifest.
|
|
||||||
|
|
||||||
## Inputs and Outputs
|
Materialize canonical current-session inputs before processing stages.
|
||||||
Inputs:
|
|
||||||
- `session.yml` (resolved session config)
|
|
||||||
- `pipeline.resolved.yml` (materialized from resolved pipeline config)
|
|
||||||
- `speakers.yml`
|
|
||||||
- `autocorrect.yml`
|
|
||||||
- `glossary.yml`
|
|
||||||
- audio source:
|
|
||||||
- local (`session.inputs.audio_dir` or `session.inputs.audio_files`), or
|
|
||||||
- S3 (`session.inputs.audio_s3.prefix`)
|
|
||||||
|
|
||||||
Outputs:
|
## Inputs
|
||||||
|
|
||||||
|
- resolved campaign, session, and pipeline configuration
|
||||||
|
- the stable speakers input, inline autocorrection rules, canonical party, and optional glossary selections
|
||||||
|
- a local or S3 audio source when transcription needs audio
|
||||||
|
- previous-session input requirements from selected targets and their configured prerequisites
|
||||||
|
|
||||||
|
## Outputs
|
||||||
|
|
||||||
|
- `inputs/campaign.yml`
|
||||||
- `inputs/session.yml`
|
- `inputs/session.yml`
|
||||||
- `inputs/pipeline.resolved.yml`
|
- `inputs/pipeline.resolved.yml`
|
||||||
- `inputs/speakers.yml`
|
- `inputs/speakers.yml`
|
||||||
- `inputs/autocorrect.yml`
|
- `inputs/autocorrect.yml`
|
||||||
- `inputs/glossary.yml`
|
- `inputs/glossaries/{party,campaign,setting,spells,combined}.yml`
|
||||||
- `audio/*.flac` in session workdir
|
- `inputs/players.yml`
|
||||||
- `manifest.Inputs` records with checksums and source metadata
|
- `inputs/party.yml`
|
||||||
|
- prepared recordings in `audio/` when audio is acquired
|
||||||
|
- optional `inputs/previous/artifacts/**`
|
||||||
|
- deterministic `manifest.inputs` entries (checksums + provenance)
|
||||||
|
|
||||||
## Boundaries
|
## Key Behavior
|
||||||
Owns:
|
|
||||||
- Input path resolution and validation
|
|
||||||
- Local copy/materialization of configs and audio files
|
|
||||||
- S3 audio download to run-scoped spool, then copy into work audio dir
|
|
||||||
|
|
||||||
Does not own:
|
A stage-owned stable-product inventory supplies the data, destinations, and
|
||||||
- Transcript generation/processing
|
manifest provenance for reference materialization. Resume projects source
|
||||||
- Archive publish behavior
|
identities from the same inventory, using normalized snapshots and a durable-copy
|
||||||
|
check for the pipeline projection. Semantic selection uses its presence-only
|
||||||
|
projection without rendering source content. Audio and previous-session hydration
|
||||||
|
are handled separately.
|
||||||
|
|
||||||
## Config Fields Used
|
- validates required config/store state and resolves selected vocabulary before audio work.
|
||||||
- `session.session_id`
|
- prepares references and history without acquiring audio when a validated
|
||||||
- `session.campaign`
|
supplied transcript satisfies transcription. Forced or uncovered transcription
|
||||||
- `session.inputs.speakers_file`
|
requires an audio selection. Preparation metadata records whether audio was
|
||||||
- `session.inputs.autocorrect_file`
|
prepared, and reference-only preparation preserves supplied-product records.
|
||||||
- `session.inputs.glossary_file`
|
- bounded downstream runs may prepare or reuse references under the workspace
|
||||||
- `session.inputs.audio_dir`
|
lock before readiness checks, even when prepare lies outside the selected range.
|
||||||
- `session.inputs.audio_files`
|
Existing audio input records remain available without being recertified by
|
||||||
- `session.inputs.audio_s3.prefix`
|
reference-only preparation. An imported configured or extraction product can
|
||||||
- `pipeline.workspace.root`
|
support this workflow without any transcript. Reference-only validation
|
||||||
- `pipeline.spool.root`
|
explicitly excludes audio acquisition and source checks.
|
||||||
- `pipeline.storage.s3.bucket`
|
- derives the party glossary and resolves the remaining named collections through
|
||||||
- `pipeline.storage.s3.root_prefix`
|
`internal/glossary`; writes four individual shared envelopes and a combined
|
||||||
|
envelope with checksums, sizes, and provenance. The combined record declares
|
||||||
|
its four individual input dependencies.
|
||||||
|
- enforces local audio vs S3 audio mutual exclusivity.
|
||||||
|
- uses `internal/audio` for read-only source discovery shared with inspection;
|
||||||
|
rejects duplicate explicit local audio sources after resolution.
|
||||||
|
- gives distinct local source paths with the same basename deterministic unique
|
||||||
|
prepared filenames so neither source is overwritten; unresolved speaker-ID
|
||||||
|
collisions fail before audio materialization.
|
||||||
|
- downloads S3 audio into a temporary sibling before verifying and installing the prepared copy; its recorded identity comes from the same response as the bytes.
|
||||||
|
- writes effective autocorrection rules as a Seriatim envelope, with checksum,
|
||||||
|
size, and source provenance, including an empty list when no rules apply.
|
||||||
|
- renders standalone effective campaign, session, and canonical party documents,
|
||||||
|
and deterministically generates the prepared players projection.
|
||||||
|
- collects `narratio.previous_session.artifact.*` requirements from the selected
|
||||||
|
targets and their full prerequisite closure, including disabled prerequisites;
|
||||||
|
see [previous requirement collection](artifacts.md#previous-requirement-collection).
|
||||||
|
Bounded reference preparation uses projected work and reused local checkpoint
|
||||||
|
keys, preserving their history while excluding supplied products' history.
|
||||||
|
- clears managed `inputs/previous/` state on every invocation, then, when requirements exist:
|
||||||
|
- resolves the pointer-selected previous source through the shared resolver;
|
||||||
|
- downloads declared previous artifacts;
|
||||||
|
- records previous inputs in `manifest.inputs`.
|
||||||
|
|
||||||
## External Adapters Used
|
Required previous-session inputs fail when unavailable; optional missing inputs
|
||||||
- Object storage backend (`env.ObjectStore`) for S3 audio list/download when `audio_s3` is configured.
|
are typed skipped results. Each requirement resolves only from its unique
|
||||||
|
`published_output` declaration in the pointer-selected remote commit. Prepare
|
||||||
|
strips that selected run's immutable `published/` prefix to derive the local
|
||||||
|
cache path, then validates the committed checksum, size, and generation.
|
||||||
|
|
||||||
## State and Manifest Behavior
|
## Invariants
|
||||||
- Ensures workspace layout exists.
|
|
||||||
- Writes resolved config and input files to canonical `inputs/` paths.
|
|
||||||
- Records all prepared inputs into `manifest.Inputs` (sorted deterministically by kind/path).
|
|
||||||
- For S3 audio, records `S3Bucket`, `S3Key`, `S3Size`, `S3ETag`, and `SpoolPath` in each audio input record.
|
|
||||||
|
|
||||||
## Skip and Resume Behavior
|
- prepare and restore hydrate canonical `inputs/previous/` state from exact
|
||||||
- Runner-level skip applies when stage already `succeeded` and `--force` is not set.
|
declared previous-session products.
|
||||||
- Stage itself is deterministic/idempotent for unchanged inputs (`copyFileIfChanged`, `writeBytesIfChanged`).
|
- managed previous artifacts are stored under `inputs/previous/artifacts/**` without
|
||||||
|
duplicate `artifacts/artifacts/` nesting.
|
||||||
|
- managed `inputs/previous/` state represents only the current requirement set.
|
||||||
|
- `manifest.inputs` ordering is deterministic (`kind`, `path`).
|
||||||
|
|
||||||
## Failure Behavior
|
## Resume Evidence
|
||||||
- Fails on missing required files, invalid audio source combinations, no discoverable `.flac` files, duplicate audio basenames, missing object store for S3 mode, or S3 list/download failures.
|
|
||||||
|
|
||||||
## Tests to Inspect Before Changing
|
Prepare records a versioned semantic-configuration fingerprint for the
|
||||||
- `internal/stage/prepare_test.go`
|
resolved campaign/session selection, local-versus-S3 audio mode and canonical
|
||||||
- `internal/app/session_cli_test.go`
|
audio names, stable-input presence, previous-session identity, the canonical
|
||||||
- `internal/config/load_validate_test.go`
|
players projection version, and the effective
|
||||||
|
previous-artifact requirement set. A change reruns prepare and
|
||||||
|
stales its fixed descendants. Existing successful records without this
|
||||||
|
evidence rerun once when selected.
|
||||||
|
|
||||||
## Architectural Invariants
|
Source ownership and workspace placement are not semantic when logical selection,
|
||||||
- `audio_dir`/`audio_files` and `audio_s3` are mutually exclusive.
|
canonical names, and effective bytes are equivalent.
|
||||||
- Audio files must be `.flac`.
|
The fingerprint deliberately does not read or rehash large audio. Prepared
|
||||||
- Canonical `inputs/*` and `audio/*` paths are the durable source for downstream stages.
|
input checksums remain the content provenance. Before reusing success, prepare
|
||||||
|
validates every durable prepared copy and compares current stable-input bytes,
|
||||||
|
effective campaign/session, canonical party, derived-player and resolved glossary
|
||||||
|
bytes, and, when audio was needed, local audio membership/checksums or S3
|
||||||
|
key/size/entity-tag identity with that provenance.
|
||||||
|
Source relocation with equivalent effective documents, names, and bytes remains
|
||||||
|
reusable; changed or unavailable evidence causes a normal prepare rerun.
|
||||||
|
Confirmed mismatches and sources that cannot be verified have distinct reasons;
|
||||||
|
the latter retains the inspection error. Planning supplies the same S3 identity
|
||||||
|
collaborator to this validator without running preparation.
|
||||||
|
|
||||||
|
## Related Contracts And Tests
|
||||||
|
|
||||||
|
- [Configuration](../config.md) owns audio selection, stable input fields, and
|
||||||
|
previous-session settings.
|
||||||
|
- [Operations](../operations.md) owns physical input, audio, and
|
||||||
|
previous-state layout.
|
||||||
|
- [Storage Internals](storage.md) and [Artifact Internals](artifacts.md) explain
|
||||||
|
the internal collaborators.
|
||||||
|
- Implementation and tests: `internal/stage/prepare.go`,
|
||||||
|
`internal/stage/prepare_party.go`, `internal/stage/prepare_test.go`,
|
||||||
|
`internal/stage/prepare_resume.go`,
|
||||||
|
`internal/stage/prepare_resume_test.go`,
|
||||||
|
`internal/stage/semantic_contracts_initial.go`,
|
||||||
|
`internal/stage/semantic_contracts_initial_test.go`,
|
||||||
|
`internal/audio/discovery_test.go`, `internal/audio/s3_audio_test.go`,
|
||||||
|
`internal/previouscache/*_test.go`
|
||||||
|
|||||||
162
docs/internal/stage-publish.md
Normal file
162
docs/internal/stage-publish.md
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
# Stage: publish
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
|
||||||
|
Upload run/session outputs to object storage and atomically advance remote current state.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- ordinary preceding stage evidence or valid supplied product availability
|
||||||
|
- declared run-local diagnostic files
|
||||||
|
- resolved publish output rules
|
||||||
|
- independent per-source remote lock objects read at planning start
|
||||||
|
- the validated prior current commit when an initially locked source may carry
|
||||||
|
- durable previous-session cache files when present
|
||||||
|
|
||||||
|
## Outputs
|
||||||
|
|
||||||
|
- uploaded prepared campaign/session/party inputs, declared
|
||||||
|
run-local diagnostics, and selected publish outputs;
|
||||||
|
- uploaded durable previous-session cache files when present;
|
||||||
|
- immutable run-scoped commit manifest; and
|
||||||
|
- current commit pointer, written last.
|
||||||
|
|
||||||
|
Exact remote placement and the operator workflow belong in
|
||||||
|
[Operations](../operations.md#publish-workflow).
|
||||||
|
|
||||||
|
## Key Behavior
|
||||||
|
|
||||||
|
`publish.go` retains the transaction-owning `Run` path. Source discovery,
|
||||||
|
manifest-derived archive metadata, confined opening, and checksum validation
|
||||||
|
live in `publish_sources.go`; artifact-catalog matching, selection, required
|
||||||
|
and optional rules, destination resolution, and collision inputs live in
|
||||||
|
`publish_outputs.go`. Copying, hashing, immutable upload, reuse checks, and
|
||||||
|
remote verification live in `publish_transfer.go`; immutable-commit and
|
||||||
|
current-pointer encoding and writes live in
|
||||||
|
`publish_commit.go`. `publish_output_plan.go` owns the deterministic, I/O-free
|
||||||
|
five-outcome model and its secret-free metadata projection. Prepared input
|
||||||
|
objects are committed under the immutable run; the committed standalone session
|
||||||
|
supports remote loading when no authored session override is available. The
|
||||||
|
[configuration reference](../config.md#sessionyml) owns input selection.
|
||||||
|
|
||||||
|
- when publishing or run upload is disabled, completes successfully with no
|
||||||
|
outputs and records explanatory metadata. This is not an explicit self-skip:
|
||||||
|
the session manifest records success. Enablement and upload policy are
|
||||||
|
fingerprinted, so changing either automatically makes the prior result
|
||||||
|
non-resumable.
|
||||||
|
- validates ordinary prerequisites or valid supplied availability and requires
|
||||||
|
an object store. Every selected source is independently resolved and checked.
|
||||||
|
- derives a deterministic run-archive allowlist from the session manifest's
|
||||||
|
declared current-run outputs, logs, and generated configurations. References
|
||||||
|
outside the current run root, including canonical session files and prior-run
|
||||||
|
diagnostics, are not archive candidates. No distinguished diagnostic file is
|
||||||
|
read or uploaded.
|
||||||
|
- opens each archive candidate beneath its archive root without following
|
||||||
|
symlinked ancestors or leaf entries, verifies that it is a regular file and
|
||||||
|
checks a declared checksum when present, then streams the opened descriptor.
|
||||||
|
- derives the durable previous-cache archive from recorded previous inputs using
|
||||||
|
the same confinement and regular-file checks.
|
||||||
|
- resolves publish output sources through runtime artifact catalog and
|
||||||
|
manifest-aware resolution. Configured Scriptorium outputs are publishable
|
||||||
|
from validated `current` per-artifact analyze evidence or a valid supplied
|
||||||
|
product; an incidental
|
||||||
|
canonical file, aggregate output, stale/failed/unselected record, or
|
||||||
|
mismatched path, size, or checksum remains unavailable. Built-in and
|
||||||
|
extraction sources likewise require their own current local or supplied evidence.
|
||||||
|
- includes the four individual prepared glossary documents and the combined
|
||||||
|
glossary with their declared input identities for restore;
|
||||||
|
- publishes extraction lanes only through explicit configured output rules;
|
||||||
|
original Notarius bundles are not scanned or uploaded wholesale. Historical
|
||||||
|
run-local references are not required for later publication.
|
||||||
|
- selected artifact filter applies to configured artifact sources only.
|
||||||
|
- plans every configured output into exactly one source-sorted outcome:
|
||||||
|
`published`, `carried_locked`, `locked_unpublished`, `optional_missing`, or
|
||||||
|
`unselected`.
|
||||||
|
- an initially locked selected output carries its exact prior
|
||||||
|
`published_output` declaration when one exists. The declaration may point to
|
||||||
|
an earlier run in the same session and retains its source, key, checksum,
|
||||||
|
size, and generation; the bytes are not copied.
|
||||||
|
- verifies a carried object's exact key, size, and generation through object
|
||||||
|
metadata without downloading or opening the local output source; catalog
|
||||||
|
hydration skips carried output payloads.
|
||||||
|
- an initially locked source with no prior declaration remains absent even
|
||||||
|
when the output rule is required. Optional missing unlocked outputs remain
|
||||||
|
absent; required missing unlocked outputs fail.
|
||||||
|
- creates one complete immutable source-to-destination mapping before upload,
|
||||||
|
then opens, verifies, transfers, and closes sources sequentially;
|
||||||
|
- uploads and verifies every declared immutable object and the commit manifest;
|
||||||
|
- writes the immutable commit from the combined new and exact carried
|
||||||
|
declarations.
|
||||||
|
- rereads every initially unlocked participating source after the immutable
|
||||||
|
commit. A newly present lock aborts selection, leaving the uploaded immutable
|
||||||
|
attempt unselected. Removing an initial lock may conservatively produce one
|
||||||
|
carry because the initial snapshot controls the plan.
|
||||||
|
- updates `current/commit-pointer.json` exactly once, last, and writes no other
|
||||||
|
mutable publication control record.
|
||||||
|
|
||||||
|
## Metadata Signals
|
||||||
|
|
||||||
|
`internal/artifacts` owns the typed codecs for completion identity and output
|
||||||
|
outcomes. Cleanup applies strict authorization to decoded fields; inspection
|
||||||
|
skips malformed outcome rows independently.
|
||||||
|
|
||||||
|
Includes counts/lists for:
|
||||||
|
- run uploads
|
||||||
|
- published output uploads
|
||||||
|
- previous uploads
|
||||||
|
- one `publish_output_outcomes` collection containing all five output states,
|
||||||
|
exact declared keys, and key-derived origin runs where applicable
|
||||||
|
- remote commit and current-pointer key paths
|
||||||
|
- the run identifier selected by the commit
|
||||||
|
|
||||||
|
## Invariants
|
||||||
|
|
||||||
|
- `current/commit-pointer.json` is the remote commit marker and is written last.
|
||||||
|
- run files, selected outputs, and previous-cache files are declared by an
|
||||||
|
immutable commit under the run prefix. Execution ledgers are not published.
|
||||||
|
- run and previous uploads contain only manifest-declared regular files opened
|
||||||
|
from verified descriptors. Symlinks, special files, and changed declared
|
||||||
|
content are rejected; undeclared entries are ignored. A later invalid source
|
||||||
|
can leave earlier immutable uploads unselected.
|
||||||
|
- run-local diagnostics, including Notarius completion report and stderr files, are
|
||||||
|
archived only when recorded by the session manifest. A run with no declared
|
||||||
|
current-run diagnostics legitimately uploads none.
|
||||||
|
- independent publish locks are not overridden by `--force`; every initially
|
||||||
|
unlocked relevant source is reread immediately before current-state
|
||||||
|
selection.
|
||||||
|
- successful uploaded publication records the exact run ID, remote commit key,
|
||||||
|
and current-pointer key consumed by the later cleanup stage.
|
||||||
|
|
||||||
|
## Resume Semantics
|
||||||
|
|
||||||
|
The versioned semantic fingerprint covers enabled behavior, run-upload policy,
|
||||||
|
normalized source/destination/required output rules, and the remote backend,
|
||||||
|
bucket, region, endpoint, and root-prefix identity. Rule ordering is
|
||||||
|
canonicalized. Credential
|
||||||
|
environment names, path-addressing transport mode, local workspace placement,
|
||||||
|
and run identifiers are excluded. Independent remote locks remain mutable state
|
||||||
|
and are read directly by publish at planning and commit boundaries; semantic
|
||||||
|
evidence does not replace those safety checks.
|
||||||
|
|
||||||
|
The commit boundary and cleanup authorization are normative architecture invariants; see
|
||||||
|
[Architecture](../policy/architecture.md#publish-commit-boundary).
|
||||||
|
|
||||||
|
Publish never deletes local state. `run SESSION --stage publish` selects
|
||||||
|
only this stage; a full run selects notify and cleanup afterward.
|
||||||
|
|
||||||
|
## Related Contracts And Tests
|
||||||
|
|
||||||
|
- [Configuration](../config.md#publish-configuration-summary) owns output
|
||||||
|
rules.
|
||||||
|
- [Operations](../operations.md#publish-locks) owns remote lock lifecycle and
|
||||||
|
physical remote state.
|
||||||
|
- [Artifact Internals](artifacts.md) explains source resolution and current-state
|
||||||
|
helpers.
|
||||||
|
- Implementation and tests: `internal/stage/publish.go`,
|
||||||
|
`internal/stage/publish_sources.go`, `internal/stage/publish_outputs.go`,
|
||||||
|
`internal/stage/publish_output_plan.go`,
|
||||||
|
`internal/stage/publish_transfer.go`, `internal/stage/publish_commit.go`,
|
||||||
|
`internal/stage/publish_test.go`,
|
||||||
|
`internal/stage/semantic_contracts_delivery.go`,
|
||||||
|
`internal/app/operator_helpers_test.go`, and
|
||||||
|
`internal/app/cleanup_orchestration_test.go`
|
||||||
61
docs/internal/stage-render.md
Normal file
61
docs/internal/stage-render.md
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
# Stage: render
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
|
||||||
|
Render Markdown transcript artifacts from normalized JSON transcripts via Seriatim.
|
||||||
|
It runs after `trim` and before `extract` in the canonical sequence. Render and
|
||||||
|
extract are independent sibling consumers: replacing render output does not
|
||||||
|
invalidate extraction, but it does invalidate succeeded analysis and delivery
|
||||||
|
records that may consume rendered transcripts.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `narratio.transcript.final` (`transcripts/final.json`)
|
||||||
|
- `narratio.transcript.final_trimmed` (`transcripts/final.trimmed.json`)
|
||||||
|
|
||||||
|
## Outputs
|
||||||
|
|
||||||
|
- `narratio.transcript.final_markdown` -> `transcripts/final.md`
|
||||||
|
- `narratio.transcript.final_trimmed_markdown` -> `transcripts/final.trimmed.md`
|
||||||
|
|
||||||
|
## Key Behavior
|
||||||
|
|
||||||
|
- uses `pipeline.render` settings (enabled/variants/format/title/booleans).
|
||||||
|
- resolves and renders only selected variants; duplicate selections have no effect.
|
||||||
|
- resolves inputs from verified local output evidence or supplied records.
|
||||||
|
- writes run-local outputs first, then materializes canonical session outputs.
|
||||||
|
- records input provenance, output paths, adapter metadata, logs, and generated config refs.
|
||||||
|
- when `pipeline.render.enabled=false`, completes successfully with no outputs
|
||||||
|
and records explanatory metadata. This is not an explicit self-skip: the
|
||||||
|
local manifest records success. Because enablement is fingerprinted, enabling
|
||||||
|
render later automatically makes the prior result non-resumable.
|
||||||
|
|
||||||
|
## Failure Semantics
|
||||||
|
|
||||||
|
- a missing selected normalized input fails with normalize rerun guidance.
|
||||||
|
- a missing selected trimmed input fails with trim rerun guidance.
|
||||||
|
- adapter/subprocess failure fails stage.
|
||||||
|
- empty render output files fail validation.
|
||||||
|
|
||||||
|
## Invariants
|
||||||
|
|
||||||
|
- only `format: markdown` is supported.
|
||||||
|
- render stage owns production of built-in Markdown transcript sources.
|
||||||
|
|
||||||
|
## Resume Semantics
|
||||||
|
|
||||||
|
The versioned semantic fingerprint covers enablement, final format, resolved
|
||||||
|
title (including the session-title fallback), timestamp, segment-ID and
|
||||||
|
metadata inclusion, and the selected input and Markdown output identities.
|
||||||
|
Seriatim's executable, timeout, and report behavior are operational
|
||||||
|
and do not invalidate rendered transcripts. A render-only change leaves the
|
||||||
|
independent `extract` sibling reusable while invalidating their shared
|
||||||
|
downstream consumers.
|
||||||
|
|
||||||
|
## Related Contracts And Tests
|
||||||
|
|
||||||
|
- [Seriatim](../integrations/seriatim.md) owns render subprocess behavior.
|
||||||
|
- [Configuration](../config.md#pipeline) owns render fields and defaults.
|
||||||
|
- Implementation and tests: `internal/stage/render.go`,
|
||||||
|
`internal/stage/render_test.go`,
|
||||||
|
`internal/stage/semantic_contracts_refinement.go`
|
||||||
@@ -1,58 +1,96 @@
|
|||||||
# Stage: transcribe
|
# Stage: transcribe
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
Generate per-speaker raw transcripts from prepared audio using WhisperX.
|
|
||||||
|
|
||||||
## Inputs and Outputs
|
Generate raw per-speaker transcripts from prepared audio using WhisperX.
|
||||||
Inputs:
|
|
||||||
- `audio/*.flac` prepared by `prepare`
|
|
||||||
|
|
||||||
Outputs:
|
## Inputs
|
||||||
- `transcripts/raw/<speaker>.json` for each input audio file
|
|
||||||
|
|
||||||
## Boundaries
|
- prepared recordings in `audio/` from `prepare`
|
||||||
Owns:
|
|
||||||
- Discovering prepared audio inputs
|
|
||||||
- Deriving speaker ids from audio basenames
|
|
||||||
- Parallel WhisperX invocation with bounded concurrency
|
|
||||||
- Validating produced JSON and promoting run-local outputs
|
|
||||||
|
|
||||||
Does not own:
|
## Outputs
|
||||||
- Transcript merge/polish/normalize/trim/analyze
|
|
||||||
|
|
||||||
## Config Fields Used
|
- `transcripts/raw/<speaker>.json`
|
||||||
- `session.session_id`
|
|
||||||
- `session.campaign`
|
|
||||||
- `pipeline.workspace.root`
|
|
||||||
- `pipeline.whisperx.transcribe_url`
|
|
||||||
- `pipeline.whisperx.language`
|
|
||||||
- `pipeline.whisperx.timeout`
|
|
||||||
- `pipeline.whisperx.retries`
|
|
||||||
- `pipeline.whisperx.retry_delay`
|
|
||||||
- `pipeline.whisperx.concurrency`
|
|
||||||
|
|
||||||
## External Adapters Used
|
## Key Behavior
|
||||||
- WhisperX adapter (`env.WhisperX.Transcribe`).
|
|
||||||
|
|
||||||
## State and Manifest Behavior
|
- discovers prepared audio from manifest inputs or the canonical audio
|
||||||
- Uses run-local output paths under `runs/{run_id}/transcribe/outputs/...` when run layout is enabled.
|
directory. Manifest-selected files are authoritative; fallback scans use the
|
||||||
- Validates each generated transcript JSON before promotion.
|
shared candidate filter. Speaker IDs remove the final filename extension;
|
||||||
- Promotes canonical outputs to `transcripts/raw/*.json`.
|
duplicate IDs are rejected before dispatch.
|
||||||
- Records per-file metadata (attempts/status/duration/output path) in stage metadata.
|
- hashes the current audio and reconciles it with the versioned per-speaker
|
||||||
|
completion collection before starting HTTP work.
|
||||||
|
- reuses only records whose audio identity, observable WhisperX semantics,
|
||||||
|
canonical output location, JSON, checksum, and size remain current.
|
||||||
|
- durably checkpoints the reconciled collection before dispatch, then sends
|
||||||
|
only missing or obsolete speakers through the bounded worker group.
|
||||||
|
- validates each successful run-local response, rechecks the audio bytes,
|
||||||
|
materializes the canonical raw transcript, and checkpoints that speaker
|
||||||
|
before accepting another completion.
|
||||||
|
- rebuilds aggregate stage outputs in stable speaker order from the complete
|
||||||
|
current collection, including records produced by earlier invocations.
|
||||||
|
|
||||||
## Skip and Resume Behavior
|
## Invariants
|
||||||
- Runner-level skip applies for previously succeeded stage unless forced.
|
|
||||||
- On forced upstream reruns, downstream succeeded stages can be marked `stale` by runner logic.
|
|
||||||
|
|
||||||
## Failure Behavior
|
- prepared audio identities must be unique; prepare disambiguates distinct
|
||||||
- Fails if no prepared audio exists, duplicate speaker basenames are detected, adapter output path mismatches expected path, any output JSON is invalid, or one worker fails.
|
source paths that share a basename.
|
||||||
- Cancels in-flight workers after first terminal error.
|
- output path returned by adapter must match requested output path.
|
||||||
|
- an empty adapter result path means the requested path; adapters cannot select
|
||||||
|
an alternate destination.
|
||||||
|
- candidate collection construction, the shared
|
||||||
|
[checkpoint persistence boundary](manifest.md#checkpoint-persistence-boundary),
|
||||||
|
and installation into live state are serialized by transcribe's mutex.
|
||||||
|
Expensive hashing and HTTP work remain outside that critical section.
|
||||||
|
- a canonical file has no completion authority until its manifest checkpoint
|
||||||
|
succeeds. A save failure preserves the last successfully committed
|
||||||
|
collection for ordinary retry.
|
||||||
|
- each successful output is validated before its checkpoint, and cancellation,
|
||||||
|
incomplete dispatch, or a failed aggregate save cannot be reported as
|
||||||
|
aggregate stage success.
|
||||||
|
- removed audio inputs are omitted from the current collection and aggregate
|
||||||
|
output list; reconciliation does not delete arbitrary transcript files.
|
||||||
|
- merge cannot consume a partial versioned collection: it requires transcribe
|
||||||
|
aggregate success and an exact match between current speaker records and
|
||||||
|
declared aggregate outputs.
|
||||||
|
|
||||||
## Tests to Inspect Before Changing
|
## Resume Evidence
|
||||||
- `internal/stage/transcribe_test.go`
|
|
||||||
- `internal/app/whisperx_wiring_test.go`
|
|
||||||
|
|
||||||
## Architectural Invariants
|
Each completed speaker record binds the speaker ID, session-relative audio
|
||||||
- Speaker identity is derived from `.flac` basename and must be unique.
|
path, streamed audio checksum and size, the Narratio-visible WhisperX service
|
||||||
- Every successful speaker output must be valid JSON before promotion.
|
URL and recognition language, and the canonical transcript path, checksum,
|
||||||
- Canonical raw transcript set is the only supported merge input surface.
|
size, and producer run. Changed audio bytes select that speaker for replacement;
|
||||||
|
a changed URL or language selects every speaker. Either case stales fixed
|
||||||
|
descendants through the normal runner decision. Retry count/delay, concurrency,
|
||||||
|
timeout, credentials, and diagnostic locations are operational and do not
|
||||||
|
change this evidence.
|
||||||
|
|
||||||
|
An ordinary retry reuses every valid speaker checkpoint even when aggregate
|
||||||
|
transcribe status is failed, running, or stale. A succeeded stage is skipped only
|
||||||
|
when its stored speaker set and aggregate output evidence also match the current
|
||||||
|
collection. Otherwise, execution repairs those records without retranscribing
|
||||||
|
reusable speakers and stales dependents through the normal runner path.
|
||||||
|
`--force` first durably replaces
|
||||||
|
the collection with an empty versioned collection, so a later ordinary retry
|
||||||
|
cannot resurrect pre-force results; speakers checkpointed by that forced
|
||||||
|
attempt remain reusable.
|
||||||
|
|
||||||
|
WhisperX models or private service configuration not exposed by Narratio's
|
||||||
|
adapter contract cannot be fingerprinted; use `--force` after changing them.
|
||||||
|
An older aggregate-only transcribe record has no trustworthy audio-to-output
|
||||||
|
binding. When transcribe is next selected, every current speaker is therefore
|
||||||
|
generated once and recorded in the versioned collection; later invocations can
|
||||||
|
reuse it normally.
|
||||||
|
|
||||||
|
## Related Contracts And Tests
|
||||||
|
|
||||||
|
- [WhisperX](../integrations/whisperx.md) owns HTTP, retry, timeout, and
|
||||||
|
cancellation semantics.
|
||||||
|
- [Configuration](../config.md) owns source selection, concurrency, and other
|
||||||
|
operator-selected values.
|
||||||
|
- Implementation and tests: `internal/stage/transcribe.go`,
|
||||||
|
`internal/stage/transcribe_reconciliation.go`,
|
||||||
|
`internal/stage/transcribe_execution_state.go`,
|
||||||
|
`internal/stage/transcribe_resume.go`,
|
||||||
|
`internal/stage/transcribe_test.go`,
|
||||||
|
`internal/stage/transcribe_reconciliation_test.go`, and
|
||||||
|
`internal/stage/transcribe_checkpoint_test.go`
|
||||||
|
|||||||
@@ -1,75 +1,68 @@
|
|||||||
# Stage: trim
|
# Stage: trim
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
Optionally trim the normalized transcript to session bounds; always produce a durable trimmed transcript.
|
|
||||||
|
|
||||||
## Inputs and Outputs
|
Produce a final-trimmed transcript. By default, the stage generates bounds and
|
||||||
Inputs:
|
applies a bounds-driven trim.
|
||||||
- `transcripts/normalized.json`
|
|
||||||
|
|
||||||
Outputs:
|
## Inputs
|
||||||
- `transcripts/trimmed.json` (or configured trim output path)
|
|
||||||
|
- `transcripts/final.json`
|
||||||
|
|
||||||
|
## Outputs
|
||||||
|
|
||||||
|
- `transcripts/final.trimmed.json` (or configured trim output path)
|
||||||
- when trim enabled: `artifacts/session_bounds.json`
|
- when trim enabled: `artifacts/session_bounds.json`
|
||||||
|
|
||||||
## Boundaries
|
## Key Behavior
|
||||||
Owns:
|
|
||||||
- Trim-enabled switch behavior
|
|
||||||
- Bounds generation via Scriptorium artifact run
|
|
||||||
- Bounds validation against normalized transcript
|
|
||||||
- Keep-selector derivation and Seriatim trim invocation
|
|
||||||
- Copy-through behavior when disabled or bounds indicate unchanged transcript
|
|
||||||
|
|
||||||
Does not own:
|
Bounds generation, selector validation, transcript production, and final
|
||||||
- Upstream normalization
|
acceptance are separate operations. Both enabled and disabled paths validate
|
||||||
- Downstream artifact analysis
|
the resulting transcript before materializing its canonical output.
|
||||||
|
|
||||||
## Config Fields Used
|
When `trim.enabled=true`:
|
||||||
- `session.session_id`
|
- shares the effective prompt context with early requirements inspection;
|
||||||
- `session.campaign`
|
- runs Scriptorium bounds artifact generation;
|
||||||
- `pipeline.workspace.root`
|
- optionally runs render-debug output generation;
|
||||||
- `pipeline.trim.enabled`
|
- validates bounds payload against transcript;
|
||||||
- `pipeline.trim.output_path`
|
- derives keep selector;
|
||||||
- `pipeline.trim.bounds.prompt_id`
|
- either copies unchanged transcript or runs Seriatim trim;
|
||||||
- `pipeline.trim.bounds.profile_id`
|
- validates trimmed transcript and materializes bounds output.
|
||||||
- `pipeline.trim.bounds.timeout`
|
|
||||||
- `pipeline.trim.bounds.output_path`
|
|
||||||
- `pipeline.trim.bounds.transcript_input_name`
|
|
||||||
- `pipeline.trim.bounds.render_debug`
|
|
||||||
- `pipeline.trim.bounds.render_output_path`
|
|
||||||
- `pipeline.seriatim.binary`
|
|
||||||
- `pipeline.seriatim.timeout`
|
|
||||||
- `pipeline.scriptorium.binary`
|
|
||||||
- `pipeline.scriptorium.config_path`
|
|
||||||
- `pipeline.scriptorium.timeout`
|
|
||||||
|
|
||||||
## External Adapters Used
|
When `trim.enabled=false`:
|
||||||
- Scriptorium adapter:
|
- copies normalized transcript to trimmed output.
|
||||||
- optional `RenderArtifact` for bounds debug render
|
|
||||||
- `RunArtifact` for bounds output
|
|
||||||
- Seriatim adapter:
|
|
||||||
- `Trim` when bounds indicate trimming is required
|
|
||||||
|
|
||||||
## State and Manifest Behavior
|
## Invariants
|
||||||
- Reads normalized transcript from normalize manifest outputs when available; falls back to canonical path.
|
|
||||||
- Uses run-local outputs/logs/reports/config/scratch paths when run layout is enabled.
|
|
||||||
- Promotes canonical trimmed transcript; promotes session bounds when trim enabled.
|
|
||||||
- Records bounds diagnostics, trim action, keep selector, and adapter metadata.
|
|
||||||
|
|
||||||
## Skip and Resume Behavior
|
- normalized transcript is required input.
|
||||||
- Runner-level skip applies when already succeeded and not forced.
|
- bounds output exists only in enabled trim path.
|
||||||
- Forced reruns can stale downstream succeeded stages.
|
- render-debug output is diagnostic and not a declared stage output.
|
||||||
- When `trim.enabled=false`, stage still succeeds by copying normalized to trimmed output.
|
- prepared preview and generated bounds use separate result destinations;
|
||||||
|
Scriptorium stderr and invocation records are the diagnostic references.
|
||||||
|
|
||||||
## Failure Behavior
|
The application checks projected bounds requirements before attempting any
|
||||||
- Fails on missing/invalid normalized transcript.
|
stage. See [preflight internals](preflight.md); actual transcript resolution and
|
||||||
- With trim enabled, fails on missing adapters/config, bounds generation/validation errors, invalid bounds JSON, invalid range/segment ids, trim adapter failures, or invalid trimmed output.
|
bounds validation remain responsibilities of this stage.
|
||||||
|
|
||||||
## Tests to Inspect Before Changing
|
## Resume Semantics
|
||||||
- `internal/stage/trim_test.go`
|
|
||||||
- `internal/adapters/scriptorium/subprocess_test.go`
|
|
||||||
- `internal/adapters/seriatim/subprocess_test.go`
|
|
||||||
|
|
||||||
## Architectural Invariants
|
The versioned semantic fingerprint covers enablement, the bounds prompt and
|
||||||
- Trim never falls back to processed transcript; normalized transcript is required input.
|
profile identifiers, the Scriptorium configuration identity, transcript input
|
||||||
- `session_bounds` output exists only for enabled trim path.
|
name, sticky session variable, bounds and trimmed output identities, and the
|
||||||
- Render-debug artifacts are diagnostics and not declared stage outputs.
|
Seriatim trim operation. Diagnostic bounds rendering, diagnostic output paths,
|
||||||
|
timeouts, executable paths, and optional reports are operational and do not
|
||||||
|
invalidate the canonical trimmed transcript.
|
||||||
|
|
||||||
|
Narratio cannot inspect prompt, profile, or configuration content that
|
||||||
|
Scriptorium or Seriatim privately resolves behind a stable identifier. Force
|
||||||
|
`trim` after changing such private content without changing its identifier.
|
||||||
|
|
||||||
|
## Related Contracts And Tests
|
||||||
|
|
||||||
|
- [Scriptorium](../integrations/scriptorium.md) owns bounds generation and
|
||||||
|
debug-render subprocess behavior.
|
||||||
|
- [Seriatim](../integrations/seriatim.md) owns transcript trimming behavior.
|
||||||
|
- [Configuration](../config.md#pipeline) owns trim fields and defaults.
|
||||||
|
- Implementation and tests: `internal/stage/trim.go`,
|
||||||
|
`internal/stage/trim_operations.go`, `internal/stage/trim_test.go`,
|
||||||
|
`internal/stage/semantic_contracts_refinement.go`
|
||||||
|
|||||||
@@ -1,71 +1,76 @@
|
|||||||
# Internal: Storage
|
# Internal: Storage
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
Document Narratio's remote storage backend contracts and implementations under `internal/adapters/storage`.
|
|
||||||
|
|
||||||
## Inputs and outputs
|
Explain the object-store interface and S3 implementation used by Narratio.
|
||||||
Inputs:
|
Remote key layout and lifecycle belong in [Operations](../operations.md), while
|
||||||
- Resolved storage config (`pipeline.storage.*`).
|
operator-selected storage fields and credential mechanisms belong in
|
||||||
- Bucket-relative object keys and local file paths from stage/app orchestration.
|
[Configuration](../config.md).
|
||||||
|
|
||||||
Outputs:
|
## Primary Contract
|
||||||
- Listed/downloaded/uploaded object metadata (`ObjectInfo`).
|
|
||||||
- Existence checks and storage-layer errors.
|
|
||||||
|
|
||||||
## Boundaries
|
`storage.ObjectStore` interface:
|
||||||
Owns:
|
|
||||||
- Remote object-store interface and implementation details.
|
|
||||||
- S3 client wiring and API calls.
|
|
||||||
- Object key normalization and upload/download/list primitives.
|
|
||||||
|
|
||||||
Does not own:
|
- `List(ctx, prefix)`
|
||||||
- Session/run prefix semantics.
|
- `Read(ctx, key)` returns an object body and the generation observed with it
|
||||||
- Archive commit order semantics.
|
- `Upload(ctx, localPath, key, opts)`
|
||||||
- Manifest updates.
|
- `UploadConditional(ctx, source, key, opts, condition)`
|
||||||
|
- `Delete(ctx, key)` removes one object and succeeds when it is already absent
|
||||||
|
- `Exists(ctx, key)`
|
||||||
|
|
||||||
## Config fields used
|
Key invariant:
|
||||||
- `pipeline.storage.backend`
|
- callers pass full bucket-relative keys;
|
||||||
- `pipeline.storage.s3.bucket`
|
- storage implementations do not infer campaign/session/run prefixes.
|
||||||
- `pipeline.storage.s3.region`
|
|
||||||
- `pipeline.storage.s3.endpoint`
|
|
||||||
- `pipeline.storage.s3.force_path_style`
|
|
||||||
- `pipeline.storage.s3.access_key_id_env`
|
|
||||||
- `pipeline.storage.s3.secret_access_key_env`
|
|
||||||
|
|
||||||
## External adapters used
|
`ReadObjectBounded` is the shared mechanism for small control objects. It opens
|
||||||
Storage package contracts:
|
one object version, returns the metadata observed with that body, rejects an
|
||||||
- `ObjectStore` (active remote object-store boundary): `List`, `Download`, `Upload`, `Exists`.
|
oversized known size before transfer, and still performs a context-aware
|
||||||
- `Backend` (archive request boundary): currently implemented with `NoopBackend` only.
|
limit-plus-one read. It closes the body on every exit. Callers own the policy
|
||||||
|
limit and add the control-object category to errors; this helper is not used for
|
||||||
|
large artifact payloads.
|
||||||
|
|
||||||
Implementations:
|
`StreamObject` transfers payloads to caller-owned writers using the metadata
|
||||||
- `S3Backend`: AWS SDK-backed `ObjectStore` implementation.
|
from the same response. It checks a caller-declared size or the observed size
|
||||||
- `FakeBackend`: deterministic test `ObjectStore` and archive backend.
|
when available, reads at most one byte beyond that size, and closes the body.
|
||||||
- `NoopBackend`: deterministic no-op archive backend for compatibility wiring.
|
Unknown-size responses stream to EOF; known zero is distinct from unknown.
|
||||||
|
|
||||||
## State and manifest behavior
|
## Composition
|
||||||
- Storage implementations are stateless with respect to manifest/session lifecycle.
|
|
||||||
- Caller supplies fully-qualified bucket-relative keys.
|
|
||||||
- Storage layer does not infer campaign/session/run/root-prefix semantics.
|
|
||||||
- Caller controls publish ordering; storage layer executes individual operations in the order invoked.
|
|
||||||
|
|
||||||
## Skip and resume behavior
|
`NewObjectStoreFromConfig` constructs the S3-backed implementation from
|
||||||
- No storage-level skip/resume behavior.
|
resolved configuration. Invocation acquisition calls [ConfigKit configured startup](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap)
|
||||||
- Skip/resume decisions are made by stage/app logic before storage calls occur.
|
before typed loading; the storage adapter consumes the resolved values. It does
|
||||||
|
not own discovery, defaults, or configuration validation. See
|
||||||
|
[Operations](../operations.md#workspace-permissions) for credential permissions.
|
||||||
|
|
||||||
## Failure behavior
|
## S3 Backend Behavior
|
||||||
- `NewObjectStoreFromConfig` fails when no remote backend is configured or required S3 config is missing.
|
|
||||||
- `S3Backend` constructor fails when required bucket is missing or AWS client setup fails.
|
|
||||||
- CRUD operations return contextual errors (including not-found behavior via `Exists`).
|
|
||||||
- Key normalization is applied before operations (`\\` to `/`, leading slash trimmed).
|
|
||||||
|
|
||||||
## Tests to inspect before changing
|
- normalizes object keys.
|
||||||
- `internal/adapters/storage/factory_test.go`
|
- `List` paginates and returns normalized `ObjectInfo`.
|
||||||
- `internal/adapters/storage/s3_backend_test.go`
|
- A truncated S3 listing must supply a new, non-empty continuation token;
|
||||||
- `internal/adapters/storage/fake_test.go`
|
otherwise listing fails with bucket and prefix context instead of looping.
|
||||||
- `internal/adapters/storage/keys_test.go`
|
- `Upload` streams local file and returns remote metadata.
|
||||||
- `internal/adapters/storage/archive.go` + consumers in stage tests (`prepare`, `archive`)
|
- `Read` binds a returned body to its S3 ETag. `UploadConditional` maps an ETag
|
||||||
|
match or absence precondition directly to the provider request and reports a
|
||||||
|
failed precondition without performing a local check-then-write replacement.
|
||||||
|
- `Delete` maps one normalized key to the provider delete-object operation and
|
||||||
|
treats an absent object as success.
|
||||||
|
- `Exists` maps not-found responses to `false`.
|
||||||
|
|
||||||
## Architectural invariants
|
## Invariants
|
||||||
- Callers pass full bucket-relative keys.
|
|
||||||
- Storage backends must not prepend or infer narratio prefixes.
|
- storage layer is stateless regarding manifest/stage progression.
|
||||||
- Remote transport details remain isolated to storage adapter implementations.
|
- bounded reads never retain more than the caller's limit plus one byte and do
|
||||||
|
not replace owner-specific size policy.
|
||||||
|
- publish ordering semantics are owned by stage/app code, not storage adapters.
|
||||||
|
- A caller that installs remote content into a canonical workspace path first
|
||||||
|
writes a sibling temporary file, validates the complete object against its
|
||||||
|
owner-specific contract, and only then replaces the destination. Temporary
|
||||||
|
files used solely for remote comparisons are removed by their callers and do
|
||||||
|
not represent installed workspace state.
|
||||||
|
|
||||||
|
## Implementation And Tests
|
||||||
|
|
||||||
|
- Contract and S3 adapter: `internal/adapters/storage`
|
||||||
|
- Composition: `internal/app/object_store.go`
|
||||||
|
- Tests: `internal/adapters/storage/*_test.go`,
|
||||||
|
`internal/app/object_store_test.go`
|
||||||
|
|||||||
@@ -1,68 +1,112 @@
|
|||||||
# Workspace internals
|
# Internal: Workspace
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
Define the local durable and run-local workspace model used by stages, manifests, resume, and archive.
|
|
||||||
|
|
||||||
## Inputs and Outputs
|
Explain the helpers that construct local session and run paths, coordinate
|
||||||
Inputs:
|
single-writer access, and confine cleanup. The authoritative physical layout and
|
||||||
- `pipeline.workspace.root`
|
retention workflow belong in [Operations](../operations.md#local-state-layout).
|
||||||
- `session.campaign`
|
|
||||||
- `session.session_id`
|
|
||||||
- generated `run_id`
|
|
||||||
|
|
||||||
Outputs:
|
## Path Ownership
|
||||||
- Session manifest at `{workspace.root}/work/{campaign}/{session_id}/manifest.json`
|
|
||||||
- Run manifest at `{workspace.root}/work/{campaign}/{session_id}/runs/{run_id}/manifest.json`
|
|
||||||
- Canonical durable session directories and run-local stage trees
|
|
||||||
|
|
||||||
## Boundaries
|
`internal/artifacts` owns canonical session, run, and
|
||||||
Owns:
|
previous-cache path construction. `SessionPathsFor` provides the session-scoped
|
||||||
- Session-level path layout (`inputs/`, `audio/`, `transcripts/`, `artifacts/`, `reports/`, `logs/`, `config/`, `current/`, `runs/`)
|
path model, and layout creation goes through `EnsureLayoutFor`. Callers should
|
||||||
- Run-local stage sandbox layout under `runs/{run_id}/{stage}/`
|
consume those helpers instead of rebuilding relative paths.
|
||||||
- Session lock acquisition/release (`.lock`)
|
|
||||||
|
|
||||||
Does not own:
|
`internal/pathsafe` validates relative destinations. `internal/fileops` opens
|
||||||
- Stage business logic
|
explicit cleanup roots and removes only normalized proper descendants through
|
||||||
- Remote archive semantics (documented in `stage-archive.md`)
|
the resulting root handle.
|
||||||
- CLI argument parsing
|
|
||||||
|
|
||||||
## Config Fields Used
|
`internal/fileops` owns the ordinary workspace mode contract. On POSIX,
|
||||||
- `pipeline.workspace.root`
|
`WorkspaceDirectoryMode` is setgid `02775` and `WorkspaceFileMode` is `0664`.
|
||||||
- `pipeline.workspace.cleanup_after_archive`
|
`EnsureWorkspaceDirectory` reapplies the directory mode after creation so a
|
||||||
- `pipeline.spool.root`
|
restrictive umask cannot remove group access, while retaining existing ownership
|
||||||
- `pipeline.spool.delete_audio_after_archive`
|
and group. Credential paths are outside this contract; the platform-specific
|
||||||
- `session.campaign`
|
operational requirements are in [Operations](../operations.md#workspace-permissions).
|
||||||
- `session.session_id`
|
|
||||||
|
|
||||||
## External Adapters Used
|
## Run-Local Stage Layout
|
||||||
None directly in this subsystem. Stages may use object storage adapters and then write local outputs into this layout.
|
|
||||||
|
|
||||||
## State and Manifest Behavior
|
`internal/stage/run_local.go` maps stage outputs and diagnostics into an
|
||||||
- Session state is persisted in the session manifest (`manifest.Manifest`).
|
invocation-scoped layout. Successful outputs are validated and atomically
|
||||||
- Invocation history is persisted per run in run manifests under `runs/{run_id}/manifest.json`.
|
materialized into canonical session paths before stage success. Managed
|
||||||
- During each run, stage outputs are often written run-local first (`runs/{run_id}/{stage}/outputs/...`) and promoted to canonical session paths after stage success.
|
previous-session cache paths remain session-durable and are never redirected
|
||||||
- `manifest.Artifacts` entries record `ProducerRunID` for durable outputs.
|
into run-local output space.
|
||||||
- For S3 audio sessions, `prepare` records spool/work paths and S3 provenance in `manifest.Inputs`.
|
|
||||||
|
|
||||||
## Skip and Resume Behavior
|
Polish and extraction write to actual run-local output, log, and debug paths.
|
||||||
- Skip/resume decisions are made in `internal/app` (`run_control.go`, `resume.go`) using stage status in the session manifest.
|
The artifact path owner advances managed relative `logs/<stage>` and `debug/<stage>` links;
|
||||||
- `--force` reruns selected stages and marks downstream previously-succeeded stages as `stale`.
|
skips do not rotate them. Restore has its own diagnostic attempt. Extraction
|
||||||
- Workspace layout is idempotent (`EnsureLayoutFor`) and reused across runs.
|
promotes validated lanes to flat artifacts; the original bundle remains in
|
||||||
|
the producing run until cleanup. See [Operations](../operations.md#local-state-layout).
|
||||||
|
|
||||||
## Failure Behavior
|
Prepared references delivered to Notarius use session-durable paths owned by
|
||||||
- Failures preserve manifests and run-local files for inspection.
|
`internal/artifacts` beneath
|
||||||
- Lock conflicts fail fast via `ErrLockConflict`.
|
`inputs/references/<sha256>/<prepared-basename>`. These verified
|
||||||
- Cleanup can fail post-archive; failure is recorded in archive stage metadata and returned by the run.
|
content-addressed snapshots are outside run-local layout, survive ordinary
|
||||||
|
session run-history cleanup, and are excluded from publish and restore enumeration.
|
||||||
|
|
||||||
## Tests to Inspect Before Changing
|
## Locking
|
||||||
- `internal/artifacts/local_test.go`
|
|
||||||
- `internal/stage/run_local_test.go`
|
|
||||||
- `internal/app/run_control_test.go`
|
|
||||||
- `internal/app/resume_run_stage_test.go`
|
|
||||||
- `internal/app/post_archive_cleanup_test.go`
|
|
||||||
|
|
||||||
## Architectural Invariants
|
`artifacts.LocalStore` enforces single-writer workspace access via an
|
||||||
- Session root is campaign-aware: `{workspace.root}/work/{campaign}/{session_id}`.
|
operating-system lock held on `<workspace.root>/.lock` (`ErrLockConflict` on contention). The
|
||||||
- Run roots are always nested: `runs/{run_id}` under the session root.
|
file retains owner metadata after release or process death; its existence is
|
||||||
- Run-local output promotion must end in canonical session paths.
|
not evidence that a lock is active. Runs, preflight, mutating restore, and
|
||||||
- Cleanup only targets run-scoped directories and must never delete configured root directories.
|
manual cleanup acquire it before creating or changing managed session state.
|
||||||
|
Initialization targeting managed work also acquires it. They wait only while
|
||||||
|
their context remains active and report a release failure. Read-only inspection
|
||||||
|
and dry runs do not acquire it; separate workspaces remain independent.
|
||||||
|
Standalone preflight holds the same lock through preparation, readiness probes,
|
||||||
|
and finalization, keeping active probe files outside concurrent cleanup.
|
||||||
|
Preparation uses ordinary manifest transitions and invalidation.
|
||||||
|
|
||||||
|
The runner assigns every invocation a run-workspace identity but creates the
|
||||||
|
physical stage run directory only when an executing stage requires it. Fully
|
||||||
|
reused pipeline invocations and cleanup-only invocations do not accumulate
|
||||||
|
empty run directories. Readiness probes create their separate invocation-scoped
|
||||||
|
diagnostic directories when checks run, including during a reused preparation.
|
||||||
|
|
||||||
|
## Cleanup Semantics
|
||||||
|
|
||||||
|
The canonical cleanup stage:
|
||||||
|
|
||||||
|
- runs after notify only when selected by the invocation range;
|
||||||
|
- requires a succeeded publish record with `uploaded=true`, the published run
|
||||||
|
ID, remote commit key, and current commit-pointer key;
|
||||||
|
- consumes the resolved cleanup policy described in
|
||||||
|
[Configuration](../config.md);
|
||||||
|
- removes the entire session run history and recognized managed diagnostic views;
|
||||||
|
- refuses unsafe deletes (root delete, traversal, and out-of-root targets);
|
||||||
|
- treats missing targets as successful, idempotent deletion; and
|
||||||
|
- uses its ordinary failed/succeeded manifest stage record for retry. A later
|
||||||
|
full run can skip reusable upstream stages and retry cleanup without
|
||||||
|
republishing.
|
||||||
|
|
||||||
|
Manual cleanup uses the same root-confined deletion mechanism. Invocation
|
||||||
|
syntax and exact deletion scope belong in [CLI](../cli.md#session-clean) and
|
||||||
|
[Operations](../operations.md#cleanup).
|
||||||
|
|
||||||
|
## Invariants
|
||||||
|
|
||||||
|
- campaign-aware session root is mandatory.
|
||||||
|
- manifest-driven stage state is durable across runs.
|
||||||
|
- cleanup guardrails prevent destructive root/out-of-scope deletion.
|
||||||
|
- restore installation is confined to validated relative paths beneath the
|
||||||
|
selected session root.
|
||||||
|
- ordinary workspace paths retain group-writable directory and file modes across
|
||||||
|
nested creation, replacement, and Notarius promotion.
|
||||||
|
|
||||||
|
## Implementation And Tests
|
||||||
|
|
||||||
|
- Path model and local store: `internal/artifacts/paths.go`,
|
||||||
|
`internal/artifacts/local.go`, `internal/artifacts/attempt_views.go`
|
||||||
|
- Run-local materialization: `internal/stage/run_local.go`
|
||||||
|
- Bundle validation and product promotion: `internal/stage/extract.go`
|
||||||
|
- Workspace modes: `internal/fileops/modes.go`
|
||||||
|
- Cleanup confinement: `internal/fileops/cleanup.go`,
|
||||||
|
`internal/stage/cleanup.go`, `internal/stage/cleanup_plan.go`, and
|
||||||
|
`internal/app/cleanup_targets.go`
|
||||||
|
- Tests: `internal/artifacts/paths_model_test.go`,
|
||||||
|
`internal/artifacts/local_test.go`, `internal/stage/run_local_test.go`,
|
||||||
|
`internal/fileops/modes_posix_test.go`,
|
||||||
|
`internal/fileops/cleanup_test.go`, `internal/app/cleanup_targets_test.go`,
|
||||||
|
`internal/stage/cleanup_test.go`, and
|
||||||
|
`internal/app/cleanup_orchestration_test.go`
|
||||||
|
|||||||
@@ -1,213 +1,805 @@
|
|||||||
# Operations
|
# Operations Guide
|
||||||
|
|
||||||
This guide describes the implemented operator lifecycle for Narratio.
|
Operator workflow for running, recovering, and publishing Narratio sessions.
|
||||||
|
|
||||||
For field-level configuration, see [docs/config.md](./config.md). For full command/flag reference, see [docs/cli.md](./cli.md).
|
For command syntax, see [docs/cli.md](./cli.md). For field-level config, see [docs/config.md](./config.md).
|
||||||
|
|
||||||
## Normal workflow (S3-first path)
|
## Campaign and Session Selection
|
||||||
|
|
||||||
1. Upload session `.flac` files to object storage under the configured session audio prefix.
|
Identity and exact-file selection are complementary: a selected file supplies
|
||||||
2. Run Narratio:
|
configuration and an explicit ID asserts its effective identity. Session domain
|
||||||
|
commands take positional identity; `--session-file` selects its source. An
|
||||||
|
explicit `--party-file` supplies the roster consistently across consumers.
|
||||||
|
See [CLI selectors](cli.md#configuration-selectors) and
|
||||||
|
[configuration discovery](config.md#discovery-and-selection) for selection rules.
|
||||||
|
Existing scripts should follow the [CLI migration table](cli.md#migration-from-the-previous-cli).
|
||||||
|
|
||||||
|
## Session Initialization
|
||||||
|
|
||||||
|
Use `session init` to generate a concrete session file for local or remote use.
|
||||||
|
|
||||||
|
Local file:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio run --session-id 2026-04-04
|
narratio session init 2026-04-04 --output ./session.yml --date 2026-04-04 --title "Session 12"
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Read success output:
|
Remote session object:
|
||||||
- `narratio run: session <session_id>; executed=<n> skipped=<n>; manifest=<path>`
|
|
||||||
- use `manifest=<path>` with `status` for inspection.
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
- default config/session discovery applies unless `--config` and `--session` are passed.
|
|
||||||
- S3 audio mode requires `session.inputs.audio_s3.prefix` and valid object-store access.
|
|
||||||
|
|
||||||
## Restore workflow
|
|
||||||
|
|
||||||
Use restore when local durable session state is missing or stale and archive current state is authoritative.
|
|
||||||
|
|
||||||
Dry-run (no local writes):
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio restore --session-id 2026-04-04 --dry-run
|
narratio session init 2026-04-04 --remote --force
|
||||||
```
|
```
|
||||||
|
|
||||||
Execution:
|
Installation config supplies services, credentials, and an optional reference
|
||||||
|
catalog. Onboard a campaign with [campaign.yml](../examples/campaigns/lantern-coast/campaign.yml),
|
||||||
|
[party.yml](../examples/campaigns/lantern-coast/party.yml), and
|
||||||
|
[speakers.yml](../examples/campaigns/lantern-coast/speakers.yml). The campaign
|
||||||
|
selects its roster, speakers, optional catalog sources, inline vocabulary and
|
||||||
|
replacement rules. The roster describes characters and players; speaker mapping
|
||||||
|
separately describes recordings. The example uses synthetic catalog data.
|
||||||
|
|
||||||
|
`session init` uses a campaign template if configured, otherwise the installation
|
||||||
|
template or built-in default. Supply session audio and metadata, for example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio restore --session-id 2026-04-04
|
narratio session init 2026-04-04 --output ./session.yml --audio-dir ./audio
|
||||||
```
|
```
|
||||||
|
|
||||||
Post-restore analyze rerun pattern:
|
Preparation resolves the roster, rules, and vocabularies into standalone inputs.
|
||||||
|
See [Configuration](config.md#campaign) for fields, inheritance and clearing.
|
||||||
|
|
||||||
|
## Migrating to the shared pipeline
|
||||||
|
|
||||||
|
Before upgrading an existing deployment, retain its authored sources and any
|
||||||
|
committed snapshots. Convert campaign identity and inputs to the shared campaign
|
||||||
|
fields and Narratio extension in [Configuration](config.md#campaign); replace
|
||||||
|
file-based autocorrection with inline rules and the private spell source with a
|
||||||
|
shared glossary. Reauthor wrapperless vocabularies as shared envelopes. Remove
|
||||||
|
retired spool/audio-cache settings, Notarius descriptor fields, `resume`, and
|
||||||
|
`chunk_cache`; select native `cache` and optional debug controls as needed.
|
||||||
|
Keep external tool configuration under each tool's ownership: Audita uses its
|
||||||
|
version 3 configuration and Notarius its version 6 configuration. Consult the
|
||||||
|
[Audita](integrations/audita.md) and [Notarius](integrations/notarius.md)
|
||||||
|
contracts for their upstream guides.
|
||||||
|
|
||||||
|
Move unsupported local state aside before regenerating or importing published
|
||||||
|
products into a new local baseline. Do not edit state markers manually.
|
||||||
|
Products now use flat session paths and diagnostics use
|
||||||
|
latest-attempt views; explicit remote destinations remain independent. Review
|
||||||
|
cleanup and separately configured subprocess caches before removing old state.
|
||||||
|
This guidance does not create a release or publish any changes.
|
||||||
|
|
||||||
|
## Standard Session Workflow
|
||||||
|
|
||||||
|
1. Select pipeline/campaign/session config.
|
||||||
|
2. Prepare inputs and check session readiness:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio run-stage --session-id 2026-04-04 --force analyze
|
narratio preflight 2026-04-04
|
||||||
```
|
```
|
||||||
|
|
||||||
Restore source-of-truth:
|
3. (Optional) inspect stage decisions:
|
||||||
- remote commit marker: `current/run_id.txt`
|
|
||||||
- remote current manifest: `current/manifest.json`
|
|
||||||
|
|
||||||
Restore default scope:
|
|
||||||
- includes `manifest.json`, `transcripts/**`, `artifacts/**`
|
|
||||||
- includes `audio/**` only with `--include-audio`
|
|
||||||
- excludes `runs/**`, `logs/**`, `reports/**`, `config/**`, `inputs/**`, and `current/**` (except remote `current/manifest.json` as source)
|
|
||||||
|
|
||||||
## Local filesystem layout and state artifacts
|
|
||||||
|
|
||||||
Session root:
|
|
||||||
- `{workspace.root}/work/{campaign}/{session_id}/`
|
|
||||||
|
|
||||||
Primary state:
|
|
||||||
- `manifest.json`: session-level stage state.
|
|
||||||
- `runs/{run_id}/manifest.json`: invocation-level state.
|
|
||||||
- `.lock`: session lock while a modifying command is active.
|
|
||||||
|
|
||||||
Canonical session directories:
|
|
||||||
- `inputs/`
|
|
||||||
- `audio/`
|
|
||||||
- `transcripts/`
|
|
||||||
- `artifacts/`
|
|
||||||
- `reports/`
|
|
||||||
- `logs/`
|
|
||||||
- `config/`
|
|
||||||
- `current/`
|
|
||||||
- `runs/`
|
|
||||||
|
|
||||||
Run-local stage directories:
|
|
||||||
- `runs/{run_id}/{stage}/` with stage-local `outputs/`, `logs/`, `reports/`, `config/`, `scratch/`.
|
|
||||||
|
|
||||||
Behavior:
|
|
||||||
- directory creation is idempotent.
|
|
||||||
- stage outputs are generally generated run-local first, then promoted to canonical paths on success.
|
|
||||||
- restore installs downloaded files to canonical session paths and does not recreate historical run sandboxes.
|
|
||||||
|
|
||||||
## Analyze artifact execution lifecycle
|
|
||||||
|
|
||||||
Analyze executes configured artifacts from `pipeline.scriptorium.artifacts`.
|
|
||||||
|
|
||||||
Execution model:
|
|
||||||
- executable set = enabled artifacts, filtered by `--artifacts` when provided.
|
|
||||||
- artifact-to-artifact dependencies are declared via `depends_on`.
|
|
||||||
- selected artifacts run in deterministic dependency order.
|
|
||||||
- after each successful artifact run, output is promoted to configured canonical `output_path`.
|
|
||||||
|
|
||||||
Configured artifact source reuse:
|
|
||||||
- a non-executable configured artifact can satisfy inputs if its configured output file already exists and is valid.
|
|
||||||
- reused configured artifact provenance is `filesystem.disabled_artifact_output`.
|
|
||||||
|
|
||||||
`--artifacts` behavior:
|
|
||||||
- accepted on `run`, `resume`, and `run-stage analyze`.
|
|
||||||
- filters analyze execution only; does not force stage rerun.
|
|
||||||
|
|
||||||
## Remote archive layout and publish contract
|
|
||||||
|
|
||||||
When archive is enabled and run upload is enabled, archive publishes under:
|
|
||||||
|
|
||||||
- session prefix: `{root_prefix}/campaigns/{campaign}/sessions/{session_id}/`
|
|
||||||
- run prefix: `{session_prefix}/runs/{run_id}/`
|
|
||||||
|
|
||||||
Archive uploads:
|
|
||||||
- run record files from run root (excluding `audio/`).
|
|
||||||
- promoted files from explicit `archive.promote_artifacts` rules.
|
|
||||||
|
|
||||||
Publish order:
|
|
||||||
1. upload `current/manifest.json`
|
|
||||||
2. upload `current/run_id.txt` last
|
|
||||||
|
|
||||||
`current/run_id.txt` is the remote commit marker.
|
|
||||||
|
|
||||||
Archive promotion is explicit and source-based:
|
|
||||||
- Narratio does not auto-promote all generated analyze artifacts.
|
|
||||||
- each rule resolves `source` through the artifact resolver/catalog model, then uploads to `dest`.
|
|
||||||
- missing required promotion sources fail archive stage.
|
|
||||||
- missing optional promotion sources are skipped.
|
|
||||||
- invalid resolved artifacts fail archive stage.
|
|
||||||
|
|
||||||
## Resume, retry, restore, and safe rerun behavior
|
|
||||||
|
|
||||||
Default skip:
|
|
||||||
- `run` and `run-stage` skip already-succeeded stages unless `--force` is set.
|
|
||||||
|
|
||||||
Resume:
|
|
||||||
- `resume` starts at first non-succeeded stage.
|
|
||||||
- `resume --force` runs full stage order.
|
|
||||||
|
|
||||||
Restore conflict policy:
|
|
||||||
- restore classifies local differences as conflicts.
|
|
||||||
- without `--force`, restore fails when conflicts exist.
|
|
||||||
- with `--force`, conflicting local files are overwritten by remote archive files.
|
|
||||||
|
|
||||||
Forced reruns:
|
|
||||||
- force-rerunning an upstream succeeded stage marks downstream succeeded stages as `stale`.
|
|
||||||
|
|
||||||
Safe rerun pattern:
|
|
||||||
1. rerun the changed stage with `--force`.
|
|
||||||
2. run `resume` to rebuild downstream stages.
|
|
||||||
|
|
||||||
## Cleanup behavior
|
|
||||||
|
|
||||||
Cleanup is considered only when archive stage executed and succeeded.
|
|
||||||
|
|
||||||
Cleanup toggles:
|
|
||||||
- `pipeline.spool.delete_audio_after_archive=true` deletes run-scoped spool audio.
|
|
||||||
- `pipeline.workspace.cleanup_after_archive=true` deletes run-scoped local run directory.
|
|
||||||
|
|
||||||
Cleanup eligibility gates:
|
|
||||||
- archive enabled
|
|
||||||
- archive run upload enabled
|
|
||||||
- run record upload completed
|
|
||||||
- current pointer write completed (`current/run_id.txt` written)
|
|
||||||
|
|
||||||
No cleanup for failed/incomplete/unarchived/archive-skipped runs.
|
|
||||||
|
|
||||||
## Failure and recovery playbooks
|
|
||||||
|
|
||||||
After run failure, Narratio keeps:
|
|
||||||
- session manifest
|
|
||||||
- run manifest
|
|
||||||
- run-local artifacts/logs/config/reports
|
|
||||||
|
|
||||||
Failed or incomplete runs remain local-only.
|
|
||||||
|
|
||||||
After restore failure:
|
|
||||||
- already-installed restore files remain in place.
|
|
||||||
- restore does not roll back prior successful installs.
|
|
||||||
- existing local manifest is preserved if restored manifest validation/install fails.
|
|
||||||
|
|
||||||
Recommended recovery:
|
|
||||||
|
|
||||||
1. inspect state:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio status --manifest <manifest-path>
|
narratio session plan 2026-04-04
|
||||||
```
|
```
|
||||||
|
|
||||||
2. for restore-specific checks, run:
|
4. Run the pipeline:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
narratio restore --session-id 2026-04-04 --dry-run
|
narratio run 2026-04-04
|
||||||
```
|
```
|
||||||
|
|
||||||
3. fix root cause (config/input/credentials/storage/service availability).
|
5. Check state:
|
||||||
4. continue with `resume`, or targeted `run-stage --force` followed by `resume`.
|
|
||||||
|
|
||||||
## Restore report
|
```bash
|
||||||
|
narratio session status 2026-04-04
|
||||||
|
```
|
||||||
|
|
||||||
Non-dry-run restore writes a durable report at:
|
Status distinguishes currently resolved configuration provenance from the last
|
||||||
- `reports/restore-latest.json`
|
persisted configuration, helping diagnose overlay switches without changing
|
||||||
|
semantic resume authority. Run and plan reports describe execution and decisions;
|
||||||
|
see the [report fields](cli.md#public-domain-report-fields).
|
||||||
|
|
||||||
Report content includes:
|
Before switching an operational overlay, compare its effective configuration
|
||||||
- identity (`campaign`, `session_id`, `run_id`)
|
with the base through `narratio config diff --against-overlay NAME`. When using an
|
||||||
- mode flags (`dry_run`, `force`, `include_audio`)
|
explicit root, supply it with both `--config` and `--against-config`. Each side
|
||||||
- plan counts and execution counts
|
loads independently using its own defaults. Native inspection retains authored
|
||||||
- per-action status
|
family declarations; use `narratio artifacts list` to review concrete identities,
|
||||||
|
outputs, dependencies, and selected-party members. See
|
||||||
|
[configuration inspection](cli.md#configuration-inspection) for selection and
|
||||||
|
comparison details.
|
||||||
|
|
||||||
Dry-run does not write restore report files.
|
### Prompt requirements preflight
|
||||||
|
|
||||||
## Operational caveats
|
After selected preparation completes or is reused, Narratio checks downstream
|
||||||
|
work projected to run before processing continues. Audita preflight uses the
|
||||||
|
prepared glossary files, a synthetic transcript, and the selected Audita
|
||||||
|
configuration; its native provider smoke checks are enabled. Notarius inspection
|
||||||
|
and preflight use its configured pipeline and the verified transcript when available,
|
||||||
|
or a synthetic transcript otherwise. Both may contact providers. Scriptorium
|
||||||
|
requirements discovery checks projected trim and analysis bindings. A missing
|
||||||
|
required binding or failed check stops the invocation; incomplete or conditional
|
||||||
|
prompt discovery can produce warnings. Already completed work remains recorded.
|
||||||
|
`session plan` does not invoke these downstream checks.
|
||||||
|
|
||||||
- `status` requires explicit `--manifest`; there is no session-id lookup command.
|
Standalone `preflight` prepares or reuses the session's real inputs before
|
||||||
- local and S3 audio input modes are mutually exclusive.
|
checking every enabled downstream capability and prompt prerequisite, including
|
||||||
- archive publish requires upstream stages through `analyze` to be `succeeded`.
|
work whose outputs could be reused. It may create workspace state, download
|
||||||
- required promotion rules can fail when selected analyze artifacts did not generate a required file path.
|
inputs, update the manifest, and contact providers. Changed inputs can stale
|
||||||
- restore requires configured remote object storage and committed remote current state.
|
dependent stage records through ordinary preparation rules. Preparation remains
|
||||||
|
available for reuse if a later readiness check fails. Preflight stops before
|
||||||
|
processing, publishing, notification, or cleanup.
|
||||||
|
|
||||||
|
For S3 audio, preflight checks source identity through ordinary preparation
|
||||||
|
reuse and can download current inputs when preparation runs. An access failure
|
||||||
|
can prevent readiness. In contrast, [session planning](cli.md#session-plan)
|
||||||
|
only inspects the source evidence and projects the resulting work.
|
||||||
|
|
||||||
|
Audita checks a synthetic transcript. Notarius uses a verified trimmed
|
||||||
|
transcript only when the normal work projection indicates its producers will
|
||||||
|
not rerun; otherwise it uses a synthetic input. These checks do not establish
|
||||||
|
real-transcript feasibility, editorial quality, or future provider availability.
|
||||||
|
See [Audita](integrations/audita.md) and [Scriptorium](integrations/scriptorium.md).
|
||||||
|
|
||||||
|
The workspace lock covers preparation, probes, and finalization. Probe diagnostics
|
||||||
|
under `runs/` are disposable and can be removed by a later authorized cleanup;
|
||||||
|
prepared inputs remain durable. Preflight itself does not run cleanup or rotate
|
||||||
|
processing-stage diagnostic views. See [cleanup](#cleanup).
|
||||||
|
|
||||||
|
## Stage Execution and Continuation Behavior
|
||||||
|
|
||||||
|
Canonical stage order:
|
||||||
|
|
||||||
|
1. `prepare`
|
||||||
|
2. `transcribe`
|
||||||
|
3. `merge`
|
||||||
|
4. `polish`
|
||||||
|
5. `normalize`
|
||||||
|
6. `trim`
|
||||||
|
7. `render`
|
||||||
|
8. `extract`
|
||||||
|
9. `analyze`
|
||||||
|
10. `publish`
|
||||||
|
11. `notify`
|
||||||
|
12. `cleanup`
|
||||||
|
|
||||||
|
Execution rules:
|
||||||
|
|
||||||
|
- succeeded stages are skipped unless `--force` is set; stages with semantic
|
||||||
|
configuration contracts additionally require matching versioned evidence;
|
||||||
|
- `run` continues interrupted or partially completed sessions by running non-succeeded stages;
|
||||||
|
- forcing a stage marks succeeded transitive dependents as `stale` before the
|
||||||
|
replacement runs; render and extract are independent siblings; and
|
||||||
|
- an executed failure, changed self-skip, or success that replaces a different
|
||||||
|
effective outcome uses the same fixed dependency relation. A
|
||||||
|
repeated self-skip with the same reason and no outputs is stable and does not
|
||||||
|
perpetually rerun dependent work.
|
||||||
|
|
||||||
|
Every aggregate stage except analyze currently provides semantic-configuration
|
||||||
|
evidence; transcribe additionally reconciles per-speaker completion evidence,
|
||||||
|
while analyze retains its more precise per-artifact fingerprints and validator.
|
||||||
|
Prepare additionally validates current stable/local/S3 source identity and the
|
||||||
|
checksums of its durable prepared copies before reuse. Changed bytes, audio
|
||||||
|
membership, S3 object identity, or missing/tampered copies rerun prepare and
|
||||||
|
its fixed descendants without requiring `--force`. Changing prepare selection
|
||||||
|
semantics likewise reruns all fixed descendants; changing
|
||||||
|
WhisperX language/service identity reuses prepare; changing a Seriatim merge
|
||||||
|
transformation reuses prepare and transcribe; and changing a selected Audita
|
||||||
|
overlay or profile reuses prepare, transcribe, and merge while rebuilding
|
||||||
|
transcript refinement. A trim change invalidates both render and
|
||||||
|
extract through the fixed dependency relation, while a render-only change
|
||||||
|
preserves the extract sibling.
|
||||||
|
|
||||||
|
Operational timeouts, retry/concurrency tuning, executable paths,
|
||||||
|
workspace placement, reports, diagnostics, and secret values are
|
||||||
|
excluded. Configuration, models, prompts, modules, or resources loaded
|
||||||
|
privately inside external tools remain unobservable to Narratio. If their
|
||||||
|
contents change behind the same configured identifier, explicitly force the
|
||||||
|
affected stage.
|
||||||
|
|
||||||
|
An explicit self-skip is a durable `skipped` stage outcome that later runs
|
||||||
|
reconsider. It differs from successful no-output execution: disabled `render`
|
||||||
|
and `publish`, and absent or no-executable `analyze`, record `succeeded` with
|
||||||
|
metadata and no outputs. Ordinary later runs reuse those successful results;
|
||||||
|
when the observable enablement or configuration changes, selected work is
|
||||||
|
reassessed and reruns as needed. Use force to replace a current result or for
|
||||||
|
private upstream changes Narratio cannot observe. Supplied products are assessed
|
||||||
|
independently of historical producer configuration. Optional artifact
|
||||||
|
inputs are omitted only from the consuming artifact invocation and do not make
|
||||||
|
the stage self-skip.
|
||||||
|
|
||||||
|
Single-stage execution:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
narratio run 2026-04-04 --stage normalize --force
|
||||||
|
```
|
||||||
|
|
||||||
|
Contiguous bounded execution uses inclusive canonical endpoints:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
narratio session plan 2026-04-04 --from extract --through analyze --force
|
||||||
|
narratio run 2026-04-04 --from extract --through analyze --force
|
||||||
|
```
|
||||||
|
|
||||||
|
Omitting `--from` selects from `prepare`; omitting `--through` selects through
|
||||||
|
`cleanup`. Force applies only within the selected range. Repeating `--from`,
|
||||||
|
`--through`, or `--force` is rejected instead of resolving by argument order.
|
||||||
|
The plan command uses the same selection contract and prints only the selected
|
||||||
|
range. Planning is read-only: it clones the loaded manifest, models selected
|
||||||
|
stage transitions and invalidation in memory, and invokes resume validation
|
||||||
|
without writing the manifest, creating run directories, materializing files,
|
||||||
|
or invoking pipeline adapters. Analyze detail separates explicit targets,
|
||||||
|
prerequisite rebuilds, scheduled execution, and current reuse. This lets a
|
||||||
|
coarsely stale aggregate analyze stage show zero artifact executions when its
|
||||||
|
selected artifact evidence is still semantically current.
|
||||||
|
|
||||||
|
Before a bounded run or plan whose range starts after `prepare`, excluded
|
||||||
|
prefix work needs local success/skip evidence or applicable supplied-product
|
||||||
|
coverage. With a supplied transcript, prepare and independent render/extract
|
||||||
|
work do not automatically block downstream selections; required consumer inputs
|
||||||
|
must still exist. Narratio reports the first unsatisfied absent, pending, running, failed, stale,
|
||||||
|
or interrupted prerequisite without creating a run-local directory or changing
|
||||||
|
session state. Widen `--from` to include that stage, or recover it explicitly
|
||||||
|
before retrying. Excluded prefix stages are not resume-validated or repaired as
|
||||||
|
part of the bounded invocation; selected stages still reject missing, unsafe,
|
||||||
|
or manifest-inconsistent inputs at their owning boundary.
|
||||||
|
|
||||||
|
Stages after `--through` are not prerequisites and are never scheduled by the
|
||||||
|
bounded invocation. A selected forced stage can mark one of those succeeded
|
||||||
|
dependents stale through the fixed invalidation relation, but the dependent
|
||||||
|
does not execute until a later invocation selects it. Production composition
|
||||||
|
likewise initializes only collaborators needed by the selected range and
|
||||||
|
shared session lifecycle. In particular, render does not require Notarius or
|
||||||
|
Scriptorium, extract does not require Scriptorium, and analyze does not require
|
||||||
|
the transcription, Seriatim, Audita, or Notarius adapters.
|
||||||
|
|
||||||
|
### Transcription continuation and replacement
|
||||||
|
|
||||||
|
Transcribe checkpoints each validated speaker independently. If a later
|
||||||
|
speaker exhausts HTTP retries, the process is canceled, or the aggregate stage
|
||||||
|
save fails, the aggregate stage is not successful and downstream merge cannot
|
||||||
|
consume the partial set. The last successfully saved speaker records and their
|
||||||
|
canonical `transcripts/raw/<speaker>.json` files remain durable, however.
|
||||||
|
|
||||||
|
After correcting the underlying problem, retry normally:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
narratio run 2026-04-04 --stage transcribe
|
||||||
|
```
|
||||||
|
|
||||||
|
Narratio hashes the current prepared audio, validates recorded transcript JSON,
|
||||||
|
checksum, size, and location, and calls WhisperX only for missing or obsolete
|
||||||
|
speakers. Preparation and inspection share read-only [audio selection](config.md#session);
|
||||||
|
prepared recordings retain their bytes and filename suffixes. A changed audio
|
||||||
|
file replaces only its speaker; a changed WhisperX URL or language makes every
|
||||||
|
current speaker non-reusable. Retry, timeout, and
|
||||||
|
concurrency tuning do not invalidate completed speakers.
|
||||||
|
|
||||||
|
Use force only when every current transcript must be replaced, including after
|
||||||
|
a WhisperX model or private server-side configuration changes behind the same
|
||||||
|
URL and language:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
narratio run 2026-04-04 --stage transcribe --force
|
||||||
|
```
|
||||||
|
|
||||||
|
Force durably clears the reusable collection before sending requests. If that
|
||||||
|
forced attempt fails, a later ordinary retry reuses only replacement speakers
|
||||||
|
checkpointed after the reset; it does not revive pre-force results. Do not edit
|
||||||
|
speaker checksums or copy older JSON into the canonical directory to influence
|
||||||
|
reuse.
|
||||||
|
|
||||||
|
The first current Narratio invocation that selects transcribe for an older
|
||||||
|
aggregate-only manifest retranscribes every current speaker once because the
|
||||||
|
old record cannot prove which audio bytes produced each file. Subsequent runs
|
||||||
|
reuse the new versioned evidence normally. The overall session-manifest schema
|
||||||
|
identifier is unchanged, but older strict-decoding Narratio binaries may reject
|
||||||
|
a manifest after current Narratio writes the additive speaker fields; retain a
|
||||||
|
backup or complete the upgrade before relying on downgrade.
|
||||||
|
|
||||||
|
Importing published products does not restore every raw speaker file. If a
|
||||||
|
recorded canonical speaker transcript is absent locally, ordinary
|
||||||
|
reconciliation schedules that speaker again. Removing run directories does not
|
||||||
|
remove canonical checkpointed transcripts and does not by itself invalidate
|
||||||
|
them.
|
||||||
|
|
||||||
|
## Artifact Development Workflows
|
||||||
|
|
||||||
|
Choose the narrowest workflow that matches the intended replacement:
|
||||||
|
|
||||||
|
| Intent | Command | Preserved and rebuilt state |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Rebuild analysis only | [`narratio run 2026-04-04 --stage analyze --force`](./cli.md#run) | Preserves transcripts and current extraction products; force-runs selected analysis artifacts and their required analysis prerequisites. |
|
||||||
|
| Rebuild extraction and analysis | [`narratio artifacts regenerate 2026-04-04`](./cli.md#artifacts-regenerate) | Preserves transcripts; force-runs the complete configured extraction bundle, then selected analysis. `--artifacts` narrows analysis only. |
|
||||||
|
| Continue bounded work normally | [`narratio run 2026-04-04 --from extract --through analyze`](./cli.md#run) | Uses ordinary resume decisions: current extraction and analysis can be skipped, while incomplete or obsolete work runs. |
|
||||||
|
|
||||||
|
All three stop before publication. Inspect the results and run
|
||||||
|
[`narratio run SESSION --stage publish --force`](./cli.md#run) separately when delivery is intended.
|
||||||
|
|
||||||
|
For the extraction-plus-analysis development loop, use:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
narratio artifacts regenerate 2026-04-04
|
||||||
|
narratio artifacts regenerate 2026-04-04 --artifacts session_recap,player_handout
|
||||||
|
```
|
||||||
|
|
||||||
|
This command shares the forced bounded execution operation from
|
||||||
|
`extract` through `analyze`. Extraction always rebuilds its complete configured
|
||||||
|
bundle. Analysis rebuilds the selected targets and their required analysis
|
||||||
|
prerequisites, or uses the normal default selection when no artifact names are
|
||||||
|
given. The command does not run publish, notify, or cleanup; delivery and
|
||||||
|
retention remain separate operator actions.
|
||||||
|
|
||||||
|
Inspect current artifact evidence, then publish explicitly when the regenerated
|
||||||
|
set is ready:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
narratio session artifacts 2026-04-04
|
||||||
|
narratio run 2026-04-04 --stage publish --force
|
||||||
|
```
|
||||||
|
|
||||||
|
If planning or execution reports stale, missing, failed, or tampered
|
||||||
|
analysis evidence, regenerate the affected target instead of copying an older
|
||||||
|
canonical file into place or editing the manifest. See
|
||||||
|
[Troubleshooting: Analysis artifact evidence is not current](./troubleshooting.md#analysis-artifact-evidence-is-not-current).
|
||||||
|
|
||||||
|
Analyze checkpoints each completed configured artifact before starting later
|
||||||
|
artifact work. After a partial failure or interruption, retry normally: valid
|
||||||
|
earlier checkpoints are reused and execution resumes with failed, stale, or
|
||||||
|
missing work in dependency order. `--force` is unnecessary unless the operator
|
||||||
|
intends to replace otherwise-current artifacts.
|
||||||
|
|
||||||
|
### Developing With Audita And Notarius Overlays
|
||||||
|
|
||||||
|
All three applications use ConfigKit, but each owns its root configuration and
|
||||||
|
its own `overlays/` directory beside that file. A Narratio testing overlay can
|
||||||
|
explicitly select downstream testing overlays without requiring their names to
|
||||||
|
match. For example, Narratio's `overlays/testing.yml` may contain:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
audita:
|
||||||
|
overlay: testing
|
||||||
|
notarius:
|
||||||
|
config_overlay: downstream-economy
|
||||||
|
```
|
||||||
|
|
||||||
|
Place Audita's settings in `overlays/testing.yml` beside its configuration, and
|
||||||
|
Notarius's settings in `overlays/downstream-economy.yml` beside its configuration.
|
||||||
|
Use each tool's own schema for model/profile selection and other settings;
|
||||||
|
Narratio neither copies those settings nor implicitly forwards its overlay name.
|
||||||
|
Select the Narratio file with `--overlay testing` on the desired command. Each
|
||||||
|
downstream selector is used only when its stage actually executes: `polish` for
|
||||||
|
Audita and `extract` for Notarius. Production can omit both selectors.
|
||||||
|
|
||||||
|
Set `audita.debug: true` in Narratio to request Audita debug capture. Omission
|
||||||
|
or false adds no debug override. Narratio supplies the run-local `polish/debug` work destination and
|
||||||
|
the separate `polish/logs` report destination. Set `notarius.debug: true` to request Notarius capture; its debug directory alone
|
||||||
|
does not enable capture.
|
||||||
|
See the upstream [Audita configuration](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/config.md)
|
||||||
|
and [Notarius CLI](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.10.0/docs/cli.md).
|
||||||
|
|
||||||
|
Edits inside downstream configuration behind an unchanged selector are not
|
||||||
|
automatically detected by Narratio. To inspect a fresh Audita debug run, explicitly
|
||||||
|
rerun polish, for example:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
narratio run SESSION --overlay testing --force --from polish --through polish
|
||||||
|
```
|
||||||
|
|
||||||
|
This replaces polish output and invalidates dependent results; it is not a
|
||||||
|
diagnostics-only operation. Selecting testing does not create an isolated
|
||||||
|
workspace or retain a separate current result.
|
||||||
|
|
||||||
|
Review downstream retry settings and Narratio's extraction timeout together;
|
||||||
|
retries can increase elapsed time and provider charges.
|
||||||
|
|
||||||
|
Selecting Narratio's `testing` overlay then supplies `downstream-economy` only
|
||||||
|
when extraction executes. Switching that explicit selector makes a recorded
|
||||||
|
extraction non-current and reruns it when `extract` is in the selected stage
|
||||||
|
range; the usual dependent invalidation then applies. Selecting an overlay does
|
||||||
|
not create a separate workspace or retain a separate current extraction result.
|
||||||
|
|
||||||
|
Narratio cannot observe edits inside Notarius configuration behind an unchanged
|
||||||
|
selector. Force extraction after such an edit when a replacement is intended.
|
||||||
|
Use `artifacts regenerate` when both extraction and analysis must be rebuilt;
|
||||||
|
use `run SESSION --stage analyze --force` when the existing extraction products
|
||||||
|
should be preserved. Field
|
||||||
|
semantics belong in [Configuration](./config.md#notarius-configuration-overlay),
|
||||||
|
with Audita selectors covered under
|
||||||
|
[Audita selection and credentials](./config.md#audita-selection-and-credentials).
|
||||||
|
Exact downstream invocations belong in the [Audita](./integrations/audita.md)
|
||||||
|
and [Notarius](./integrations/notarius.md#invocation) integration contracts.
|
||||||
|
|
||||||
|
## Artifact Selection
|
||||||
|
|
||||||
|
For a configured artifact family, selecting its family key expands to every
|
||||||
|
concrete character artifact. Select a concrete generated key to operate on one
|
||||||
|
member only. Manifests and plan output retain the concrete key as the durable
|
||||||
|
identity and include the family and character ID as optional provenance.
|
||||||
|
|
||||||
|
`--artifacts` can be used on `run`, `session plan`, and
|
||||||
|
`artifacts regenerate`. For a bounded run or plan, the selected range must contain `analyze`
|
||||||
|
or `publish`.
|
||||||
|
|
||||||
|
Selection behavior:
|
||||||
|
|
||||||
|
- validates names against the derived concrete catalog and family selections;
|
||||||
|
- selects explicit analyze targets and permits their required configured
|
||||||
|
prerequisites to be reused or rebuilt first;
|
||||||
|
- uses those targets and their full prerequisite closure when preparation
|
||||||
|
collects previous-session input requirements;
|
||||||
|
- filters publish rules for `narratio.artifact.<name>` sources only;
|
||||||
|
- does not suppress built-in transcript, bounds, or explicitly configured
|
||||||
|
`narratio.extraction.<name>` publish sources; and
|
||||||
|
- never partially selects Notarius lanes.
|
||||||
|
|
||||||
|
## Extraction Workflow
|
||||||
|
|
||||||
|
Disabled extraction records a skipped outcome. When enabled, Narratio uses the
|
||||||
|
configured Notarius pipeline and verified prepared inputs. Bind the shared party
|
||||||
|
and combined glossary as described in [Configuration](config.md#notarius-reference-bindings).
|
||||||
|
The final trimmed transcript and content-identified snapshots under
|
||||||
|
`inputs/references/` are passed to the subprocess.
|
||||||
|
|
||||||
|
Successful configured lanes become flat `artifacts/<name>.json` products and
|
||||||
|
`narratio.extraction.<name>` sources. The original bundle remains under the
|
||||||
|
producing run until authorized cleanup removes it; it is not implicitly
|
||||||
|
published. A failed replacement does not make the earlier extraction record current. Native fallback counts and
|
||||||
|
readiness warnings remain visible in command reports.
|
||||||
|
|
||||||
|
Narratio can reuse completed extraction without starting Notarius. When extraction
|
||||||
|
runs, Notarius owns its own cache and configuration. Select native `cache` if
|
||||||
|
needed; force extraction requests `refresh`. Configure downstream cache locations
|
||||||
|
in Notarius, outside Narratio cleanup. A changed private downstream model or config
|
||||||
|
is not automatically detected; force extraction when fresh work is needed.
|
||||||
|
See [Notarius integration](integrations/notarius.md).
|
||||||
|
|
||||||
|
## Migrating Manifest Overlay Provenance
|
||||||
|
|
||||||
|
Manifests containing `effective_config.selected_profile` are rejected by strict
|
||||||
|
decoding. Historical session state is not converted in place; move it aside and
|
||||||
|
regenerate the session using the supported format. Do not edit immutable remote
|
||||||
|
snapshots.
|
||||||
|
|
||||||
|
## Migrating Audita and Provider Credentials
|
||||||
|
|
||||||
|
Install Audita v4.3.0 and its own configuration and selected pipeline before
|
||||||
|
running polish. Move ordered processing configuration into Audita; remove the
|
||||||
|
retired Narratio `pipeline.audita.modules` field. Update every old
|
||||||
|
`narratio.input.glossary` binding to the intended explicit glossary source and
|
||||||
|
rewrite legacy glossary files into the named-collection format. Narratio does
|
||||||
|
not translate these settings or files. Install a catalog separately when using
|
||||||
|
setting or system selections; see [glossary inputs](config.md#glossary-inputs).
|
||||||
|
|
||||||
|
List each downstream provider's exact environment-variable name in
|
||||||
|
`audita.credentials`; Narratio passes resolved values to Audita and does not
|
||||||
|
infer names or generate the downstream configuration. `audita.config_path`
|
||||||
|
and `audita.overlay` select Audita's configuration independently of Narratio's
|
||||||
|
overlay. Consult [Audita's configuration guide](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/config.md).
|
||||||
|
Operators can install the independently maintained [D&D recipes](https://forge.maximumdirect.net/eric/audita-pipelines-dnd/src/commit/6d5e66dcfca4bb5971a8423332a19ce884b846c0/README.md)
|
||||||
|
and select their production or testing overlays explicitly; Narratio does not
|
||||||
|
bundle those recipes or infer a downstream selection.
|
||||||
|
|
||||||
|
Preparation compares effective vocabulary and prepared evidence when deciding
|
||||||
|
reuse. If it changes, normal preparation invalidation applies; use
|
||||||
|
`narratio run <session-id> --stage prepare --force` when regeneration is needed.
|
||||||
|
Polish tracks its selected configuration and prepared glossary evidence, but
|
||||||
|
does not inspect the contents of Audita-owned files. Force polish after changing
|
||||||
|
those files behind unchanged selectors. Reports and debug destinations are
|
||||||
|
run-local; see the [Audita integration contract](integrations/audita.md).
|
||||||
|
|
||||||
|
## External Command Lifecycle
|
||||||
|
|
||||||
|
When an external command is cancelled or times out, Narratio terminates its
|
||||||
|
owned descendants as well as the command itself. Cancellation first requests
|
||||||
|
termination where the platform supports it, then force terminates after a
|
||||||
|
bounded wait. A command is not considered finished until its leader has been
|
||||||
|
reaped, and descendants that keep standard output or error open cannot keep
|
||||||
|
the invocation blocked. Other operating systems fail closed rather than launch
|
||||||
|
a command without tree ownership.
|
||||||
|
|
||||||
|
Subprocess diagnostic streams are separately redacted and capped at 8 MiB per
|
||||||
|
invocation. Narratio does not retain configured credential values in these logs
|
||||||
|
or their error tails; reaching a capture limit terminates the command tree and
|
||||||
|
reports which stream exceeded the limit. Scriptorium result stdout is captured
|
||||||
|
separately without redaction; see its [integration contract](integrations/scriptorium.md).
|
||||||
|
|
||||||
|
Run-local diagnostics are:
|
||||||
|
|
||||||
|
- `runs/{run_id}/polish/logs/{errors.yml,recoveries.yml,report.md}` when
|
||||||
|
Audita reporting is enabled, alongside captured streams and invocation records
|
||||||
|
- `runs/{run_id}/extract/logs/notarius.report.json`
|
||||||
|
- `runs/{run_id}/extract/logs/notarius.stderr.log`
|
||||||
|
- `runs/{run_id}/extract/notarius-output/` for original bundles until cleanup
|
||||||
|
|
||||||
|
The run upload is an allowlist derived from the session manifest's declared
|
||||||
|
current-run outputs, logs, and generated configurations, not a workspace scan.
|
||||||
|
References to canonical session files and prior-run paths are excluded. Each
|
||||||
|
declared source is opened without following symlinked ancestors or the leaf,
|
||||||
|
verified as a regular file, and streamed from that verified descriptor. After
|
||||||
|
destination planning, sources are verified and transferred sequentially. A
|
||||||
|
later invalid source can leave unselected immutable uploads; the current
|
||||||
|
publication remains unchanged.
|
||||||
|
Unlisted files and unsafe entries are never uploaded; a run with no declared
|
||||||
|
current-run diagnostics uploads no run-local files. No distinguished diagnostic
|
||||||
|
file is uploaded. The original bundle is never scanned for implicit publication;
|
||||||
|
only lanes named by explicit `pipeline.publish.outputs` rules are uploaded.
|
||||||
|
To inspect a published polish report remotely, read its declared object under
|
||||||
|
the run archive's `polish/logs/` prefix. Session restore does
|
||||||
|
not restore run-archive diagnostics as canonical session files; it restores only
|
||||||
|
the committed manifest and declared transcript/artifact objects.
|
||||||
|
|
||||||
|
To intentionally replace the current extraction result, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
narratio run 2026-04-04 --stage extract --force
|
||||||
|
```
|
||||||
|
|
||||||
|
Narratio automatically reruns extraction when its recorded invocation contract,
|
||||||
|
prepared Narratio reference identities, or durable output validation changes.
|
||||||
|
The semantic portion covers Notarius enablement, pipeline identity, declared
|
||||||
|
reference mapping, output contracts, and the explicit Notarius configuration
|
||||||
|
profile selector. Executable, timeout, working directory, and private
|
||||||
|
config-file paths are operational and do not invalidate a current result.
|
||||||
|
It cannot fingerprint configuration or profile contents, prompts, modules, or
|
||||||
|
other references loaded transitively by Notarius itself. Force extraction after
|
||||||
|
changing any of those inputs behind an unchanged selector, even when the
|
||||||
|
top-level Narratio and Notarius config paths remain the same. A forced extract
|
||||||
|
marks successful downstream stages stale. Ordinary extraction failures or
|
||||||
|
outcome changes also stale affected downstream stages, while an identical
|
||||||
|
repeated `notarius_disabled` self-skip does not repeatedly invalidate them.
|
||||||
|
|
||||||
|
Publish reuse additionally tracks enabled/run-upload behavior, normalized
|
||||||
|
output rules, and remote backend/bucket/region/endpoint/root identity.
|
||||||
|
Credential environment names, local workspace placement, and run IDs are
|
||||||
|
excluded. Regardless of semantic reuse evidence, executing publish reads
|
||||||
|
independent remote locks directly and rechecks initially unlocked sources
|
||||||
|
before commit selection.
|
||||||
|
|
||||||
|
## Publish Workflow
|
||||||
|
|
||||||
|
Run publish only:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
narratio run 2026-04-04 --stage publish --force
|
||||||
|
```
|
||||||
|
|
||||||
|
This selection stops after publish and does not invoke cleanup. A
|
||||||
|
default full `run` continues through notify and cleanup.
|
||||||
|
|
||||||
|
Publish commit model:
|
||||||
|
|
||||||
|
- uploads eligible run files under `{session_prefix}/runs/{run_id}/`, excluding
|
||||||
|
audio and the run-local Notarius staging bundle;
|
||||||
|
- uploads prepared campaign, session, and party documents under the run's
|
||||||
|
`prepare/inputs/` prefix, when recorded by the manifest;
|
||||||
|
- uploads configured published outputs and `previous/**` cache files into the
|
||||||
|
same immutable run scope, including only explicitly configured extraction
|
||||||
|
lanes;
|
||||||
|
- does not upload the local execution ledger; and
|
||||||
|
- writes `{session_prefix}/runs/{run_id}/commit.json` after all declared
|
||||||
|
immutable objects are uploaded and verified; and
|
||||||
|
- writes `{session_prefix}/current/commit-pointer.json` once, last.
|
||||||
|
|
||||||
|
`current/commit-pointer.json` is the remote current-state commit marker. It
|
||||||
|
selects exactly one immutable commit, which declares the complete object set.
|
||||||
|
Restore reads that inventory without fetching an execution ledger.
|
||||||
|
|
||||||
|
## Remote Commit Migration
|
||||||
|
|
||||||
|
The immutable remote commit contract uses
|
||||||
|
`runs/{run_id}/commit.json` to declare a run's complete object set and a small
|
||||||
|
`current/commit-pointer.json` to select it. The pointer binds the selected
|
||||||
|
commit by version, checksum, size, and storage generation; committed artifacts
|
||||||
|
are also checksum- and generation-bound. Readers accept this contract now and
|
||||||
|
strictly reject mismatched or unknown data.
|
||||||
|
|
||||||
|
A selected commit may carry a `published_output` declaration from an earlier
|
||||||
|
run in the same campaign/session. Restore, previous-session caching, status,
|
||||||
|
and artifact inspection use that declaration's exact immutable key and stable
|
||||||
|
source; they do not reconstruct a current-run key or scan the session prefix.
|
||||||
|
Other artifact types remain confined to the selected commit's own run.
|
||||||
|
|
||||||
|
When the pointer is absent, remote state is not published; republish the
|
||||||
|
session to establish a committed publication. Remote commit state does not carry
|
||||||
|
local `current_pointer_written` metadata.
|
||||||
|
|
||||||
|
## Publish Locks
|
||||||
|
|
||||||
|
Each mutable lock is an independent strict JSON object at
|
||||||
|
`{session_prefix}/locks/{sha256(source)}.lock`. The lowercase digest is computed
|
||||||
|
from the exact canonical source. Listing validates every object in that
|
||||||
|
reserved prefix and reports locks sorted by source.
|
||||||
|
|
||||||
|
Upgrades do not read, migrate, or delete the retired `{session_prefix}/locks.yml`
|
||||||
|
object. It has no effect on publication and may be removed manually after
|
||||||
|
verifying lock commands and publication behavior with the upgraded Narratio
|
||||||
|
version. No migration command is required.
|
||||||
|
|
||||||
|
Operational rules:
|
||||||
|
|
||||||
|
- add uses conditional creation and reports an existing lock;
|
||||||
|
- add with `--force` observes the current generation and attempts one
|
||||||
|
generation-matched replacement. A concurrent change is reported for an
|
||||||
|
explicit operator retry;
|
||||||
|
- remove is idempotent and reports whether a lock was present;
|
||||||
|
- the initial publish lock snapshot controls output planning. A locked source
|
||||||
|
carries its exact declaration from the prior current commit when available;
|
||||||
|
a never-published locked source remains absent even when required;
|
||||||
|
- carried bytes are not copied. Publish verifies the prior object's exact key,
|
||||||
|
size, and generation without downloading it; and
|
||||||
|
- after immutable uploads and the immutable commit, publish re-reads every
|
||||||
|
initially unlocked participating source. A newly added lock prevents the
|
||||||
|
current pointer from advancing, although the immutable attempt may remain.
|
||||||
|
A removed initial lock may conservatively cause one carry.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
narratio session locks list 2026-04-04
|
||||||
|
narratio session locks add 2026-04-04 narratio.artifact.session_recap --reason "manual edits" --force
|
||||||
|
narratio session locks remove 2026-04-04 narratio.artifact.session_recap
|
||||||
|
```
|
||||||
|
|
||||||
|
## Restore Workflow
|
||||||
|
|
||||||
|
Use restore to import products from the selected publication into a local session.
|
||||||
|
Existing local progress is retained where its evidence remains valid.
|
||||||
|
|
||||||
|
Dry run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
narratio session restore 2026-04-04 --dry-run
|
||||||
|
```
|
||||||
|
|
||||||
|
Apply:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
narratio session restore 2026-04-04
|
||||||
|
```
|
||||||
|
|
||||||
|
`--dry-run` does not write durable session files. It still reads the selected
|
||||||
|
remote current state and may read object identity/content needed to classify the
|
||||||
|
plan, so it is not a network-free operation. The inventory-based preview maps
|
||||||
|
published source identities to current canonical local product paths; the remote
|
||||||
|
destination name does not choose the local filename. Projected satisfied and
|
||||||
|
remaining work combines conditional product coverage with the read-only
|
||||||
|
assessment of preserved local evidence. Planned downloads must still pass
|
||||||
|
content verification; the preview does not certify an import or pipeline run.
|
||||||
|
|
||||||
|
Default restore scope:
|
||||||
|
|
||||||
|
- prepared inputs and currently recognized transcript/artifact products declared
|
||||||
|
by the selected remote commit
|
||||||
|
- `inputs/previous/**` when needed by enabled targets or their configured
|
||||||
|
prerequisites, including disabled prerequisites; each is selected from its
|
||||||
|
exact committed `published_output` declaration
|
||||||
|
|
||||||
|
Optional:
|
||||||
|
|
||||||
|
- `--include-audio` to include `audio/**`
|
||||||
|
- `--force` to overwrite eligible conflicting regular files; it never replaces
|
||||||
|
directories, symlinks, or other non-regular local targets
|
||||||
|
|
||||||
|
Verified products without valid local execution evidence receive local supplied
|
||||||
|
product records. Identical files preserve valid local execution evidence. Changed
|
||||||
|
products invalidate dependent local work; unrelated checkpoints are preserved.
|
||||||
|
This import does not claim that the remote execution occurred locally, and
|
||||||
|
`--force` here authorizes replacement rather than pipeline regeneration.
|
||||||
|
|
||||||
|
Restore treats a local leaf symlink or any symlinked ancestor beneath the
|
||||||
|
selected session root as a conflict, even when the linked content matches the
|
||||||
|
selected remote object. `--force` does not override that conflict.
|
||||||
|
|
||||||
|
Before each install, restore validates the destination again beneath the
|
||||||
|
selected session root. A target changed into a symlink, directory, or other
|
||||||
|
non-regular entry is not overwritten.
|
||||||
|
|
||||||
|
Restore writes an execution report under `runs/<run_id>/restore/logs/restore.json`;
|
||||||
|
`logs/restore` points to the latest actual restore attempt.
|
||||||
|
|
||||||
|
If restore fails after beginning installation, it leaves a durable
|
||||||
|
`.restore-incomplete.json` marker in the session root. Pipeline runs will stop
|
||||||
|
until you rerun the same restore command and it completes. Restore intentionally
|
||||||
|
does not try to roll back files already installed; retrying the selected remote
|
||||||
|
publication is the recovery procedure.
|
||||||
|
|
||||||
|
## Local State Layout
|
||||||
|
|
||||||
|
A session lives at `{workspace.root}/work/{campaign}/{session_id}`. It contains
|
||||||
|
`manifest.json`, prepared `inputs/` and `audio/`, `transcripts/` (including
|
||||||
|
`raw/` speaker files), flat `artifacts/`, and `runs/` for actual attempts.
|
||||||
|
Previous-session inputs live under `inputs/previous/`; verified subprocess
|
||||||
|
reference snapshots live under `inputs/references/`.
|
||||||
|
|
||||||
|
Each attempted stage writes actual logs and debug capture beneath its run.
|
||||||
|
`logs/<stage>` and `debug/<stage>` are relative links to the latest attempt,
|
||||||
|
including failed attempts; skipped work does not rotate them. Restore writes its
|
||||||
|
own diagnostic attempt. Original Notarius bundles remain in the producing run
|
||||||
|
until authorized cleanup. The `runs/` directory is created on demand.
|
||||||
|
|
||||||
|
Remote audio is downloaded to a temporary sibling and verified before replacing
|
||||||
|
its single prepared `audio/` copy. Restore follows the same layout. Subprocess
|
||||||
|
cache and state locations are configured separately in those applications.
|
||||||
|
|
||||||
|
Only `narratio.session-manifest.v2` is supported locally. Move older local state
|
||||||
|
aside and regenerate it or import published products into a new baseline. Do not
|
||||||
|
edit old markers by hand.
|
||||||
|
|
||||||
|
### Workspace Permissions
|
||||||
|
|
||||||
|
Ordinary Narratio workspace content is intentionally shareable with the
|
||||||
|
workspace group. On POSIX systems, Narratio-created workspace
|
||||||
|
directories converge on setgid `02775`; ordinary files, including manifests,
|
||||||
|
transcripts, generated configuration, logs, reports, and Notarius artifacts,
|
||||||
|
converge on `0664`. Narratio explicitly applies these modes so a restrictive
|
||||||
|
caller umask does not remove group write or setgid. It does not change file or
|
||||||
|
directory ownership: the configured workspace's existing group is inherited.
|
||||||
|
|
||||||
|
API keys are credentials, not ordinary workspace data. Store them outside the
|
||||||
|
shared workspace or in a separately restricted credential location; ordinary
|
||||||
|
workspace group access must never be treated as authorization to read keys.
|
||||||
|
Provision a credential directory as `0700` and credential files as `0600`;
|
||||||
|
these permission modes are an operator requirement and are not enforced by
|
||||||
|
ConfigKit.
|
||||||
|
|
||||||
|
Pipeline acquisition uses the directory declared in the main pipeline file,
|
||||||
|
when present, before resolving typed credentials. Remove `--secrets-dir` from
|
||||||
|
old invocations and declare `config.secrets_dir`, or provision environment values.
|
||||||
|
A pipeline beside the former system-wide directory can select `secrets`; other
|
||||||
|
layouts follow [ConfigKit's path rules](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap).
|
||||||
|
See [Secrets Handling](config.md#secrets-handling) for Narratio's integration.
|
||||||
|
|
||||||
|
S3 `access_key_id` and `secret_access_key` are an optional pair of typed
|
||||||
|
environment references. When both are absent, the AWS SDK retains its default
|
||||||
|
credential provider chain. When both are configured, Narratio supplies their
|
||||||
|
load-time resolved values through an explicit static provider. Audita and
|
||||||
|
Notarius credential lists likewise resolve at pipeline load. Each adapter
|
||||||
|
receives only its listed names and captured values, with no alias mapping or
|
||||||
|
ambient environment inheritance. See [configuration](./config.md#audita-selection-and-credentials).
|
||||||
|
|
||||||
|
External adapter results are individually bounded before Narratio validates or
|
||||||
|
materializes them. These per-file limits do not reserve disk space: prevent hard
|
||||||
|
disk exhaustion with filesystem, service, container, or volume quotas sized for
|
||||||
|
the session workload.
|
||||||
|
|
||||||
|
## Cleanup
|
||||||
|
|
||||||
|
Use `narratio session clean SESSION` to remove an entire local session, or
|
||||||
|
`narratio session clean --all` for all local sessions. Add `--dry-run` to inspect
|
||||||
|
planned targets. These commands do not delete subprocess caches or remote data.
|
||||||
|
Mutating cleanup waits for the same workspace lock used by runs, preflight, and
|
||||||
|
restore. Waiting can be cancelled; dry-run inspection does not take the lock.
|
||||||
|
Mutating commands report the lock path through progress reporting before
|
||||||
|
acquisition; normal visibility controls apply.
|
||||||
|
The lock file remains at `<workspace.root>/.lock` after cleanup.
|
||||||
|
|
||||||
|
Automatic cleanup requires `workspace.cleanup_after_publish=true` and successful
|
||||||
|
publication evidence. When selected, it removes the entire session `runs/` tree,
|
||||||
|
including older failures, restore attempts, probes, logs, debug captures, and
|
||||||
|
original Notarius bundles. Managed stage and restore views are removed as well.
|
||||||
|
Canonical products, prepared inputs, manifests, other sessions, subprocess
|
||||||
|
state and caches, and remote objects remain. Set the option to `false` to keep
|
||||||
|
run history and diagnostics.
|
||||||
|
|
||||||
|
A failed cleanup is reported and may have removed some files already. Retry the
|
||||||
|
cleanup stage or a full run without republishing. Bounded runs ending before
|
||||||
|
cleanup do not execute it; their new attempts remain until a later authorized
|
||||||
|
cleanup. See [cleanup internals](internal/stage-cleanup.md).
|
||||||
|
|
||||||
|
## Operational Caveats
|
||||||
|
|
||||||
|
- Local and S3 audio modes are mutually exclusive.
|
||||||
|
- Ordinary publication checks prerequisite stage success; a supplied-product
|
||||||
|
baseline permits publication of individually validated selected sources.
|
||||||
|
- Markdown publish defaults require render outputs (`transcripts/final.md` and `transcripts/final.trimmed.md`).
|
||||||
|
- Restore requires configured object storage and committed remote current state.
|
||||||
|
- Each reached pipeline acquisition applies its configured startup before typed
|
||||||
|
credential resolution and object-store initialization.
|
||||||
|
|
||||||
|
Console progress and informational diagnostics use native invocation visibility.
|
||||||
|
`--progress` shows work without requiring verbose mode; `--verbose` adds source
|
||||||
|
and decision context. Console `--debug` does not enable downstream debug capture
|
||||||
|
or change retention. Downstream streams stay in captured logs. See
|
||||||
|
[CLI reporting](cli.md#reporting-and-visibility) for mode combinations and formats.
|
||||||
|
|||||||
342
docs/oss/attribution.md
Normal file
342
docs/oss/attribution.md
Normal file
@@ -0,0 +1,342 @@
|
|||||||
|
# Open Source Attribution Notices
|
||||||
|
|
||||||
|
## Standard Repository Policies
|
||||||
|
|
||||||
|
Material: `docs/policy/documentation.md`, adapted from revision
|
||||||
|
`5b9088601290564647a9e20c13f95c0da9f4cb15`; `docs/policy/agents.md`,
|
||||||
|
`architecture.md`, `testing.md`, `release.md`, `meta.md`, and `oss.md`; root
|
||||||
|
`AGENTS.md` and the policy reading guide in `docs/development.md`, adapted from
|
||||||
|
revision `593c9b52273c5c879785ae9e995d21026df467b4` for this repository.
|
||||||
|
|
||||||
|
Copyright (C) 2026 Eric Rakestraw
|
||||||
|
|
||||||
|
SPDX-License-Identifier: CC-BY-SA-4.0
|
||||||
|
|
||||||
|
License and notices: [CC BY-SA 4.0](licenses/CC-BY-SA-4.0.txt) |
|
||||||
|
[COPYRIGHT](https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/COPYRIGHT) |
|
||||||
|
[LICENSE](https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/LICENSE) |
|
||||||
|
[COPYRIGHT](https://gitea.maximumdirect.net/eric/policy/src/commit/5b9088601290564647a9e20c13f95c0da9f4cb15/COPYRIGHT) |
|
||||||
|
[LICENSE](https://gitea.maximumdirect.net/eric/policy/src/commit/5b9088601290564647a9e20c13f95c0da9f4cb15/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4).
|
||||||
|
[Source](https://gitea.maximumdirect.net/eric/policy/src/commit/5b9088601290564647a9e20c13f95c0da9f4cb15).
|
||||||
|
|
||||||
|
## ConfigKit
|
||||||
|
|
||||||
|
Selected module: `go.maximumdirect.net/configkit` at `v1.4.0`.
|
||||||
|
|
||||||
|
Copyright (C) 2026 Eric Rakestraw
|
||||||
|
|
||||||
|
SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
|
License and notices: [LGPL 3.0](licenses/LGPL-3.0.txt) |
|
||||||
|
[GPL 3.0](licenses/GPL-3.0.txt) |
|
||||||
|
[COPYRIGHT](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/COPYRIGHT) |
|
||||||
|
[LICENSE](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3).
|
||||||
|
|
||||||
|
## CommandKit
|
||||||
|
|
||||||
|
Selected module: `go.maximumdirect.net/commandkit` at `v0.8.0`.
|
||||||
|
|
||||||
|
Copyright (C) 2026 Eric Rakestraw
|
||||||
|
|
||||||
|
SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
|
License and notices: [LGPL 3.0](licenses/LGPL-3.0.txt) |
|
||||||
|
[GPL 3.0](licenses/GPL-3.0.txt) |
|
||||||
|
[COPYRIGHT](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/COPYRIGHT) |
|
||||||
|
[LICENSE](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/0b53a63648c536afe50c46f948159116f776adae).
|
||||||
|
|
||||||
|
## CommandKit ckconfig
|
||||||
|
|
||||||
|
Selected module: `go.maximumdirect.net/ckconfig` at `v0.11.0`.
|
||||||
|
|
||||||
|
Copyright (C) 2026 Eric Rakestraw
|
||||||
|
|
||||||
|
SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
|
License and notices: [LGPL 3.0](licenses/LGPL-3.0.txt) |
|
||||||
|
[GPL 3.0](licenses/GPL-3.0.txt) |
|
||||||
|
[COPYRIGHT](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/cd5cf483a46caeff7ca0a91fb4747d57188a3888/integrations/ckconfig/COPYRIGHT) |
|
||||||
|
[LICENSE](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/cd5cf483a46caeff7ca0a91fb4747d57188a3888/integrations/ckconfig/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/cd5cf483a46caeff7ca0a91fb4747d57188a3888).
|
||||||
|
|
||||||
|
## ReleaseKit
|
||||||
|
|
||||||
|
Selected module: `go.maximumdirect.net/releasekit` at `v0.10.0`; adapted launcher and Woodpecker delivery workflow.
|
||||||
|
|
||||||
|
Copyright (C) 2026 Eric Rakestraw
|
||||||
|
|
||||||
|
SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
|
License and notices: [LGPL 3.0](licenses/LGPL-3.0.txt) |
|
||||||
|
[GPL 3.0](licenses/GPL-3.0.txt) |
|
||||||
|
[COPYRIGHT](https://forge.maximumdirect.net/base-layer/releasekit/src/commit/82bac1a3ab935beddd4b8789d1e07f52135d4243/COPYRIGHT) |
|
||||||
|
[LICENSE](https://forge.maximumdirect.net/base-layer/releasekit/src/commit/82bac1a3ab935beddd4b8789d1e07f52135d4243/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://forge.maximumdirect.net/base-layer/releasekit/src/commit/82bac1a3ab935beddd4b8789d1e07f52135d4243).
|
||||||
|
|
||||||
|
## Cobra
|
||||||
|
|
||||||
|
Selected module: `github.com/spf13/cobra` at `v1.10.2` (transitive dependency).
|
||||||
|
|
||||||
|
Copyright 2013-2023 The Cobra Authors
|
||||||
|
|
||||||
|
SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
License and notices: [Apache 2.0](licenses/Apache-2.0.txt) |
|
||||||
|
[LICENSE.txt](https://github.com/spf13/cobra/blob/88b30ab89da2d0d0abb153818746c5a2d30eccec/LICENSE.txt).
|
||||||
|
|
||||||
|
[Source](https://github.com/spf13/cobra/commit/88b30ab89da2d0d0abb153818746c5a2d30eccec).
|
||||||
|
|
||||||
|
## pflag
|
||||||
|
|
||||||
|
Selected module: `github.com/spf13/pflag` at `v1.1.0` (transitive dependency).
|
||||||
|
|
||||||
|
Copyright (c) 2012 Alex Ogier. All rights reserved.
|
||||||
|
|
||||||
|
Copyright (c) 2012 The Go Authors. All rights reserved.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
License and notices: [BSD 3-Clause](licenses/BSD-3-Clause.txt) |
|
||||||
|
[LICENSE](https://github.com/spf13/pflag/blob/f8a990678a6d44385313e9b19e40737f889f9b14/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://github.com/spf13/pflag/commit/f8a990678a6d44385313e9b19e40737f889f9b14).
|
||||||
|
|
||||||
|
## YAML v3
|
||||||
|
|
||||||
|
Selected module: `gopkg.in/yaml.v3` at `v3.0.1`.
|
||||||
|
|
||||||
|
Copyright (c) 2006-2010 Kirill Simonov
|
||||||
|
|
||||||
|
Copyright (c) 2006-2011 Kirill Simonov
|
||||||
|
|
||||||
|
Copyright (c) 2011-2019 Canonical Ltd
|
||||||
|
|
||||||
|
Copyright 2011-2016 Canonical Ltd.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: MIT AND Apache-2.0
|
||||||
|
|
||||||
|
License and notices: [MIT](licenses/MIT.txt) |
|
||||||
|
[Apache 2.0](licenses/Apache-2.0.txt) |
|
||||||
|
[LICENSE](https://github.com/go-yaml/yaml/blob/f6f7691b1fdeb513f56608cd2c32c51f8194bf51/LICENSE) |
|
||||||
|
[NOTICE](https://github.com/go-yaml/yaml/blob/f6f7691b1fdeb513f56608cd2c32c51f8194bf51/NOTICE).
|
||||||
|
|
||||||
|
[Source](https://github.com/go-yaml/yaml/commit/f6f7691b1fdeb513f56608cd2c32c51f8194bf51).
|
||||||
|
|
||||||
|
## YAML v4
|
||||||
|
|
||||||
|
Selected module: `go.yaml.in/yaml/v4` at `v4.0.0`.
|
||||||
|
|
||||||
|
Copyright 2006-2010 Kirill Simonov
|
||||||
|
|
||||||
|
Copyright 2011-2019 Canonical Ltd
|
||||||
|
|
||||||
|
Copyright 2025 The go-yaml Project Contributors
|
||||||
|
|
||||||
|
SPDX-License-Identifier: MIT AND Apache-2.0
|
||||||
|
|
||||||
|
License and notices: [MIT](licenses/MIT.txt) |
|
||||||
|
[Apache 2.0](licenses/Apache-2.0.txt) |
|
||||||
|
[LICENSE](https://github.com/yaml/go-yaml/blob/f2f9563503f11b7a60da0c532175dcc693ce8d5a/LICENSE) |
|
||||||
|
[NOTICE](https://github.com/yaml/go-yaml/blob/f2f9563503f11b7a60da0c532175dcc693ce8d5a/NOTICE).
|
||||||
|
|
||||||
|
[Source](https://github.com/yaml/go-yaml/commit/f2f9563503f11b7a60da0c532175dcc693ce8d5a).
|
||||||
|
|
||||||
|
## go-cmp
|
||||||
|
|
||||||
|
Selected module: `github.com/google/go-cmp` at `v0.7.0` (test-only).
|
||||||
|
|
||||||
|
Copyright (c) 2017 The Go Authors. All rights reserved.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
License and notices: [BSD 3-Clause](licenses/BSD-3-Clause.txt) |
|
||||||
|
[LICENSE](https://github.com/google/go-cmp/blob/9b12f366a942ebc7254abc7f32ca05068b455fb7/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://github.com/google/go-cmp/commit/9b12f366a942ebc7254abc7f32ca05068b455fb7).
|
||||||
|
|
||||||
|
## Go sync extension
|
||||||
|
|
||||||
|
Selected module: `golang.org/x/sync` at `v0.22.0`.
|
||||||
|
|
||||||
|
Copyright 2009 The Go Authors.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
License and notices: [BSD 3-Clause](licenses/BSD-3-Clause.txt) |
|
||||||
|
[LICENSE](https://github.com/golang/sync/blob/1eb64d4bc0cde6da1bb8ebc7f178bb577508e5d0/LICENSE) |
|
||||||
|
[PATENTS](https://github.com/golang/sync/blob/1eb64d4bc0cde6da1bb8ebc7f178bb577508e5d0/PATENTS).
|
||||||
|
|
||||||
|
[Source](https://github.com/golang/sync/commit/1eb64d4bc0cde6da1bb8ebc7f178bb577508e5d0).
|
||||||
|
|
||||||
|
## Go system extension
|
||||||
|
|
||||||
|
Selected module: `golang.org/x/sys` at `v0.47.0`.
|
||||||
|
|
||||||
|
Copyright 2009 The Go Authors.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
License and notices: [BSD 3-Clause](licenses/BSD-3-Clause.txt) |
|
||||||
|
[LICENSE](https://github.com/golang/sys/blob/9e7e939dcafac07e8ab4cffa6e5fc74908413f00/LICENSE) |
|
||||||
|
[PATENTS](https://github.com/golang/sys/blob/9e7e939dcafac07e8ab4cffa6e5fc74908413f00/PATENTS).
|
||||||
|
|
||||||
|
[Source](https://github.com/golang/sys/commit/9e7e939dcafac07e8ab4cffa6e5fc74908413f00).
|
||||||
|
|
||||||
|
## Go runtime and standard library
|
||||||
|
|
||||||
|
Material: Go `1.27.4` runtime and standard library material incorporated in
|
||||||
|
release binaries built with the declared `golang:1.27.4` CI toolchain.
|
||||||
|
|
||||||
|
Copyright 2009 The Go Authors.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
License and notices: [BSD 3-Clause](licenses/BSD-3-Clause.txt) |
|
||||||
|
[LICENSE](https://github.com/golang/go/blob/7b2881024c95a11ddb86663a616340aa3a88b67f/LICENSE) |
|
||||||
|
[PATENTS](https://github.com/golang/go/blob/7b2881024c95a11ddb86663a616340aa3a88b67f/PATENTS).
|
||||||
|
|
||||||
|
[Source](https://github.com/golang/go/commit/7b2881024c95a11ddb86663a616340aa3a88b67f).
|
||||||
|
|
||||||
|
## AWS SDK for Go v2
|
||||||
|
|
||||||
|
Selected modules under `github.com/aws/aws-sdk-go-v2` at source revision
|
||||||
|
`2223642aeafb3b46ae924667ee47d31a1cf5a9d5`: root `v1.41.7`,
|
||||||
|
`aws/protocol/eventstream` `v1.7.10`, `config` `v1.32.17`, `credentials`
|
||||||
|
`v1.19.16`, `feature/ec2/imds` `v1.18.23`, `internal/configsources`
|
||||||
|
`v1.4.23`, `internal/endpoints/v2` `v2.7.23`, `internal/v4a` `v1.4.24`,
|
||||||
|
`service/internal/accept-encoding` `v1.13.9`, `service/internal/checksum`
|
||||||
|
`v1.9.15`, `service/internal/presigned-url` `v1.13.23`,
|
||||||
|
`service/internal/s3shared` `v1.19.23`, `service/signin` `v1.0.11`,
|
||||||
|
`service/sso` `v1.30.17`, `service/ssooidc` `v1.35.21`, and `service/sts`
|
||||||
|
`v1.42.1`.
|
||||||
|
|
||||||
|
Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
|
||||||
|
Copyright 2014-2015 Stripe, Inc.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
License and notices: [Apache 2.0](licenses/Apache-2.0.txt) |
|
||||||
|
[LICENSE.txt](https://github.com/aws/aws-sdk-go-v2/blob/2223642aeafb3b46ae924667ee47d31a1cf5a9d5/LICENSE.txt) |
|
||||||
|
[NOTICE.txt](https://github.com/aws/aws-sdk-go-v2/blob/2223642aeafb3b46ae924667ee47d31a1cf5a9d5/NOTICE.txt).
|
||||||
|
|
||||||
|
[Source](https://github.com/aws/aws-sdk-go-v2/commit/2223642aeafb3b46ae924667ee47d31a1cf5a9d5).
|
||||||
|
|
||||||
|
## AWS SDK for Go v2 S3
|
||||||
|
|
||||||
|
Selected module: `github.com/aws/aws-sdk-go-v2/service/s3` at `v1.101.0`.
|
||||||
|
|
||||||
|
Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
|
||||||
|
Copyright 2014-2015 Stripe, Inc.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
License and notices: [Apache 2.0](licenses/Apache-2.0.txt) |
|
||||||
|
[LICENSE.txt](https://github.com/aws/aws-sdk-go-v2/blob/84ddd08980744ac0f3bacfe7d2796c861671accc/service/s3/LICENSE.txt) |
|
||||||
|
[NOTICE.txt](https://github.com/aws/aws-sdk-go-v2/blob/84ddd08980744ac0f3bacfe7d2796c861671accc/NOTICE.txt).
|
||||||
|
|
||||||
|
[Source](https://github.com/aws/aws-sdk-go-v2/commit/84ddd08980744ac0f3bacfe7d2796c861671accc).
|
||||||
|
|
||||||
|
## AWS Smithy Go
|
||||||
|
|
||||||
|
Selected module: `github.com/aws/smithy-go` at `v1.25.1`.
|
||||||
|
|
||||||
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
License and notices: [Apache 2.0](licenses/Apache-2.0.txt) |
|
||||||
|
[LICENSE](https://github.com/aws/smithy-go/blob/e094f45e716e33a1b950cf8bbe804790bf87f965/LICENSE) |
|
||||||
|
[NOTICE](https://github.com/aws/smithy-go/blob/e094f45e716e33a1b950cf8bbe804790bf87f965/NOTICE).
|
||||||
|
|
||||||
|
[Source](https://github.com/aws/smithy-go/commit/e094f45e716e33a1b950cf8bbe804790bf87f965).
|
||||||
|
|
||||||
|
## Go singleflight in AWS SDK for Go v2
|
||||||
|
|
||||||
|
Material: `internal/sync/singleflight` in the selected AWS SDK root module.
|
||||||
|
|
||||||
|
Copyright (c) 2009 The Go Authors. All rights reserved.
|
||||||
|
|
||||||
|
Copyright 2013 The Go Authors. All rights reserved.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
License and notices: [BSD 3-Clause](licenses/BSD-3-Clause.txt) |
|
||||||
|
[LICENSE](https://github.com/aws/aws-sdk-go-v2/blob/2223642aeafb3b46ae924667ee47d31a1cf5a9d5/internal/sync/singleflight/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://github.com/aws/aws-sdk-go-v2/commit/2223642aeafb3b46ae924667ee47d31a1cf5a9d5).
|
||||||
|
|
||||||
|
## Go singleflight in AWS Smithy Go
|
||||||
|
|
||||||
|
Material: `internal/sync/singleflight` in the selected smithy-go module.
|
||||||
|
|
||||||
|
Copyright (c) 2009 The Go Authors. All rights reserved.
|
||||||
|
|
||||||
|
Copyright 2013 The Go Authors. All rights reserved.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
License and notices: [BSD 3-Clause](licenses/BSD-3-Clause.txt) |
|
||||||
|
[LICENSE](https://github.com/aws/smithy-go/blob/e094f45e716e33a1b950cf8bbe804790bf87f965/internal/sync/singleflight/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://github.com/aws/smithy-go/commit/e094f45e716e33a1b950cf8bbe804790bf87f965).
|
||||||
|
|
||||||
|
## JSON Schema
|
||||||
|
|
||||||
|
Selected module: `github.com/santhosh-tekuri/jsonschema/v6` at `v6.0.3`.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
License and notices: [Apache 2.0](licenses/Apache-2.0.txt) |
|
||||||
|
[LICENSE](https://github.com/santhosh-tekuri/jsonschema/blob/b0fc661f4939578bc429f408c18202573dbafcc4/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://github.com/santhosh-tekuri/jsonschema/commit/b0fc661f4939578bc429f408c18202573dbafcc4).
|
||||||
|
|
||||||
|
## Go text extension
|
||||||
|
|
||||||
|
Selected module: `golang.org/x/text` at `v0.14.0`.
|
||||||
|
|
||||||
|
Copyright 2009 The Go Authors.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
License and notices: [BSD 3-Clause](licenses/BSD-3-Clause.txt) |
|
||||||
|
[LICENSE](https://github.com/golang/text/blob/6c97a165dd661335ff7bce6104a008558123c353/LICENSE) |
|
||||||
|
[PATENTS](https://github.com/golang/text/blob/6c97a165dd661335ff7bce6104a008558123c353/PATENTS).
|
||||||
|
|
||||||
|
[Source](https://github.com/golang/text/commit/6c97a165dd661335ff7bce6104a008558123c353).
|
||||||
|
|
||||||
|
## Maximum Direct shared schemas
|
||||||
|
|
||||||
|
Material: `internal/domaininput/resources/`, copied without modification from `2026.11.1`.
|
||||||
|
|
||||||
|
Copyright 2026 Eric Rakestraw
|
||||||
|
|
||||||
|
SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
|
License and notices: [CC0 1.0](licenses/CC0-1.0.txt) |
|
||||||
|
[COPYRIGHT](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/COPYRIGHT) |
|
||||||
|
[LICENSE](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://forge.maximumdirect.net/eric/schemas/src/commit/f7e3cedeca11ed903311cdf29ca4d81fb1f216b7).
|
||||||
|
|
||||||
|
## Narratio reference catalog
|
||||||
|
|
||||||
|
Material: synthetic files under `examples/reference-catalog/`, adapted from
|
||||||
|
revision `02dd53c6ea026347452d497350c40249c949f8ce`.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
|
License and notices: [CC0 1.0](licenses/CC0-1.0.txt) |
|
||||||
|
[LICENSE](https://forge.maximumdirect.net/eric/narratio-reference-catalog/src/commit/02dd53c6ea026347452d497350c40249c949f8ce/LICENSE).
|
||||||
|
|
||||||
|
[Source](https://forge.maximumdirect.net/eric/narratio-reference-catalog/src/commit/02dd53c6ea026347452d497350c40249c949f8ce).
|
||||||
202
docs/oss/licenses/Apache-2.0.txt
Normal file
202
docs/oss/licenses/Apache-2.0.txt
Normal file
@@ -0,0 +1,202 @@
|
|||||||
|
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
11
docs/oss/licenses/BSD-3-Clause.txt
Normal file
11
docs/oss/licenses/BSD-3-Clause.txt
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
Copyright (c) <year> <owner>.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
170
docs/oss/licenses/CC-BY-SA-4.0.txt
Normal file
170
docs/oss/licenses/CC-BY-SA-4.0.txt
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
Creative Commons Attribution-ShareAlike 4.0 International
|
||||||
|
|
||||||
|
Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
|
||||||
|
|
||||||
|
Using Creative Commons Public Licenses
|
||||||
|
|
||||||
|
Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
|
||||||
|
|
||||||
|
Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors.
|
||||||
|
|
||||||
|
Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described.
|
||||||
|
|
||||||
|
Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public.
|
||||||
|
|
||||||
|
Creative Commons Attribution-ShareAlike 4.0 International Public License
|
||||||
|
|
||||||
|
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
|
||||||
|
|
||||||
|
Section 1 – Definitions.
|
||||||
|
|
||||||
|
a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
|
||||||
|
|
||||||
|
b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
|
||||||
|
|
||||||
|
c. BY-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License.
|
||||||
|
|
||||||
|
d. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
|
||||||
|
|
||||||
|
e. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
|
||||||
|
|
||||||
|
f. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
|
||||||
|
|
||||||
|
g. License Elements means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution and ShareAlike.
|
||||||
|
|
||||||
|
h. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
|
||||||
|
|
||||||
|
i. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
|
||||||
|
|
||||||
|
j. Licensor means the individual(s) or entity(ies) granting rights under this Public License.
|
||||||
|
|
||||||
|
k. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
|
||||||
|
|
||||||
|
l. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
|
||||||
|
|
||||||
|
m. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
|
||||||
|
|
||||||
|
Section 2 – Scope.
|
||||||
|
|
||||||
|
a. License grant.
|
||||||
|
|
||||||
|
1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
|
||||||
|
|
||||||
|
A. reproduce and Share the Licensed Material, in whole or in part; and
|
||||||
|
|
||||||
|
B. produce, reproduce, and Share Adapted Material.
|
||||||
|
|
||||||
|
2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
|
||||||
|
|
||||||
|
3. Term. The term of this Public License is specified in Section 6(a).
|
||||||
|
|
||||||
|
4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
|
||||||
|
|
||||||
|
5. Downstream recipients.
|
||||||
|
|
||||||
|
A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
|
||||||
|
|
||||||
|
B. Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply.
|
||||||
|
|
||||||
|
C. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
|
||||||
|
|
||||||
|
6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
|
||||||
|
|
||||||
|
b. Other rights.
|
||||||
|
|
||||||
|
1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
|
||||||
|
|
||||||
|
2. Patent and trademark rights are not licensed under this Public License.
|
||||||
|
|
||||||
|
3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
|
||||||
|
|
||||||
|
Section 3 – License Conditions.
|
||||||
|
|
||||||
|
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
|
||||||
|
|
||||||
|
a. Attribution.
|
||||||
|
|
||||||
|
1. If You Share the Licensed Material (including in modified form), You must:
|
||||||
|
|
||||||
|
A. retain the following if it is supplied by the Licensor with the Licensed Material:
|
||||||
|
|
||||||
|
i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
|
||||||
|
|
||||||
|
ii. a copyright notice;
|
||||||
|
|
||||||
|
iii. a notice that refers to this Public License;
|
||||||
|
|
||||||
|
iv. a notice that refers to the disclaimer of warranties;
|
||||||
|
|
||||||
|
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
|
||||||
|
|
||||||
|
B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
|
||||||
|
|
||||||
|
C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
|
||||||
|
|
||||||
|
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
|
||||||
|
|
||||||
|
3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
|
||||||
|
|
||||||
|
b. ShareAlike.In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply.
|
||||||
|
|
||||||
|
1. The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License.
|
||||||
|
|
||||||
|
2. You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.
|
||||||
|
|
||||||
|
3. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.
|
||||||
|
|
||||||
|
Section 4 – Sui Generis Database Rights.
|
||||||
|
|
||||||
|
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
|
||||||
|
|
||||||
|
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
|
||||||
|
|
||||||
|
b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and
|
||||||
|
|
||||||
|
c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
|
||||||
|
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
|
||||||
|
|
||||||
|
Section 5 – Disclaimer of Warranties and Limitation of Liability.
|
||||||
|
|
||||||
|
a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
|
||||||
|
|
||||||
|
b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
|
||||||
|
|
||||||
|
c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
|
||||||
|
|
||||||
|
Section 6 – Term and Termination.
|
||||||
|
|
||||||
|
a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
|
||||||
|
|
||||||
|
b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
|
||||||
|
|
||||||
|
1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
|
||||||
|
|
||||||
|
2. upon express reinstatement by the Licensor.
|
||||||
|
|
||||||
|
c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
|
||||||
|
|
||||||
|
d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
|
||||||
|
|
||||||
|
e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
|
||||||
|
|
||||||
|
Section 7 – Other Terms and Conditions.
|
||||||
|
|
||||||
|
a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
|
||||||
|
|
||||||
|
b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
|
||||||
|
|
||||||
|
Section 8 – Interpretation.
|
||||||
|
|
||||||
|
a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
|
||||||
|
|
||||||
|
b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
|
||||||
|
|
||||||
|
c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
|
||||||
|
|
||||||
|
d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
|
||||||
|
|
||||||
|
Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
|
||||||
|
|
||||||
|
Creative Commons may be contacted at creativecommons.org.
|
||||||
121
docs/oss/licenses/CC0-1.0.txt
Normal file
121
docs/oss/licenses/CC0-1.0.txt
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
Creative Commons Legal Code
|
||||||
|
|
||||||
|
CC0 1.0 Universal
|
||||||
|
|
||||||
|
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||||
|
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
||||||
|
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||||
|
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||||
|
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
||||||
|
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
||||||
|
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
||||||
|
HEREUNDER.
|
||||||
|
|
||||||
|
Statement of Purpose
|
||||||
|
|
||||||
|
The laws of most jurisdictions throughout the world automatically confer
|
||||||
|
exclusive Copyright and Related Rights (defined below) upon the creator
|
||||||
|
and subsequent owner(s) (each and all, an "owner") of an original work of
|
||||||
|
authorship and/or a database (each, a "Work").
|
||||||
|
|
||||||
|
Certain owners wish to permanently relinquish those rights to a Work for
|
||||||
|
the purpose of contributing to a commons of creative, cultural and
|
||||||
|
scientific works ("Commons") that the public can reliably and without fear
|
||||||
|
of later claims of infringement build upon, modify, incorporate in other
|
||||||
|
works, reuse and redistribute as freely as possible in any form whatsoever
|
||||||
|
and for any purposes, including without limitation commercial purposes.
|
||||||
|
These owners may contribute to the Commons to promote the ideal of a free
|
||||||
|
culture and the further production of creative, cultural and scientific
|
||||||
|
works, or to gain reputation or greater distribution for their Work in
|
||||||
|
part through the use and efforts of others.
|
||||||
|
|
||||||
|
For these and/or other purposes and motivations, and without any
|
||||||
|
expectation of additional consideration or compensation, the person
|
||||||
|
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
||||||
|
is an owner of Copyright and Related Rights in the Work, voluntarily
|
||||||
|
elects to apply CC0 to the Work and publicly distribute the Work under its
|
||||||
|
terms, with knowledge of his or her Copyright and Related Rights in the
|
||||||
|
Work and the meaning and intended legal effect of CC0 on those rights.
|
||||||
|
|
||||||
|
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||||
|
protected by copyright and related or neighboring rights ("Copyright and
|
||||||
|
Related Rights"). Copyright and Related Rights include, but are not
|
||||||
|
limited to, the following:
|
||||||
|
|
||||||
|
i. the right to reproduce, adapt, distribute, perform, display,
|
||||||
|
communicate, and translate a Work;
|
||||||
|
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||||
|
iii. publicity and privacy rights pertaining to a person's image or
|
||||||
|
likeness depicted in a Work;
|
||||||
|
iv. rights protecting against unfair competition in regards to a Work,
|
||||||
|
subject to the limitations in paragraph 4(a), below;
|
||||||
|
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||||
|
in a Work;
|
||||||
|
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||||
|
European Parliament and of the Council of 11 March 1996 on the legal
|
||||||
|
protection of databases, and under any national implementation
|
||||||
|
thereof, including any amended or successor version of such
|
||||||
|
directive); and
|
||||||
|
vii. other similar, equivalent or corresponding rights throughout the
|
||||||
|
world based on applicable law or treaty, and any national
|
||||||
|
implementations thereof.
|
||||||
|
|
||||||
|
2. Waiver. To the greatest extent permitted by, but not in contravention
|
||||||
|
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||||
|
irrevocably and unconditionally waives, abandons, and surrenders all of
|
||||||
|
Affirmer's Copyright and Related Rights and associated claims and causes
|
||||||
|
of action, whether now known or unknown (including existing as well as
|
||||||
|
future claims and causes of action), in the Work (i) in all territories
|
||||||
|
worldwide, (ii) for the maximum duration provided by applicable law or
|
||||||
|
treaty (including future time extensions), (iii) in any current or future
|
||||||
|
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
||||||
|
including without limitation commercial, advertising or promotional
|
||||||
|
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
||||||
|
member of the public at large and to the detriment of Affirmer's heirs and
|
||||||
|
successors, fully intending that such Waiver shall not be subject to
|
||||||
|
revocation, rescission, cancellation, termination, or any other legal or
|
||||||
|
equitable action to disrupt the quiet enjoyment of the Work by the public
|
||||||
|
as contemplated by Affirmer's express Statement of Purpose.
|
||||||
|
|
||||||
|
3. Public License Fallback. Should any part of the Waiver for any reason
|
||||||
|
be judged legally invalid or ineffective under applicable law, then the
|
||||||
|
Waiver shall be preserved to the maximum extent permitted taking into
|
||||||
|
account Affirmer's express Statement of Purpose. In addition, to the
|
||||||
|
extent the Waiver is so judged Affirmer hereby grants to each affected
|
||||||
|
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
||||||
|
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
||||||
|
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
||||||
|
maximum duration provided by applicable law or treaty (including future
|
||||||
|
time extensions), (iii) in any current or future medium and for any number
|
||||||
|
of copies, and (iv) for any purpose whatsoever, including without
|
||||||
|
limitation commercial, advertising or promotional purposes (the
|
||||||
|
"License"). The License shall be deemed effective as of the date CC0 was
|
||||||
|
applied by Affirmer to the Work. Should any part of the License for any
|
||||||
|
reason be judged legally invalid or ineffective under applicable law, such
|
||||||
|
partial invalidity or ineffectiveness shall not invalidate the remainder
|
||||||
|
of the License, and in such case Affirmer hereby affirms that he or she
|
||||||
|
will not (i) exercise any of his or her remaining Copyright and Related
|
||||||
|
Rights in the Work or (ii) assert any associated claims and causes of
|
||||||
|
action with respect to the Work, in either case contrary to Affirmer's
|
||||||
|
express Statement of Purpose.
|
||||||
|
|
||||||
|
4. Limitations and Disclaimers.
|
||||||
|
|
||||||
|
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||||
|
surrendered, licensed or otherwise affected by this document.
|
||||||
|
b. Affirmer offers the Work as-is and makes no representations or
|
||||||
|
warranties of any kind concerning the Work, express, implied,
|
||||||
|
statutory or otherwise, including without limitation warranties of
|
||||||
|
title, merchantability, fitness for a particular purpose, non
|
||||||
|
infringement, or the absence of latent or other defects, accuracy, or
|
||||||
|
the present or absence of errors, whether or not discoverable, all to
|
||||||
|
the greatest extent permissible under applicable law.
|
||||||
|
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||||
|
that may apply to the Work or any use thereof, including without
|
||||||
|
limitation any person's Copyright and Related Rights in the Work.
|
||||||
|
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||||
|
consents, permissions or other rights required for any use of the
|
||||||
|
Work.
|
||||||
|
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||||
|
party to this document and has no duty or obligation with respect to
|
||||||
|
this CC0 or use of the Work.
|
||||||
674
docs/oss/licenses/GPL-3.0.txt
Normal file
674
docs/oss/licenses/GPL-3.0.txt
Normal file
@@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||||
165
docs/oss/licenses/LGPL-3.0.txt
Normal file
165
docs/oss/licenses/LGPL-3.0.txt
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
|
||||||
|
This version of the GNU Lesser General Public License incorporates
|
||||||
|
the terms and conditions of version 3 of the GNU General Public
|
||||||
|
License, supplemented by the additional permissions listed below.
|
||||||
|
|
||||||
|
0. Additional Definitions.
|
||||||
|
|
||||||
|
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||||
|
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||||
|
General Public License.
|
||||||
|
|
||||||
|
"The Library" refers to a covered work governed by this License,
|
||||||
|
other than an Application or a Combined Work as defined below.
|
||||||
|
|
||||||
|
An "Application" is any work that makes use of an interface provided
|
||||||
|
by the Library, but which is not otherwise based on the Library.
|
||||||
|
Defining a subclass of a class defined by the Library is deemed a mode
|
||||||
|
of using an interface provided by the Library.
|
||||||
|
|
||||||
|
A "Combined Work" is a work produced by combining or linking an
|
||||||
|
Application with the Library. The particular version of the Library
|
||||||
|
with which the Combined Work was made is also called the "Linked
|
||||||
|
Version".
|
||||||
|
|
||||||
|
The "Minimal Corresponding Source" for a Combined Work means the
|
||||||
|
Corresponding Source for the Combined Work, excluding any source code
|
||||||
|
for portions of the Combined Work that, considered in isolation, are
|
||||||
|
based on the Application, and not on the Linked Version.
|
||||||
|
|
||||||
|
The "Corresponding Application Code" for a Combined Work means the
|
||||||
|
object code and/or source code for the Application, including any data
|
||||||
|
and utility programs needed for reproducing the Combined Work from the
|
||||||
|
Application, but excluding the System Libraries of the Combined Work.
|
||||||
|
|
||||||
|
1. Exception to Section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
You may convey a covered work under sections 3 and 4 of this License
|
||||||
|
without being bound by section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
2. Conveying Modified Versions.
|
||||||
|
|
||||||
|
If you modify a copy of the Library, and, in your modifications, a
|
||||||
|
facility refers to a function or data to be supplied by an Application
|
||||||
|
that uses the facility (other than as an argument passed when the
|
||||||
|
facility is invoked), then you may convey a copy of the modified
|
||||||
|
version:
|
||||||
|
|
||||||
|
a) under this License, provided that you make a good faith effort to
|
||||||
|
ensure that, in the event an Application does not supply the
|
||||||
|
function or data, the facility still operates, and performs
|
||||||
|
whatever part of its purpose remains meaningful, or
|
||||||
|
|
||||||
|
b) under the GNU GPL, with none of the additional permissions of
|
||||||
|
this License applicable to that copy.
|
||||||
|
|
||||||
|
3. Object Code Incorporating Material from Library Header Files.
|
||||||
|
|
||||||
|
The object code form of an Application may incorporate material from
|
||||||
|
a header file that is part of the Library. You may convey such object
|
||||||
|
code under terms of your choice, provided that, if the incorporated
|
||||||
|
material is not limited to numerical parameters, data structure
|
||||||
|
layouts and accessors, or small macros, inline functions and templates
|
||||||
|
(ten or fewer lines in length), you do both of the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the object code that the
|
||||||
|
Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
4. Combined Works.
|
||||||
|
|
||||||
|
You may convey a Combined Work under terms of your choice that,
|
||||||
|
taken together, effectively do not restrict modification of the
|
||||||
|
portions of the Library contained in the Combined Work and reverse
|
||||||
|
engineering for debugging such modifications, if you also do each of
|
||||||
|
the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the Combined Work that
|
||||||
|
the Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
c) For a Combined Work that displays copyright notices during
|
||||||
|
execution, include the copyright notice for the Library among
|
||||||
|
these notices, as well as a reference directing the user to the
|
||||||
|
copies of the GNU GPL and this license document.
|
||||||
|
|
||||||
|
d) Do one of the following:
|
||||||
|
|
||||||
|
0) Convey the Minimal Corresponding Source under the terms of this
|
||||||
|
License, and the Corresponding Application Code in a form
|
||||||
|
suitable for, and under terms that permit, the user to
|
||||||
|
recombine or relink the Application with a modified version of
|
||||||
|
the Linked Version to produce a modified Combined Work, in the
|
||||||
|
manner specified by section 6 of the GNU GPL for conveying
|
||||||
|
Corresponding Source.
|
||||||
|
|
||||||
|
1) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (a) uses at run time
|
||||||
|
a copy of the Library already present on the user's computer
|
||||||
|
system, and (b) will operate properly with a modified version
|
||||||
|
of the Library that is interface-compatible with the Linked
|
||||||
|
Version.
|
||||||
|
|
||||||
|
e) Provide Installation Information, but only if you would otherwise
|
||||||
|
be required to provide such information under section 6 of the
|
||||||
|
GNU GPL, and only to the extent that such information is
|
||||||
|
necessary to install and execute a modified version of the
|
||||||
|
Combined Work produced by recombining or relinking the
|
||||||
|
Application with a modified version of the Linked Version. (If
|
||||||
|
you use option 4d0, the Installation Information must accompany
|
||||||
|
the Minimal Corresponding Source and Corresponding Application
|
||||||
|
Code. If you use option 4d1, you must provide the Installation
|
||||||
|
Information in the manner specified by section 6 of the GNU GPL
|
||||||
|
for conveying Corresponding Source.)
|
||||||
|
|
||||||
|
5. Combined Libraries.
|
||||||
|
|
||||||
|
You may place library facilities that are a work based on the
|
||||||
|
Library side by side in a single library together with other library
|
||||||
|
facilities that are not Applications and are not covered by this
|
||||||
|
License, and convey such a combined library under terms of your
|
||||||
|
choice, if you do both of the following:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work based
|
||||||
|
on the Library, uncombined with any other library facilities,
|
||||||
|
conveyed under the terms of this License.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library that part of it
|
||||||
|
is a work based on the Library, and explaining where to find the
|
||||||
|
accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
6. Revised Versions of the GNU Lesser General Public License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU Lesser General Public License from time to time. Such new
|
||||||
|
versions will be similar in spirit to the present version, but may
|
||||||
|
differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Library as you received it specifies that a certain numbered version
|
||||||
|
of the GNU Lesser General Public License "or any later version"
|
||||||
|
applies to it, you have the option of following the terms and
|
||||||
|
conditions either of that published version or of any later version
|
||||||
|
published by the Free Software Foundation. If the Library as you
|
||||||
|
received it does not specify a version number of the GNU Lesser
|
||||||
|
General Public License, you may choose any version of the GNU Lesser
|
||||||
|
General Public License ever published by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Library as you received it specifies that a proxy can decide
|
||||||
|
whether future versions of the GNU Lesser General Public License shall
|
||||||
|
apply, that proxy's public statement of acceptance of any version is
|
||||||
|
permanent authorization for you to choose that version for the
|
||||||
|
Library.
|
||||||
18
docs/oss/licenses/MIT.txt
Normal file
18
docs/oss/licenses/MIT.txt
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) <year> <copyright holders>
|
||||||
|
|
||||||
|
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.
|
||||||
79
docs/policy/agents.md
Normal file
79
docs/policy/agents.md
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
# Agent Policy
|
||||||
|
|
||||||
|
**Base Policy Version:** 1.3
|
||||||
|
|
||||||
|
**Last Updated**: 2026-11-17
|
||||||
|
|
||||||
|
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/docs/policy/agents.md
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
|
||||||
|
Agents must read and follow these rules.
|
||||||
|
|
||||||
|
## Implementation Discipline
|
||||||
|
|
||||||
|
**KEY PRINCIPLES:** Write the simplest idiomatic code that satisfies the user's
|
||||||
|
request. Do not implicitly strengthen requirements, restrictions, or guarantees
|
||||||
|
beyond what the user actually requested.
|
||||||
|
|
||||||
|
**Keep implementation machinery proportionate.** Use straightforward,
|
||||||
|
idiomatic code and introduce only the machinery needed to support the requested
|
||||||
|
behavior and flexibility. Optimize for conceptual simplicity and
|
||||||
|
maintainability, not for the fewest lines, fewest options, or narrowest product
|
||||||
|
surface.
|
||||||
|
|
||||||
|
**Do not invent restrictions.** Do not reject, prohibit, constrain, cap,
|
||||||
|
harden, or otherwise narrow behavior unless required by the user, an explicit
|
||||||
|
repository contract, or an unavoidable correctness constraint. Preserve
|
||||||
|
operator and caller choice where policy has not been established. If an
|
||||||
|
additional restriction appears advisable, present it as a decision rather than
|
||||||
|
silently implementing it.
|
||||||
|
|
||||||
|
**Do not invent guarantees.** Do not strengthen public contracts, guarantees,
|
||||||
|
or invariants beyond those expressly requested by the user.
|
||||||
|
|
||||||
|
**Use the standard library.** For example: in almost every case, the best
|
||||||
|
approach to copying files is to use the standard library. Writing custom code to
|
||||||
|
implement power-loss protection at the application level, or to guard against
|
||||||
|
bad actors with privileged and concurrent access to the host's filesystem,
|
||||||
|
is wasteful, unnecessary, and not idiomatic. Stick to the simple, standard, and
|
||||||
|
idiomatic approach unless another path is expressly requested by the user.
|
||||||
|
|
||||||
|
**An implementation detail is not repository policy.** Tests and documentation
|
||||||
|
must not elevate incidental behavior into a durable guarantee or restriction
|
||||||
|
unless that behavior was expressly selected as part of the contract.
|
||||||
|
|
||||||
|
## Git Commit Policy
|
||||||
|
|
||||||
|
By default, commit each completed, nonempty unit of work using a
|
||||||
|
concise, plain-English message describing what changed. This policy is standing
|
||||||
|
authorization to create those local commits; a separate user request is not
|
||||||
|
required. An explicit user instruction to leave work uncommitted takes precedence.
|
||||||
|
|
||||||
|
A unit of work is a focused, reviewable outcome, including its relevant tests and
|
||||||
|
documentation.
|
||||||
|
Complete the appropriate validation before committing. If work is incomplete or
|
||||||
|
validation is blocked, report that state accurately.
|
||||||
|
|
||||||
|
Before committing:
|
||||||
|
|
||||||
|
1. Run `git status --short` and review the relevant diff, including any staged
|
||||||
|
changes. Identify changes that predate the current unit of work.
|
||||||
|
2. Exclude secrets, local environment files, generated junk, and unrelated changes.
|
||||||
|
3. Stage only the files or hunks belonging to the completed unit. Use `git add .`
|
||||||
|
only when every included change belongs to that unit. Preserve unrelated
|
||||||
|
staged and unstaged work.
|
||||||
|
4. Review `git diff --staged` and run appropriate checks for the change. Reuse
|
||||||
|
successful checks for unchanged content.
|
||||||
|
5. Review `git log --oneline -n 10` and use
|
||||||
|
`git commit -m "<concise plain-English commit message>"`.
|
||||||
|
6. Report the commit identifier and any remaining uncommitted work.
|
||||||
|
|
||||||
|
If the unit cannot be safely separated from pre-existing work, leave it uncommitted
|
||||||
|
and explain the overlap rather than silently including that work. If a commit
|
||||||
|
fails, preserve the changes and report the failure; do not bypass hooks.
|
||||||
|
|
||||||
|
Default commit authorization does not authorize pushing, publishing, amending,
|
||||||
|
resetting, reverting, or rewriting history. Those actions require a separate user
|
||||||
|
instruction. Do not use `git commit -a` or `git commit --no-verify` to bypass the
|
||||||
|
staging and validation discipline above.
|
||||||
368
docs/policy/architecture.md
Normal file
368
docs/policy/architecture.md
Normal file
@@ -0,0 +1,368 @@
|
|||||||
|
# Architecture Policy
|
||||||
|
|
||||||
|
**Base Policy Version:** 1.3
|
||||||
|
|
||||||
|
**Last Updated**: 2026-11-22
|
||||||
|
|
||||||
|
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/docs/policy/architecture.md
|
||||||
|
|
||||||
|
## Purpose And Ownership
|
||||||
|
|
||||||
|
The adopted policy defines the application's purpose and the architectural
|
||||||
|
constraints contributors must follow. It owns system boundaries, responsibility
|
||||||
|
and dependency rules, established invariants, and explicit non-goals.
|
||||||
|
|
||||||
|
Describe the concrete package inventory and implementation mechanics in internal
|
||||||
|
documentation. Link to canonical public contracts for their exact behavior and
|
||||||
|
to ADRs for decision rationale.
|
||||||
|
|
||||||
|
## Architectural Approach
|
||||||
|
|
||||||
|
Hexagonal architecture is strongly recommended, including encapsulating external
|
||||||
|
integrations and APIs within internal adapters. Keep domain and application
|
||||||
|
logic independent of external integration details, and make dependency direction
|
||||||
|
clear in the adopted policy.
|
||||||
|
|
||||||
|
Implement that separation with proportionate, idiomatic code. Choose interfaces
|
||||||
|
and package layout to serve the application's actual boundaries. Use adapters
|
||||||
|
for collaborators with external integration responsibilities.
|
||||||
|
|
||||||
|
## Adopted Constraints And Implemented Structure
|
||||||
|
|
||||||
|
Architectural constraints govern current and future development. Record
|
||||||
|
implemented structure accurately, proposals and implementation status in the
|
||||||
|
roadmap, and significant decisions and rationale in ADRs. Describe a target
|
||||||
|
structure as implemented when its changes land.
|
||||||
|
|
||||||
|
Constraints must reflect deliberately selected requirements and decisions.
|
||||||
|
Do not promote incidental implementation choices into architectural invariants.
|
||||||
|
|
||||||
|
## System Shape
|
||||||
|
|
||||||
|
Narratio is a small Go application that turns D&D session audio into polished
|
||||||
|
transcripts and generated session artifacts. It is an explicit, stage-driven
|
||||||
|
orchestrator, not a general workflow engine.
|
||||||
|
|
||||||
|
Narratio coordinates specialized external systems rather than reimplementing
|
||||||
|
their domains:
|
||||||
|
|
||||||
|
- WhisperX performs transcription;
|
||||||
|
- Seriatim performs deterministic transcript processing and rendering;
|
||||||
|
- Audita performs transcript correction and polishing;
|
||||||
|
- Notarius extracts validated structured artifact bundles; and
|
||||||
|
- Scriptorium executes prompts and produces configured artifacts.
|
||||||
|
|
||||||
|
Narratio owns orchestration, configuration interpretation, session and run state,
|
||||||
|
artifact and path modeling, manifest persistence, stage sequencing, resume,
|
||||||
|
restore, cleanup gates, and publish semantics. External contracts are defined
|
||||||
|
in the [integration documentation](../integrations/).
|
||||||
|
|
||||||
|
The pipeline has one canonical ordered stage set. Configuration may enable,
|
||||||
|
disable, or parameterize supported behavior, but it must not turn that sequence
|
||||||
|
into an arbitrary DAG or hide orchestration in generic workflow abstractions.
|
||||||
|
An invocation selects either the full sequence or one inclusive contiguous
|
||||||
|
range of it. Execution remains flat and canonical even though invalidation is
|
||||||
|
dependency-aware: the application owns a separate fixed relation used only to
|
||||||
|
stale transitive dependents, including dependents outside a selected range.
|
||||||
|
The implemented stage inventory belongs in the
|
||||||
|
[Internal Overview](../internal/overview.md).
|
||||||
|
|
||||||
|
Narratio is contract-first without being abstraction-heavy. Interfaces and
|
||||||
|
extension points should protect demonstrated boundaries. New abstraction is not
|
||||||
|
itself an architectural goal.
|
||||||
|
|
||||||
|
## Ownership And Dependency Direction
|
||||||
|
|
||||||
|
The application boundary owns command composition, configuration selection,
|
||||||
|
production composition, workspace locking, and top-level lifecycle. It may depend
|
||||||
|
on concrete implementations to assemble a run.
|
||||||
|
|
||||||
|
Stage orchestration expresses intent in Narratio-level data and interfaces.
|
||||||
|
Stages may depend on configuration, manifest, artifact, path, and adapter
|
||||||
|
contracts, but they must not depend on transport-specific request types,
|
||||||
|
subprocess argument construction, cloud SDK types, or downstream tool internals.
|
||||||
|
|
||||||
|
Adapters translate between Narratio contracts and external systems. They own
|
||||||
|
HTTP, subprocess, notification, and object-storage mechanics, including command
|
||||||
|
construction, transport behavior, provider response handling, and external
|
||||||
|
error adaptation. External dependency types must remain inside the adapter that
|
||||||
|
owns them unless that dependency is the adapter's explicit public contract.
|
||||||
|
WhisperX HTTP behavior, Seriatim, Audita, Notarius, and Scriptorium command
|
||||||
|
construction, notification transport, and object-storage SDK details remain
|
||||||
|
behind these boundaries.
|
||||||
|
|
||||||
|
State and path services must not infer stage policy. Storage implementations
|
||||||
|
receive explicit bucket-relative keys and do not infer campaign, session, run,
|
||||||
|
or root-prefix semantics. Manifest persistence records transitions but does not
|
||||||
|
choose orchestration policy. Artifact resolution identifies and validates
|
||||||
|
artifacts but does not execute producers.
|
||||||
|
|
||||||
|
Dependencies should remain narrow and point toward Narratio-owned contracts.
|
||||||
|
Prefer the Go standard library. Add an external dependency only when it provides
|
||||||
|
a clear correctness, security, interoperability, or complexity benefit, and
|
||||||
|
confine it to the boundary that needs it.
|
||||||
|
|
||||||
|
## Stage Boundaries
|
||||||
|
|
||||||
|
Each stage has one explicit responsibility and declares:
|
||||||
|
|
||||||
|
- required input state;
|
||||||
|
- produced output state;
|
||||||
|
- configuration it consumes;
|
||||||
|
- external adapters it uses;
|
||||||
|
- manifest references and metadata it reads or writes;
|
||||||
|
- skip, force, invalidation, and resume behavior; and
|
||||||
|
- failure behavior.
|
||||||
|
|
||||||
|
Stages write and validate run-local results before materializing canonical
|
||||||
|
outputs where that distinction applies. Executed work is complete after its
|
||||||
|
required outputs have been written, validated, and recorded in durable manifest
|
||||||
|
state. Validated supplied products recorded in that state can also satisfy work
|
||||||
|
according to the application's fixed coverage rules. Consumers resolve actual
|
||||||
|
recorded products; completion does not imply that an absent intermediate file
|
||||||
|
exists.
|
||||||
|
|
||||||
|
A failed or interrupted stage must not be presented as successful. Failure
|
||||||
|
should preserve enough local state and diagnostics for inspection, recovery,
|
||||||
|
and resume until a later authorized cleanup. Forcing a stage invalidates
|
||||||
|
succeeded transitive dependents
|
||||||
|
according to a fixed application-owned relation that is separate from canonical
|
||||||
|
execution order. The relation is validated against the stage inventory and is
|
||||||
|
not configurable.
|
||||||
|
|
||||||
|
Downstream readiness is an invocation check after selected preparation and
|
||||||
|
before the selected processing work. It does not create a stage success.
|
||||||
|
Standalone preflight prepares or reuses session inputs and checks enabled
|
||||||
|
capabilities under the same workspace lock; its checks may probe destinations and
|
||||||
|
contact configured providers.
|
||||||
|
|
||||||
|
A stage may explicitly self-skip with a stable reason and no outputs. That
|
||||||
|
outcome is persisted, clears older outputs owned by the stage, and is
|
||||||
|
reconsidered on a later invocation. A stage may also validate whether an
|
||||||
|
otherwise successful recorded result is still resumable; an obsolete result
|
||||||
|
is staled and rerun, while an unsafe condition that prevents a sound decision
|
||||||
|
stops execution.
|
||||||
|
|
||||||
|
Shared behavior should live behind a narrow service or helper with one clear
|
||||||
|
owner. Stages must not reach across boundaries or reproduce adapter, manifest,
|
||||||
|
artifact, or path policy ad hoc.
|
||||||
|
|
||||||
|
## Manifest, Resume, And Restore
|
||||||
|
|
||||||
|
The session manifest is the durable ledger for progress across invocations. It
|
||||||
|
records session and run identity, stage state, input and output references,
|
||||||
|
diagnostic references, checksums or provenance where useful, and non-secret
|
||||||
|
adapter and publish metadata.
|
||||||
|
|
||||||
|
Resume and skip decisions are manifest-driven. Filesystem state may be
|
||||||
|
inspected and validated, but file presence alone does not replace recorded
|
||||||
|
stage state or accepted supplied-product records. Each invocation retains an
|
||||||
|
in-memory command summary and a run-local workspace identity, but neither is a
|
||||||
|
durable progress ledger. The
|
||||||
|
physical run directory is created on demand only when an executing stage
|
||||||
|
requires it; a fully reused invocation or a cleanup-only invocation does not
|
||||||
|
leave an empty run directory.
|
||||||
|
|
||||||
|
Restore treats the pointer-selected publication inventory as its authority. It
|
||||||
|
must plan deterministically, confine remote-to-local paths, protect local
|
||||||
|
conflicts, and save a merged local baseline after accepting restored products.
|
||||||
|
Valid supplied records represent actual local products and may satisfy the
|
||||||
|
fixed work they cover without asserting that their historical producers ran
|
||||||
|
locally. Imported products are independent of one another; publication does
|
||||||
|
not require common generation history. Local generation keeps its ordinary
|
||||||
|
checkpoint and freshness rules. Import alone must not record successful
|
||||||
|
publication, notification, or cleanup execution.
|
||||||
|
The physical workflow and recovery procedures belong in
|
||||||
|
[Operations](../operations.md).
|
||||||
|
|
||||||
|
Restore and runner transitions for one session use the same local lock. A
|
||||||
|
durable incomplete-restore marker blocks runner reuse after a partial restore;
|
||||||
|
safe retry, rather than rollback of arbitrary local effects, is the recovery
|
||||||
|
mechanism. Imported product paths must be confined to the selected local
|
||||||
|
session root and derived from current source definitions, not producer paths.
|
||||||
|
|
||||||
|
For the immutable remote-commit protocol, a restore or status operation binds
|
||||||
|
to one pointer-selected commit and only its declared object identities. A force
|
||||||
|
flag may replace an eligible regular managed file, but never turns a directory
|
||||||
|
or other non-regular conflict into a successful restore.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Configuration ownership follows
|
||||||
|
[ADR 0003](../adr/0003-assign-configuration-ownership.md):
|
||||||
|
|
||||||
|
- ConfigKit owns configuration policy and resolution through the final handoff.
|
||||||
|
Narratio supplies its schema, defaults, and configuration rules through
|
||||||
|
supported extension points. The completed ConfigKit result is authoritative.
|
||||||
|
- Narratio consumes that result without mutation and derives separate domain
|
||||||
|
objects. It must not construct a replacement effective configuration.
|
||||||
|
- CommandKit owns CLI mechanics and presentation; `ckconfig` exposes ConfigKit
|
||||||
|
inspection. Narratio supplies selection and acquisition wiring through native
|
||||||
|
adapters without changing upstream semantics or substituting inspection views.
|
||||||
|
|
||||||
|
Missing configuration or inspection capabilities are addressed upstream.
|
||||||
|
|
||||||
|
- YAML decoding rejects unknown fields.
|
||||||
|
- Defaults are centralized and testable.
|
||||||
|
- Defaults apply only to absent fields. Explicit false, zero, empty, and null
|
||||||
|
values remain present and are evaluated by Narratio's domain rules.
|
||||||
|
- Validation rejects invalid configuration before stage execution where
|
||||||
|
practical.
|
||||||
|
- ConfigKit resolves local imports and the selected pipeline overlay. Shared
|
||||||
|
campaign, party, and glossary documents permit schema extensions; Narratio
|
||||||
|
operational settings remain strict, as selected in [ADR 0003](../adr/0003-assign-configuration-ownership.md).
|
||||||
|
- Canonical party rosters are campaign-owned inputs. Narratio derives players
|
||||||
|
projections and concrete character-family artifacts as separate domain
|
||||||
|
objects before execution, without modifying configuration.
|
||||||
|
- Resume uses stage- or artifact-owned semantic evidence for observable
|
||||||
|
result-affecting configuration of locally generated work. Accepted supplied
|
||||||
|
products do not require historical generation evidence; overlay identity and
|
||||||
|
an effective digest are provenance, never blanket cache keys.
|
||||||
|
- Session templating remains narrow and deterministic rather than becoming a
|
||||||
|
general configuration language.
|
||||||
|
- Secret values are supplied indirectly and are not persisted in ordinary
|
||||||
|
configuration.
|
||||||
|
|
||||||
|
Narratio must not become a second configuration system for downstream tools.
|
||||||
|
External systems own their runtime defaults wherever practical; Narratio passes
|
||||||
|
the paths required by its stage contracts and explicit operator overrides. The
|
||||||
|
field-level contract and credential-supply mechanisms belong in
|
||||||
|
[Configuration](../config.md).
|
||||||
|
|
||||||
|
## Artifacts, Paths, And Storage
|
||||||
|
|
||||||
|
Artifact identities and local and remote paths are application contracts.
|
||||||
|
Canonical helpers own workspace, session, run, input, transcript,
|
||||||
|
artifact, log, report, configuration, and publish-current paths. Callers must
|
||||||
|
not reconstruct canonical paths through scattered string concatenation.
|
||||||
|
|
||||||
|
Prepared audio reuse requires manifest-backed identity and checksum evidence.
|
||||||
|
Subprocess applications own their own state and caches, separately configured
|
||||||
|
and outside Narratio cleanup. See [ADR 0001](../adr/0001-classify-session-content.md)
|
||||||
|
and [ADR 0002](../adr/0002-assign-subprocess-content-ownership.md).
|
||||||
|
|
||||||
|
Artifact resolution is deterministic and manifest-aware. Producers materialize
|
||||||
|
canonical outputs before reporting success, and consumers resolve declared
|
||||||
|
artifact identities rather than infer files from unrelated directory contents.
|
||||||
|
Configured products become current through validated promotion or accepted
|
||||||
|
supplied-product records; directory presence alone never establishes availability.
|
||||||
|
|
||||||
|
Writes, moves, replacements, and deletions must use narrow, explicit,
|
||||||
|
root-confined destinations. Symlinks, traversal, broad roots, and ambiguous
|
||||||
|
relative destinations must not expand the scope of an operation. Cleanup is
|
||||||
|
permitted only through explicit operator action or the configured final cleanup
|
||||||
|
stage, and must preserve subprocess-owned state and caches.
|
||||||
|
|
||||||
|
Physical layout, retention, and operational lifecycle belong in
|
||||||
|
[Operations](../operations.md). Logical external formats and durable integration
|
||||||
|
contracts belong under [Integrations](../integrations/).
|
||||||
|
|
||||||
|
## Publish Commit Boundary
|
||||||
|
|
||||||
|
Publish has one explicit remote commit boundary. A remote run becomes current
|
||||||
|
only after Narratio has successfully uploaded its immutable run-scoped objects,
|
||||||
|
the immutable commit manifest, and finally the current commit pointer.
|
||||||
|
Destination planning precedes sequential source verification and transfer;
|
||||||
|
failed attempts may leave immutable objects that are not selected as current.
|
||||||
|
|
||||||
|
`current/commit-pointer.json` is the sole mutable selector and must be written
|
||||||
|
exactly once, last. Failed, incomplete, skipped, or uncommitted publish attempts
|
||||||
|
must not be presented as current remote state. Publish locks remain authoritative
|
||||||
|
and are not bypassed by a forced run. Each mutable remote lock is an independent
|
||||||
|
per-source object; lock mutations use provider-enforced generation preconditions.
|
||||||
|
Publish revalidates every initially unlocked participating source after writing
|
||||||
|
the immutable commit and before pointer selection. A lock observed then leaves
|
||||||
|
the prior committed snapshot current. A lock created after that final check may
|
||||||
|
race the pointer write; the commit protocol does not claim a stronger distributed
|
||||||
|
transaction boundary.
|
||||||
|
|
||||||
|
Automatic local cleanup is permitted only after a successful publish commit,
|
||||||
|
only when explicitly configured, and only through the path-safety guardrails.
|
||||||
|
It is the final ordinary pipeline stage after `notify`. The stage derives the
|
||||||
|
selected session's run-history target from validated publish metadata and the
|
||||||
|
configured campaign/session identity; it never infers a target from directory contents or
|
||||||
|
rereads remote storage. A cleanup failure makes the invocation incomplete while
|
||||||
|
leaving publish succeeded and the committed remote snapshot authoritative. A
|
||||||
|
normal later full run reuses valid upstream stages and retries cleanup.
|
||||||
|
|
||||||
|
`run SESSION --stage publish` selects only publish and therefore never
|
||||||
|
invokes cleanup. Operators may select cleanup directly only when the manifest
|
||||||
|
contains valid successful publication evidence.
|
||||||
|
|
||||||
|
## Security, Privacy, And Diagnostics
|
||||||
|
|
||||||
|
Narratio distinguishes ordinary workspace data from credentials. Campaign and
|
||||||
|
session material—including manifests, transcripts, prompts, generated
|
||||||
|
configuration, logs, reports, diagnostics, and Notarius artifacts—is
|
||||||
|
intentionally shareable with the configured workspace group. API-key material
|
||||||
|
is sensitive and is not covered by the ordinary workspace-sharing policy.
|
||||||
|
|
||||||
|
Narratio supports Linux on amd64 and arm64. macOS arm64 is best effort: it has
|
||||||
|
a cross-build gate and release asset, but no native runtime release gate.
|
||||||
|
Windows and macOS amd64 are unsupported and have no compatibility promise or
|
||||||
|
release asset.
|
||||||
|
|
||||||
|
On supported systems, Narratio-created ordinary workspace directories converge on
|
||||||
|
setgid `02775` and ordinary workspace files on `0664`, even when the caller's
|
||||||
|
umask is restrictive. This preserves the existing workspace group for nested
|
||||||
|
creation and atomic replacements without changing ownership. API-key storage
|
||||||
|
uses a separate restrictive contract.
|
||||||
|
|
||||||
|
Raw secrets must not be stored in pipeline, campaign, or session YAML or written
|
||||||
|
to manifests, logs, generated configuration, reports, publish metadata,
|
||||||
|
documentation, or examples. Pipeline configuration names environment variables. Command-owned pipeline
|
||||||
|
acquisition explicitly prepares the selected source through ConfigKit's
|
||||||
|
configured bootstrap before typed credential resolution and adapter construction.
|
||||||
|
Completed acquisitions are reused normally; ConfigKit's selected environment
|
||||||
|
policy governs each preparation. Library loading does not write the environment.
|
||||||
|
Safe bootstrap diagnostics may identify files and statuses but never values. Diagnostics should avoid transcript and
|
||||||
|
prompt content unless a deliberate, bounded inspection mechanism requires it.
|
||||||
|
|
||||||
|
Logs, reports, generated invocation files, generated configuration, and render
|
||||||
|
debug files are diagnostics, not canonical pipeline products. They remain
|
||||||
|
discoverable until configured cleanup removes their run history. Manifest
|
||||||
|
references must preserve the distinction between diagnostics and artifacts.
|
||||||
|
|
||||||
|
Documentation security rules belong in the
|
||||||
|
[Documentation Policy](documentation.md). Credential supply belongs in
|
||||||
|
[Configuration](../config.md), while permissions, sensitive runtime-artifact
|
||||||
|
handling, and recovery belong in [Operations](../operations.md).
|
||||||
|
|
||||||
|
## Determinism And Testability
|
||||||
|
|
||||||
|
Narratio prefers deterministic behavior where practical, including stable local
|
||||||
|
and remote layouts, sorted operation order, predictable generated
|
||||||
|
configuration, repeatable command construction, deterministic artifact
|
||||||
|
resolution, and reproducible planning.
|
||||||
|
|
||||||
|
Run IDs and timestamps may be intentionally variable, but surrounding behavior
|
||||||
|
must remain controllable in tests. Core behavior should be testable without live
|
||||||
|
external services; expensive, nondeterministic, destructive, or external
|
||||||
|
boundaries should be replaceable with focused test doubles. General testing
|
||||||
|
philosophy and sufficiency rules belong in the [Testing Policy](testing.md).
|
||||||
|
|
||||||
|
## Documentation And Decision Records
|
||||||
|
|
||||||
|
Documentation follows the [Documentation Policy](documentation.md). Current
|
||||||
|
behavior belongs in its canonical user, operator, integration, architecture, or
|
||||||
|
internal owner. Proposed behavior and implementation status belong under
|
||||||
|
`docs/roadmap/`.
|
||||||
|
|
||||||
|
Significant architectural decisions may be recorded under `docs/adr/` using the
|
||||||
|
format and lifecycle defined by the documentation policy. ADR acceptance does
|
||||||
|
not establish that a decision has been implemented.
|
||||||
|
|
||||||
|
## Architectural Non-Goals
|
||||||
|
|
||||||
|
Narratio does not aim to provide:
|
||||||
|
|
||||||
|
- a generic DAG or workflow engine;
|
||||||
|
- a replacement configuration layer for WhisperX, Seriatim, Audita,
|
||||||
|
Scriptorium, or other downstream tools;
|
||||||
|
- a storage abstraction broader than the needs of this pipeline;
|
||||||
|
- stage logic coupled directly to cloud SDKs, transports, subprocess details,
|
||||||
|
or downstream implementation internals;
|
||||||
|
- raw-secret persistence;
|
||||||
|
- implicit cross-stage behavior that bypasses manifest and artifact contracts;
|
||||||
|
or
|
||||||
|
- a prompt-authoring system.
|
||||||
189
docs/policy/documentation.md
Normal file
189
docs/policy/documentation.md
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
# Documentation Policy
|
||||||
|
|
||||||
|
**Base Policy Version:** 1.13
|
||||||
|
|
||||||
|
**Last Updated**: 2026-11-22
|
||||||
|
|
||||||
|
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/5b9088601290564647a9e20c13f95c0da9f4cb15/docs/policy/documentation.md
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
|
||||||
|
This policy assigns each documentation topic to one canonical owner. Its goal is
|
||||||
|
to keep this application's documentation accurate, concise, discoverable, and resistant
|
||||||
|
to drift for users, operators, developers, integrators, and LLM coding agents.
|
||||||
|
|
||||||
|
## Core Rules
|
||||||
|
|
||||||
|
### One Canonical Owner
|
||||||
|
|
||||||
|
Each authoritative fact belongs in one document. A non-owning document may give
|
||||||
|
a short, stable summary for orientation, but it must link to the canonical owner
|
||||||
|
for volatile details.
|
||||||
|
|
||||||
|
Volatile details include commands, flags, configuration fields and defaults,
|
||||||
|
module keys, schemas, file names, paths, status codes, retry behavior, and
|
||||||
|
runtime guarantees. If readers could reasonably treat a statement as a
|
||||||
|
contract, maintain it only in the owning document.
|
||||||
|
|
||||||
|
### Current And Future Behavior
|
||||||
|
|
||||||
|
Outside `docs/roadmap/`, documentation describes implemented behavior only.
|
||||||
|
Partial features may be described only to their implemented boundary.
|
||||||
|
|
||||||
|
Architectural constraints may govern future changes. Describe current structure
|
||||||
|
from implemented behavior.
|
||||||
|
|
||||||
|
ADRs may record an accepted architectural decision before implementation. The
|
||||||
|
roadmap owns implementation status and sequencing until the decision is
|
||||||
|
implemented. Current architecture, user, operator, integration, and internal
|
||||||
|
documentation are updated when the behavior lands.
|
||||||
|
|
||||||
|
### Audience And Detail
|
||||||
|
|
||||||
|
Write for the document's stated audience and include only the detail needed for
|
||||||
|
its owned topic. Keep user and operator docs focused on using and operating the
|
||||||
|
application. Developer docs should link to user-facing and external contracts
|
||||||
|
for their definitions.
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
Complete copyable files belong in `examples/`. Documentation may use the
|
||||||
|
smallest illustrative snippet needed to explain its owned topic, but should link
|
||||||
|
to maintained examples for complete copyable files.
|
||||||
|
|
||||||
|
Examples must be valid, secret-free, and tested where practical. Commands and
|
||||||
|
configuration used in documentation should match the application.
|
||||||
|
|
||||||
|
### Security And Privacy
|
||||||
|
|
||||||
|
Documentation and examples must not contain real credentials, private keys,
|
||||||
|
private environment dumps, sensitive source material, or private infrastructure
|
||||||
|
details unless intentionally public. Document secret-handling mechanisms, not
|
||||||
|
secret values.
|
||||||
|
|
||||||
|
## Canonical Ownership
|
||||||
|
|
||||||
|
| Topic | Canonical owner | Owned content | Content owned elsewhere |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| Product orientation and minimal end-to-end quickstart | `README.md` | Purpose, value, shortest successful invocation, and navigation, including licensing and attribution. | Complete command reference, configuration reference, operational procedures, implementation detail. |
|
||||||
|
| Contributor entry point | `docs/development.md` | Task-oriented reading guide, contributor orientation, baseline validation commands, and canonical links. | Package inventory, architecture rules, subsystem behavior, detailed change recipes. |
|
||||||
|
| Application architecture policy | `docs/policy/architecture.md` | System shape, normative ownership, dependency direction, boundaries, invariants, safety properties, and non-goals. | Concrete package inventory, implementation mechanics, contributor procedures, decision history, future work. |
|
||||||
|
| Policy-set provenance and upstream navigation | `docs/policy/meta.md` | Policy-set origin, local authority, adoption baselines, and upstream adoption and update links. | Task-specific reading triggers, detailed adoption procedures, and formal attribution notices. |
|
||||||
|
| Agent policy | `docs/policy/agents.md` | Proportionate, idiomatic implementation; rules against inventing requirements, restrictions, guarantees, or policy. | Application contracts, architecture, testing policy, and contributor procedures. |
|
||||||
|
| Documentation policy | `docs/policy/documentation.md` | Documentation ownership, audience boundaries, maintenance rules, and ADR/document lifecycle. | Application architecture or product behavior. |
|
||||||
|
| Testing policy | `docs/policy/testing.md` | Test philosophy, risk sufficiency, boundaries, doubles, coverage, regressions, and test maintenance. | Subsystem behavior, application contracts, subsystem-specific test inventories, and implementation plans. |
|
||||||
|
| Release policy | `docs/policy/release.md` | Versioning, compatibility, release integrity and immutability, release documentation, proportionate gates, publication controls, completion, and required versus optional checks. | Repository-specific commands, product installation guidance, CLI version semantics, historical release summaries, and CI implementation detail. |
|
||||||
|
| Open source licensing and attribution policy | `docs/policy/oss.md` | License defaults and author choices, COPYRIGHT and attribution formats, license/notice links, discoverability, maintenance, and concrete exceptions. | Component entries, license texts, release commands, and dependency security review. |
|
||||||
|
| Project copyright and license grant | `COPYRIGHT` | Project identity, copyright holders and years, SPDX expression, grant, warranty disclaimer, and third-party statement. | Complete license texts and upstream component attribution. |
|
||||||
|
| Project license texts | `LICENSE` | Complete project and incorporated companion license texts, with required project-specific fields. | General licensing policy and upstream component attribution. |
|
||||||
|
| Upstream component attribution | `docs/oss/attribution.md` | House Format component entries: identity, material scope and modifications where applicable, copyright, license, required notices, and license, notice, and source links. | General attribution policy, exception reasoning, research narratives, compliance commentary, and complete standard license texts. |
|
||||||
|
| Standard dependency license texts | `docs/oss/licenses/` | Complete, verbatim standard license texts shared by applicable entries. | Project-specific upstream notices, attribution prose, and policy interpretation. |
|
||||||
|
| Repository-specific release procedure | `docs/release.md` | Maintainer prerequisites, candidate preparation, validation and publication commands and automated guards, asynchronous deliverables, delivery status, optional consumer verification, and recovery. | General release requirements, product installation guidance, historical release summaries, and current compatibility contracts. |
|
||||||
|
| CLI contract (if applicable) | `docs/cli.md` | Commands, arguments, flags, invocation semantics, and exit codes. | End-to-end operating procedures, configuration field definitions, runtime filesystem layout, module implementation details. |
|
||||||
|
| Configuration contract (if applicable) | `docs/config.md` | Discovery, precedence, schema, fields, defaults, environment overrides, validation, and selectable module and validator keys. | Complete example files, CLI syntax, runtime state lifecycle, module implementation details. |
|
||||||
|
| Operations (if applicable) | `docs/operations.md` | Runtime workflows, physical filesystem and state layout, output, cache and debug handling, resume, cleanup, permissions, recovery, and limits. | CLI flag syntax, configuration field definitions, logical output schemas, implementation mechanics. |
|
||||||
|
| Troubleshooting | `docs/troubleshooting.md` | Symptom-driven diagnosis, likely causes, safe inspection, and remedies. | Canonical commands, configuration definitions, operational procedures, and integration contracts. |
|
||||||
|
| Integration contracts for external components (if applicable) | `docs/integrations/` | External formats and protocols, upstream and downstream contracts, logical output paths and schemas, media types, and compatibility. | Physical runtime placement and lifecycle, internal transformations, CLI syntax, configuration defaults. |
|
||||||
|
| Inventory of implemented internal packages | `docs/internal/overview.md` | Implemented packages and components, responsibilities, and links to focused internal docs. | Normative architecture, contributor reading policy, external contracts. |
|
||||||
|
| Behavior and architecture of internal packages | Other files under `docs/internal/` | Implementation flow, collaborators, state transitions, package-local guarantees and failures, and relevant tests. | Global architecture invariants, configuration definitions and defaults, external schemas, operator procedures. |
|
||||||
|
| Architectural decision records | `docs/adr/` | Records of significant architectural decisions and supporting rationale. | Ordinary design choices, current behavior reference, implementation status, task sequencing. |
|
||||||
|
| Future work and implementation status | `docs/roadmap/` | Proposed, accepted, or future work; implementation status, sequencing, and task breakdowns. | Implemented behavior reference and architectural decision rationale. |
|
||||||
|
| Release-note history | `docs/releases/` | One checked-in summary per source release under the procedure; the note at its immutable tag is the release record. | Current commands, behavior, contracts, and compatibility definitions. |
|
||||||
|
| Complete copyable artifacts | `examples/` | Maintained configuration, inputs, and other copyable or runnable files. | Field-by-field reference, command reference, prose explanation. |
|
||||||
|
|
||||||
|
Create supporting documents for existing interfaces and responsibilities when
|
||||||
|
substantive content is available.
|
||||||
|
|
||||||
|
## Boundary Rules
|
||||||
|
|
||||||
|
### Orientation
|
||||||
|
|
||||||
|
Link among orientation, architecture, and internal documents; maintain each
|
||||||
|
package or behavior description in its canonical owner.
|
||||||
|
|
||||||
|
### Commands, Configuration, Operations, And Troubleshooting
|
||||||
|
|
||||||
|
CLI documentation answers how to invoke the application. Configuration
|
||||||
|
documentation answers what settings mean. Operations answers what happens to
|
||||||
|
runtime state and how to operate or recover the application. When a workflow
|
||||||
|
crosses these topics, choose the document that owns the task and link to the
|
||||||
|
other contracts. Troubleshooting begins with observable symptoms and links to the owning contract.
|
||||||
|
|
||||||
|
### Releases
|
||||||
|
|
||||||
|
The release policy defines requirements and invariants that every release must
|
||||||
|
satisfy. The repository-specific release procedure defines the commands and
|
||||||
|
workflow maintainers use to satisfy that policy. Release notes record history
|
||||||
|
at immutable tags. Maintain current behavior in its canonical documentation,
|
||||||
|
update it with the corresponding behavior changes, and keep release procedures
|
||||||
|
consistent with adopted policy.
|
||||||
|
|
||||||
|
### Project Licensing And Upstream Attribution
|
||||||
|
|
||||||
|
README and release documents link to the canonical licensing and attribution
|
||||||
|
materials under the [OSS policy](oss.md). The release procedure owns URL
|
||||||
|
construction and publication mechanics.
|
||||||
|
|
||||||
|
### Contracts And Implementation
|
||||||
|
|
||||||
|
Integration and API documents define externally observable shapes and
|
||||||
|
semantics. Internal documents explain how this application implements or consumes those
|
||||||
|
contracts. Internal docs may name a field, file, or protocol to identify a
|
||||||
|
dependency, but must link to its canonical contract for the definition.
|
||||||
|
|
||||||
|
### Upstream Dependencies
|
||||||
|
|
||||||
|
When documenting an upstream dependency, identify the library and link to its
|
||||||
|
canonical documentation for its features and behavior. Maintain local
|
||||||
|
documentation for application-specific integration, configuration, and
|
||||||
|
adaptations. Brief summaries may orient readers; upstream documentation remains
|
||||||
|
the canonical reference for upstream behavior. Where behavior differs by
|
||||||
|
version, link to documentation applicable to the imported version.
|
||||||
|
|
||||||
|
### Security Topics
|
||||||
|
|
||||||
|
This policy owns what documentation and examples may contain. Architecture owns
|
||||||
|
application security invariants. Configuration owns credential-supply
|
||||||
|
mechanisms. Operations owns permissions and handling of sensitive runtime
|
||||||
|
artifacts. Internal docs own implementation mechanisms only.
|
||||||
|
|
||||||
|
## Architecture Decision Records
|
||||||
|
|
||||||
|
Use sequentially numbered ADR filenames such as
|
||||||
|
`0001-record-architecture-decisions.md`. Follow the lightweight Nygard format:
|
||||||
|
|
||||||
|
1. title;
|
||||||
|
2. status;
|
||||||
|
3. date;
|
||||||
|
4. context;
|
||||||
|
5. decision;
|
||||||
|
6. alternatives considered;
|
||||||
|
7. consequences.
|
||||||
|
|
||||||
|
Treat the decision content of an accepted ADR as immutable. When a decision
|
||||||
|
changes, create a new ADR and update the earlier ADR's status to superseded.
|
||||||
|
|
||||||
|
ADRs should be reserved for major architectural decisions, such as ownership
|
||||||
|
boundaries, large-scale architectural features, or invariants that rise to
|
||||||
|
the level of architectural significance. Routine choices, implementation
|
||||||
|
decisions, and rejected suggestions do not warrant an ADR unless they
|
||||||
|
otherwise represent a significant architectural decision.
|
||||||
|
|
||||||
|
Roadmaps should preserve plausible future work, not rejected product
|
||||||
|
ideas.
|
||||||
|
|
||||||
|
## Maintenance
|
||||||
|
|
||||||
|
When behavior changes, update its canonical owner in the same change. If
|
||||||
|
ownership moves, remove the old definition and replace it with a link where
|
||||||
|
navigation remains useful.
|
||||||
|
|
||||||
|
Before completing documentation work:
|
||||||
|
|
||||||
|
- verify affected behavior and examples;
|
||||||
|
- check commands, flags, fields, defaults, schemas, and paths against their
|
||||||
|
implementation;
|
||||||
|
- keep unimplemented behavior in the roadmap, subject to the ADR exception;
|
||||||
|
- remove stale references and validate links;
|
||||||
|
- confirm that non-owning documents summarize and link rather than redefine;
|
||||||
|
- confirm that no secrets or sensitive private data were added.
|
||||||
27
docs/policy/meta.md
Normal file
27
docs/policy/meta.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# Policy Set Provenance
|
||||||
|
|
||||||
|
**Base Policy Version:** 1.0
|
||||||
|
|
||||||
|
**Last Updated**: 2026-11-17
|
||||||
|
|
||||||
|
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/docs/policy/meta.md
|
||||||
|
|
||||||
|
## Origin And Local Authority
|
||||||
|
|
||||||
|
This repository's policy set is adapted from
|
||||||
|
[Standard Repository Policies](https://gitea.maximumdirect.net/eric/policy).
|
||||||
|
The adopted local policies govern work in this repository. Upstream revisions
|
||||||
|
become local policy through deliberate adoption, preserving local decisions.
|
||||||
|
Each policy's `Upstream Source` identifies its adopted baseline.
|
||||||
|
|
||||||
|
## Adoption And Updates
|
||||||
|
|
||||||
|
For policy adoption, upstream revision reviews, and updates, consult the
|
||||||
|
[upstream adoption and update guide](https://gitea.maximumdirect.net/eric/policy/src/branch/main/docs/adoption.md).
|
||||||
|
That guide and the reference example collection are maintained upstream and
|
||||||
|
accessed through links. Keep discovery links pointed at the current upstream
|
||||||
|
project and guide; keep adopted-source and example links pinned to commits.
|
||||||
|
|
||||||
|
The local [developer guide](../development.md) routes tasks to applicable
|
||||||
|
policies. Formal credit and licensing notices for the copied policy material
|
||||||
|
belong in the local [attribution document](../oss/attribution.md).
|
||||||
225
docs/policy/oss.md
Normal file
225
docs/policy/oss.md
Normal file
@@ -0,0 +1,225 @@
|
|||||||
|
# Open Source Licensing And Attribution Policy
|
||||||
|
|
||||||
|
**Base Policy Version:** 1.9
|
||||||
|
|
||||||
|
**Last Updated**: 2026-11-17
|
||||||
|
|
||||||
|
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/docs/policy/oss.md
|
||||||
|
|
||||||
|
## Purpose And Scope
|
||||||
|
|
||||||
|
This policy defines project licensing conventions and a repeatable House Format
|
||||||
|
for upstream attribution and license notices. It covers the project's own code
|
||||||
|
and upstream components incorporated into or distributed with the application
|
||||||
|
or library, including relevant transitive dependencies and copied code,
|
||||||
|
documentation, or assets.
|
||||||
|
Determine treatment from the component's terms and actual use.
|
||||||
|
|
||||||
|
Consulting development guidance or using tooling alone does not require an
|
||||||
|
attribution entry. Copying or adapting documentation for inclusion in the
|
||||||
|
repository is different: preserve its applicable attribution and license terms.
|
||||||
|
A material's role as development guidance does not exempt copied documents.
|
||||||
|
Apply any express permissions for attribution-free reuse of example formatting.
|
||||||
|
|
||||||
|
The baseline is a publicly available source repository with releases published
|
||||||
|
alongside it. The format is independent of language, forge, and build system.
|
||||||
|
It does not require attribution for every development tool, establish license
|
||||||
|
compatibility, or resolve every obligation arising from use or distribution.
|
||||||
|
|
||||||
|
## Canonical Locations
|
||||||
|
|
||||||
|
The [documentation policy](documentation.md) assigns ownership:
|
||||||
|
|
||||||
|
- `COPYRIGHT`: project name, copyright statements, SPDX expression, grant,
|
||||||
|
warranty disclaimer, and third-party statement.
|
||||||
|
- `LICENSE` contains the complete, unmodified project license text, including
|
||||||
|
incorporated companion text. Dependency attribution does not relicense the project.
|
||||||
|
- `docs/oss/attribution.md`: canonical component entries.
|
||||||
|
- `docs/oss/licenses/`: complete, verbatim standard and applicable companion texts.
|
||||||
|
|
||||||
|
Use recognizable license filenames, such as `Apache-2.0.txt` or `LGPL-3.0.txt`.
|
||||||
|
A shared standard text may serve multiple entries. Keep explanations outside
|
||||||
|
license texts and preserve distinct versions and exceptions.
|
||||||
|
|
||||||
|
## Narratio Licensing Scope
|
||||||
|
|
||||||
|
Narratio application code remains GPL-3.0-or-later under its existing
|
||||||
|
[COPYRIGHT](../../COPYRIGHT) and [LICENSE](../../LICENSE). Its source and release
|
||||||
|
artifacts are hosted on Gitea; separately installed subprocess applications are
|
||||||
|
not incorporated merely because Narratio invokes them. The
|
||||||
|
[release procedure](../release.md) owns publication mechanics. Policy documents
|
||||||
|
adapted from Standard Repository Policies retain CC-BY-SA-4.0 under the distinct
|
||||||
|
scope recorded in COPYRIGHT and [attribution](../oss/attribution.md).
|
||||||
|
|
||||||
|
## Upstream Reference Examples
|
||||||
|
|
||||||
|
Use the commit-pinned upstream examples to create actual project notices.
|
||||||
|
Retain their links and keep the example collection upstream; keep applicable
|
||||||
|
license texts locally as specified above.
|
||||||
|
|
||||||
|
## Project Licensing
|
||||||
|
|
||||||
|
Unless the author specifies otherwise, use **GPL version 3 or later**
|
||||||
|
(`GPL-3.0-or-later`) for applications and **LGPL version 3 or later**
|
||||||
|
(`LGPL-3.0-or-later`) for libraries. An author's explicit choice takes precedence:
|
||||||
|
for example, a one-off script may use MIT. Such a choice requires no exception
|
||||||
|
rationale, additional approval, or compensating controls under this policy.
|
||||||
|
|
||||||
|
These defaults guide new license selection. Adopting this policy does not
|
||||||
|
relicense existing code or override third-party terms. Preserve an existing
|
||||||
|
license unless the author deliberately changes it. For mixed-purpose projects,
|
||||||
|
follow the author's selected scope rather than inferring different licenses for
|
||||||
|
individual packages.
|
||||||
|
|
||||||
|
Use the upstream [application COPYRIGHT example](https://gitea.maximumdirect.net/eric/policy/src/commit/a469273adda336625f96b9d769ea27b33999f146/examples/licensing/application/COPYRIGHT)
|
||||||
|
or [library COPYRIGHT example](https://gitea.maximumdirect.net/eric/policy/src/commit/a469273adda336625f96b9d769ea27b33999f146/examples/licensing/library/COPYRIGHT)
|
||||||
|
to create the project’s root `COPYRIGHT` file.
|
||||||
|
Use the COPYRIGHT examples exactly as provided, except for placeholder
|
||||||
|
substitutions and changes expressly required or authorized by this policy or
|
||||||
|
the author.
|
||||||
|
Use verified project names, contribution years, and copyright holders.
|
||||||
|
For another selected license, adapt the grant, SPDX expression, disclaimer, and
|
||||||
|
text references together to reflect the author's selected grant.
|
||||||
|
|
||||||
|
For GPLv3 projects, copy the complete GPLv3 text into `LICENSE`. For LGPLv3
|
||||||
|
projects, place the complete LGPLv3 text followed by the complete GPLv3 text in
|
||||||
|
`LICENSE`; the LGPL incorporates the GPL terms. Keep the texts unmodified and
|
||||||
|
place project-specific statements in `COPYRIGHT`. For the default grants, the
|
||||||
|
grant and SPDX expression in `COPYRIGHT` must expressly identify `or-later`;
|
||||||
|
follow the author’s choice if a different grant is selected.
|
||||||
|
|
||||||
|
For other licenses, provide their complete text and any required project-specific
|
||||||
|
fields; the standard reference collection remains unchanged. Keep `COPYRIGHT`,
|
||||||
|
`LICENSE`, SPDX expressions, and README descriptions consistent with the actual
|
||||||
|
grant. This convention introduces no blanket requirement for per-file headers;
|
||||||
|
preserve notices or add them where the applicable terms require them.
|
||||||
|
|
||||||
|
Identify separately licensed documentation or assets in the project grant, with
|
||||||
|
links to their attribution and license information. An application's default
|
||||||
|
code license does not override the terms of incorporated documentation.
|
||||||
|
|
||||||
|
## Upstream Attribution House Format
|
||||||
|
|
||||||
|
Begin `docs/oss/attribution.md` with `# Open Source Attribution Notices`,
|
||||||
|
followed directly by component entries. These comprise the complete document.
|
||||||
|
|
||||||
|
Each entry presents these five fields in order, with blank lines between them:
|
||||||
|
|
||||||
|
1. **Project name** as a level-two heading. An optional identification paragraph
|
||||||
|
may follow, such as `Selected module: MODULE at VERSION.` with the module and
|
||||||
|
version in backticks. For copied documentation, a concise `Material:` sentence
|
||||||
|
may identify the affected files and whether they were adapted or copied
|
||||||
|
without modification. A factual qualifier such as `(transitive dependency)`
|
||||||
|
is permitted. Limit optional identification prose to factual component and
|
||||||
|
material scope.
|
||||||
|
2. **Upstream copyright statement or statements**, preserving their wording.
|
||||||
|
Put multiple statements in separate paragraphs. Include this field when the
|
||||||
|
selected upstream source supplies an applicable statement; otherwise, omit it.
|
||||||
|
3. **SPDX license identifier or expression**, when applicable, using
|
||||||
|
`SPDX-License-Identifier: EXPRESSION`.
|
||||||
|
4. **License and notice links**, beginning `License and notices:`, separated
|
||||||
|
by ` | `, and ending with a period. Label local standard texts by license
|
||||||
|
name, such as `MIT` or `Apache 2.0`. Label upstream files by their actual
|
||||||
|
filenames, such as `COPYRIGHT`, `LICENSE`, `NOTICE`, or `PATENTS`.
|
||||||
|
5. **Source repository link**, rendered exactly as `[Source](COMMIT_URL).`.
|
||||||
|
|
||||||
|
Use the upstream [attribution example](https://gitea.maximumdirect.net/eric/policy/src/commit/a469273adda336625f96b9d769ea27b33999f146/examples/licensing/attribution.md)
|
||||||
|
to create the project’s `docs/oss/attribution.md`.
|
||||||
|
The example illustrates omitted fields and multiple copyrights and licenses.
|
||||||
|
Replace the uppercase placeholders and illustrative URLs with actual component
|
||||||
|
information. Local license links are relative to the destination
|
||||||
|
`docs/oss/attribution.md`; copy the applicable texts into its `licenses/`
|
||||||
|
directory. Do not copy example entries for components the project does not use.
|
||||||
|
|
||||||
|
These are five fields, not a line limit. Omit the SPDX field when no applicable
|
||||||
|
identifier exists; identify nonstandard terms through the linked text. Preserve
|
||||||
|
licensing alternatives and exceptions, and record a selected option when
|
||||||
|
relevant through the factual license identification. Do not invent an identifier
|
||||||
|
or silently resolve an unsettled licensing choice.
|
||||||
|
|
||||||
|
Keep entries factual. Do not add agent-authored explanations of license
|
||||||
|
expressions, file-level license scope, research performed, retained source
|
||||||
|
notices, or compliance conclusions. Avoid filler such as "none is invented
|
||||||
|
here" and embellished link labels such as "upstream LICENSE", "additional
|
||||||
|
patent grant", or "at the imported commit". Preserve actual required upstream
|
||||||
|
content; this rule excludes editorial additions, not required notices. Policy
|
||||||
|
interpretation and exception reasoning belong in the adopted OSS policy or an
|
||||||
|
appropriate decision record, not the attribution document.
|
||||||
|
|
||||||
|
## License Texts And Upstream Links
|
||||||
|
|
||||||
|
Link standard license texts to their local copies. Link project-specific
|
||||||
|
notices to their upstream copies. Every upstream repository or notice link must
|
||||||
|
identify the exact commit corresponding to the
|
||||||
|
imported version, including the selected source revision for copied material.
|
||||||
|
|
||||||
|
Classify material according to its contents. An upstream `LICENSE`,
|
||||||
|
`COPYING`, or similar file may contain project-specific notices or exceptions
|
||||||
|
in addition to standard wording. Link both the local standard text and the
|
||||||
|
commit-specific upstream file when needed. Make companion license texts directly
|
||||||
|
reachable from the entry.
|
||||||
|
|
||||||
|
For project-specific license and attribution material, this policy accepts
|
||||||
|
direct links to the applicable upstream texts as satisfying reproduction,
|
||||||
|
inclusion, or copy requirements. This is the adopted house interpretation.
|
||||||
|
Agents must apply it without adding local-copy requirements or seeking repeated
|
||||||
|
approval solely because a license uses those terms.
|
||||||
|
|
||||||
|
This interpretation concerns notice reproduction. Concrete obligations such as
|
||||||
|
marking modified files or supplying corresponding source receive their own
|
||||||
|
applicable treatment. Preserve required notices already present in incorporated
|
||||||
|
source files; the central attribution entry does not authorize stripping them.
|
||||||
|
|
||||||
|
## Discoverability
|
||||||
|
|
||||||
|
End the project's README with two friendly statements linking to its actual
|
||||||
|
grant in `COPYRIGHT` and the attribution document. For example, for a project
|
||||||
|
with the stated license:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
PROJECT_NAME is licensed under the [LGPL v3.0 or later](COPYRIGHT).
|
||||||
|
|
||||||
|
[Open Source attribution notices](docs/oss/attribution.md) are available.
|
||||||
|
```
|
||||||
|
|
||||||
|
Each new checked-in release document and its hosted download page must end
|
||||||
|
with links whose visible text is `COPYRIGHT | LICENSE | ATTRIBUTION`. Use absolute
|
||||||
|
URLs to those files at the release's immutable tag or corresponding immutable source
|
||||||
|
revision so the links work in both locations. This release navigation is distinct
|
||||||
|
from upstream component links, which must use the imported commit.
|
||||||
|
|
||||||
|
Reuse the checked-in release document as the hosted release body where supported.
|
||||||
|
The release procedure owns concrete URLs and publication mechanics for delivering
|
||||||
|
the links through the selected channel. Do not maintain duplicate notice lists.
|
||||||
|
These conventions do not by themselves require separate downloadable license
|
||||||
|
assets, source bundles, or a different binary package format.
|
||||||
|
|
||||||
|
## Maintenance And Exceptions
|
||||||
|
|
||||||
|
Update project licensing statements together when the author changes the grant
|
||||||
|
or its scope. Update upstream notices in the change that adds, removes, upgrades,
|
||||||
|
copies, or changes the distribution of a relevant component. Check the selected source's license
|
||||||
|
and notices rather than assuming they are unchanged. Update affected entries,
|
||||||
|
commit links, and texts; retain historical versions through Git.
|
||||||
|
|
||||||
|
Check affected statements, faithful standard-text copies, and link destinations
|
||||||
|
as part of ordinary change review. For a future release tag, check intended file
|
||||||
|
paths against the candidate source; the tag need not resolve remotely before
|
||||||
|
publication. Do not add publication-time network checks, CI polling, recurring
|
||||||
|
legal sign-offs, mandatory scanners, or a full software bill of materials merely
|
||||||
|
to implement this policy.
|
||||||
|
|
||||||
|
Use the House Format routinely. Raise an exception only for a concrete obligation
|
||||||
|
or unresolved rights question it does not address, including any arising from a
|
||||||
|
particular distribution channel. Record the issue and selected treatment in the
|
||||||
|
adopted OSS policy or an appropriate decision record. Attribution entries
|
||||||
|
contain the resulting factual identification and required material, without
|
||||||
|
repeating that reasoning. Resolve the issue before the affected use or
|
||||||
|
distribution without reopening settled choices.
|
||||||
|
Common ownership of projects is neither required nor a blanket exception.
|
||||||
|
|
||||||
|
Apply the formatting convention prospectively. Do not rewrite published tags,
|
||||||
|
notes, binaries, or checksums to retrofit it. Address actual omissions deliberately
|
||||||
|
under the applicable terms and the [release correction policy](release.md#immutability-and-failure-recovery).
|
||||||
|
Ordinary attribution maintenance and release links are preparation work, not new
|
||||||
|
release approval gates.
|
||||||
248
docs/policy/release.md
Normal file
248
docs/policy/release.md
Normal file
@@ -0,0 +1,248 @@
|
|||||||
|
# Release Policy
|
||||||
|
|
||||||
|
**Base Policy Version:** 1.7
|
||||||
|
|
||||||
|
**Last Updated**: 2026-11-23
|
||||||
|
|
||||||
|
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/docs/policy/release.md
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
|
||||||
|
This policy defines a proportionate workflow for validating and publishing an
|
||||||
|
intended source revision under a fresh version. Releases should require little
|
||||||
|
routine intervention, avoid repeated work, and preserve published contents.
|
||||||
|
|
||||||
|
Adopt stronger verification or reproducibility requirements through an explicit
|
||||||
|
project-specific decision justified by the intended audience and support needs.
|
||||||
|
|
||||||
|
The repository-specific commands belong in `docs/release.md`. Historical release
|
||||||
|
summaries belong in `docs/releases/`. The procedure must agree with the adopted
|
||||||
|
policy and link to it rather than introduce additional release requirements.
|
||||||
|
|
||||||
|
## Release Model And Completion
|
||||||
|
|
||||||
|
A source release identifies one exact committed source revision through an
|
||||||
|
immutable version tag and a version-matched, checked-in release note. The
|
||||||
|
primary release branch is `main` unless the adopted policy specifies otherwise.
|
||||||
|
The procedure must name the authoritative publication remote.
|
||||||
|
|
||||||
|
A successful push of the intended tag, with its source commit available on the
|
||||||
|
authoritative primary branch, completes the release. The source commit may be
|
||||||
|
pushed before the tag or published together with it through an atomic push.
|
||||||
|
The procedure must choose and document the supported approach.
|
||||||
|
|
||||||
|
Release commands must finish at successful publication. They must not wait for
|
||||||
|
or poll CI, require successful CI status, inspect downloadable artifacts, or
|
||||||
|
check consumer installation or Go module availability as completion gates.
|
||||||
|
A failed or ambiguous push requires resolving the authoritative remote state
|
||||||
|
before declaring success or retrying; successful pushes do not require a
|
||||||
|
separate remote read-back gate.
|
||||||
|
|
||||||
|
Repositories may publish source only. Additional binaries, images, packages,
|
||||||
|
checksums, or other declared deliverables may be published asynchronously from
|
||||||
|
the tagged source. The procedure must identify those deliverables and the
|
||||||
|
responsibility of their automation. Published deliverables must be traceable
|
||||||
|
to that source and identify the same version.
|
||||||
|
|
||||||
|
Track source-release completion and artifact delivery separately. Report delivery
|
||||||
|
failures and optional investigations under artifact-delivery status.
|
||||||
|
|
||||||
|
## Versioning And Compatibility
|
||||||
|
|
||||||
|
Stable releases use Semantic Versioning in the form `vMAJOR.MINOR.PATCH`, with
|
||||||
|
no leading zeroes. Prereleases require an explicit adopted policy defining
|
||||||
|
their format and use.
|
||||||
|
|
||||||
|
The selected version must be unused locally and on the authoritative remote.
|
||||||
|
Do not require queries to every configured remote or publication service.
|
||||||
|
A version known to have already been published must not be reused, even if the
|
||||||
|
normal guards do not inspect that channel. Adding a distribution channel
|
||||||
|
requires a deliberate update to the policy and procedure where needed.
|
||||||
|
|
||||||
|
For releases at or after `v1.0.0`:
|
||||||
|
|
||||||
|
- a major release may make intentional incompatible changes;
|
||||||
|
- a minor release may add backward-compatible behavior or raise the Go consumer
|
||||||
|
minimum as described below; and
|
||||||
|
- a patch release may make backward-compatible fixes.
|
||||||
|
|
||||||
|
In this context, "backward-compatible" means only that pre-existing, valid
|
||||||
|
configurations will continue to work following the release. Behavior need not
|
||||||
|
remain strictly identical.
|
||||||
|
|
||||||
|
Before `v1.0.0`, a minor release may change a documented public, operational,
|
||||||
|
configuration, data, integration, or compatibility contract when the release
|
||||||
|
note explains the impact and required consumer action. A patch release must
|
||||||
|
not intentionally break those contracts within its minor line.
|
||||||
|
|
||||||
|
Additional compatibility promises and deliberate exceptions belong in the
|
||||||
|
adopted policy or canonical contract documentation. Release notes explain
|
||||||
|
changes; they do not redefine current compatibility contracts.
|
||||||
|
|
||||||
|
## Consumer Minimum And Release Toolchain
|
||||||
|
|
||||||
|
Distinguish the minimum toolchain supported for consumers from the toolchain
|
||||||
|
maintainers use to build and validate a release. Record the consumer minimum in
|
||||||
|
the language's standard metadata and explain its support meaning in canonical
|
||||||
|
documentation. Define the selected release toolchain and its setup commands in
|
||||||
|
`docs/release.md`. Toolchain selection and upgrade cadence are repository-specific
|
||||||
|
choices.
|
||||||
|
|
||||||
|
For Go repositories, normally declare the initial stable release of the selected
|
||||||
|
series as the consumer minimum, such as `go 1.26.0`. Use a higher patch minimum
|
||||||
|
when a dependency or an identified correctness fix requires it, and document
|
||||||
|
the reason.
|
||||||
|
|
||||||
|
For release-policy purposes, successful build and release validation on the
|
||||||
|
selected Go patch release are sufficient to presume support across that Go
|
||||||
|
series, subject to the declared consumer minimum and concrete evidence of
|
||||||
|
incompatibility. Investigate specific compatibility concerns as they arise.
|
||||||
|
|
||||||
|
Use the selected release toolchain for candidate validation and release builds,
|
||||||
|
including CI jobs performing those tasks. A newer validation patch version alone
|
||||||
|
leaves the consumer minimum unchanged.
|
||||||
|
|
||||||
|
A minor release may raise the Go consumer minimum, including from one Go series
|
||||||
|
to the next, both before and after `v1.0.0`. This is an explicit exception to the
|
||||||
|
backward-compatibility requirement for minor releases. Patch releases preserve
|
||||||
|
the consumer minimum. Explain an increase's impact and required consumer action
|
||||||
|
in the release note. Other incompatible changes remain subject to the versioning
|
||||||
|
rules above.
|
||||||
|
|
||||||
|
## Release Documentation And Preparation
|
||||||
|
|
||||||
|
Every new release must include `docs/releases/<version>.md` in the tagged
|
||||||
|
source tree. Use the complete version tag as the filename and begin with a
|
||||||
|
title containing the product name and that exact version.
|
||||||
|
|
||||||
|
Include a short summary and any relevant compatibility impact or upgrade
|
||||||
|
instructions. Choose sections suited to the release and keep the note
|
||||||
|
proportionate to the change.
|
||||||
|
|
||||||
|
Keep exact current contracts in their canonical documents and update affected
|
||||||
|
documentation with the behavior change. Link to those documents from the note
|
||||||
|
where useful. If annotated tags are used, derive their summary from the
|
||||||
|
checked-in note.
|
||||||
|
|
||||||
|
Include the release footer defined by the [OSS policy](oss.md#discoverability)
|
||||||
|
in each new release document and preserve it on the hosted download page. The
|
||||||
|
release procedure defines the concrete URLs and publication mechanics. Prepare
|
||||||
|
these links with the release note; they do not add a network check or approval
|
||||||
|
gate.
|
||||||
|
|
||||||
|
Handle version selection, release-note content, and retirement of completed
|
||||||
|
roadmaps during preparation. Preserve planned and deferred work and repair
|
||||||
|
affected links when retiring roadmaps. Reuse ordinary change review for
|
||||||
|
unintended files, credentials, and private data. Scope release-content review
|
||||||
|
to the tagged source.
|
||||||
|
|
||||||
|
## Candidate Validation
|
||||||
|
|
||||||
|
Provide one publication command that validates the final committed candidate,
|
||||||
|
checks publication state, and publishes the intended refs. A validation-only
|
||||||
|
mode or command may be provided for diagnosis, but must not be a required step
|
||||||
|
before publication repeats the same checks.
|
||||||
|
|
||||||
|
Run the complete deterministic, offline default test suite once for the final
|
||||||
|
candidate, following the [testing policy](testing.md). For repositories that
|
||||||
|
publish builds, verify the required build targets. Select those targets for
|
||||||
|
the application's actual support commitments; native testing on each platform
|
||||||
|
and access to particular hardware are not default release prerequisites.
|
||||||
|
|
||||||
|
Additional gates must address a concrete risk that the existing checks do not
|
||||||
|
adequately cover. Do not automatically require linting, race testing, module
|
||||||
|
hygiene audits, documentation audits, credential scans, example validation, or
|
||||||
|
expanded platform matrices solely because they are possible. Retain such
|
||||||
|
checks when their distinct protection justifies their cost. A one-time migration
|
||||||
|
check must not silently become a permanent release requirement.
|
||||||
|
|
||||||
|
Release tests must not require real credentials, mutable application services,
|
||||||
|
paid APIs, provider probes, or inference calls. The procedure may describe dependency
|
||||||
|
preparation separately from offline validation.
|
||||||
|
|
||||||
|
Avoid duplicate validation across release phases. Successful checks for the
|
||||||
|
same final candidate need not be repeated solely to satisfy another phase;
|
||||||
|
any reuse must clearly apply to that exact candidate. Persistent validation
|
||||||
|
caches are not required. If the candidate changes, validate the new candidate.
|
||||||
|
Cheap publication-state checks may be repeated immediately before pushing
|
||||||
|
because local or remote state may have changed during validation.
|
||||||
|
|
||||||
|
Automate mechanical guards. Human review gates are strongly disfavored: add one
|
||||||
|
only through an explicit project-specific policy decision explaining the
|
||||||
|
concrete risk and why ordinary change review or automation is insufficient.
|
||||||
|
Do not add routine confirmations for checks the command can perform itself.
|
||||||
|
|
||||||
|
## Narratio Candidate Checks
|
||||||
|
|
||||||
|
Narratio selects one race-enabled offline suite, full `go vet`, Go formatting,
|
||||||
|
and local module-replacement checks through ReleaseKit. The selected builds
|
||||||
|
verify Linux amd64, Linux arm64, and best-effort macOS arm64 binaries and the
|
||||||
|
embedded version on a host executable. Versioned module replacements remain
|
||||||
|
allowed; filesystem replacements are not release inputs. Workspace and vendor
|
||||||
|
files are not prohibited solely by their presence.
|
||||||
|
|
||||||
|
## Publication Guards
|
||||||
|
|
||||||
|
Automate the checks needed to publish the intended source under a fresh version:
|
||||||
|
|
||||||
|
- the version has the adopted format and is unused locally and on the
|
||||||
|
authoritative remote;
|
||||||
|
- the worktree and index are clean on the primary release branch;
|
||||||
|
- the source being published is the exact candidate that passed validation,
|
||||||
|
including its matching release note;
|
||||||
|
- the remote primary branch already identifies that candidate, or an atomic
|
||||||
|
source/tag push will advance it to that candidate without discarding remote
|
||||||
|
history; and
|
||||||
|
- the tag identifies the validated candidate and only the intended refs are
|
||||||
|
published.
|
||||||
|
|
||||||
|
Fetch the authoritative branch and tag state as needed for these checks.
|
||||||
|
Do not force branch or tag updates to bypass a failed guard. Publish explicit
|
||||||
|
refs rather than all local tags. Do not require CI success, publication-service
|
||||||
|
availability checks, or a separate manual confirmation for each guard.
|
||||||
|
|
||||||
|
## Immutability And Failure Recovery
|
||||||
|
|
||||||
|
Published version tags and published contents are immutable. Do not move,
|
||||||
|
overwrite, recreate, or delete a published tag, or replace a published artifact,
|
||||||
|
checksum, signature, provenance statement, or release note under that version.
|
||||||
|
The checked-in note at the immutable tag is that release's historical record.
|
||||||
|
|
||||||
|
If validation fails before publication, correct and commit the candidate and
|
||||||
|
rerun the publication command. If a push fails or its outcome is ambiguous,
|
||||||
|
inspect the authoritative remote before retrying. Remove an unpublished local
|
||||||
|
tag only after confirming it was never published or used by a release channel.
|
||||||
|
An unavailable remote leaves publication status unknown; do not overwrite a tag
|
||||||
|
to resolve uncertainty.
|
||||||
|
|
||||||
|
Transient network, authentication, CI, or consumer-availability failures do not
|
||||||
|
by themselves require a new version. Asynchronous delivery may be retried from
|
||||||
|
the same immutable tag. Missing artifacts may be published later, provided
|
||||||
|
existing published contents are not replaced and the additions remain consistent
|
||||||
|
with the tagged source and any already-published checksum manifest. If that
|
||||||
|
cannot be achieved, publish a new version.
|
||||||
|
|
||||||
|
A defect requiring changes to published source or contents requires a corrected
|
||||||
|
commit, a new semantically appropriate version, a matching release note, and
|
||||||
|
the release procedure again. Leave the original release intact. A channel's
|
||||||
|
yank, deprecation, or advisory mechanism may warn consumers away from a defective
|
||||||
|
release without replacing its contents or reusing its version.
|
||||||
|
|
||||||
|
## Repository Release Procedure
|
||||||
|
|
||||||
|
Maintain `docs/release.md` as a short, executable maintainer runbook. It must
|
||||||
|
identify:
|
||||||
|
|
||||||
|
1. prerequisites, selected release toolchain, primary branch, and authoritative
|
||||||
|
remote;
|
||||||
|
2. version and release-note preparation;
|
||||||
|
3. one publication command with its selected local checks and automated guards;
|
||||||
|
4. declared deliverables, required build targets, and automation responsibilities;
|
||||||
|
5. the successful-push completion point and separately reported delivery status;
|
||||||
|
and
|
||||||
|
6. failure handling, ambiguous-push recovery, and asynchronous delivery retries.
|
||||||
|
|
||||||
|
Use copyable commands where practical. Keep optional diagnostics and consumer
|
||||||
|
verification clearly optional. The procedure must not turn preparation work,
|
||||||
|
ordinary change review, or post-publication investigation into additional
|
||||||
|
release gates.
|
||||||
264
docs/policy/testing.md
Normal file
264
docs/policy/testing.md
Normal file
@@ -0,0 +1,264 @@
|
|||||||
|
# Testing Policy
|
||||||
|
|
||||||
|
**Base Policy Version:** 1.3
|
||||||
|
|
||||||
|
**Last Updated**: 2026-11-17
|
||||||
|
|
||||||
|
**Upstream Source**: https://gitea.maximumdirect.net/eric/policy/src/commit/593c9b52273c5c879785ae9e995d21026df467b4/docs/policy/testing.md
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
|
||||||
|
Our tests exist to make **incorrect changes expensive and correct changes cheap**.
|
||||||
|
|
||||||
|
We optimize for sufficient confidence in important behavior while minimizing friction on future development.
|
||||||
|
|
||||||
|
## Every test has a cost
|
||||||
|
|
||||||
|
Every test has an immediate and continuing cost: writing, review, execution,
|
||||||
|
diagnosis, fixture maintenance, and updates when legitimate behavior changes.
|
||||||
|
Tests can also constrain refactoring, duplicate policy, and add failure noise.
|
||||||
|
|
||||||
|
A test is warranted only when the confidence it provides justifies these costs.
|
||||||
|
Evaluate that tradeoff at two levels:
|
||||||
|
|
||||||
|
1. **Per test:** What realistic defect does this test detect, how consequential would that defect be, and is that protection worth the test's lifetime cost?
|
||||||
|
2. **Across the suite:** Does this collection provide materially more confidence than a smaller, simpler suite would?
|
||||||
|
|
||||||
|
Some friction is intentional. Tests should make dangerous changes—such as breaking compatibility, corrupting data, violating security boundaries, or reintroducing subtle bugs—require deliberate review. Keep ordinary internal changes inexpensive.
|
||||||
|
|
||||||
|
Evaluate maintenance cost against the specific failure being protected. When omitting a plausible test, be able to state why the protected failure is low-risk, already covered, obvious, reversible, or cheaper to detect elsewhere. For consequential, subtle, or difficult-to-observe behavior, the presumption should favor testing.
|
||||||
|
|
||||||
|
## Default testing style
|
||||||
|
|
||||||
|
Use a **classical/Detroit-style** approach:
|
||||||
|
|
||||||
|
- Test observable behavior, resulting state, contracts, and invariants.
|
||||||
|
- Use real internal collaborators when they are fast and deterministic.
|
||||||
|
- Use fakes, stubs, or mocks primarily at expensive, nondeterministic, destructive, or external boundaries.
|
||||||
|
- Prefer package-level behavioral tests over tests coupled to private helpers or internal call sequences.
|
||||||
|
- Treat exact collaborator interactions as testable behavior only when the interaction itself is a requirement.
|
||||||
|
|
||||||
|
Examples of appropriate seams include clocks, randomness, subprocesses, remote APIs, object storage, email, and paid LLM calls.
|
||||||
|
|
||||||
|
## Test execution requirements
|
||||||
|
|
||||||
|
Tests in the default suite must be deterministic, offline, and independent of real credentials. They must not invoke paid APIs or depend on mutable external services. Tests that require live infrastructure must be explicitly opt-in and clearly separated from the default suite.
|
||||||
|
|
||||||
|
Control clocks, randomness, environment variables, and other process-global or machine-specific state when they affect behavior. Tests should be safe to run repeatedly and alongside other tests without depending on execution order or state left by an earlier test.
|
||||||
|
|
||||||
|
## What deserves tests
|
||||||
|
|
||||||
|
To the extent the following features are present in the application, prioritize tests for:
|
||||||
|
|
||||||
|
1. Public and package-level contracts.
|
||||||
|
2. Domain rules and important invariants.
|
||||||
|
3. Boundary conditions and malformed input.
|
||||||
|
4. Failure handling, cancellation, retries, recovery, and partial success.
|
||||||
|
5. Serialization, schemas, compatibility, and round trips.
|
||||||
|
6. Previously observed or plausible regressions.
|
||||||
|
7. Representative integration and end-to-end workflows.
|
||||||
|
|
||||||
|
A package-level contract comprises behavior relied upon by another package or major collaborator.
|
||||||
|
|
||||||
|
Choose tests for requested behavior and established contracts. Tests must not
|
||||||
|
introduce new restrictions, guarantees, or threat scenarios merely because they
|
||||||
|
could be asserted. Follow the [agent policy](agents.md) when deciding whether a
|
||||||
|
behavior belongs to the contract; current implementation behavior alone is not
|
||||||
|
sufficient authority.
|
||||||
|
|
||||||
|
For established behavior involving **data integrity, destructive operations,
|
||||||
|
compatibility, security, concurrency, idempotency, or recovery**, favor durable
|
||||||
|
tests for realistic failures whose consequences warrant protection. Identify
|
||||||
|
the failure and the existing contract it would violate. These categories call
|
||||||
|
for attention, not an automatic test inventory or permission to strengthen the
|
||||||
|
application's guarantees. Account for protection already provided at other layers.
|
||||||
|
|
||||||
|
Do not add tests merely because a function, branch, or line exists. Do not add a test when the same meaningful risk is already adequately protected elsewhere.
|
||||||
|
|
||||||
|
## Choose the right test boundary
|
||||||
|
|
||||||
|
Choose the narrowest stable boundary that expresses the behavior clearly and
|
||||||
|
provides durable confidence with minimal incidental coupling.
|
||||||
|
|
||||||
|
This is often the package API, but it may instead be:
|
||||||
|
|
||||||
|
- a smaller pure function when dense domain logic is most clearly isolated there;
|
||||||
|
- a package-level operation when several internal collaborators jointly produce the behavior; or
|
||||||
|
- a larger integration boundary when correctness emerges from interaction with a real dependency.
|
||||||
|
|
||||||
|
## Test behavior, not implementation
|
||||||
|
|
||||||
|
A test should protect a selected decision, contract, or invariant.
|
||||||
|
|
||||||
|
A test is suspect when it primarily detects changes to private constants or
|
||||||
|
helpers, equivalent operation ordering, incidental formatting, equivalent
|
||||||
|
algorithms, or internal structure that preserves behavior.
|
||||||
|
|
||||||
|
Behavioral tests should normally remain stable through internal refactoring that preserves the contract.
|
||||||
|
|
||||||
|
## Expected effects of different changes
|
||||||
|
|
||||||
|
Use the following expectations when evaluating test failures and test maintenance:
|
||||||
|
|
||||||
|
| Change | Expected effect on tests |
|
||||||
|
|---|---|
|
||||||
|
| Internal refactor that preserves behavior | Existing tests should normally remain unchanged and continue to pass. |
|
||||||
|
| Change to an internal default with no contractual significance | Behavioral tests should normally remain unchanged; tests should derive expectations from configuration or relationships rather than duplicate the old value. |
|
||||||
|
| Intentional change to public behavior, policy, schema, or compatibility guarantees | The relevant tests should be reviewed and changed deliberately. |
|
||||||
|
| Accidental violation of a contract or invariant | Tests should fail; fix the production code rather than rewriting the tests to accept the defect. |
|
||||||
|
|
||||||
|
A test failing is not the same as a test needing to be edited. Many tests may correctly fail because of one production defect. The maintenance smell is a correct internal change that requires unrelated expectation updates throughout the suite.
|
||||||
|
|
||||||
|
## Separate mechanism from policy
|
||||||
|
|
||||||
|
Derive expectations from test-controlled configuration and relationships.
|
||||||
|
|
||||||
|
For this example, assume the selected contract rejects a request to start more
|
||||||
|
processes than a configured limit. Do not encode its production default indirectly:
|
||||||
|
|
||||||
|
```go
|
||||||
|
// Production default:
|
||||||
|
const maxConcurrency = 4
|
||||||
|
|
||||||
|
// Brittle test:
|
||||||
|
err := startProcesses(5)
|
||||||
|
require.Error(t, err)
|
||||||
|
```
|
||||||
|
|
||||||
|
Instead, test the mechanism relationally:
|
||||||
|
|
||||||
|
```go
|
||||||
|
const limit = 2
|
||||||
|
runner := NewRunner(limit)
|
||||||
|
|
||||||
|
require.NoError(t, runner.Start(limit))
|
||||||
|
require.ErrorIs(t, runner.Start(limit+1), ErrTooMuchConcurrency)
|
||||||
|
```
|
||||||
|
|
||||||
|
For this selected contract, the test should prove:
|
||||||
|
|
||||||
|
- the configured limit is accepted; and
|
||||||
|
- one beyond the configured limit is rejected.
|
||||||
|
|
||||||
|
Rejection is not a general requirement for concurrency control. If the selected
|
||||||
|
contract queues excess work or limits active workers while accepting larger
|
||||||
|
batches, test that behavior instead. Do not add rejection or a configurable
|
||||||
|
limit solely to reproduce this example.
|
||||||
|
|
||||||
|
The production default should be tested exactly only when its literal value is itself a public, operational, safety, protocol, or compatibility requirement.
|
||||||
|
|
||||||
|
Apply the same rule to limits, timeouts, capacities, retry counts, and ranges: test relationships and behavior.
|
||||||
|
|
||||||
|
For established concurrency limits, distinguish these behaviors where the contract requires them:
|
||||||
|
|
||||||
|
1. **Configuration handling:** values are accepted or rejected according to the selected contract.
|
||||||
|
2. **Runtime enforcement:** observed peak concurrency never exceeds the configured limit.
|
||||||
|
|
||||||
|
Use a test-controlled limit and measure the behavior relative to that limit.
|
||||||
|
|
||||||
|
## Assign each behavior a test owner
|
||||||
|
|
||||||
|
Where these layers exist, assign ownership as follows:
|
||||||
|
|
||||||
|
- Parser tests own parsing cases.
|
||||||
|
- Validator tests own validation rules.
|
||||||
|
- Domain tests own transformations and invariants.
|
||||||
|
- Adapter tests own external integration behavior.
|
||||||
|
- Orchestrator tests own coordination and failure propagation.
|
||||||
|
- CLI tests own argument and configuration mapping.
|
||||||
|
- End-to-end tests prove that representative assembled workflows work.
|
||||||
|
|
||||||
|
Give each layer its distinct responsibility and keep expectation updates localized to the contract being changed.
|
||||||
|
|
||||||
|
## Use test doubles deliberately
|
||||||
|
|
||||||
|
Choose the least elaborate test double that provides the required control or observation.
|
||||||
|
|
||||||
|
As a default:
|
||||||
|
|
||||||
|
1. Prefer real collaborators when they are fast and deterministic.
|
||||||
|
2. Use small in-memory fakes when realistic stateful behavior is helpful.
|
||||||
|
3. Use stubs when a dependency only needs to provide controlled responses.
|
||||||
|
4. Use mocks when the interaction itself is contractual.
|
||||||
|
|
||||||
|
Mocks are appropriate when the contract includes facts such as:
|
||||||
|
|
||||||
|
- a notification is sent exactly once;
|
||||||
|
- a transaction is committed only after successful writes;
|
||||||
|
- cancellation reaches a subprocess;
|
||||||
|
- an expensive API is called no more than once; or
|
||||||
|
- a security audit event is emitted.
|
||||||
|
|
||||||
|
## Go-specific guidance
|
||||||
|
|
||||||
|
Select techniques by behavior and risk:
|
||||||
|
|
||||||
|
- table-driven tests for meaningful behavioral categories and boundaries;
|
||||||
|
- `t.TempDir()` for real filesystem behavior;
|
||||||
|
- `httptest.Server` for realistic HTTP interactions;
|
||||||
|
- fuzz tests when exploring broad input spaces, such as parsers or path handling, adds useful protection beyond representative cases;
|
||||||
|
- golden files only when the complete output is intentionally stable;
|
||||||
|
- integration tests where correctness depends on component interaction; and
|
||||||
|
- a small number of representative end-to-end tests when assembled workflows expose meaningful risks not adequately covered at narrower boundaries.
|
||||||
|
|
||||||
|
Prefer `errors.Is`, `errors.As`, typed errors, or structured error fields. Use exact error-wording assertions only when the wording is contractual.
|
||||||
|
|
||||||
|
At CLI boundaries, prefer exit classifications, structured output, and the smallest stable semantic fragment needed to identify the error. Use complete diagnostic snapshots only when the wording is contractual.
|
||||||
|
|
||||||
|
Golden-file updates must require an explicit local flag. CI must not update golden files automatically, and reviewers must inspect the semantic diff before accepting an update.
|
||||||
|
|
||||||
|
Keep tests readable and direct. Size test helpers and fixture frameworks to the maintenance benefit they provide.
|
||||||
|
|
||||||
|
## Coverage
|
||||||
|
|
||||||
|
Use coverage to locate untested critical branches and unexpectedly weak packages. Evaluate test quality through meaningful behavioral protection and choose coverage according to risk.
|
||||||
|
|
||||||
|
Pure domain logic will often warrant higher coverage than CLI wiring or external adapters. Uneven coverage is acceptable when it reflects risk.
|
||||||
|
|
||||||
|
## Regression tests
|
||||||
|
|
||||||
|
A bug fix should normally include a regression test that fails before the fix and passes afterward.
|
||||||
|
|
||||||
|
Retain the test when the defect could realistically recur and its consequences justify the ongoing cost. Prefer the narrowest durable test of the violated contract or invariant.
|
||||||
|
|
||||||
|
Remove or consolidate a test when the underlying design has made recurrence impossible, its protection is redundant, or a stronger invariant test subsumes it.
|
||||||
|
|
||||||
|
## Deleting or rewriting tests
|
||||||
|
|
||||||
|
Delete or rewrite tests when maintenance cost exceeds their continuing
|
||||||
|
protective value.
|
||||||
|
|
||||||
|
Strong candidates include tests that:
|
||||||
|
|
||||||
|
- require updates after harmless internal changes;
|
||||||
|
- assert incidental private constants or snapshot large amounts of incidental output;
|
||||||
|
- verify mock choreography rather than outcomes;
|
||||||
|
- duplicate policy across layers, retest trivial helpers covered by package
|
||||||
|
behavior, or protect risks covered more effectively elsewhere;
|
||||||
|
- are flaky, misleading, obsolete, or disproportionately expensive to diagnose; or
|
||||||
|
- no longer correspond to a plausible failure mode.
|
||||||
|
|
||||||
|
Several brittle tests may encode one genuine requirement. Consolidate them into one durable behavior-level or invariant test.
|
||||||
|
|
||||||
|
## Reviewing a proposed test
|
||||||
|
|
||||||
|
Use the following questions when a proposed test needs closer evaluation. Significant test additions should be reviewable against them; written answers are optional for routine tests.
|
||||||
|
|
||||||
|
1. Which requested behavior or established contract does it protect, and what realistic defect would violate it?
|
||||||
|
2. How likely and consequential is that defect, and is it already protected elsewhere?
|
||||||
|
3. What is the narrowest stable boundary that can test it clearly?
|
||||||
|
4. Would a correct internal refactor or a change to an incidental default require test edits?
|
||||||
|
5. Does its confidence justify its maintenance, execution, and diagnostic cost, or would a smaller test suffice?
|
||||||
|
|
||||||
|
## Definition of sufficient
|
||||||
|
|
||||||
|
A test suite is sufficient when:
|
||||||
|
|
||||||
|
- important requested behavior and established contracts are protected against realistic, consequential failures;
|
||||||
|
- boundaries and component interactions have coverage where they introduce meaningful risks not protected elsewhere;
|
||||||
|
- failures provide useful, distinct signals;
|
||||||
|
- tests usually remain stable through legitimate internal changes; and
|
||||||
|
- additional tests would mostly repeat existing protection or preserve inconsequential implementation details.
|
||||||
|
|
||||||
|
Reassess sufficiency as the application, its users, and the consequences of
|
||||||
|
failure evolve.
|
||||||
97
docs/release.md
Normal file
97
docs/release.md
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
# Releasing Narratio
|
||||||
|
|
||||||
|
This is the maintainer runbook for the [release policy](policy/release.md).
|
||||||
|
The authoritative source destination is `origin` at
|
||||||
|
`ssh://git@forge.maximumdirect.net:22222/eric/narratio.git`; use `main`.
|
||||||
|
The hosted destination is [Narratio on Gitea](https://forge.maximumdirect.net/eric/narratio).
|
||||||
|
Install Git, a POSIX shell, and the native compiler and tools needed for Go race
|
||||||
|
builds. Git access must permit fetching and pushing tags.
|
||||||
|
|
||||||
|
## Release toolchain
|
||||||
|
|
||||||
|
Use the official Go 1.27.4 toolchain for validation and builds. The consumer
|
||||||
|
minimum remains Go 1.27.0. Prepare the selected toolchain, application modules,
|
||||||
|
and the module-selected ReleaseKit tool before offline validation:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
export GOTOOLCHAIN=go1.27.4
|
||||||
|
go version
|
||||||
|
go mod download
|
||||||
|
./releasekit version
|
||||||
|
```
|
||||||
|
|
||||||
|
The launcher runs the ReleaseKit version selected in `go.mod`. The CI image
|
||||||
|
uses the same Go patch. See [upstream adoption guidance](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/adoption.md).
|
||||||
|
|
||||||
|
## Prepare and publish
|
||||||
|
|
||||||
|
Choose an unused stable version under the [versioning and compatibility
|
||||||
|
rules](policy/release.md#versioning-and-compatibility). Update affected current
|
||||||
|
documentation and prepare `docs/releases/vMAJOR.MINOR.PATCH.md` with a title
|
||||||
|
containing Narratio and the version, a summary, and any compatibility impact
|
||||||
|
or upgrade instructions. End the note with this footer, replacing the version
|
||||||
|
in each URL with the intended tag:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
[COPYRIGHT](https://forge.maximumdirect.net/eric/narratio/src/tag/vMAJOR.MINOR.PATCH/COPYRIGHT) | [LICENSE](https://forge.maximumdirect.net/eric/narratio/src/tag/vMAJOR.MINOR.PATCH/LICENSE) | [ATTRIBUTION](https://forge.maximumdirect.net/eric/narratio/src/tag/vMAJOR.MINOR.PATCH/docs/oss/attribution.md)
|
||||||
|
```
|
||||||
|
|
||||||
|
For the next release note, describe the cleanup retention change: when automatic
|
||||||
|
cleanup is enabled and authorized, it removes the selected session's entire run
|
||||||
|
history, including failed-attempt diagnostics and original Notarius bundles.
|
||||||
|
Operators can retain that material by setting `workspace.cleanup_after_publish`
|
||||||
|
to `false`.
|
||||||
|
|
||||||
|
Also document the replacement of `session validate` with `preflight SESSION`,
|
||||||
|
which prepares or reuses inputs before checking readiness. See the
|
||||||
|
[preflight command](cli.md#preflight).
|
||||||
|
|
||||||
|
Retire completed roadmaps as appropriate, preserve pending work, and review the
|
||||||
|
candidate through the ordinary development workflow. Commit the candidate and
|
||||||
|
push it to `origin/main`, then publish from the clean `main` checkout:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git add <candidate-files>
|
||||||
|
git commit -m "Prepare Narratio release"
|
||||||
|
git push origin main
|
||||||
|
./releasekit publish vMAJOR.MINOR.PATCH
|
||||||
|
```
|
||||||
|
|
||||||
|
ReleaseKit validates the committed candidate with the selected race-enabled
|
||||||
|
suite, full vet, Go formatting and local-replacement checks, and builds the
|
||||||
|
three selected binaries with an injected-version smoke check. It creates an
|
||||||
|
annotated tag and pushes it. Confirmed source-tag publication completes the
|
||||||
|
release; CI and hosted delivery are separate observations. For optional
|
||||||
|
diagnosis, use `./releasekit check vMAJOR.MINOR.PATCH`; publication runs its
|
||||||
|
own validation, so this is not a prerequisite. See the upstream
|
||||||
|
[check](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/check.md)
|
||||||
|
and [publish](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/publish.md)
|
||||||
|
guides for native behavior and diagnostics.
|
||||||
|
|
||||||
|
## Delivery and recovery
|
||||||
|
|
||||||
|
Tag-triggered Woodpecker CI uses the tagged module's ReleaseKit selection to
|
||||||
|
build and deliver the checked-in note and these assets asynchronously:
|
||||||
|
|
||||||
|
- `narratio-vMAJOR.MINOR.PATCH-linux-amd64`
|
||||||
|
- `narratio-vMAJOR.MINOR.PATCH-linux-arm64`
|
||||||
|
- `narratio-vMAJOR.MINOR.PATCH-darwin-arm64` (best effort)
|
||||||
|
- `SHA256SUMS`
|
||||||
|
|
||||||
|
A cross-build establishes compilation, not native macOS runtime coverage.
|
||||||
|
CI maps its existing `GITEA_RELEASE_TOKEN` secret to
|
||||||
|
`RELEASEKIT_GITEA_TOKEN`. Delivery does not determine source-release completion.
|
||||||
|
|
||||||
|
Local delivery uses the ignored `.releasekit/gitea-token` file when the configured
|
||||||
|
environment token is absent. Keep the token file owner-readable only; see the
|
||||||
|
[upstream credential configuration](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/config.md)
|
||||||
|
for credential selection.
|
||||||
|
|
||||||
|
If publication is uncertain, use the recovery entry point printed by ReleaseKit
|
||||||
|
and its saved private publication record to reconcile the outcome before
|
||||||
|
retrying. Follow the [publication recovery guide](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/publish.md#retain-and-reconcile-publication-evidence).
|
||||||
|
For failed or partial delivery, retry from the same immutable tag using the
|
||||||
|
[delivery guide](https://forge.maximumdirect.net/base-layer/releasekit/src/tag/v0.10.0/docs/consumers/delivery.md).
|
||||||
|
Investigate conflicts or uncertain outcomes according to that guide; do not
|
||||||
|
replace published content. For older tags, use the tooling and workflow selected
|
||||||
|
by those tags.
|
||||||
25
docs/releases/README.md
Normal file
25
docs/releases/README.md
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# Release Notes
|
||||||
|
|
||||||
|
This directory contains immutable historical release notes for Narratio.
|
||||||
|
Future notes use the matching stable version and begin with
|
||||||
|
`# Narratio vMAJOR.MINOR.PATCH`. Include a short summary and relevant
|
||||||
|
compatibility or upgrade guidance; choose sections suited to the release.
|
||||||
|
End each new note with the three immutable-tag notice links specified in the
|
||||||
|
[release procedure](../release.md).
|
||||||
|
|
||||||
|
See the [release procedure](../release.md) for creating a candidate and tag.
|
||||||
|
When asynchronous publication succeeds, the corresponding Gitea release is the
|
||||||
|
canonical source for downloadable binaries and checksums.
|
||||||
|
|
||||||
|
- [v4.0.0](v4.0.0.md)
|
||||||
|
- [v3.1.0](v3.1.0.md)
|
||||||
|
- [v3.0.0](v3.0.0.md)
|
||||||
|
- [v2.2.1](v2.2.1.md)
|
||||||
|
- [v2.2.0](v2.2.0.md)
|
||||||
|
- [v2.1.2](v2.1.2.md)
|
||||||
|
- [v2.1.1](v2.1.1.md)
|
||||||
|
- [v2.1.0](v2.1.0.md)
|
||||||
|
- [v2.0.0](v2.0.0.md)
|
||||||
|
- [v1.7.0](v1.7.0.md)
|
||||||
|
- [v1.6.0](v1.6.0.md)
|
||||||
|
- [v1.5.0](v1.5.0.md)
|
||||||
47
docs/releases/v1.5.0.md
Normal file
47
docs/releases/v1.5.0.md
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
# Narratio v1.5.0
|
||||||
|
|
||||||
|
Narratio v1.5.0 makes repeated post-transcript artifact development faster and
|
||||||
|
more explicit while retaining the fixed, stage-driven pipeline model.
|
||||||
|
|
||||||
|
## Highlights
|
||||||
|
|
||||||
|
- The canonical pipeline now completes deterministic rendering before
|
||||||
|
extraction, cleanly separating transcript-generating stages from
|
||||||
|
artifact-generating stages.
|
||||||
|
- `narratio run` and `narratio session plan` accept inclusive `--from` and
|
||||||
|
`--through` bounds. Excluded transcript stages are not executed or
|
||||||
|
invalidated by a bounded artifact-regeneration run.
|
||||||
|
- `narratio regenerate-artifacts SESSION` is an exact convenience alias for a
|
||||||
|
forced run from `extract` through `analyze`, including focused
|
||||||
|
`--artifacts` selections.
|
||||||
|
- Configured Scriptorium artifacts now have independent,
|
||||||
|
manifest-authoritative freshness. Narratio reuses validated current work,
|
||||||
|
rebuilds stale prerequisites in dependency order, and persists successful,
|
||||||
|
failed, and newly stale artifact state when an analysis invocation only
|
||||||
|
partially succeeds.
|
||||||
|
- Publish consumes only configured artifacts backed by current manifest
|
||||||
|
evidence; incidental or tampered files are not promoted as current output.
|
||||||
|
|
||||||
|
## Reliability And Administration
|
||||||
|
|
||||||
|
- Bounded prerequisites are checked again under the session lock before any
|
||||||
|
run mutation, closing a concurrent-run race.
|
||||||
|
- Analysis fingerprints are stable across executable and configuration path
|
||||||
|
changes and continue to cover only Narratio-observable semantic inputs.
|
||||||
|
- Runner composition now carries one validated execution plan from command
|
||||||
|
parsing through prerequisite validation, adapter composition, manifest
|
||||||
|
recording, and stage execution.
|
||||||
|
- `narratio version` reports the exact tag embedded in official release
|
||||||
|
binaries; ordinary source builds report `dev`.
|
||||||
|
|
||||||
|
## Upgrade Notes
|
||||||
|
|
||||||
|
- Existing unbounded commands and direct `run-stage`, `analyze`, and `publish`
|
||||||
|
workflows retain their meanings.
|
||||||
|
- Manifests written before artifact-level analysis state remain readable.
|
||||||
|
Legacy aggregate analysis success is not sufficient freshness evidence, so
|
||||||
|
the first analysis evaluation after upgrading may regenerate configured
|
||||||
|
artifacts once.
|
||||||
|
- Narratio cannot observe executable contents or configuration, prompt,
|
||||||
|
profile, module, and other files loaded privately by Scriptorium. Explicitly
|
||||||
|
force affected artifacts after changing those private inputs.
|
||||||
74
docs/releases/v1.6.0.md
Normal file
74
docs/releases/v1.6.0.md
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
# Narratio v1.6.0
|
||||||
|
|
||||||
|
Narratio v1.6.0 makes large pipeline configurations easier to organize,
|
||||||
|
inspect, and vary while adding character-oriented artifact generation and a
|
||||||
|
guarded, reproducible release procedure.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Pipeline configuration can now be assembled from explicit additive imports and
|
||||||
|
a selected production or testing profile. Campaigns can own a canonical,
|
||||||
|
versioned party roster, and Scriptorium artifact families can expand one
|
||||||
|
definition into concrete per-character artifacts, dependencies, variables, and
|
||||||
|
publish rules.
|
||||||
|
|
||||||
|
New read-only configuration commands expose the fully resolved pipeline,
|
||||||
|
source provenance, semantic digest, and profile differences before a session is
|
||||||
|
run. Stage reuse now records configuration-sensitive semantic evidence so
|
||||||
|
profile or configuration changes cannot silently reuse incompatible work.
|
||||||
|
|
||||||
|
## Compatibility
|
||||||
|
|
||||||
|
This is a backward-compatible feature release. Existing monolithic pipeline
|
||||||
|
files, concrete Scriptorium artifacts, publish rules, and configurations
|
||||||
|
without profiles remain supported. When profiles are declared and no explicit
|
||||||
|
profile is selected, Narratio uses the configured production default.
|
||||||
|
|
||||||
|
An unversioned party file plus a separate players file remains available as an
|
||||||
|
isolated legacy compatibility path, but it cannot drive artifact families. New
|
||||||
|
campaigns and new party-oriented features should use the `narratio.party.v1`
|
||||||
|
schema. Existing manifests remain readable; missing legacy semantic evidence
|
||||||
|
is treated as stale rather than trusted.
|
||||||
|
|
||||||
|
Narratio continues to consume the documented Notarius D&D pipeline contract.
|
||||||
|
The release workflow still cross-compiles Linux, macOS, and Windows binaries
|
||||||
|
for `amd64` and `arm64`; cross-compilation is not native runtime evidence for
|
||||||
|
macOS or Windows.
|
||||||
|
|
||||||
|
## Upgrade
|
||||||
|
|
||||||
|
No special action is required for existing monolithic configurations that do
|
||||||
|
not adopt profiles or artifact families. On the first run after upgrading,
|
||||||
|
stages recorded by older manifests may regenerate once because those records do
|
||||||
|
not contain the new semantic configuration evidence.
|
||||||
|
|
||||||
|
To adopt the new configuration model, use the maintained
|
||||||
|
`examples/production-testing` bundle as a migration reference: split stable
|
||||||
|
settings into explicit imports, define a production default and optional
|
||||||
|
testing profile, convert campaign party data to `narratio.party.v1`, remove the
|
||||||
|
separate players file, and then introduce character artifact families. Review
|
||||||
|
the result with `narratio config validate`, `config show`, `config sources`, and
|
||||||
|
`config diff` before running a session.
|
||||||
|
|
||||||
|
Campaign, session, previous-session, and run identifiers must satisfy the
|
||||||
|
documented portable identity grammar. Existing manifests or remote state with
|
||||||
|
unsafe legacy identifiers must be migrated before use.
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Added root-owned, non-recursive additive pipeline imports with strict,
|
||||||
|
source-aware conflict detection.
|
||||||
|
- Added named pipeline profiles with an explicit production default and
|
||||||
|
deliberate command-line selection.
|
||||||
|
- Added `config validate`, `config show`, `config sources`, and `config diff`
|
||||||
|
for read-only inspection of resolved configuration and provenance.
|
||||||
|
- Added the strict `narratio.party.v1` campaign roster, including stable
|
||||||
|
character IDs, player and character names, optional aliases, and classes.
|
||||||
|
- Added deterministic players derivation and canonical party delivery to
|
||||||
|
downstream integrations.
|
||||||
|
- Added character-oriented artifact families, corresponding member
|
||||||
|
dependencies, family selection, and generated publish policies.
|
||||||
|
- Added semantic configuration fingerprints and stage-specific resume checks
|
||||||
|
across transcript and artifact stages.
|
||||||
|
- Added shared release candidate, asset build, and guarded tag-publication
|
||||||
|
scripts, with tag-triggered publication remaining asynchronous.
|
||||||
100
docs/releases/v1.7.0.md
Normal file
100
docs/releases/v1.7.0.md
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
# Narratio v1.7.0
|
||||||
|
|
||||||
|
Narratio v1.7.0 completes the maintainability refactor begun after v1.6.0. It
|
||||||
|
simplifies filesystem and process handling, makes resumable work more precise,
|
||||||
|
replaces legacy local and remote state with explicit authorities, and turns
|
||||||
|
cleanup into the final ordinary pipeline stage.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
The session manifest is now the sole durable local progress ledger. Analyze
|
||||||
|
checkpoints successful artifacts individually, allowing an interrupted or
|
||||||
|
partially failed analysis to resume at the first incomplete artifact without
|
||||||
|
rerunning successful siblings unless forced.
|
||||||
|
|
||||||
|
Remote publication now commits immutable run state before advancing one
|
||||||
|
verified current pointer. Publish locks are independent per-source objects;
|
||||||
|
locked outputs retain their previously committed declarations rather than
|
||||||
|
being overwritten or silently omitted. Local cleanup runs after notification
|
||||||
|
as a separately recorded, safely retryable stage.
|
||||||
|
|
||||||
|
The release also adopts Go 1.26, simplifies ordinary file operations around
|
||||||
|
Narratio's trusted group-owned workspace model, improves subprocess lifecycle
|
||||||
|
handling, decomposes several large orchestration and validation components,
|
||||||
|
and removes mutable global test seams.
|
||||||
|
|
||||||
|
## Compatibility
|
||||||
|
|
||||||
|
This is a minor release with deliberate removal of compatibility paths that
|
||||||
|
were deprecated and documented as subject to removal:
|
||||||
|
|
||||||
|
- Campaigns must use one versioned `narratio.party.v1` `party.yml`. Separate
|
||||||
|
players files, session-level party overrides, and unversioned party documents
|
||||||
|
are rejected.
|
||||||
|
- Session manifests must declare `schema_version:
|
||||||
|
narratio.session-manifest.v1` and satisfy the current strict schema. Older
|
||||||
|
unversioned state and manifests containing the retired
|
||||||
|
`post_publish_cleanup` obligation are rejected rather than migrated.
|
||||||
|
- Remote current state must be selected by
|
||||||
|
`current/commit-pointer.json` and its referenced immutable run commit. Legacy
|
||||||
|
current-state layouts are no longer inferred.
|
||||||
|
- The retired aggregate `locks.yml` object is ignored. Publish locks now live
|
||||||
|
as independent strict objects under the session lock prefix.
|
||||||
|
- Run manifests are no longer produced or consumed. The session manifest owns
|
||||||
|
durable stage progress; invocation summaries and run workspaces remain
|
||||||
|
operational data rather than a second progress authority.
|
||||||
|
|
||||||
|
The CLI and current pipeline/configuration formats otherwise remain compatible.
|
||||||
|
Building and maintaining Narratio now requires Go 1.26. Cross-built Linux,
|
||||||
|
macOS, and Windows assets remain available for `amd64` and `arm64`.
|
||||||
|
|
||||||
|
## Upgrade
|
||||||
|
|
||||||
|
Before upgrading a campaign that still uses compatibility data:
|
||||||
|
|
||||||
|
1. Replace legacy party/player inputs with the documented
|
||||||
|
[`narratio.party.v1`](../integrations/party.md) campaign roster.
|
||||||
|
2. If a local manifest contains an outstanding `post_publish_cleanup`
|
||||||
|
obligation, complete it with the pre-upgrade binary. Otherwise verify the
|
||||||
|
remote commit, move aside or regenerate the incompatible manifest, or
|
||||||
|
restore a verified committed snapshot. Do not migrate state by manually
|
||||||
|
editing JSON.
|
||||||
|
3. Republish sessions that do not yet have a valid immutable run commit and
|
||||||
|
`current/commit-pointer.json`; legacy remote layouts are not current state in
|
||||||
|
v1.7.0.
|
||||||
|
4. Recreate any required publication locks with `narratio session locks add`.
|
||||||
|
After verifying the new locks and publication behavior, the ignored legacy
|
||||||
|
`locks.yml` object may be removed manually.
|
||||||
|
|
||||||
|
Existing compatible session manifests and already committed remote snapshots
|
||||||
|
need no special action. Consult [Operations](../operations.md) and
|
||||||
|
[Troubleshooting](../troubleshooting.md) for recovery procedures.
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Upgraded the maintained development and release baseline to Go 1.26.
|
||||||
|
- Reworked subprocess execution and Windows process-tree supervision while
|
||||||
|
preserving contextual wait and cleanup failures.
|
||||||
|
- Replaced custom confined ordinary I/O and directory-promotion machinery with
|
||||||
|
simpler standard-library operations while retaining bounded reads, atomic
|
||||||
|
single-file visibility, workspace modes, validated downloads, and
|
||||||
|
root-confined destructive operations.
|
||||||
|
- Removed legacy party, manifest, artifact-discovery, remote-current, and lock
|
||||||
|
compatibility paths.
|
||||||
|
- Consolidated durable progress in the session manifest and removed the run
|
||||||
|
manifest domain model.
|
||||||
|
- Unified runner planning and execution decisions, separated invocation
|
||||||
|
lifecycle responsibilities, and avoided creating empty run workspaces for
|
||||||
|
fully reused or cleanup-only invocations.
|
||||||
|
- Added per-artifact analyze execution, checkpointing, reconciliation, and
|
||||||
|
recovery.
|
||||||
|
- Decomposed configuration validation by domain and made validation diagnostics
|
||||||
|
deterministic without treating incidental ordering or wording as a contract.
|
||||||
|
- Introduced immutable remote publish commits, one final current pointer,
|
||||||
|
explicit output planning, safe cross-run carried outputs, and independent
|
||||||
|
per-artifact remote locks.
|
||||||
|
- Added `cleanup` as the final canonical stage after `notify`, with validated
|
||||||
|
publish evidence, safe retry, explicit selection, and no separate cleanup
|
||||||
|
obligation.
|
||||||
|
- Replaced mutable command test hooks with invocation-scoped dependencies and
|
||||||
|
improved structural test diagnostics.
|
||||||
94
docs/releases/v2.0.0.md
Normal file
94
docs/releases/v2.0.0.md
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
# Narratio v2.0.0
|
||||||
|
|
||||||
|
Narratio v2.0.0 replaces its configuration infrastructure with ConfigKit,
|
||||||
|
simplifies the supported release platforms, and makes artifact definitions and
|
||||||
|
their effective dependency graph directly inspectable.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Pipeline roots now use ConfigKit v0.1.2 for strict YAML loading, explicit
|
||||||
|
imports, fixed-path named profiles, provenance, defaults, and typed credential
|
||||||
|
references. The recommended production layout keeps production values in the
|
||||||
|
base, defines each ordinary artifact and artifact family in its own imported
|
||||||
|
file, and keeps testing changes in `profiles/testing.yml`.
|
||||||
|
|
||||||
|
Configured-artifact inputs now create their dependency edges automatically.
|
||||||
|
`narratio config artifacts` reports the finalized concrete catalog, including
|
||||||
|
generated party-family members, without loading a session or initializing
|
||||||
|
runtime adapters.
|
||||||
|
|
||||||
|
## Compatibility
|
||||||
|
|
||||||
|
This is a breaking configuration and platform release. There is no runtime
|
||||||
|
fallback for the retired Narratio composition/profile catalog, `pipeline.secrets`
|
||||||
|
or `secrets.env_dir`, credential `_env` fields, or the previous YAML
|
||||||
|
presence/default behavior. Defaults apply only to absent values; explicit empty,
|
||||||
|
zero, false, and null values retain their typed meaning and may fail Narratio
|
||||||
|
domain validation.
|
||||||
|
|
||||||
|
The maintained binaries are Linux amd64, Linux arm64, and macOS arm64. Windows
|
||||||
|
and macOS amd64 builds are no longer produced or supported. Existing v1 release
|
||||||
|
notes remain historical descriptions of their releases.
|
||||||
|
|
||||||
|
Inspection commands still avoid session, manifest, workspace, adapter, and
|
||||||
|
remote-service activity, but they are not credential-free loaders: every
|
||||||
|
explicit typed credential reference in the selected effective configuration must
|
||||||
|
resolve; references replaced or removed by that profile need not resolve.
|
||||||
|
Pipelines containing artifact families also require a campaign so the canonical
|
||||||
|
party can be expanded.
|
||||||
|
`config show` is a secret-safe review projection, not a promised reloadable
|
||||||
|
authoring file.
|
||||||
|
|
||||||
|
## Upgrade
|
||||||
|
|
||||||
|
Migrate each operational bundle before running v2:
|
||||||
|
|
||||||
|
1. Replace old composition syntax with root-owned
|
||||||
|
[`configkit.imports`](../config.md#pipeline-imports-and-profiles). Imports are
|
||||||
|
additive base sources; they do not override one another.
|
||||||
|
2. Fold the old production overlay into the base pipeline. Move testing changes
|
||||||
|
to `profiles/testing.yml`; compare the two independent resolutions with
|
||||||
|
`narratio config diff default testing`.
|
||||||
|
3. Follow the maintained
|
||||||
|
[`examples/production-testing`](../../examples/production-testing/pipeline.yml)
|
||||||
|
layout: one explicit artifact entry per `artifacts/<key>.yml` and one family
|
||||||
|
entry per `artifact-families/<key>.yml`. The map key, not the filename, is the
|
||||||
|
stable artifact identity.
|
||||||
|
4. Move credential files to an untracked `secrets/` directory beside
|
||||||
|
`pipeline.yml`, or pass `--secrets-dir`. Rename S3 fields to `access_key_id`
|
||||||
|
and `secret_access_key`, and rename the Audita field to `llm_api_key`.
|
||||||
|
5. For static S3 credentials, configure both S3 references (commonly
|
||||||
|
`OBJECT_STORAGE_KEY_ID` and `OBJECT_STORAGE_KEY`) and make them resolvable.
|
||||||
|
To use instance roles, workload identity, shared SDK files, or another AWS SDK
|
||||||
|
discovery provider, omit both references. A partial pair is invalid.
|
||||||
|
6. Remove a `depends_on` entry when it only duplicates a
|
||||||
|
`narratio.artifact.<key>` input. Keep explicit entries that express ordering
|
||||||
|
without supplying the upstream output as an input.
|
||||||
|
7. Review ConfigKit's stricter explicit-value/null semantics and correct values
|
||||||
|
that previously acquired defaults after being explicitly empty. Do not use
|
||||||
|
`config show` output as a source migration mechanism.
|
||||||
|
8. Run `config validate`, `config show`, `config sources`, and `config artifacts`
|
||||||
|
with the same profile, campaign, and secrets selection intended for runtime.
|
||||||
|
Resolve the campaign-owned party whenever families are present.
|
||||||
|
9. Update deployment and download automation to one of the three maintained
|
||||||
|
platform assets before removing the v1 binary.
|
||||||
|
|
||||||
|
The [configuration reference](../config.md), [CLI reference](../cli.md), and
|
||||||
|
[maintained examples](../../examples/README.md) are the canonical detailed
|
||||||
|
guides.
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Adopted ConfigKit v0.1.2 across pipeline, campaign, session, and party loading
|
||||||
|
while keeping Narratio domain validation and post-campaign expansion explicit.
|
||||||
|
- Added ConfigKit imports and fixed `profiles/<name>.yml` pipeline overlays,
|
||||||
|
unified safe effective show/diff/digest projection, and source provenance.
|
||||||
|
- Added invocation-scoped ConfigKit secrets-directory bootstrap and typed S3 and
|
||||||
|
Audita credential references without exposing resolved values.
|
||||||
|
- Inferred, normalized, and validated configured-artifact input dependencies as
|
||||||
|
part of the one concrete graph consumed by analyze planning and resume logic.
|
||||||
|
- Added `config artifacts` with stable concrete identities, definition sources,
|
||||||
|
effective dependencies, and generated family/party provenance.
|
||||||
|
- Added the maintained production-base/testing-overlay artifact authoring layout.
|
||||||
|
- Reduced release assets and active platform support to Linux amd64/arm64 and
|
||||||
|
macOS arm64.
|
||||||
70
docs/releases/v2.1.0.md
Normal file
70
docs/releases/v2.1.0.md
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
# Narratio v2.1.0
|
||||||
|
|
||||||
|
This release adds explicit Notarius credential forwarding and cache reuse,
|
||||||
|
with predictable forced regeneration and clearer artifact-development guidance.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Narratio can pass one typed API-key reference to Notarius and opt into reuse of
|
||||||
|
its accepted execution checkpoints. Stable, verified reference snapshots allow
|
||||||
|
unchanged references to retain their cache identity across Narratio invocations.
|
||||||
|
Configuration loading now uses ConfigKit v0.3.0.
|
||||||
|
|
||||||
|
## Compatibility
|
||||||
|
|
||||||
|
The new `notarius.llm_api_key`, `notarius.resume`, and `notarius.chunk_cache`
|
||||||
|
fields are optional. Existing v2 configuration needs no schema migration.
|
||||||
|
Configured credential references must resolve during configuration loading,
|
||||||
|
even when extraction will not execute; omitted references add no requirement.
|
||||||
|
|
||||||
|
Forced extraction now omits Notarius checkpoint loading and requests chunk-plan
|
||||||
|
refresh. This includes `regenerate-artifacts`, which remains an alias for a
|
||||||
|
forced run from extract through analyze. `analyze` continues to force analysis
|
||||||
|
only, preserving extraction results and transcripts.
|
||||||
|
|
||||||
|
Notarius v0.7.0 is the tested cache integration baseline, not an unconditional
|
||||||
|
minimum-version gate. The executable must support the flags selected for the
|
||||||
|
invocation, including `--chunk_cache refresh` for forced extraction. Reference
|
||||||
|
bindings retain the contract introduced in Notarius v0.6.0. Receipt and artifact
|
||||||
|
schemas are unchanged; reused producers may report zero production attempts.
|
||||||
|
|
||||||
|
Supported release platforms remain Linux amd64/arm64 and best-effort macOS
|
||||||
|
arm64. macOS validation is cross-compilation, not native runtime testing.
|
||||||
|
|
||||||
|
## Upgrade
|
||||||
|
|
||||||
|
No special migration is required for existing v2 configuration. To use the new
|
||||||
|
features:
|
||||||
|
|
||||||
|
- Declare `notarius.llm_api_key` with the environment-variable name expected by
|
||||||
|
the deployed Notarius profile, supplying its value through the existing
|
||||||
|
environment or secrets-directory mechanism.
|
||||||
|
- Enable checkpoint recording in Notarius configuration before setting
|
||||||
|
Narratio's `notarius.resume: true`. Prefer explicit persistent Notarius cache
|
||||||
|
roots for service deployments. An optional `notarius.chunk_cache` overrides
|
||||||
|
its ordinary chunk-plan policy.
|
||||||
|
- Expect an initial checkpoint miss when moving from old run-local reference
|
||||||
|
paths to stable session snapshots. No migration or deletion of old caches is
|
||||||
|
required. Force refreshes the current input's plan, not the whole cache.
|
||||||
|
- Use `narratio analyze SESSION` for analysis-only iteration, and
|
||||||
|
`narratio regenerate-artifacts SESSION` when extraction should also be rebuilt.
|
||||||
|
|
||||||
|
See [Configuration](../config.md), the
|
||||||
|
[Notarius integration contract](../integrations/notarius.md), and
|
||||||
|
[Artifact Development Workflows](../operations.md#artifact-development-workflows)
|
||||||
|
for current details.
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Upgraded ConfigKit from v0.1.2 to v0.3.0 and isolated pipeline-discovery tests
|
||||||
|
from machine configuration.
|
||||||
|
- Added optional typed Notarius credentials, exact-name environment delivery,
|
||||||
|
safe configuration projections, and captured-stream redaction for custom names.
|
||||||
|
- Added Notarius resume and chunk-cache controls with force taking precedence.
|
||||||
|
- Added verified, content-addressed session reference snapshots that survive
|
||||||
|
ordinary run cleanup without becoming published artifacts.
|
||||||
|
- Preserved relative-workspace support for snapshot delivery and confinement.
|
||||||
|
- Kept credentials and cache-policy controls outside extract's semantic resume
|
||||||
|
identity, so operational changes alone do not invalidate completed results.
|
||||||
|
- Added an opt-in real Notarius integration test using a local provider to
|
||||||
|
verify reuse, partial-failure recovery, and forced refresh without paid calls.
|
||||||
33
docs/releases/v2.1.1.md
Normal file
33
docs/releases/v2.1.1.md
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# Narratio v2.1.1
|
||||||
|
|
||||||
|
This release fixes configuration loading for publish rules that explicitly set
|
||||||
|
requiredness while relying on a derived destination.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Publish rules with a derivable source and omitted `dest` now load correctly
|
||||||
|
whether `required` is omitted, explicitly true, or explicitly false. Previously,
|
||||||
|
explicit requiredness could trigger ConfigKit's `resolve.unrecorded_change`
|
||||||
|
diagnostic instead of accepting valid configuration.
|
||||||
|
|
||||||
|
## Compatibility
|
||||||
|
|
||||||
|
This is a backward-compatible bookkeeping correction. Publish schemas,
|
||||||
|
destination derivation, requiredness defaults, and YAML syntax support are
|
||||||
|
unchanged. Explicit destinations and explicit false values remain intact.
|
||||||
|
No ConfigKit upgrade or publication/storage behavior change is involved.
|
||||||
|
|
||||||
|
## Upgrade
|
||||||
|
|
||||||
|
No special upgrade action or configuration migration is required. Operators
|
||||||
|
need not add a derivable `dest`, remove explicit `required` values, or change
|
||||||
|
flow-style YAML to block-style YAML. See the
|
||||||
|
[configuration reference](../config.md#publish-configuration-summary).
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Recorded derived publish destinations at ConfigKit's atomic sequence boundary
|
||||||
|
while retaining field-level resolution records.
|
||||||
|
- Added real load/validation and safe effective-configuration regression coverage
|
||||||
|
for built-in and configured-artifact sources, explicit requiredness, and an
|
||||||
|
explicit destination that must remain unchanged.
|
||||||
26
docs/releases/v2.1.2.md
Normal file
26
docs/releases/v2.1.2.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# Narratio v2.1.2
|
||||||
|
|
||||||
|
This release allows secrets directories to contain hidden metadata without
|
||||||
|
preventing credential loading.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
ConfigKit v0.3.1 ignores dot-prefixed entries such as `.git`, `.gitignore`, and
|
||||||
|
`.DS_Store` during secrets bootstrap. These entries no longer block otherwise
|
||||||
|
valid credentials from loading and are omitted from bootstrap reports.
|
||||||
|
|
||||||
|
## Compatibility
|
||||||
|
|
||||||
|
This is a backward-compatible dependency bug fix. Configuration schemas,
|
||||||
|
existing-environment precedence, and validation of non-hidden entries are
|
||||||
|
unchanged. Hidden entries still count toward the directory entry limit.
|
||||||
|
|
||||||
|
## Upgrade
|
||||||
|
|
||||||
|
No special upgrade action or configuration migration is required. See the
|
||||||
|
[credential configuration reference](../config.md) for secrets-directory usage.
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Updated ConfigKit from v0.3.0 to v0.3.1.
|
||||||
|
- Clarified hidden-entry handling in the secrets-directory documentation.
|
||||||
53
docs/releases/v2.2.0.md
Normal file
53
docs/releases/v2.2.0.md
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# Narratio v2.2.0
|
||||||
|
|
||||||
|
This release adds resumable per-speaker transcription, replayable WhisperX
|
||||||
|
uploads, and explicit Notarius configuration profile selection.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Successfully checkpointed speaker transcripts survive later transcription
|
||||||
|
failures. Ordinary retry reuses valid completed speakers and processes only the
|
||||||
|
remaining work. WhisperX uploads can now be replayed by the HTTP transport
|
||||||
|
without buffering whole audio files.
|
||||||
|
|
||||||
|
## Compatibility
|
||||||
|
|
||||||
|
Existing CLI commands, speaker identities, transcript formats, and pipeline
|
||||||
|
ordering are unchanged. Session manifests gain optional per-speaker completion
|
||||||
|
evidence. Older manifests remain readable, but older Narratio binaries may
|
||||||
|
reject manifests containing the new fields; downgrading after transcription
|
||||||
|
is not transparent.
|
||||||
|
|
||||||
|
The optional `pipeline.notarius.config_profile` field selects a downstream
|
||||||
|
Notarius configuration profile independently of Narratio's own profile. Using
|
||||||
|
it requires a Notarius version supporting `--config-profile`; v0.7.0 is a known
|
||||||
|
supporting version. Omitting the field retains downstream default selection.
|
||||||
|
|
||||||
|
## Upgrade
|
||||||
|
|
||||||
|
No configuration migration is required. When transcribe is next selected for
|
||||||
|
an older aggregate-only manifest, all current speakers are transcribed once
|
||||||
|
to establish reusable evidence. Previously unrecorded results from failed runs
|
||||||
|
are not automatically imported.
|
||||||
|
|
||||||
|
Use ordinary run/resume to retain valid checkpoints. Forcing transcribe resets
|
||||||
|
reuse of prior results; an ordinary retry after a failed forced invocation can
|
||||||
|
retain replacements already checkpointed by that attempt. See the
|
||||||
|
[operations guide](../operations.md) and
|
||||||
|
[Notarius profile configuration](../config.md#notarius-configuration-profile).
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Persist validated speaker completions independently of aggregate stage status,
|
||||||
|
with serialized saves for concurrent work and input/output integrity checks.
|
||||||
|
- Rebuild aggregate transcript references when speakers are removed or those
|
||||||
|
references need repair, without retranscribing otherwise-current speakers.
|
||||||
|
- Keep removed and incomplete speaker results out of versioned merge inputs.
|
||||||
|
- Permit checkpoint evidence for zero-byte audio when WhisperX accepts it;
|
||||||
|
service rejection still fails normally.
|
||||||
|
- Provide fresh streaming multipart bodies for HTTP transport replay while
|
||||||
|
preserving application retries, cancellation, and resource cleanup. This
|
||||||
|
addresses the missing-body-replay limitation, not persistent upstream
|
||||||
|
protocol failures or exactly-once service execution.
|
||||||
|
- Pass explicit Notarius configuration profiles through the CLI and include
|
||||||
|
their selection in extraction reuse decisions.
|
||||||
35
docs/releases/v2.2.1.md
Normal file
35
docs/releases/v2.2.1.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# Narratio v2.2.1
|
||||||
|
|
||||||
|
This maintenance release consolidates checkpoint persistence for transcription
|
||||||
|
and analysis without changing their operator-facing behavior.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Transcribe and analyze now share one internal operation for preparing isolated
|
||||||
|
checkpoint candidates, saving them, and promoting successfully saved progress
|
||||||
|
into live state. Each stage retains its own progress model and recovery policy.
|
||||||
|
|
||||||
|
## Compatibility
|
||||||
|
|
||||||
|
CLI commands, configuration, manifest schemas, artifact formats, and external
|
||||||
|
integration contracts are unchanged. Speaker concurrency, artifact selection,
|
||||||
|
force behavior, and ordinary resume semantics are preserved. No dependency
|
||||||
|
upgrade or new external-tool version requirement is introduced.
|
||||||
|
|
||||||
|
## Upgrade
|
||||||
|
|
||||||
|
No special upgrade action or configuration migration is required when upgrading
|
||||||
|
from v2.2.0. See the [v2.2.0 release notes](v2.2.0.md) when upgrading from an
|
||||||
|
earlier version for the original speaker-checkpoint upgrade considerations.
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Replace duplicate analyze/transcribe save-and-promote sequences with a
|
||||||
|
shared, private checkpoint helper.
|
||||||
|
- Isolate checkpoint collections from live state, including analyze records
|
||||||
|
normalized during a transcription checkpoint save.
|
||||||
|
- Preserve transcription's caller-owned locking and failure handling, and
|
||||||
|
analysis's working/committed collections and rollback behavior.
|
||||||
|
- Add focused checkpoint integrity tests while retaining stage and application
|
||||||
|
recovery coverage.
|
||||||
|
- Document the shared [checkpoint persistence boundary](../internal/manifest.md#checkpoint-persistence-boundary).
|
||||||
57
docs/releases/v3.0.0.md
Normal file
57
docs/releases/v3.0.0.md
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
# Narratio v3.0.0
|
||||||
|
|
||||||
|
This major release moves Narratio pipeline selection to ConfigKit overlays and
|
||||||
|
updates its Audita and Notarius integration contracts. Existing deployments
|
||||||
|
must migrate configuration before running affected sessions.
|
||||||
|
|
||||||
|
## Compatibility and upgrade
|
||||||
|
|
||||||
|
- Replace Narratio's `--profile <name>` with `--overlay <name>` and move selected
|
||||||
|
`profiles/<name>.yml` files to `overlays/<name>.yml` beside the pipeline root.
|
||||||
|
The old flag and selected directory are no longer supported; explicit imports
|
||||||
|
from a directory named `profiles` remain valid. Update `config diff` positional
|
||||||
|
selections accordingly. See [configuration](../config.md#pipeline-imports-and-overlays)
|
||||||
|
and the [CLI reference](../cli.md).
|
||||||
|
- Before opening a session manifest containing
|
||||||
|
`effective_config.selected_profile`, back it up and follow the
|
||||||
|
[manifest migration procedure](../operations.md#migrating-manifest-overlay-provenance).
|
||||||
|
Strict decoding rejects the retired field. Preserve the manifest's stage and
|
||||||
|
checkpoint state; this informational rename does not itself require rerunning
|
||||||
|
every stage. Immutable remote snapshots are not edited in place.
|
||||||
|
- Deploy an Audita v2 executable and migrate its configuration before running
|
||||||
|
`polish`. Narratio no longer generates an Audita config or accepts the old
|
||||||
|
endpoint, model, concurrency, singular API-key, report, and retention fields.
|
||||||
|
Audita now owns backends, PromptKit profiles, reporting, and debug settings;
|
||||||
|
Narratio accepts optional downstream selectors and forwards only names listed
|
||||||
|
in `pipeline.audita.credentials`. Follow the
|
||||||
|
[Audita migration table](../operations.md#migrating-audita-and-provider-credentials)
|
||||||
|
and [integration contract](../integrations/audita.md).
|
||||||
|
- Replace `pipeline.notarius.llm_api_key` with the
|
||||||
|
`pipeline.notarius.credentials` list. Rename
|
||||||
|
`pipeline.notarius.config_profile` to `config_overlay` and move selected
|
||||||
|
downstream Notarius files to its `overlays/` directory. The old fields have
|
||||||
|
no compatibility aliases. A named downstream overlay requires a compatible
|
||||||
|
Notarius executable; v0.8.1 is the tested baseline, while deployments that
|
||||||
|
omit the selector gain no new version requirement. See the
|
||||||
|
[Notarius configuration reference](../config.md#notarius-configuration-overlay)
|
||||||
|
and [integration contract](../integrations/notarius.md).
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Narratio and downstream overlay names are independent. Operators can select
|
||||||
|
separate Audita and Notarius overlays from one Narratio overlay without
|
||||||
|
implicit name forwarding. ConfigKit is updated to v0.4.2.
|
||||||
|
- Audita's corrected transcript remains the canonical polish output. Available
|
||||||
|
`errors.yml`, `recoveries.yml`, and `report.md` files are retained as bounded
|
||||||
|
diagnostics; missing reports are allowed, and an exit-zero valid transcript
|
||||||
|
succeeds even when reports describe recoverable errors or no corrections.
|
||||||
|
- Audita and Notarius credential lists resolve at pipeline load and forward
|
||||||
|
captured values under their exact names, with captured subprocess output and
|
||||||
|
failure diagnostics redacted. Narratio does not discover backend credentials
|
||||||
|
from downstream configuration; operators must list the names those tools need.
|
||||||
|
- Repository policy, license/attribution notices, release validation, and the
|
||||||
|
asynchronous artifact-delivery procedure are aligned with the current
|
||||||
|
[release runbook](../release.md). Completed implementation roadmaps have been
|
||||||
|
retired from the candidate source.
|
||||||
|
|
||||||
|
[COPYRIGHT](https://gitea.maximumdirect.net/eric/narratio/src/tag/v3.0.0/COPYRIGHT) | [LICENSE](https://gitea.maximumdirect.net/eric/narratio/src/tag/v3.0.0/LICENSE) | [ATTRIBUTION](https://gitea.maximumdirect.net/eric/narratio/src/tag/v3.0.0/docs/oss/attribution.md)
|
||||||
40
docs/releases/v3.1.0.md
Normal file
40
docs/releases/v3.1.0.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# Narratio v3.1.0
|
||||||
|
|
||||||
|
This minor release adds explicit provider-credential forwarding to Scriptorium
|
||||||
|
for trim bounds generation and artifact analysis.
|
||||||
|
|
||||||
|
## Compatibility and upgrade
|
||||||
|
|
||||||
|
Existing pipelines remain valid. An omitted, null, or empty
|
||||||
|
`pipeline.scriptorium.credentials` list continues to forward no provider keys.
|
||||||
|
When Scriptorium needs a credential, provision its environment variable through
|
||||||
|
Narratio's existing environment or secrets-directory mechanism and list the
|
||||||
|
exact name in the pipeline, for example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
scriptorium:
|
||||||
|
credentials: [OPENROUTER_API_KEY]
|
||||||
|
```
|
||||||
|
|
||||||
|
Selected references must resolve to nonempty values when Narratio loads the
|
||||||
|
pipeline, even if the current command will not run Scriptorium. A Narratio
|
||||||
|
overlay replaces the complete list, and `[]` clears it. After correcting a
|
||||||
|
failed trim or analysis invocation, retry normally; successful work need not be
|
||||||
|
forced solely because a credential was added or rotated. See
|
||||||
|
[Scriptorium credentials](../config.md#scriptorium-credentials) and the
|
||||||
|
[401 troubleshooting guide](../troubleshooting.md#scriptorium-returns-http-401-during-trim-or-analyze).
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Forward selected, already-resolved credential names and values to Scriptorium
|
||||||
|
for trim, analysis, character-family generation, and render-debug calls.
|
||||||
|
Scriptorium still owns provider and profile selection; Narratio does not add
|
||||||
|
a model-request `--api-key-env` override.
|
||||||
|
- Register selected values for captured subprocess-output and failure-diagnostic
|
||||||
|
redaction. Inspection and invocation metadata contain credential names, never
|
||||||
|
their values. This protection does not scan files Scriptorium writes directly.
|
||||||
|
- Reuse the credential-forwarding boundary shared with Audita and Notarius.
|
||||||
|
Retire the completed Scriptorium credential-forwarding bug report from the
|
||||||
|
source roadmap; its history remains in Git.
|
||||||
|
|
||||||
|
[COPYRIGHT](https://gitea.maximumdirect.net/eric/narratio/src/tag/v3.1.0/COPYRIGHT) | [LICENSE](https://gitea.maximumdirect.net/eric/narratio/src/tag/v3.1.0/LICENSE) | [ATTRIBUTION](https://gitea.maximumdirect.net/eric/narratio/src/tag/v3.1.0/docs/oss/attribution.md)
|
||||||
224
docs/releases/v4.0.0.md
Normal file
224
docs/releases/v4.0.0.md
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
# Narratio v4.0.0
|
||||||
|
|
||||||
|
Narratio v4.0.0 adopts a native CommandKit CLI, shared campaign and glossary
|
||||||
|
schemas, and current Audita, Notarius, and Scriptorium interfaces. A standalone
|
||||||
|
preflight command prepares real inputs and checks readiness before processing.
|
||||||
|
Published products can be imported for further work without restoring the
|
||||||
|
execution history that produced them.
|
||||||
|
|
||||||
|
This is a breaking upgrade from v3.1.0. Update authored configuration, input
|
||||||
|
documents, command invocations, and scripts that consume command reports. Older
|
||||||
|
local session state is not converted in place.
|
||||||
|
|
||||||
|
## Compatibility and deployment
|
||||||
|
|
||||||
|
- The Go module path is now `gitea.maximumdirect.net/eric/narratio/v4`.
|
||||||
|
Source integrations and build scripts that reference the module path must update it.
|
||||||
|
- Building from source now requires Go 1.27.0 or later, up from 1.26.0.
|
||||||
|
Maintained builds use Go 1.27.4. Release targets remain Linux amd64 and arm64,
|
||||||
|
plus best-effort macOS arm64.
|
||||||
|
- The integration baselines are Audita v4.3.0, Notarius v0.10.0, and Scriptorium
|
||||||
|
v0.16.0. Install the applicable tools separately and migrate their own
|
||||||
|
configuration using the guides linked from the
|
||||||
|
[integration contracts](../integrations/README.md). Audita uses its version 3
|
||||||
|
configuration and Notarius its version 6 configuration.
|
||||||
|
- Narratio embeds the shared glossary, RPG party, and RPG campaign schemas at
|
||||||
|
version 0.2.0 from schemas distribution `2026.11.1`. Validation is offline;
|
||||||
|
the schema markers remain `maximumdirect.glossary.v1`,
|
||||||
|
`maximumdirect.rpg.party.v1`, and `maximumdirect.rpg.campaign.v1`.
|
||||||
|
- The configuration and CLI integrations now use ConfigKit v1.4.0,
|
||||||
|
CommandKit v0.8.0, and ckconfig v0.11.0. ReleaseKit v0.10.0 owns version
|
||||||
|
reporting and the maintainer release workflow.
|
||||||
|
|
||||||
|
## CLI and reporting changes
|
||||||
|
|
||||||
|
CommandKit now owns parsing, configuration inspection, reporting, diagnostics,
|
||||||
|
and completion. Removed command paths have no compatibility aliases.
|
||||||
|
|
||||||
|
| Previous invocation | Replacement |
|
||||||
|
| --- | --- |
|
||||||
|
| `session validate SESSION` | `preflight SESSION` |
|
||||||
|
| `run-stage STAGE SESSION` | `run SESSION --stage STAGE` |
|
||||||
|
| `analyze SESSION` | `run SESSION --stage analyze --force` |
|
||||||
|
| `publish SESSION` | `run SESSION --stage publish --force` |
|
||||||
|
| `regenerate-artifacts SESSION` | `artifacts regenerate SESSION` |
|
||||||
|
| `clean SESSION` / `clean --all` | `session clean SESSION` / `session clean --all` |
|
||||||
|
| `config artifacts` | `artifacts list` |
|
||||||
|
| `session locks SESSION` | `session locks list SESSION` |
|
||||||
|
| `--session FILE` | `--session-file FILE` |
|
||||||
|
| `--session-id ID` | Positional `SESSION` on domain commands |
|
||||||
|
| `config diff LEFT RIGHT` | `config diff --overlay LEFT --against-overlay RIGHT` |
|
||||||
|
|
||||||
|
Place flags after the complete command path. Configuration inspection uses
|
||||||
|
`--session` to assert an identity, not to select a file. Campaign identity and
|
||||||
|
file selectors may now be used together; `--party-file` selects a roster without
|
||||||
|
editing the campaign. See the [CLI reference](../cli.md).
|
||||||
|
|
||||||
|
Native inspection exposes `app`, `campaign`, `session`, and `party` scopes,
|
||||||
|
including source explanations and independent comparisons. It preserves authored
|
||||||
|
artifact-family declarations. Use `artifacts list` for expanded domain
|
||||||
|
definitions, `session plan` for execution and reuse decisions, and
|
||||||
|
`session artifacts` for product availability. App inspection supports native
|
||||||
|
field overrides; execution and planning continue to use files and overlays.
|
||||||
|
|
||||||
|
Reports go to stdout through native text, YAML, or JSON rendering; automatic
|
||||||
|
structured output uses YAML. Diagnostics and progress go to stderr.
|
||||||
|
`--progress` reports work such as transfers and speaker/artifact completion;
|
||||||
|
`--verbose` adds informational context. Quiet mode suppresses reports while
|
||||||
|
retaining failure diagnostics. Console debug does not enable downstream debug
|
||||||
|
capture. Scripts must adapt to the new report shapes and
|
||||||
|
[exit classifications](../cli.md#cancellation-and-exit-status), including status
|
||||||
|
2 for identifiable invalid configuration input and status 1 for operational
|
||||||
|
failures.
|
||||||
|
|
||||||
|
`artifacts regenerate` forces the whole configured extraction before rebuilding
|
||||||
|
selected analysis targets and prerequisites. `--artifacts` narrows analysis,
|
||||||
|
not extraction lanes; this command stops before publication and cleanup.
|
||||||
|
|
||||||
|
## Configuration and shared inputs
|
||||||
|
|
||||||
|
Configuration policy is delegated to ConfigKit. The main migration steps are:
|
||||||
|
|
||||||
|
- Rename source-root `configkit:` controls to `config:`. Review native import,
|
||||||
|
inheritance, and sequence-composition rules; mark required imports explicitly.
|
||||||
|
- Update pipeline discovery filenames, or pass an existing custom filename such
|
||||||
|
as `pipeline.yml` with `--config`. The former implicit search for
|
||||||
|
`/etc/narratio/pipeline.yml` and `/usr/local/etc/narratio/pipeline.yml` has been
|
||||||
|
replaced by [native discovery](../config.md#discovery-and-selection).
|
||||||
|
- Remove `--secrets-dir`. Declare `config.secrets_dir` in the pipeline main file
|
||||||
|
or provide credentials through the process environment. There is no automatic
|
||||||
|
conventional secrets-directory probe. Retain exact credential-reference names
|
||||||
|
in the applicable downstream `credentials` lists.
|
||||||
|
- Review relative resource paths: imported and inherited values resolve from
|
||||||
|
their defining source. Defaults apply to absent fields; explicit empty, null,
|
||||||
|
zero, and false values retain their native meaning and undergo domain checks.
|
||||||
|
|
||||||
|
Campaigns now use the shared campaign envelope: `schema_version` and `id`,
|
||||||
|
`references.party` for the roster, and the `narratio` extension for speakers,
|
||||||
|
inline autocorrection, campaign vocabulary, and session templates. Replace
|
||||||
|
file-based autocorrection and private spell-catalog inputs with the maintained
|
||||||
|
shared-input model. Party rosters use the shared party schema and plural
|
||||||
|
`aliases`; Narratio derives the players document and party glossary from that
|
||||||
|
single roster.
|
||||||
|
|
||||||
|
Glossaries use shared named-collection envelopes. Preparation writes `party`,
|
||||||
|
`campaign`, `setting`, and `spells` glossaries plus a combined document. Campaign
|
||||||
|
vocabulary may come from a file, inline entries, or native composition of both.
|
||||||
|
Optional setting and system selections use a separately installed reference
|
||||||
|
catalog. Replace old `narratio.input.glossary` and private spell-catalog bindings
|
||||||
|
with the applicable `narratio.input.glossary.*` sources. No legacy document
|
||||||
|
conversion is performed.
|
||||||
|
|
||||||
|
Audita receives the four individual glossaries. Its ordered processing pipeline
|
||||||
|
belongs in Audita configuration; remove Narratio's retired `audita.modules`.
|
||||||
|
Notarius can consume the prepared roster and combined glossary through explicit
|
||||||
|
reference bindings. Rename `notarius.config_profile` to `config_overlay`, replace
|
||||||
|
`resume` and `chunk_cache` with native cache selection as needed, and remove old
|
||||||
|
output descriptor fields. Output entries now select a `lane_id` and optional
|
||||||
|
flat JSON `filename`. Forced extraction requests native cache refresh.
|
||||||
|
|
||||||
|
Use the [production/testing bundle](../../examples/production-testing/pipeline.yml)
|
||||||
|
and [three-file campaign example](../../examples/campaigns/lantern-coast/campaign.yml)
|
||||||
|
as migration references. The [configuration reference](../config.md) owns the
|
||||||
|
complete field, clearing, and source-resolution rules.
|
||||||
|
|
||||||
|
## Preflight and processing
|
||||||
|
|
||||||
|
`narratio preflight SESSION` prepares or reuses inputs, then checks configured
|
||||||
|
readiness, including native Audita and Notarius preflight and Scriptorium prompt
|
||||||
|
requirements. Unlike the former validation command, it can create a workspace,
|
||||||
|
download inputs, and update preparation state. It may contact providers.
|
||||||
|
Changed inputs use ordinary dependent invalidation; a later readiness failure
|
||||||
|
does not discard successful preparation.
|
||||||
|
|
||||||
|
Standalone preflight checks enabled capabilities even when processing outputs
|
||||||
|
are reusable. Automatic preflight checks projected work after preparation and
|
||||||
|
before processing. Required failures stop execution; advisory prompt-discovery
|
||||||
|
findings retain warning treatment. Audita uses a synthetic transcript; Notarius
|
||||||
|
uses a suitable verified transcript or its synthetic fallback. These checks do
|
||||||
|
not guarantee future provider availability or real-transcript processing quality.
|
||||||
|
|
||||||
|
Scriptorium generation now uses its native CLI and captures result stdout
|
||||||
|
separately from diagnostic stderr. Prepared previews and requirements inspection
|
||||||
|
use native structured output. Missing required bindings and failed inspection
|
||||||
|
are caught before the affected processing begins.
|
||||||
|
|
||||||
|
Audio discovery now accepts common formats beyond FLAC, including WAV, MP3,
|
||||||
|
M4A, and Opus, with the same case-insensitive suffix selection for local directory
|
||||||
|
and S3 prefix scans. Explicit files can have any suffix. Narratio does not
|
||||||
|
transcode or certify the encoding; WhisperX must be able to decode the bytes.
|
||||||
|
Prepared names and speaker identities are checked for collisions before audio
|
||||||
|
materialization. See [audio selection](../config.md#session).
|
||||||
|
|
||||||
|
## Workspace, publication, and restore
|
||||||
|
|
||||||
|
The local workspace now separates prepared `inputs/` and `audio/`, combined
|
||||||
|
`transcripts/` with `raw/` speaker transcripts, flat `artifacts/`, and run-local
|
||||||
|
attempt material. Logs and debug views point to the latest actual attempt,
|
||||||
|
including failures. Selected Notarius lane products are promoted into canonical
|
||||||
|
artifact locations and can be reused without the original bundle. Retired
|
||||||
|
spool and audio-cache configuration is no longer accepted; prepared audio has
|
||||||
|
one verified copy. Subprocess state and caches remain under each tool's control.
|
||||||
|
|
||||||
|
Only `narratio.session-manifest.v2` is accepted locally. Preserve older workspaces
|
||||||
|
separately, then regenerate or import compatible published products into a new
|
||||||
|
local baseline. Do not change old schema markers or edit immutable remote
|
||||||
|
snapshots to bypass validation.
|
||||||
|
|
||||||
|
Publication now transfers products and prepared inputs without uploading the
|
||||||
|
local execution ledger. `session restore` imports recognized products from the
|
||||||
|
selected publication inventory and merges them with valid local progress. It
|
||||||
|
does not restore remote execution checkpoints or claim that remote stages ran
|
||||||
|
locally. Identical products preserve valid local evidence; changed products
|
||||||
|
invalidate dependent work while unrelated checkpoints remain.
|
||||||
|
|
||||||
|
Imported transcripts and artifacts can satisfy downstream work without their
|
||||||
|
original producer history. Bounded downstream runs prepare required references
|
||||||
|
without demanding audio for unrelated transcription. Uncovered or forced
|
||||||
|
transcription still requires audio. `render.variants` can select normalized,
|
||||||
|
trimmed, both, or neither transcript variant. Restore dry runs report planned
|
||||||
|
imports, conflicts, and projected work; `restore --force` permits eligible file
|
||||||
|
replacement rather than forcing processing. See the
|
||||||
|
[restore workflow](../operations.md#restore-workflow).
|
||||||
|
|
||||||
|
When `workspace.cleanup_after_publish` is enabled and publication evidence
|
||||||
|
authorizes cleanup, the final cleanup stage removes the **entire session run
|
||||||
|
history**: earlier failures, logs, debug captures, restore/probe attempts, and
|
||||||
|
original Notarius bundles. Managed diagnostic links are removed too. Prepared
|
||||||
|
inputs, canonical products, and the local manifest remain reusable; remote
|
||||||
|
published objects and subprocess caches are unaffected. Set the
|
||||||
|
option to `false` to retain execution evidence. `session clean` is different:
|
||||||
|
it removes the entire local session. See [cleanup](../operations.md#cleanup).
|
||||||
|
|
||||||
|
## Reliability improvements
|
||||||
|
|
||||||
|
- Workspace coordination now covers active processing, restore, initialization,
|
||||||
|
and manual cleanup; lock waiting is cancellation-aware and reported as progress.
|
||||||
|
- Subprocess completion waits for owned process output before releasing resources.
|
||||||
|
- Audio and publication transfers stream data and verify available size and
|
||||||
|
object-identity evidence; publication sources are handled one at a time.
|
||||||
|
- Planning checks current S3 source evidence before predicting preparation reuse.
|
||||||
|
- Previous-session hydration includes configured artifact prerequisites, including
|
||||||
|
disabled prerequisites needed by selected work.
|
||||||
|
- Shared dependency and input indexes reduce repeated scans during analysis,
|
||||||
|
inspection, publication, and restore.
|
||||||
|
|
||||||
|
## Upgrade sequence
|
||||||
|
|
||||||
|
1. Preserve authored sources, old local workspaces, and any execution evidence
|
||||||
|
you want to retain. Published products are not execution-checkpoint backups.
|
||||||
|
2. Install the applicable downstream versions and migrate their configuration.
|
||||||
|
3. Update Narratio configuration and shared input documents using the maintained
|
||||||
|
examples. Remove retired keys and update CLI scripts and report consumers.
|
||||||
|
4. Validate and inspect configuration with native `config` commands, then review
|
||||||
|
expanded inputs and outputs with `artifacts list`. Use a new local baseline
|
||||||
|
for unsupported state; preview any product import with
|
||||||
|
`session restore SESSION --dry-run` before applying it.
|
||||||
|
5. Run `preflight SESSION`, inspect `session plan SESSION`, and execute the desired
|
||||||
|
full or bounded `run`. Review cleanup retention before a full published run.
|
||||||
|
|
||||||
|
Maintainers now use the module-selected ReleaseKit launcher for candidate
|
||||||
|
validation, tagging, and asynchronous binary delivery; the old release scripts
|
||||||
|
have been removed. See the [release procedure](../release.md).
|
||||||
|
|
||||||
|
[COPYRIGHT](https://forge.maximumdirect.net/eric/narratio/src/tag/v4.0.0/COPYRIGHT) | [LICENSE](https://forge.maximumdirect.net/eric/narratio/src/tag/v4.0.0/LICENSE) | [ATTRIBUTION](https://forge.maximumdirect.net/eric/narratio/src/tag/v4.0.0/docs/oss/attribution.md)
|
||||||
@@ -1,715 +0,0 @@
|
|||||||
# Roadmap: `narratio restore` Subcommand
|
|
||||||
|
|
||||||
## Status
|
|
||||||
|
|
||||||
Implemented through Step 8. This document remains as roadmap and design history for the restore feature, and as the home for future restore-related ideas (for example `run --restore`).
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
Add a new `narratio restore` subcommand that hydrates a local session workspace from the current committed remote archive state.
|
|
||||||
|
|
||||||
The primary operator workflow is:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio restore --session-id 2026-04-04
|
|
||||||
narratio run-stage --force analyze
|
|
||||||
```
|
|
||||||
|
|
||||||
This should allow a new machine with no local workspace state to restore the durable session manifest, transcripts, and generated artifacts from S3, then generate new Scriptorium artifacts without re-running transcription, merge, normalize, polish, or trim.
|
|
||||||
|
|
||||||
This is intentionally a separate command. Do not fold this behavior into the `prepare` stage. The existing `prepare` stage should remain focused on materializing configured local/S3 inputs for a pipeline run.
|
|
||||||
|
|
||||||
## Goals
|
|
||||||
|
|
||||||
- Add a first-class `narratio restore` command.
|
|
||||||
- Restore the current committed remote session state into the canonical local session workspace.
|
|
||||||
- Use the existing object storage adapter boundary.
|
|
||||||
- Preserve archive commit semantics: only restore from a remote state that has a valid current commit marker.
|
|
||||||
- Restore durable session-level outputs needed for downstream stages, especially `analyze`.
|
|
||||||
- Provide safe conflict behavior by default.
|
|
||||||
- Support `--dry-run`, `--force`, and `--include-audio`.
|
|
||||||
- Keep the implementation explicit, testable, and narrow.
|
|
||||||
|
|
||||||
## Non-goals
|
|
||||||
|
|
||||||
- Do not make `restore` a pipeline stage.
|
|
||||||
- Do not change the `prepare` stage behavior as part of this work.
|
|
||||||
- Do not add implicit restore behavior to `narratio run` in this implementation.
|
|
||||||
- Do not restore historical run-local sandboxes by default.
|
|
||||||
- Do not implement a generic remote synchronization engine.
|
|
||||||
- Do not implement bidirectional sync.
|
|
||||||
- Do not delete local files merely because they are absent remotely.
|
|
||||||
- Do not merge remote and local manifests in the first implementation.
|
|
||||||
- Do not require live S3 for the ordinary unit test suite.
|
|
||||||
|
|
||||||
## Future work explicitly out of scope
|
|
||||||
|
|
||||||
A future change may add:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio run --restore
|
|
||||||
```
|
|
||||||
|
|
||||||
That future flag should run `narratio restore` before starting the normal pipeline. Mention this as future work in roadmap/docs if useful, but do not implement it now.
|
|
||||||
|
|
||||||
## Existing architecture to preserve
|
|
||||||
|
|
||||||
### `prepare` remains input materialization
|
|
||||||
|
|
||||||
The `prepare` stage currently materializes required session inputs into canonical local workspace paths and records input provenance. It owns local copying/materialization of config and audio inputs, including S3 audio download when `session.inputs.audio_s3.prefix` is configured. It does not own transcript generation/processing or archive publish behavior.
|
|
||||||
|
|
||||||
`restore` should not be implemented by expanding `prepare`. It should be an app-level command that reuses shared helpers where appropriate.
|
|
||||||
|
|
||||||
### Workspace model
|
|
||||||
|
|
||||||
The local durable session workspace is campaign-aware:
|
|
||||||
|
|
||||||
```text
|
|
||||||
{workspace.root}/work/{campaign}/{session_id}/
|
|
||||||
```
|
|
||||||
|
|
||||||
It contains durable session paths such as:
|
|
||||||
|
|
||||||
```text
|
|
||||||
manifest.json
|
|
||||||
inputs/
|
|
||||||
audio/
|
|
||||||
transcripts/
|
|
||||||
artifacts/
|
|
||||||
reports/
|
|
||||||
logs/
|
|
||||||
config/
|
|
||||||
current/
|
|
||||||
runs/
|
|
||||||
```
|
|
||||||
|
|
||||||
Run-local sandboxes live below:
|
|
||||||
|
|
||||||
```text
|
|
||||||
runs/{run_id}/
|
|
||||||
```
|
|
||||||
|
|
||||||
Restore should target durable session-level paths, not old run-local stage sandboxes.
|
|
||||||
|
|
||||||
### Storage boundary
|
|
||||||
|
|
||||||
The storage adapter owns object-store primitives only: `List`, `Download`, `Upload`, and `Exists`.
|
|
||||||
|
|
||||||
The storage adapter must not infer root prefixes, campaign names, session IDs, run IDs, or archive layout. Restore code must construct full bucket-relative keys before calling storage.
|
|
||||||
|
|
||||||
### Archive commit boundary
|
|
||||||
|
|
||||||
A remote run is current only after the archive stage has uploaded the run record, promoted outputs, `current/manifest.json`, and finally `current/run_id.txt`.
|
|
||||||
|
|
||||||
`current/run_id.txt` is the final remote commit marker and must be written last.
|
|
||||||
|
|
||||||
Restore must not treat incomplete, skipped, failed, or uncommitted archive attempts as current remote state.
|
|
||||||
|
|
||||||
## User-facing command
|
|
||||||
|
|
||||||
Add:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio restore [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
The command should use the same configuration/session discovery conventions as `run`, `plan`, `resume`, and `run-stage` where practical:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio restore --config /path/to/pipeline.yml --session ./session.yml --session-id 2026-04-04
|
|
||||||
```
|
|
||||||
|
|
||||||
Required effective inputs:
|
|
||||||
|
|
||||||
- resolved pipeline config;
|
|
||||||
- resolved session config;
|
|
||||||
- `session.campaign`;
|
|
||||||
- `session.session_id`;
|
|
||||||
- configured remote storage backend.
|
|
||||||
|
|
||||||
Supported flags:
|
|
||||||
|
|
||||||
```text
|
|
||||||
--config <path> Existing pipeline config path behavior.
|
|
||||||
--session <path> Existing session config path behavior.
|
|
||||||
--session-id <value> Existing session template behavior.
|
|
||||||
--dry-run Plan restore actions without writing local files.
|
|
||||||
--force Overwrite conflicting local files with remote files.
|
|
||||||
--include-audio Include archived session-level audio files.
|
|
||||||
```
|
|
||||||
|
|
||||||
Do not add `--restore` to `run` in this implementation.
|
|
||||||
|
|
||||||
## Default restore scope
|
|
||||||
|
|
||||||
By default, restore:
|
|
||||||
|
|
||||||
1. Validates and reads the current remote commit marker.
|
|
||||||
2. Downloads the current remote manifest into the local session manifest path.
|
|
||||||
3. Downloads durable transcript files.
|
|
||||||
4. Downloads durable generated artifact files.
|
|
||||||
|
|
||||||
Default included remote/local durable paths:
|
|
||||||
|
|
||||||
```text
|
|
||||||
manifest.json from remote current manifest
|
|
||||||
transcripts/**
|
|
||||||
artifacts/**
|
|
||||||
```
|
|
||||||
|
|
||||||
Default excluded paths:
|
|
||||||
|
|
||||||
```text
|
|
||||||
audio/** unless --include-audio is passed
|
|
||||||
runs/** always excluded for this implementation
|
|
||||||
logs/** excluded for this implementation
|
|
||||||
reports/** excluded for this implementation unless needed for current manifest validation
|
|
||||||
config/** excluded for this implementation
|
|
||||||
inputs/** excluded for this implementation
|
|
||||||
current/** remote control metadata only; do not mirror blindly
|
|
||||||
```
|
|
||||||
|
|
||||||
If the existing archive implementation stores promoted files in a different remote layout, use the existing archive/path helpers and current archive semantics rather than inventing a parallel layout.
|
|
||||||
|
|
||||||
## Remote state discovery
|
|
||||||
|
|
||||||
Implement restore around the current committed archive state.
|
|
||||||
|
|
||||||
Expected algorithm:
|
|
||||||
|
|
||||||
1. Resolve pipeline/session config.
|
|
||||||
2. Ensure storage is configured.
|
|
||||||
3. Ensure local workspace layout exists.
|
|
||||||
4. Acquire the session lock.
|
|
||||||
5. Build the remote session archive prefix using the same helpers/policy used by archive code.
|
|
||||||
6. Check for the remote `current/run_id.txt` commit marker.
|
|
||||||
7. Read the committed run ID.
|
|
||||||
8. Download `current/manifest.json` to a temporary file.
|
|
||||||
9. Validate that the manifest is parseable and belongs to the requested campaign/session.
|
|
||||||
10. Build a restore plan from the committed remote state.
|
|
||||||
11. Execute the restore plan unless `--dry-run` is set.
|
|
||||||
12. Emit a concise summary.
|
|
||||||
|
|
||||||
Important: `current/run_id.txt` is the commit marker. Do not restore from a remote session prefix merely because files exist under `transcripts/` or `artifacts/`.
|
|
||||||
|
|
||||||
## Restore planning
|
|
||||||
|
|
||||||
Create a planning layer before writing files.
|
|
||||||
|
|
||||||
A restore plan entry should include at least:
|
|
||||||
|
|
||||||
```go
|
|
||||||
type RestoreAction struct {
|
|
||||||
Kind RestoreActionKind
|
|
||||||
RemoteKey string
|
|
||||||
LocalPath string
|
|
||||||
Size int64
|
|
||||||
ETag string
|
|
||||||
ExistsLocal bool
|
|
||||||
SameLocal bool
|
|
||||||
Conflict bool
|
|
||||||
Reason string
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Suggested action kinds:
|
|
||||||
|
|
||||||
```text
|
|
||||||
download
|
|
||||||
skip_same
|
|
||||||
skip_missing_optional
|
|
||||||
conflict
|
|
||||||
```
|
|
||||||
|
|
||||||
The restore planner should be deterministic:
|
|
||||||
|
|
||||||
- sort remote objects by key;
|
|
||||||
- sort planned actions by local path or stable restore priority;
|
|
||||||
- write/report stable output for tests.
|
|
||||||
|
|
||||||
## Conflict and overwrite policy
|
|
||||||
|
|
||||||
Default behavior should be safe.
|
|
||||||
|
|
||||||
For each planned file:
|
|
||||||
|
|
||||||
```text
|
|
||||||
local absent:
|
|
||||||
download
|
|
||||||
|
|
||||||
local present and same as remote:
|
|
||||||
skip
|
|
||||||
|
|
||||||
local present and different:
|
|
||||||
conflict; fail restore unless --force is set
|
|
||||||
|
|
||||||
--force:
|
|
||||||
overwrite local conflicting files with remote versions
|
|
||||||
|
|
||||||
--dry-run:
|
|
||||||
do not write any files; report what would happen
|
|
||||||
```
|
|
||||||
|
|
||||||
The first implementation may use size and checksum/hash comparison where available. If remote ETag cannot be treated as a content hash, compare by downloading to a temporary file and hashing locally before deciding whether a local file is the same. Prefer correctness over assuming provider-specific ETag semantics.
|
|
||||||
|
|
||||||
Do not delete local files that are not present remotely.
|
|
||||||
|
|
||||||
## File writing and transactionality
|
|
||||||
|
|
||||||
Restore should avoid partial writes.
|
|
||||||
|
|
||||||
Implementation requirements:
|
|
||||||
|
|
||||||
- download each remote object to a temporary file under the session workspace or OS temp dir;
|
|
||||||
- validate downloaded content where possible before replacing local files;
|
|
||||||
- create parent directories as needed;
|
|
||||||
- atomically rename/copy into place only after successful download;
|
|
||||||
- do not overwrite local files unless `--force` is set;
|
|
||||||
- if a later file fails, preserve already-restored files but return a failure summary;
|
|
||||||
- never corrupt an existing local manifest on failed manifest download/parse.
|
|
||||||
|
|
||||||
Manifest restore is especially sensitive:
|
|
||||||
|
|
||||||
- download remote `current/manifest.json` to a temporary file;
|
|
||||||
- parse and validate it;
|
|
||||||
- if no local manifest exists, install it;
|
|
||||||
- if a local manifest exists and is equivalent, skip;
|
|
||||||
- if a local manifest exists and differs, fail unless `--force` is set;
|
|
||||||
- with `--force`, replace the local manifest with the remote manifest after validation;
|
|
||||||
- do not attempt a manifest merge in the initial implementation.
|
|
||||||
|
|
||||||
## Manifest semantics
|
|
||||||
|
|
||||||
`restore` is not a pipeline run and should not mark stages as running/succeeded/failed.
|
|
||||||
|
|
||||||
The restored remote manifest becomes the local session manifest. That is what allows a subsequent command such as:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio run-stage --force analyze
|
|
||||||
```
|
|
||||||
|
|
||||||
to see existing upstream stage state and canonical durable outputs.
|
|
||||||
|
|
||||||
Do not create a new run manifest for `restore`.
|
|
||||||
|
|
||||||
It is acceptable to write a restore diagnostic report outside the manifest, for example:
|
|
||||||
|
|
||||||
```text
|
|
||||||
reports/restore-latest.json
|
|
||||||
```
|
|
||||||
|
|
||||||
or a timestamped report, if that pattern fits the existing codebase. The report must not contain secrets.
|
|
||||||
|
|
||||||
## Local workspace locking
|
|
||||||
|
|
||||||
`restore` should acquire the same session lock used by ordinary pipeline operations before modifying session workspace state.
|
|
||||||
|
|
||||||
If the lock is held, fail fast with the same lock-conflict behavior used elsewhere.
|
|
||||||
|
|
||||||
`--dry-run` may still acquire the lock for consistency, but it is acceptable to avoid the lock if the codebase already has a clear read-only command pattern. Prefer safety and simplicity.
|
|
||||||
|
|
||||||
## Audio behavior
|
|
||||||
|
|
||||||
By default, do not restore audio.
|
|
||||||
|
|
||||||
If `--include-audio` is passed:
|
|
||||||
|
|
||||||
- restore archived durable session-level audio files only;
|
|
||||||
- do not use run-scoped spool paths;
|
|
||||||
- do not mutate or delete spool state;
|
|
||||||
- do not infer original `session.inputs.audio_s3.prefix` behavior;
|
|
||||||
- respect the same conflict/force/dry-run behavior used for transcripts/artifacts.
|
|
||||||
|
|
||||||
If the archive does not contain durable audio files, `--include-audio` should report that no archived audio was found rather than failing, unless the final implementation chooses to treat explicit audio restore as required. Prefer non-failure for absent archived audio unless tests or existing archive semantics suggest otherwise.
|
|
||||||
|
|
||||||
## Remote object selection
|
|
||||||
|
|
||||||
Prefer using manifest/artifact metadata when it reliably identifies durable outputs.
|
|
||||||
|
|
||||||
Also support listing committed durable archive prefixes so restore can retrieve all top-level session artifacts that may not yet be fully represented in manifest metadata.
|
|
||||||
|
|
||||||
The implementation should inspect existing archive code before choosing the final object-selection method. Do not duplicate archive path construction.
|
|
||||||
|
|
||||||
Recommended selection priority:
|
|
||||||
|
|
||||||
1. Remote current manifest path.
|
|
||||||
2. Durable promoted transcript/artifact outputs recorded in the manifest or archive metadata, if available.
|
|
||||||
3. Objects under committed durable `transcripts/` and `artifacts/` archive prefixes.
|
|
||||||
4. Objects under durable `audio/` only when `--include-audio` is passed.
|
|
||||||
|
|
||||||
Always exclude:
|
|
||||||
|
|
||||||
```text
|
|
||||||
runs/**
|
|
||||||
```
|
|
||||||
|
|
||||||
for the first implementation.
|
|
||||||
|
|
||||||
## Package and file organization
|
|
||||||
|
|
||||||
Expected areas to inspect and update:
|
|
||||||
|
|
||||||
```text
|
|
||||||
cmd/narratio/
|
|
||||||
internal/app/
|
|
||||||
internal/adapters/storage/
|
|
||||||
internal/artifacts/
|
|
||||||
internal/manifest/
|
|
||||||
docs/
|
|
||||||
examples/
|
|
||||||
```
|
|
||||||
|
|
||||||
Suggested implementation shape:
|
|
||||||
|
|
||||||
```text
|
|
||||||
internal/app/restore.go
|
|
||||||
internal/app/restore_test.go
|
|
||||||
|
|
||||||
internal/archive/restore/
|
|
||||||
planner.go
|
|
||||||
executor.go
|
|
||||||
report.go
|
|
||||||
keys.go
|
|
||||||
*_test.go
|
|
||||||
```
|
|
||||||
|
|
||||||
The exact package name may vary. Use whatever best fits the existing repository, but keep these boundaries clear:
|
|
||||||
|
|
||||||
- `internal/app` owns CLI command handling, config/session loading, lock acquisition, and wiring.
|
|
||||||
- Restore planning/execution owns remote key discovery, conflict detection, downloads, and reporting.
|
|
||||||
- `internal/adapters/storage` remains a transport boundary only.
|
|
||||||
- Workspace/path helpers remain centralized; do not scatter string concatenation.
|
|
||||||
|
|
||||||
If the repository already has an `internal/archive` or archive-stage helper package, prefer extending that rather than creating a conflicting package layout.
|
|
||||||
|
|
||||||
## CLI output
|
|
||||||
|
|
||||||
`narratio restore` should print a concise operator summary.
|
|
||||||
|
|
||||||
Example successful output:
|
|
||||||
|
|
||||||
```text
|
|
||||||
Restored session archive for sample-campaign/2026-04-04
|
|
||||||
Remote run: 20260504T031500Z-a1b2c3
|
|
||||||
Downloaded: 4
|
|
||||||
Skipped unchanged: 2
|
|
||||||
Conflicts: 0
|
|
||||||
```
|
|
||||||
|
|
||||||
Example dry run:
|
|
||||||
|
|
||||||
```text
|
|
||||||
Restore plan for sample-campaign/2026-04-04
|
|
||||||
Remote run: 20260504T031500Z-a1b2c3
|
|
||||||
Would download: transcripts/processed.json
|
|
||||||
Would download: transcripts/trimmed.json
|
|
||||||
Would skip unchanged: artifacts/session_recap.md
|
|
||||||
```
|
|
||||||
|
|
||||||
Example conflict:
|
|
||||||
|
|
||||||
```text
|
|
||||||
restore conflict: local artifacts/session_recap.md differs from remote archive; rerun with --force to overwrite
|
|
||||||
```
|
|
||||||
|
|
||||||
Do not print transcript or artifact content.
|
|
||||||
|
|
||||||
## Error behavior
|
|
||||||
|
|
||||||
Fail clearly when:
|
|
||||||
|
|
||||||
- storage backend is not configured;
|
|
||||||
- S3 bucket/config is missing or invalid;
|
|
||||||
- remote current commit marker is missing;
|
|
||||||
- remote current manifest is missing;
|
|
||||||
- remote manifest is invalid;
|
|
||||||
- remote manifest does not match requested campaign/session;
|
|
||||||
- local file differs from remote and `--force` is not set;
|
|
||||||
- a required remote object download fails;
|
|
||||||
- a local path would escape the session workspace;
|
|
||||||
- a remote key maps to an unsafe local path.
|
|
||||||
|
|
||||||
Skip or report non-fatal conditions when:
|
|
||||||
|
|
||||||
- optional audio restore finds no archived audio;
|
|
||||||
- an included prefix has no objects;
|
|
||||||
- a local file already matches the remote file.
|
|
||||||
|
|
||||||
## Path safety
|
|
||||||
|
|
||||||
Every restored file must map to a safe path under the session root.
|
|
||||||
|
|
||||||
Validation rules:
|
|
||||||
|
|
||||||
- local restore paths must be relative to the session root;
|
|
||||||
- reject absolute paths;
|
|
||||||
- reject `..` traversal;
|
|
||||||
- reject paths that escape through symlinks if the codebase has symlink-safe path checks;
|
|
||||||
- do not restore remote keys directly without mapping/classification;
|
|
||||||
- do not mirror arbitrary remote keys.
|
|
||||||
|
|
||||||
## Testing plan
|
|
||||||
|
|
||||||
Add focused unit tests. Do not require live S3.
|
|
||||||
|
|
||||||
### CLI tests
|
|
||||||
|
|
||||||
Add or update `internal/app` command tests for:
|
|
||||||
|
|
||||||
- `narratio restore --help`;
|
|
||||||
- restore accepts `--config`, `--session`, and `--session-id`;
|
|
||||||
- restore accepts `--dry-run`;
|
|
||||||
- restore accepts `--force`;
|
|
||||||
- restore accepts `--include-audio`;
|
|
||||||
- restore fails when storage is not configured;
|
|
||||||
- restore does not run pipeline stages.
|
|
||||||
|
|
||||||
### Restore planner tests
|
|
||||||
|
|
||||||
Test:
|
|
||||||
|
|
||||||
- missing `current/run_id.txt` fails;
|
|
||||||
- missing `current/manifest.json` fails;
|
|
||||||
- invalid manifest fails;
|
|
||||||
- wrong campaign/session manifest fails;
|
|
||||||
- default scope includes manifest/transcripts/artifacts;
|
|
||||||
- default scope excludes audio/logs/reports/config/runs;
|
|
||||||
- `--include-audio` includes durable audio;
|
|
||||||
- run-local keys are excluded;
|
|
||||||
- keys are sorted deterministically;
|
|
||||||
- unsafe remote-to-local paths are rejected.
|
|
||||||
|
|
||||||
### Conflict policy tests
|
|
||||||
|
|
||||||
Test:
|
|
||||||
|
|
||||||
- absent local file downloads;
|
|
||||||
- matching local file skips;
|
|
||||||
- differing local file conflicts by default;
|
|
||||||
- `--force` overwrites conflicts;
|
|
||||||
- `--dry-run` writes nothing;
|
|
||||||
- partial failure does not corrupt an existing local manifest.
|
|
||||||
|
|
||||||
### Storage/fake tests
|
|
||||||
|
|
||||||
Use fake storage to simulate:
|
|
||||||
|
|
||||||
- object listing;
|
|
||||||
- object download;
|
|
||||||
- missing objects;
|
|
||||||
- download failures;
|
|
||||||
- metadata/ETag behavior.
|
|
||||||
|
|
||||||
### Workspace/lock tests
|
|
||||||
|
|
||||||
Test:
|
|
||||||
|
|
||||||
- session layout is created before restore;
|
|
||||||
- session lock conflict fails;
|
|
||||||
- restored files land under the expected campaign/session workspace;
|
|
||||||
- no files are written outside the session root.
|
|
||||||
|
|
||||||
### Follow-up command workflow test
|
|
||||||
|
|
||||||
Add at least one test that simulates:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
narratio restore --session-id 2026-04-04
|
|
||||||
narratio run-stage --force analyze
|
|
||||||
```
|
|
||||||
|
|
||||||
The test does not need to run real Scriptorium. Use existing fake/stub behavior to verify that restored transcripts and manifest state are sufficient for analyze-stage input resolution.
|
|
||||||
|
|
||||||
## Documentation updates when implemented
|
|
||||||
|
|
||||||
When the feature is implemented, update current-behavior docs:
|
|
||||||
|
|
||||||
```text
|
|
||||||
docs/cli.md
|
|
||||||
docs/operations.md
|
|
||||||
docs/internal/storage.md or docs/internal/archive/restore.md
|
|
||||||
```
|
|
||||||
|
|
||||||
If the documentation set does not yet have an internal restore document, add one consistent with the existing internal-doc style:
|
|
||||||
|
|
||||||
```text
|
|
||||||
docs/internal/command-restore.md
|
|
||||||
```
|
|
||||||
|
|
||||||
or:
|
|
||||||
|
|
||||||
```text
|
|
||||||
docs/internal/archive-restore.md
|
|
||||||
```
|
|
||||||
|
|
||||||
Do not document future `narratio run --restore` behavior outside `docs/roadmap/` until implemented.
|
|
||||||
|
|
||||||
## Implementation phases
|
|
||||||
|
|
||||||
### Phase 1: Audit existing archive and path helpers (completed)
|
|
||||||
|
|
||||||
Before coding behavior, inspect:
|
|
||||||
|
|
||||||
```text
|
|
||||||
internal/app/
|
|
||||||
internal/stage/archive*
|
|
||||||
internal/adapters/storage/
|
|
||||||
internal/artifacts/
|
|
||||||
internal/manifest/
|
|
||||||
docs/internal/stage-archive.md, if present
|
|
||||||
```
|
|
||||||
|
|
||||||
Determine:
|
|
||||||
|
|
||||||
- exact remote archive key layout;
|
|
||||||
- how root prefix/campaign/session are modeled;
|
|
||||||
- how current commit marker keys are built;
|
|
||||||
- how current manifest is uploaded;
|
|
||||||
- where promoted outputs are uploaded;
|
|
||||||
- whether helper functions already exist for remote archive keys;
|
|
||||||
- whether local workspace path helpers can safely map restore destinations.
|
|
||||||
|
|
||||||
Deliverable:
|
|
||||||
|
|
||||||
- small code comments or internal helper selection;
|
|
||||||
- no large behavior change yet unless required by tests.
|
|
||||||
|
|
||||||
### Phase 2: Add CLI surface and command wiring (completed)
|
|
||||||
|
|
||||||
Add `narratio restore` command parsing.
|
|
||||||
|
|
||||||
Wire flags:
|
|
||||||
|
|
||||||
```text
|
|
||||||
--config
|
|
||||||
--session
|
|
||||||
--session-id
|
|
||||||
--dry-run
|
|
||||||
--force
|
|
||||||
--include-audio
|
|
||||||
```
|
|
||||||
|
|
||||||
Use the existing config/session load path where practical.
|
|
||||||
|
|
||||||
Deliverable:
|
|
||||||
|
|
||||||
- command exists;
|
|
||||||
- help output is sensible;
|
|
||||||
- command validates basic inputs;
|
|
||||||
- command returns a clear “not yet implemented” or calls an empty planner if phased commits are desired;
|
|
||||||
- CLI tests pass.
|
|
||||||
|
|
||||||
### Phase 3: Implement remote current-state discovery (completed)
|
|
||||||
|
|
||||||
Add restore code that:
|
|
||||||
|
|
||||||
- creates an object store from resolved config;
|
|
||||||
- builds remote current marker key;
|
|
||||||
- reads `current/run_id.txt`;
|
|
||||||
- reads/downloads `current/manifest.json`;
|
|
||||||
- validates manifest identity;
|
|
||||||
- returns remote current-state metadata.
|
|
||||||
|
|
||||||
Deliverable:
|
|
||||||
|
|
||||||
- fake-storage tests for current-state discovery;
|
|
||||||
- no local file writes beyond temporary files.
|
|
||||||
|
|
||||||
### Phase 4: Implement restore planning (completed)
|
|
||||||
|
|
||||||
Build deterministic restore plans for default scope and `--include-audio`.
|
|
||||||
|
|
||||||
Deliverable:
|
|
||||||
|
|
||||||
- plan lists manifest, transcript, artifact files;
|
|
||||||
- plan excludes run-local data;
|
|
||||||
- plan detects local same/conflict/missing states;
|
|
||||||
- dry-run output works;
|
|
||||||
- no real file overwrite yet except temp comparisons as needed.
|
|
||||||
|
|
||||||
### Phase 5: Implement restore execution (completed)
|
|
||||||
|
|
||||||
Execute the plan safely:
|
|
||||||
|
|
||||||
- create directories;
|
|
||||||
- download to temporary files;
|
|
||||||
- validate content where practical;
|
|
||||||
- atomically install files;
|
|
||||||
- enforce default conflict failure;
|
|
||||||
- support `--force`;
|
|
||||||
- preserve existing manifest unless safe to replace.
|
|
||||||
|
|
||||||
Deliverable:
|
|
||||||
|
|
||||||
- restore works end-to-end against fake storage;
|
|
||||||
- failures are clear and do not corrupt existing local manifest.
|
|
||||||
|
|
||||||
### Phase 6: Add restore report and operator summary (completed)
|
|
||||||
|
|
||||||
Add concise stdout summary and optional JSON restore report if consistent with project diagnostics.
|
|
||||||
|
|
||||||
Deliverable:
|
|
||||||
|
|
||||||
- user-friendly output;
|
|
||||||
- durable diagnostic report if implemented;
|
|
||||||
- no content leakage.
|
|
||||||
|
|
||||||
### Phase 7: Workflow integration test (completed)
|
|
||||||
|
|
||||||
Add a test for restoring a previous session and then forcing `analyze`.
|
|
||||||
|
|
||||||
Deliverable:
|
|
||||||
|
|
||||||
- restored manifest/transcripts/artifacts are sufficient for analyze input resolution;
|
|
||||||
- no upstream stages rerun;
|
|
||||||
- no reliance on live subprocesses or S3.
|
|
||||||
|
|
||||||
### Phase 8: Documentation update (completed)
|
|
||||||
|
|
||||||
Once implemented, update current-behavior docs and internal command docs.
|
|
||||||
|
|
||||||
Also leave future `narratio run --restore` in roadmap only.
|
|
||||||
|
|
||||||
## Definition of done
|
|
||||||
|
|
||||||
The feature is complete when:
|
|
||||||
|
|
||||||
- `narratio restore` exists and is documented.
|
|
||||||
- It uses the same config/session discovery semantics as other commands where practical.
|
|
||||||
- It requires configured remote storage.
|
|
||||||
- It restores only from a committed current archive state.
|
|
||||||
- It restores the current manifest, transcripts, and artifacts by default.
|
|
||||||
- It restores audio only with `--include-audio`.
|
|
||||||
- It excludes run-local sandboxes.
|
|
||||||
- It fails on local/remote conflicts by default.
|
|
||||||
- `--force` overwrites conflicts.
|
|
||||||
- `--dry-run` writes nothing.
|
|
||||||
- It uses fake storage in tests.
|
|
||||||
- It does not change `prepare` behavior.
|
|
||||||
- It does not implement `narratio run --restore`.
|
|
||||||
- It avoids AWS SDK leakage outside the storage adapter.
|
|
||||||
- It uses centralized path/key helpers rather than scattered string concatenation.
|
|
||||||
- `go test ./...` passes.
|
|
||||||
|
|
||||||
## Suggested test commands
|
|
||||||
|
|
||||||
Run focused tests first:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
go test ./internal/app -run TestExecute -v
|
|
||||||
go test ./internal/adapters/storage -v
|
|
||||||
go test ./internal/artifacts -v
|
|
||||||
go test ./internal/manifest -v
|
|
||||||
```
|
|
||||||
|
|
||||||
Then run the full suite:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
go test ./...
|
|
||||||
```
|
|
||||||
|
|
||||||
## Suggested commit message
|
|
||||||
|
|
||||||
```text
|
|
||||||
Add restore subcommand roadmap
|
|
||||||
```
|
|
||||||
File diff suppressed because it is too large
Load Diff
115
examples/README.md
Normal file
115
examples/README.md
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
# Maintained Examples
|
||||||
|
|
||||||
|
These files are safe, copyable starting points for Narratio configuration and
|
||||||
|
input structure. Replace placeholder identifiers, storage names, integration
|
||||||
|
URLs, and paths for the target environment. Field meanings and defaults belong
|
||||||
|
in the [configuration reference](../docs/config.md).
|
||||||
|
|
||||||
|
## Pipeline Configuration
|
||||||
|
|
||||||
|
- [Minimal pipeline](pipeline.minimal.yml): campaign discovery plus the required
|
||||||
|
WhisperX URL.
|
||||||
|
- [Synthetic catalog pipeline](pipeline.catalog.yml): imports the small
|
||||||
|
[example catalog](reference-catalog/catalog.yml), whose setting imports a
|
||||||
|
relative fragment. Install an operator-selected catalog separately for a
|
||||||
|
production deployment.
|
||||||
|
- [Production-shaped pipeline](pipeline.production.yml): S3 storage, publish,
|
||||||
|
external tools, and configured Scriptorium artifacts.
|
||||||
|
- [Production-base/testing-overlay bundle](production-testing/pipeline.yml):
|
||||||
|
explicit required `conf.d` imports, an optional local import, destination-mounted
|
||||||
|
artifact files, a YAML-filtered directory of keyed families, and the fixed
|
||||||
|
`overlays/testing.yml` overlay. Production values live in the base. The
|
||||||
|
bundle demonstrates an input-only artifact dependency, two character families
|
||||||
|
sharing the campaign party, and a testing-only disabled artifact. The testing
|
||||||
|
overlay's `testing_notes` artifact inherits the recap prompt, inputs, and
|
||||||
|
testing profile while retaining its disabled status and separate output path.
|
||||||
|
The testing overlay upserts the transcript publish rule by `source`. A
|
||||||
|
destination key defines each artifact ID; filenames do not. Full-root and
|
||||||
|
disjoint definitions are also valid. Upsert replaces a matching list record
|
||||||
|
as a whole; empty append or upsert contributions leave existing entries intact.
|
||||||
|
Inspect it offline with:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
narratio config validate --config examples/production-testing/pipeline.yml
|
||||||
|
narratio config show --config examples/production-testing/pipeline.yml --overlay testing
|
||||||
|
narratio config sources --config examples/production-testing/pipeline.yml --overlay testing
|
||||||
|
narratio artifacts list --config examples/production-testing/pipeline.yml --campaign-file examples/campaigns/sample-campaign/campaign.yml --overlay testing
|
||||||
|
narratio config diff --against-config examples/production-testing/pipeline.yml --against-overlay testing --config examples/production-testing/pipeline.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
These inspection commands load configuration and resolve explicit credential
|
||||||
|
references, but do not load a session or create runtime state. This bundle is
|
||||||
|
intentionally local-storage and credential-reference free so the walkthrough
|
||||||
|
needs no tools or cloud services. Native app inspection retains family
|
||||||
|
declarations; `artifacts list` derives their concrete members using the selected
|
||||||
|
campaign. Diff selects the example root on both sides because omitted
|
||||||
|
right-side selectors use their own discovery defaults.
|
||||||
|
- [Full annotated pipeline](pipeline.full.annotated.yml): every implemented
|
||||||
|
pipeline section with explanatory comments.
|
||||||
|
- [Extraction subset pipeline](pipeline.extraction-subset.yml): a focused
|
||||||
|
Scriptorium artifact consuming only three declared Notarius lanes.
|
||||||
|
|
||||||
|
The existing `internal/config` example test loads and validates each pipeline
|
||||||
|
with the sample campaign and a compatible local- or S3-audio session.
|
||||||
|
|
||||||
|
## Campaign And Session Configuration
|
||||||
|
|
||||||
|
- [Lantern Coast](campaigns/lantern-coast/campaign.yml) is a complete three-file
|
||||||
|
campaign with adjacent [party](campaigns/lantern-coast/party.yml) and
|
||||||
|
[speakers](campaigns/lantern-coast/speakers.yml). Its optional vocabulary and
|
||||||
|
autocorrection rules may be omitted. Select the synthetic catalog through the
|
||||||
|
[catalog pipeline](pipeline.catalog.yml).
|
||||||
|
|
||||||
|
- [Sample campaign](campaigns/sample-campaign/campaign.yml), its
|
||||||
|
[session template](campaigns/sample-campaign/session.template.yml), and its
|
||||||
|
adjacent stable inputs provide a complete campaign directory shape. Its
|
||||||
|
imported settings and split party demonstrate local secondary imports;
|
||||||
|
relative resources follow the file that supplies each value.
|
||||||
|
- [Local-audio session](session.local-audio.yml) and
|
||||||
|
[S3-audio session](session.s3-audio.yml) are concrete session files.
|
||||||
|
- [Published-products session](session.published-products.yml) omits audio for
|
||||||
|
downstream work after import. Configure the needed references, and use
|
||||||
|
`render.variants: [trimmed]` when only the final trimmed transcript is
|
||||||
|
available. Transcription and forced transcription still require audio; see
|
||||||
|
the [restore workflow](../docs/operations.md#restore-workflow).
|
||||||
|
- [Session template](session.template.yml) and the campaign-local equivalent
|
||||||
|
demonstrate the narrow placeholder syntax consumed by `session init`; they
|
||||||
|
are templates, not runtime session files.
|
||||||
|
|
||||||
|
The [inline-only](glossary-authoring/inline-only.yml),
|
||||||
|
[file-only](glossary-authoring/file-only.yml), and
|
||||||
|
[combined](glossary-authoring/combined.yml) inputs fragments illustrate campaign
|
||||||
|
vocabulary selection. They omit optional setting and system selections; add
|
||||||
|
those IDs only when the pipeline imports a matching catalog.
|
||||||
|
|
||||||
|
## Input Fixtures
|
||||||
|
|
||||||
|
- [Speakers](speakers.yml) and [glossary](glossary.yml) show standalone
|
||||||
|
formats. Autocorrection is authored inline in campaign or session configuration.
|
||||||
|
- The sample campaign uses its local [speakers](campaigns/sample-campaign/speakers.yml),
|
||||||
|
[glossary](campaigns/sample-campaign/glossary.yml), and
|
||||||
|
[party](campaigns/sample-campaign/party.yml). Narratio derives players from
|
||||||
|
the roster and writes the Seriatim autocorrection input during preparation.
|
||||||
|
- The synthetic [reference catalog](reference-catalog/catalog.yml) is adapted
|
||||||
|
from catalog commit `02dd53c6ea026347452d497350c40249c949f8ce`, under CC0-1.0;
|
||||||
|
see [attribution](../docs/oss/attribution.md).
|
||||||
|
- [Sample speaker audio](audio/sample-speaker.flac) is a text placeholder that
|
||||||
|
reserves the expected filename and directory shape. Replace it with a real
|
||||||
|
supported recording before running transcription; keep the configured filename
|
||||||
|
or update the session file to match.
|
||||||
|
|
||||||
|
The examples contain environment-variable names but no credential values. Set
|
||||||
|
`OBJECT_STORAGE_KEY_ID`, `OBJECT_STORAGE_KEY`, `AUDITA_LLM_API_KEY`, and
|
||||||
|
`NOTARIUS_LLM_API_KEY` to nonempty synthetic or real values before loading the
|
||||||
|
examples that reference them. They use fictional campaign content and reserved
|
||||||
|
example domains. The Audita and Notarius names are example references, not
|
||||||
|
implicit aliases: external backend/profile configurations must use those exact
|
||||||
|
names, or the Narratio credential lists must be changed to match. See the
|
||||||
|
[Audita v4.3.0 configuration guide](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/config.md)
|
||||||
|
for maintained downstream configuration examples.
|
||||||
|
|
||||||
|
For a deployed bundle, keep credential files out of source control. Select a
|
||||||
|
directory in the main pipeline or provide environment values; see
|
||||||
|
[Secrets Handling](../docs/config.md#secrets-handling).
|
||||||
|
Static S3 credentials are optional: omit both S3 credential references to use
|
||||||
|
the AWS SDK discovery chain.
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
[]
|
|
||||||
|
|
||||||
18
examples/campaigns/lantern-coast/campaign.yml
Normal file
18
examples/campaigns/lantern-coast/campaign.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Synthetic three-file campaign example.
|
||||||
|
schema_version: maximumdirect.rpg.campaign.v1
|
||||||
|
id: lantern-coast
|
||||||
|
name: Lantern Coast expedition
|
||||||
|
setting: lantern_coast_sample
|
||||||
|
system: sample_magic
|
||||||
|
references:
|
||||||
|
party: ./party.yml
|
||||||
|
narratio:
|
||||||
|
inputs:
|
||||||
|
speakers_file: ./speakers.yml
|
||||||
|
glossary:
|
||||||
|
entries:
|
||||||
|
- id: glass-harbor
|
||||||
|
name: Glass Harbor
|
||||||
|
category: place
|
||||||
|
aliases: [The Harbor]
|
||||||
|
autocorrect: []
|
||||||
11
examples/campaigns/lantern-coast/party.yml
Normal file
11
examples/campaigns/lantern-coast/party.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
schema_version: maximumdirect.rpg.party.v1
|
||||||
|
characters:
|
||||||
|
mira:
|
||||||
|
player:
|
||||||
|
name: Rowan
|
||||||
|
character:
|
||||||
|
name: Mira
|
||||||
|
aliases: [Mira of Glass Harbor]
|
||||||
|
classes:
|
||||||
|
- name: Wizard
|
||||||
|
level: 3
|
||||||
7
examples/campaigns/lantern-coast/speakers.yml
Normal file
7
examples/campaigns/lantern-coast/speakers.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
match:
|
||||||
|
- speaker: Rowan
|
||||||
|
match:
|
||||||
|
- Rowan_recording
|
||||||
|
- speaker: GM
|
||||||
|
match:
|
||||||
|
- GM_recording
|
||||||
6
examples/campaigns/sample-campaign/campaign.yml
Normal file
6
examples/campaigns/sample-campaign/campaign.yml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
schema_version: maximumdirect.rpg.campaign.v1
|
||||||
|
id: sample-campaign
|
||||||
|
config:
|
||||||
|
imports:
|
||||||
|
- path: fragments/inputs.yml
|
||||||
|
required: true
|
||||||
12
examples/campaigns/sample-campaign/fragments/brenna.yml
Normal file
12
examples/campaigns/sample-campaign/fragments/brenna.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
brenna:
|
||||||
|
player:
|
||||||
|
name: Rowan Hale
|
||||||
|
character:
|
||||||
|
name: Brenna
|
||||||
|
aliases:
|
||||||
|
- Shield of Dawn
|
||||||
|
classes:
|
||||||
|
- name: paladin
|
||||||
|
level: 6
|
||||||
|
- name: warlock
|
||||||
|
level: 2
|
||||||
8
examples/campaigns/sample-campaign/fragments/inputs.yml
Normal file
8
examples/campaigns/sample-campaign/fragments/inputs.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
references:
|
||||||
|
party: ../party.yml
|
||||||
|
narratio:
|
||||||
|
session_template_file: ../session.template.yml
|
||||||
|
inputs:
|
||||||
|
speakers_file: ../speakers.yml
|
||||||
|
glossary_file: ../glossary.yml
|
||||||
|
autocorrect: []
|
||||||
5
examples/campaigns/sample-campaign/glossary.yml
Normal file
5
examples/campaigns/sample-campaign/glossary.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
schema_version: maximumdirect.glossary.v1
|
||||||
|
collections:
|
||||||
|
campaign:
|
||||||
|
entries:
|
||||||
|
- {id: lantern_watch, name: Lantern Watch, category: organization}
|
||||||
19
examples/campaigns/sample-campaign/party.yml
Normal file
19
examples/campaigns/sample-campaign/party.yml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
schema_version: maximumdirect.rpg.party.v1
|
||||||
|
config:
|
||||||
|
imports:
|
||||||
|
- path: fragments/brenna.yml
|
||||||
|
destination: [characters]
|
||||||
|
required: true
|
||||||
|
|
||||||
|
characters:
|
||||||
|
arannis:
|
||||||
|
player:
|
||||||
|
name: Rowan Hale
|
||||||
|
character:
|
||||||
|
name: Arannis
|
||||||
|
aliases:
|
||||||
|
- Ari
|
||||||
|
- The Grey Owl
|
||||||
|
classes:
|
||||||
|
- name: wizard
|
||||||
|
level: 8
|
||||||
3
examples/campaigns/sample-campaign/session.template.yml
Normal file
3
examples/campaigns/sample-campaign/session.template.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
session_id: "{{ session_id }}"
|
||||||
|
inputs:
|
||||||
|
audio_dir: ./audio
|
||||||
5
examples/campaigns/sample-campaign/speakers.yml
Normal file
5
examples/campaigns/sample-campaign/speakers.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
match:
|
||||||
|
- speaker: "Example Speaker"
|
||||||
|
match:
|
||||||
|
- "Example_Speaker"
|
||||||
|
- "Example"
|
||||||
8
examples/glossary-authoring/combined.yml
Normal file
8
examples/glossary-authoring/combined.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Inline records compose above the file using ConfigKit entry identities.
|
||||||
|
narratio:
|
||||||
|
inputs:
|
||||||
|
glossary_file: ../glossary.yml
|
||||||
|
glossary:
|
||||||
|
instruction: Use established campaign terminology.
|
||||||
|
entries:
|
||||||
|
- {id: lantern_watch, name: Silver Watch, category: organization}
|
||||||
4
examples/glossary-authoring/file-only.yml
Normal file
4
examples/glossary-authoring/file-only.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# Campaign inputs fragment; select the adjacent sample file when importing this fragment.
|
||||||
|
narratio:
|
||||||
|
inputs:
|
||||||
|
glossary_file: ../glossary.yml
|
||||||
6
examples/glossary-authoring/inline-only.yml
Normal file
6
examples/glossary-authoring/inline-only.yml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Campaign inputs fragment; include the required roster and other inputs separately.
|
||||||
|
narratio:
|
||||||
|
inputs:
|
||||||
|
glossary:
|
||||||
|
entries:
|
||||||
|
- {id: watch, name: Silver Watch, category: organization}
|
||||||
@@ -1,2 +1,5 @@
|
|||||||
[]
|
schema_version: maximumdirect.glossary.v1
|
||||||
|
collections:
|
||||||
|
campaign:
|
||||||
|
entries:
|
||||||
|
- {id: lantern_watch, name: Lantern Watch, category: organization}
|
||||||
|
|||||||
10
examples/pipeline.catalog.yml
Normal file
10
examples/pipeline.catalog.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Synthetic catalog example; production installations select their own local catalog.
|
||||||
|
config:
|
||||||
|
imports:
|
||||||
|
- path: reference-catalog/catalog.yml
|
||||||
|
required: true
|
||||||
|
campaigns:
|
||||||
|
root: /usr/local/share/narratio/campaigns
|
||||||
|
default_campaign_id: sample-campaign
|
||||||
|
whisperx:
|
||||||
|
transcribe_url: https://transcription.example.com/transcribe
|
||||||
46
examples/pipeline.extraction-subset.yml
Normal file
46
examples/pipeline.extraction-subset.yml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
# Purpose-specific extraction example: a Scriptorium session brief consumes
|
||||||
|
# only the three Notarius lanes it needs.
|
||||||
|
|
||||||
|
campaigns:
|
||||||
|
root: /usr/local/share/narratio/campaigns
|
||||||
|
default_campaign_id: sample-campaign
|
||||||
|
|
||||||
|
whisperx:
|
||||||
|
transcribe_url: "https://transcription.example.com/transcribe"
|
||||||
|
|
||||||
|
notarius:
|
||||||
|
enabled: true
|
||||||
|
binary: notarius
|
||||||
|
config_path: /usr/local/etc/notarius/config.yml
|
||||||
|
pipeline_id: dnd-session
|
||||||
|
timeout: 3h
|
||||||
|
references:
|
||||||
|
glossary: narratio.input.glossary.combined
|
||||||
|
party: narratio.input.party
|
||||||
|
spell_catalog: narratio.input.glossary.combined
|
||||||
|
outputs:
|
||||||
|
npc_registry:
|
||||||
|
lane_id: npc-registry
|
||||||
|
location_registry:
|
||||||
|
lane_id: location-registry
|
||||||
|
scene_descriptions:
|
||||||
|
lane_id: scene-descriptions
|
||||||
|
|
||||||
|
scriptorium:
|
||||||
|
binary: scriptorium
|
||||||
|
config_path: /usr/local/etc/scriptorium/config.yml
|
||||||
|
artifacts:
|
||||||
|
session_brief:
|
||||||
|
enabled: true
|
||||||
|
prompt_id: dnd.session_brief
|
||||||
|
output_path: artifacts/session_brief.md
|
||||||
|
inputs:
|
||||||
|
npcs:
|
||||||
|
source: narratio.extraction.npc_registry
|
||||||
|
required: true
|
||||||
|
locations:
|
||||||
|
source: narratio.extraction.location_registry
|
||||||
|
required: true
|
||||||
|
scenes:
|
||||||
|
source: narratio.extraction.scene_descriptions
|
||||||
|
required: true
|
||||||
@@ -4,21 +4,20 @@
|
|||||||
workspace:
|
workspace:
|
||||||
# Optional: defaults to /var/lib/narratio.
|
# Optional: defaults to /var/lib/narratio.
|
||||||
root: /var/lib/narratio/workspace
|
root: /var/lib/narratio/workspace
|
||||||
# Optional: remove run-scoped workdir after successful archive commit.
|
# Optional: remove the session run history after successful publish commit.
|
||||||
cleanup_after_archive: false
|
# See docs/operations.md#cleanup.
|
||||||
|
cleanup_after_publish: false
|
||||||
|
|
||||||
# Optional: local secret file loader (directory of ENV_VAR_NAME files).
|
# Optional configured bootstrap; see the ConfigKit configured-startup contract:
|
||||||
# secrets:
|
# https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap
|
||||||
# env_dir: ./secrets
|
# config:
|
||||||
|
# secrets_dir: secrets
|
||||||
|
|
||||||
storage:
|
storage:
|
||||||
# Optional storage backend selector; use "s3" for archive + S3 audio workflows.
|
# Defaults to "local". Use "s3" explicitly for publish + S3 audio workflows.
|
||||||
backend: s3
|
backend: s3
|
||||||
# Compatibility fields retained in schema.
|
|
||||||
bucket: ""
|
|
||||||
prefix: ""
|
|
||||||
s3:
|
s3:
|
||||||
# Required when using S3 audio or S3 archive uploads.
|
# Required when using S3 audio or S3 publish uploads.
|
||||||
bucket: my-dnd-archive
|
bucket: my-dnd-archive
|
||||||
# Optional; defaults to "dnd".
|
# Optional; defaults to "dnd".
|
||||||
root_prefix: dnd
|
root_prefix: dnd
|
||||||
@@ -26,24 +25,31 @@ storage:
|
|||||||
region: us-east-1
|
region: us-east-1
|
||||||
endpoint: ""
|
endpoint: ""
|
||||||
force_path_style: false
|
force_path_style: false
|
||||||
# Optional; defaults shown explicitly.
|
# Optional operator-selected secret-reference names; omit both for the provider chain.
|
||||||
access_key_id_env: OBJECT_STORAGE_KEY_ID
|
# See docs/config.md#secrets-handling.
|
||||||
secret_access_key_env: OBJECT_STORAGE_KEY
|
access_key_id: OBJECT_STORAGE_KEY_ID
|
||||||
|
secret_access_key: OBJECT_STORAGE_KEY
|
||||||
|
|
||||||
spool:
|
campaigns:
|
||||||
# Optional; defaults to /var/spool/narratio.
|
# Optional; defaults to /usr/local/share/narratio/campaigns.
|
||||||
root: /var/spool/narratio
|
root: /usr/local/share/narratio/campaigns
|
||||||
# Optional cleanup of run-scoped spool audio after successful archive commit.
|
# Optional command default when --campaign is omitted.
|
||||||
delete_audio_after_archive: false
|
default_campaign_id: sample-campaign
|
||||||
|
|
||||||
archive:
|
publish:
|
||||||
# Optional booleans; defaults are true.
|
# Optional booleans; defaults are true.
|
||||||
enabled: true
|
enabled: true
|
||||||
upload_run: true
|
upload_run: true
|
||||||
# Optional promotion rules; sources use Narratio artifact source IDs.
|
# Optional publish output rules; sources use Narratio artifact source IDs.
|
||||||
promote_artifacts:
|
outputs:
|
||||||
- source: narratio.transcript.trimmed
|
- source: narratio.transcript.final_trimmed
|
||||||
dest: transcripts/trimmed.json
|
dest: transcripts/final.trimmed.json
|
||||||
|
required: true
|
||||||
|
- source: narratio.transcript.final_markdown
|
||||||
|
dest: transcripts/final.md
|
||||||
|
required: true
|
||||||
|
- source: narratio.transcript.final_trimmed_markdown
|
||||||
|
dest: transcripts/final.trimmed.md
|
||||||
required: true
|
required: true
|
||||||
- source: narratio.artifact.session_recap
|
- source: narratio.artifact.session_recap
|
||||||
dest: artifacts/session_recap.md
|
dest: artifacts/session_recap.md
|
||||||
@@ -51,6 +57,10 @@ archive:
|
|||||||
- source: narratio.artifact.player_handout
|
- source: narratio.artifact.player_handout
|
||||||
dest: artifacts/player_handout.md
|
dest: artifacts/player_handout.md
|
||||||
required: false
|
required: false
|
||||||
|
# Extraction lanes publish only when named explicitly; the bundle stays local.
|
||||||
|
- source: narratio.extraction.npc_registry
|
||||||
|
dest: artifacts/extraction/npc-registry.json
|
||||||
|
required: true
|
||||||
|
|
||||||
whisperx:
|
whisperx:
|
||||||
# Required.
|
# Required.
|
||||||
@@ -62,6 +72,10 @@ whisperx:
|
|||||||
retry_delay: 2s
|
retry_delay: 2s
|
||||||
concurrency: 2
|
concurrency: 2
|
||||||
|
|
||||||
|
render:
|
||||||
|
# Omit variants to render both, or select only the variants needed.
|
||||||
|
variants: [normalized, trimmed]
|
||||||
|
|
||||||
seriatim:
|
seriatim:
|
||||||
# Optional overrides; defaults shown explicitly.
|
# Optional overrides; defaults shown explicitly.
|
||||||
binary: seriatim
|
binary: seriatim
|
||||||
@@ -77,46 +91,90 @@ seriatim:
|
|||||||
filler_max_duration: 1.25
|
filler_max_duration: 1.25
|
||||||
|
|
||||||
audita:
|
audita:
|
||||||
# Optional overrides; defaults shown explicitly where applicable.
|
# Optional overrides. Audita owns its own configuration and profiles.
|
||||||
binary: audita
|
binary: audita
|
||||||
timeout: 3h
|
timeout: 3h
|
||||||
llm_api_key_env: AUDITA_LLM_API_KEY
|
# Names must match credentials on the configured Audita backends.
|
||||||
modules: [glossary, homophones, spoken_word, grammar]
|
credentials: [AUDITA_LLM_API_KEY]
|
||||||
base_url: ""
|
debug: false # true requests a run-local Audita debug capture
|
||||||
model: ""
|
# Configure processing order in Audita configuration.
|
||||||
total_llm_concurrency: 2
|
overlay: ""
|
||||||
proposal_llm_concurrency: 1
|
proposal_profile: ""
|
||||||
validation_model: ""
|
validation_profile: ""
|
||||||
validation_llm_concurrency: 1
|
|
||||||
transcript_description: ""
|
transcript_description: ""
|
||||||
config_path: /usr/local/etc/audita/config.yml
|
config_path: /usr/local/etc/audita/config.yml
|
||||||
output_schema: audita-v1
|
output_schema: audita-v1
|
||||||
work_dir_retention: auto
|
|
||||||
report: true
|
|
||||||
|
|
||||||
normalize:
|
normalize:
|
||||||
# Optional; defaults shown explicitly.
|
output_path: transcripts/final.json
|
||||||
output_path: transcripts/normalized.json
|
|
||||||
output_schema: seriatim-intermediate
|
output_schema: seriatim-intermediate
|
||||||
report: true
|
report: true
|
||||||
|
|
||||||
trim:
|
trim:
|
||||||
# Keep disabled unless bounds prompt integration is configured.
|
enabled: true
|
||||||
enabled: false
|
output_path: transcripts/final.trimmed.json
|
||||||
output_path: transcripts/trimmed.json
|
|
||||||
bounds:
|
bounds:
|
||||||
prompt_id: dnd.session_bounds
|
prompt_id: dnd.session_bounds
|
||||||
profile_id: local-fast
|
profile_id: ""
|
||||||
transcript_input_name: transcript
|
transcript_input_name: transcript
|
||||||
output_path: reports/session_bounds.json
|
output_path: artifacts/session_bounds.json
|
||||||
timeout: 10m
|
timeout: 10m
|
||||||
render_debug: false
|
render_debug: false
|
||||||
render_output_path: reports/session_bounds.render.json
|
|
||||||
seriatim:
|
seriatim:
|
||||||
report: false
|
report: false
|
||||||
|
|
||||||
|
notarius:
|
||||||
|
# Optional structured extraction after render and before analyze.
|
||||||
|
enabled: true
|
||||||
|
binary: notarius
|
||||||
|
# Optional environment-variable references. Match these names to the
|
||||||
|
# selected Notarius/PromptKit providers; never put credential values here.
|
||||||
|
credentials: [NOTARIUS_LLM_API_KEY]
|
||||||
|
# Optionally select a Notarius ConfigKit overlay when extraction runs. This
|
||||||
|
# is independent of Narratio's selected overlay and may use a different name.
|
||||||
|
# See docs/config.md and docs/integrations/notarius.md for the contracts.
|
||||||
|
# config_overlay: downstream-economy
|
||||||
|
config_path: /usr/local/etc/notarius/config.yml
|
||||||
|
pipeline_id: dnd-session
|
||||||
|
timeout: 3h
|
||||||
|
working_directory: /usr/local/etc/notarius
|
||||||
|
# Forced extraction requests refresh from Notarius.
|
||||||
|
cache: auto
|
||||||
|
debug: false # true requests run-local Notarius debug capture
|
||||||
|
# External campaign references use prepared Narratio source IDs. Omit an
|
||||||
|
# optional binding when the selected Notarius pipeline does not need it.
|
||||||
|
references:
|
||||||
|
glossary: narratio.input.glossary.combined
|
||||||
|
party: narratio.input.party
|
||||||
|
spell_catalog: narratio.input.glossary.combined
|
||||||
|
# Each key creates source narratio.extraction.<key> for its selected lane.
|
||||||
|
outputs:
|
||||||
|
item_registry:
|
||||||
|
lane_id: item-registry
|
||||||
|
npc_registry:
|
||||||
|
lane_id: npc-registry
|
||||||
|
location_registry:
|
||||||
|
lane_id: location-registry
|
||||||
|
scene_descriptions:
|
||||||
|
lane_id: scene-descriptions
|
||||||
|
item_occurrences:
|
||||||
|
lane_id: item-occurrences
|
||||||
|
spells:
|
||||||
|
lane_id: spells
|
||||||
|
combat_turns:
|
||||||
|
lane_id: combat-turns
|
||||||
|
npc_occurrences:
|
||||||
|
lane_id: npc-occurrences
|
||||||
|
location_occurrences:
|
||||||
|
lane_id: location-occurrences
|
||||||
|
enemy_events:
|
||||||
|
lane_id: enemy-events
|
||||||
|
|
||||||
scriptorium:
|
scriptorium:
|
||||||
binary: scriptorium
|
binary: scriptorium
|
||||||
|
# Select provider names provisioned through Narratio's environment/secrets.
|
||||||
|
# Used for requirements inspection, trim, analysis, and render-debug calls.
|
||||||
|
# credentials: [OPENROUTER_API_KEY, RAKESTRAWHOME_API_KEY]
|
||||||
config_path: /usr/local/etc/scriptorium/config.yml
|
config_path: /usr/local/etc/scriptorium/config.yml
|
||||||
timeout: 10m
|
timeout: 10m
|
||||||
render_debug: false
|
render_debug: false
|
||||||
@@ -130,12 +188,19 @@ scriptorium:
|
|||||||
timeout: 10m
|
timeout: 10m
|
||||||
inputs:
|
inputs:
|
||||||
transcript:
|
transcript:
|
||||||
source: narratio.transcript.trimmed
|
source: narratio.transcript.final_trimmed
|
||||||
required: true
|
required: true
|
||||||
previous_recap:
|
previous_recap:
|
||||||
source: previous_session_artifact
|
source: narratio.previous_session.artifact.session_recap
|
||||||
artifact: session_recap
|
required: false
|
||||||
path: ""
|
players:
|
||||||
|
source: narratio.input.players
|
||||||
|
required: true
|
||||||
|
party:
|
||||||
|
source: narratio.input.party
|
||||||
|
required: true
|
||||||
|
glossary:
|
||||||
|
source: narratio.input.glossary.campaign
|
||||||
required: false
|
required: false
|
||||||
vars:
|
vars:
|
||||||
session_id: true
|
session_id: true
|
||||||
@@ -146,7 +211,8 @@ scriptorium:
|
|||||||
|
|
||||||
# Example dependent artifact:
|
# Example dependent artifact:
|
||||||
# - depends_on entries use artifact keys.
|
# - depends_on entries use artifact keys.
|
||||||
# - narratio.artifact.<key> sources require matching depends_on membership.
|
# - narratio.artifact.<key> inputs infer dependency edges; depends_on adds explicit ordering.
|
||||||
|
# - See docs/config.md for artifact dependency configuration.
|
||||||
player_handout:
|
player_handout:
|
||||||
enabled: true
|
enabled: true
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -160,23 +226,13 @@ scriptorium:
|
|||||||
source: narratio.artifact.session_recap
|
source: narratio.artifact.session_recap
|
||||||
required: true
|
required: true
|
||||||
transcript:
|
transcript:
|
||||||
source: narratio.transcript.trimmed
|
source: narratio.transcript.final_trimmed
|
||||||
required: true
|
required: true
|
||||||
vars:
|
vars:
|
||||||
session_id: true
|
session_id: true
|
||||||
campaign_name: true
|
campaign_name: true
|
||||||
output_kind: player_handout
|
output_kind: player_handout
|
||||||
|
|
||||||
analyzer:
|
|
||||||
# Optional adapter settings.
|
|
||||||
binary_path: ""
|
|
||||||
timeout: 2m
|
|
||||||
artifacts:
|
|
||||||
output_dir: ""
|
|
||||||
types: []
|
|
||||||
|
|
||||||
notification:
|
notification:
|
||||||
# Optional notification settings.
|
# No delivery provider is currently implemented.
|
||||||
backend: ""
|
mode: noop
|
||||||
recipient: ""
|
|
||||||
timeout: 30s
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user